summaryrefslogtreecommitdiff
path: root/src/irc
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2002-08-27 12:45:09 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2002-08-27 12:45:09 +0000
commit746ae090503172f276b0e5e09816d4e122deeb18 (patch)
treefb3d6e8a645cdc1f0e84e496458fe1aac625c133 /src/irc
parent52c44351c1d67e6f8c4e26fe5c6b3d3a11038aa7 (diff)
downloadirssi-746ae090503172f276b0e5e09816d4e122deeb18.zip
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
Diffstat (limited to 'src/irc')
-rw-r--r--src/irc/core/massjoin.c15
1 files changed, 14 insertions, 1 deletions
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 {