From 746ae090503172f276b0e5e09816d4e122deeb18 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Tue, 27 Aug 2002 12:45:09 +0000 Subject: [PATCH] wait a bit longer before sending massjoin signal. also added a comment how it's supposed to work. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2904 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/irc/core/massjoin.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/irc/core/massjoin.c b/src/irc/core/massjoin.c index 802945ec..d8631d31 100644 --- a/src/irc/core/massjoin.c +++ b/src/irc/core/massjoin.c @@ -218,6 +218,18 @@ static void server_check_massjoins(IRC_SERVER_REC *server, time_t max) { GSList *tmp; + /* + 1) First time always save massjoin count to last_massjoins + 2) Next time check if there's been less than massjoin_max_joins + (yes, the name is misleading..) joins since previous check. + yes) send a massjoin signal and reset last_massjoin count + no) unless we've waited for massjoin_max_wait seconds already, + goto 2. + + So, with single joins the massjoin signal is sent 1-2 seconds after + the join. + */ + /* Scan all channels through for massjoins */ for (tmp = server->channels; tmp != NULL; tmp = tmp->next) { IRC_CHANNEL_REC *rec = tmp->data; @@ -226,7 +238,8 @@ static void server_check_massjoins(IRC_SERVER_REC *server, time_t max) continue; if (rec->massjoin_start < max || /* We've waited long enough */ - rec->massjoins-massjoin_max_joins < rec->last_massjoins) { /* Less than x joins since last check */ + (rec->last_massjoins > 0 && + rec->massjoins-massjoin_max_joins < rec->last_massjoins)) { /* Less than x joins since last check */ /* send them */ massjoin_send(rec); } else {