repo: ngircd
action: commit
revision: 
path_from: 
revision_from: 77f68b4fd140404848e203a6634ecd472294723f:
path_to: 
revision_to: 
git.thebackupbox.net
ngircd
git clone git://git.thebackupbox.net/ngircd
commit 77f68b4fd140404848e203a6634ecd472294723f
Author: Alexander Barton 
Date:   Fri Jan 13 10:40:20 2012 +0100

    JOIN command: don't check channel limit if already member

    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.

diff --git a/src/ngircd/irc-channel.c b/src/ngircd/irc-channel.c
index 52ba0930caac5c9ab89f189dd684fe65e7976529..
index ..196b5477487cebdfa0c073277a1ff81115a7d798 100644
--- a/src/ngircd/irc-channel.c
+++ b/src/ngircd/irc-channel.c
@@ -369,6 +369,12 @@ IRC_JOIN( CLIENT *Client, REQUEST *Req )

 		/* 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))

-----END OF PAGE-----