]> arthur.barton.de Git - ngircd-alex.git/commitdiff
JOIN command: don't check channel limit if already member
authorAlexander Barton <alex@barton.de>
Fri, 13 Jan 2012 09:40:20 +0000 (10:40 +0100)
committerAlexander Barton <alex@barton.de>
Fri, 13 Jan 2012 09:40:20 +0000 (10:40 +0100)
Don't check the channel limit and don't report "too many channels"
when trying to join a channel that the client is already a member of.

src/ngircd/irc-channel.c

index 52ba0930caac5c9ab89f189dd684fe65e7976529..196b5477487cebdfa0c073277a1ff81115a7d798 100644 (file)
@@ -369,6 +369,12 @@ IRC_JOIN( CLIENT *Client, REQUEST *Req )
 
                /* Local client? */
                if (Client_Type(Client) == CLIENT_USER) {
 
                /* Local client? */
                if (Client_Type(Client) == CLIENT_USER) {
+                       if (chan) {
+                               /* Already existing channel: already member? */
+                               if (Channel_IsMemberOf(chan, Client))
+                                   goto join_next;
+                       }
+
                        /* Test if the user has reached the channel limit */
                        if ((Conf_MaxJoins > 0) &&
                            (Channel_CountForUser(Client) >= Conf_MaxJoins))
                        /* Test if the user has reached the channel limit */
                        if ((Conf_MaxJoins > 0) &&
                            (Channel_CountForUser(Client) >= Conf_MaxJoins))