]> arthur.barton.de Git - ngircd-alex.git/blobdiff - src/ngircd/irc-channel.c
doc/PAM.txt: add a slightly more useful example
[ngircd-alex.git] / src / ngircd / irc-channel.c
index 4bd5a9d1ff30fb4a7e2cb7c909c68d21b93b06a5..d5e7bdd1b474a1882c0cca04048a624c17032ac3 100644 (file)
@@ -309,7 +309,6 @@ IRC_JOIN( CLIENT *Client, REQUEST *Req )
        assert (Client != NULL);
        assert (Req != NULL);
 
-       _IRC_ARGC_BETWEEN_OR_RETURN_(Client, Req, 1, 2)
        _IRC_GET_SENDER_OR_RETURN_(target, Req, Client)
 
        /* Is argument "0"? */
@@ -324,9 +323,11 @@ IRC_JOIN( CLIENT *Client, REQUEST *Req )
        channame = strtok_r(channame, ",", &lastchan);
 
        /* Make sure that "channame" is not the empty string ("JOIN :") */
-       if (! channame)
+       if (!channame) {
+               IRC_SetPenalty(Client, 2);
                return IRC_WriteErrClient(Client, ERR_NEEDMOREPARAMS_MSG,
                                          Client_ID(Client), Req->command);
+       }
 
        while (channame) {
                flags = NULL;
@@ -440,16 +441,17 @@ IRC_PART(CLIENT * Client, REQUEST * Req)
        assert(Client != NULL);
        assert(Req != NULL);
 
-       _IRC_ARGC_BETWEEN_OR_RETURN_(Client, Req, 1, 2)
        _IRC_GET_SENDER_OR_RETURN_(target, Req, Client)
 
        /* Loop over all the given channel names */
        chan = strtok(Req->argv[0], ",");
 
        /* Make sure that "chan" is not the empty string ("PART :") */
-       if (! chan)
+       if (!chan) {
+               IRC_SetPenalty(Client, 2);
                return IRC_WriteErrClient(Client, ERR_NEEDMOREPARAMS_MSG,
                                          Client_ID(Client), Req->command);
+       }
 
        while (chan) {
                Channel_Part(target, Client, chan,
@@ -484,7 +486,6 @@ IRC_TOPIC( CLIENT *Client, REQUEST *Req )
 
        IRC_SetPenalty(Client, 1);
 
-       _IRC_ARGC_BETWEEN_OR_RETURN_(Client, Req, 1, 2)
        _IRC_GET_SENDER_OR_RETURN_(from, Req, Client)
 
        chan = Channel_Search(Req->argv[0]);
@@ -583,7 +584,6 @@ IRC_LIST( CLIENT *Client, REQUEST *Req )
 
        IRC_SetPenalty(Client, 2);
 
-       _IRC_ARGC_LE_OR_RETURN_(Client, Req, 2)
        _IRC_GET_SENDER_OR_RETURN_(from, Req, Client)
 
        if (Req->argc > 0)
@@ -666,9 +666,11 @@ IRC_CHANINFO( CLIENT *Client, REQUEST *Req )
        assert( Req != NULL );
 
        /* Bad number of parameters? */
-       if (Req->argc < 2 || Req->argc == 4 || Req->argc > 5)
+       if (Req->argc < 2 || Req->argc == 4 || Req->argc > 5) {
+               IRC_SetPenalty(Client, 2);
                return IRC_WriteErrClient(Client, ERR_NEEDMOREPARAMS_MSG,
                                          Client_ID(Client), Req->command);
+       }
 
        /* Compatibility kludge */
        if (Req->argc == 5)