diff options
| author | Alexander Barton <alex@barton.de> | 2012-01-23 21:51:38 +0100 |
|---|---|---|
| committer | Alexander Barton <alex@barton.de> | 2012-01-23 21:51:38 +0100 |
| commit | b6f19ea8feceeb2246995222f03790e6f00b0dfd (patch) | |
| tree | 989c28389d5fa90e6bfc686b6ce6a280c3734f3b | |
| parent | 8c46067b34b71dac23b388c0acc28fdf8db111fa (diff) | |
| download | ngircd-b6f19ea8feceeb2246995222f03790e6f00b0dfd.tar.gz ngircd-b6f19ea8feceeb2246995222f03790e6f00b0dfd.zip | |
Fix "MAXLIST=beI:50": the limit is the sum of all lists
"Modes which are specified in the same pair share the same maximum size", so "beI:50" means a total of 50 entries, regardless of the list. See <http://www.irc.org/tech_docs/draft-brocklesby-irc-isupport-03.txt>, thanks to Cahata for reporting this!
| -rw-r--r-- | src/ngircd/irc-mode.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/ngircd/irc-mode.c b/src/ngircd/irc-mode.c index ad83ae98..80b29490 100644 --- a/src/ngircd/irc-mode.c +++ b/src/ngircd/irc-mode.c @@ -857,6 +857,7 @@ Add_To_List(char what, CLIENT *Prefix, CLIENT *Client, CHANNEL *Channel, { const char *mask; struct list_head *list; + long int current_count; assert(Client != NULL); assert(Channel != NULL); @@ -864,6 +865,9 @@ Add_To_List(char what, CLIENT *Prefix, CLIENT *Client, CHANNEL *Channel, assert(what == 'I' || what == 'b' || what == 'e'); mask = Lists_MakeMask(Pattern); + current_count = Lists_Count(Channel_GetListInvites(Channel)) + + Lists_Count(Channel_GetListExcepts(Channel)) + + Lists_Count(Channel_GetListBans(Channel)); switch(what) { case 'I': @@ -880,7 +884,7 @@ Add_To_List(char what, CLIENT *Prefix, CLIENT *Client, CHANNEL *Channel, if (Lists_CheckDupeMask(list, mask)) return CONNECTED; if (Client_Type(Client) == CLIENT_USER && - Lists_Count(list) >= MAX_HNDL_CHANNEL_LISTS) + current_count >= MAX_HNDL_CHANNEL_LISTS) return IRC_WriteStrClient(Client, ERR_LISTFULL_MSG, Client_ID(Client), Channel_Name(Channel), mask, |