]> arthur.barton.de Git - ngircd-alex.git/blobdiff - src/ngircd/irc.c
Remove CLIENT.oper_by_my, Client_SetOperByMe() and Client_OperByMe()
[ngircd-alex.git] / src / ngircd / irc.c
index 7dafaf0539b005bdf808dcefb870838dfae8dfcc..34180aa7d48eb04130da17ffdd712909859204bf 100644 (file)
@@ -33,6 +33,7 @@
 #include "match.h"
 #include "messages.h"
 #include "parse.h"
+#include "op.h"
 #include "tool.h"
 
 #include "exp.h"
@@ -134,9 +135,8 @@ IRC_KILL(CLIENT *Client, REQUEST *Req)
        assert (Client != NULL);
        assert (Req != NULL);
 
-       if (Client_Type(Client) != CLIENT_SERVER && !Client_OperByMe(Client))
-               return IRC_WriteErrClient(Client, ERR_NOPRIVILEGES_MSG,
-                                         Client_ID(Client));
+       if (Client_Type(Client) != CLIENT_SERVER && !Op_Check(Client, Req))
+               return Op_NoPrivileges(Client, Req);
 
        /* Get prefix (origin); use the client if no prefix is given. */
        if (Req->prefix)
@@ -278,11 +278,6 @@ IRC_TRACE(CLIENT *Client, REQUEST *Req)
 
        IRC_SetPenalty(Client, 3);
 
-       /* Bad number of arguments? */
-       if (Req->argc > 1)
-               return IRC_WriteErrClient(Client, ERR_NORECIPIENT_MSG,
-                                         Client_ID(Client), Req->command);
-
        _IRC_GET_SENDER_OR_RETURN_(from, Req, Client)
        _IRC_GET_TARGET_SERVER_OR_RETURN_(target, Req, 0, from)
 
@@ -510,6 +505,7 @@ Send_Message(CLIENT * Client, REQUEST * Req, int ForceType, bool SendErrors)
        if (Req->argc > 2) {
                if (!SendErrors)
                        return CONNECTED;
+               IRC_SetPenalty(Client, 2);
                return IRC_WriteErrClient(Client, ERR_NEEDMOREPARAMS_MSG,
                                          Client_ID(Client), Req->command);
        }