summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Changes1
-rw-r--r--include/extern.h2
-rw-r--r--include/services.h1
-rw-r--r--src/bahamut.c1
-rw-r--r--src/channels.c35
-rw-r--r--src/chanserv.c3
-rw-r--r--src/hybrid.c1
-rw-r--r--src/plexus.c1
-rw-r--r--src/rageircd.c1
-rw-r--r--src/shadowircd.c1
-rw-r--r--src/solidircd.c1
-rw-r--r--src/ultimate3.c1
-rw-r--r--src/unreal32.c1
-rw-r--r--src/viagra.c1
-rw-r--r--version.log6
15 files changed, 53 insertions, 4 deletions
diff --git a/Changes b/Changes
index 6647bde3f..62a8ce411 100644
--- a/Changes
+++ b/Changes
@@ -8,6 +8,7 @@ Provided by Anope Dev. <dev@anope.org> - 2005
02/13 A Internal Event support, see EVENTS in the doc folder for help [ #00]
02/05 A Support for Unreal 3.2 +I channel mode. [ #00]
02/03 A Merged anope-win32 branch into the main, now Win32 ready. [ #00]
+03/21 F Topics being set too often during bursts. [ #00]
03/16 F Send the correct numeric for a missing MOTD file. [#315]
03/16 F Wrong modes being set in certain cases with SJOIN. [#320]
03/14 F Two normalized strings not being freed. [#314]
diff --git a/include/extern.h b/include/extern.h
index 9bc2fbfc4..bb0a278d8 100644
--- a/include/extern.h
+++ b/include/extern.h
@@ -128,6 +128,8 @@ E void do_sjoin(const char *source, int ac, char **av);
E void do_topic(const char *source, int ac, char **av);
E void do_mass_mode(char *modes);
+E void restore_unsycned_topics(void);
+
#define whosends(ci) ((!(ci) || !((ci)->botflags & BS_SYMBIOSIS) || !(ci)->bi || !(ci)->c || (ci)->c->usercount < BSMinUsers) ? s_ChanServ : (ci)->bi->nick)
/**** chanserv.c ****/
diff --git a/include/services.h b/include/services.h
index 02fc7f4ba..9a2643898 100644
--- a/include/services.h
+++ b/include/services.h
@@ -933,6 +933,7 @@ struct channel_ {
int16 server_modecount; /* Number of server MODEs this second */
int16 chanserv_modecount; /* Number of check_mode()'s this sec */
int16 bouncy_modes; /* Did we fail to set modes here? */
+ int16 topic_sync; /* Is the topic in sync? */
};
/*************************************************************************/
diff --git a/src/bahamut.c b/src/bahamut.c
index 28b8ec79a..dca254bff 100644
--- a/src/bahamut.c
+++ b/src/bahamut.c
@@ -1623,6 +1623,7 @@ int anope_event_burst(char *source, int ac, char **av)
s->sync = SSYNC_DONE;
else if (serv_uplink)
serv_uplink->sync = SSYNC_DONE;
+ restore_unsynced_topics();
}
return MOD_CONT;
}
diff --git a/src/channels.c b/src/channels.c
index 24f2f639e..bd1a5e913 100644
--- a/src/channels.c
+++ b/src/channels.c
@@ -736,10 +736,13 @@ void do_sjoin(const char *source, int ac, char **av)
{
Channel *c;
User *user;
+ Server *serv;
char *s, *end, cubuf[7], *end2, *cumodes[6];
int is_sqlined = 0;
int ts = 0;
+ serv = findserver(servlist, source);
+
if (ircd->sjb64) {
ts = base64dects(av[0]);
} else {
@@ -838,6 +841,8 @@ void do_sjoin(const char *source, int ac, char **av)
cumodes, 1);
}
+ if (c->ci && (!serv || is_sync(serv)))
+ restore_topic(c->name);
chan_set_correct_modes(user, c);
}
}
@@ -911,6 +916,8 @@ void do_sjoin(const char *source, int ac, char **av)
cumodes, 1);
}
+ if (c->ci && (!serv || is_sync(serv)))
+ restore_topic(c->name);
chan_set_correct_modes(user, c);
}
}
@@ -982,6 +989,8 @@ void do_sjoin(const char *source, int ac, char **av)
cumodes, 1);
}
+ if (c->ci && (!serv || is_sync(serv)))
+ restore_topic(c->name);
chan_set_correct_modes(user, c);
}
}
@@ -1023,6 +1032,8 @@ void do_sjoin(const char *source, int ac, char **av)
} else {
c = join_user_update(user, c, av[1]);
c->creation_time = ts;
+ if (c->ci && (!serv || is_sync(serv)))
+ restore_topic(c->name);
chan_set_correct_modes(user, c);
}
}
@@ -1126,6 +1137,9 @@ void do_topic(const char *source, int ac, char **av)
return;
}
+ /* We can be sure that the topic will be in sync here -GD */
+ c->topic_sync = 1;
+
if (check_topiclock(c, topic_time))
return;
@@ -1340,7 +1354,7 @@ void chan_adduser2(User * user, Channel * c)
* to has synced, or we'll get greet-floods when the net
* recovers from a netsplit. -GD
*/
- if (is_sync(user->server) == 1) {
+ if (is_sync(user->server)) {
anope_cmd_privmsg(c->ci->bi->nick, c->name, "[%s] %s",
user->na->nick, user->na->nc->greet);
c->ci->bi->lastmsg = time(NULL);
@@ -1378,8 +1392,10 @@ Channel *chan_create(char *chan)
/* Restore locked modes and saved topic */
if (c->ci) {
check_modes(c);
- restore_topic(chan);
stick_all(c->ci);
+ c->topic_sync = 0;
+ } else {
+ c->topic_sync = 1;
}
return c;
@@ -1692,3 +1708,18 @@ void do_mass_mode(char *modes)
}
/*************************************************************************/
+
+void restore_unsynced_topics(void)
+{
+ Channel *c;
+ int i;
+
+ for (i = 0; i < 1024; i++) {
+ for (c = chanlist[i]; c; c = c->next) {
+ if (!(c->topic_sync))
+ restore_topic(c->name);
+ }
+ }
+}
+
+/*************************************************************************/
diff --git a/src/chanserv.c b/src/chanserv.c
index 26c3a0afe..d479888a8 100644
--- a/src/chanserv.c
+++ b/src/chanserv.c
@@ -1764,6 +1764,8 @@ void restore_topic(char *chan)
if (!c || !(ci = c->ci))
return;
+ /* We can be sure that the topic will be in sync when we return -GD */
+ c->topic_sync = 1;
if (!(ci->flags & CI_KEEPTOPIC)) {
/* We need to reset the topic here, since it's currently empty and
* should be updated with a TOPIC from the IRCd soon. -GD
@@ -1771,7 +1773,6 @@ void restore_topic(char *chan)
ci->last_topic = NULL;
strscpy(ci->last_topic_setter, whosends(ci), NICKMAX);
ci->last_topic_time = time(NULL);
- /* And we still return... -GD */
return;
}
if (c->topic)
diff --git a/src/hybrid.c b/src/hybrid.c
index 55c1cf69b..fb9a87254 100644
--- a/src/hybrid.c
+++ b/src/hybrid.c
@@ -937,6 +937,7 @@ int anope_event_eob(char *source, int ac, char **av)
s->sync = SSYNC_DONE;
else if (serv_uplink)
serv_uplink->sync = SSYNC_DONE;
+ restore_unsynced_topics();
return MOD_CONT;
}
diff --git a/src/plexus.c b/src/plexus.c
index e008f5018..7b5c54f2f 100644
--- a/src/plexus.c
+++ b/src/plexus.c
@@ -1019,6 +1019,7 @@ int anope_event_eob(char *source, int ac, char **av)
s->sync = SSYNC_DONE;
else if (serv_uplink)
serv_uplink->sync = SSYNC_DONE;
+ restore_unsynced_topics();
return MOD_CONT;
}
diff --git a/src/rageircd.c b/src/rageircd.c
index 196243ca3..b638d210c 100644
--- a/src/rageircd.c
+++ b/src/rageircd.c
@@ -597,6 +597,7 @@ int anope_event_burst(char *source, int ac, char **av)
s->sync = SSYNC_DONE;
else if (serv_uplink)
serv_uplink->sync = SSYNC_DONE;
+ restore_unsynced_topics();
}
return MOD_CONT;
}
diff --git a/src/shadowircd.c b/src/shadowircd.c
index cb95db424..e9a74b104 100644
--- a/src/shadowircd.c
+++ b/src/shadowircd.c
@@ -1173,6 +1173,7 @@ int anope_event_eos(char *source, int ac, char **av)
s->sync = SSYNC_DONE;
else if (serv_uplink)
serv_uplink->sync = SSYNC_DONE;
+ restore_unsynced_topics();
return MOD_CONT;
}
diff --git a/src/solidircd.c b/src/solidircd.c
index a4bbbb714..3c9567bc7 100644
--- a/src/solidircd.c
+++ b/src/solidircd.c
@@ -1657,6 +1657,7 @@ int anope_event_burst(char *source, int ac, char **av)
s->sync = SSYNC_DONE;
else if (serv_uplink)
serv_uplink->sync = SSYNC_DONE;
+ restore_unsynced_topics();
}
return MOD_CONT;
}
diff --git a/src/ultimate3.c b/src/ultimate3.c
index b6a840a48..579d35b36 100644
--- a/src/ultimate3.c
+++ b/src/ultimate3.c
@@ -1750,6 +1750,7 @@ int anope_event_eob(char *source, int ac, char **av)
s->sync = SSYNC_DONE;
else if (serv_uplink)
serv_uplink->sync = SSYNC_DONE;
+ restore_unsynced_topics();
}
return MOD_CONT;
}
diff --git a/src/unreal32.c b/src/unreal32.c
index d2051b160..a4b3cdf35 100644
--- a/src/unreal32.c
+++ b/src/unreal32.c
@@ -1578,6 +1578,7 @@ int anope_event_eos(char *source, int ac, char **av)
s->sync = SSYNC_DONE;
else if (serv_uplink)
serv_uplink->sync = SSYNC_DONE;
+ restore_unsynced_topics();
return MOD_CONT;
}
diff --git a/src/viagra.c b/src/viagra.c
index 529dfc704..bc3878fd2 100644
--- a/src/viagra.c
+++ b/src/viagra.c
@@ -647,6 +647,7 @@ int anope_event_burst(char *source, int ac, char **av)
s->sync = SSYNC_DONE;
else if (serv_uplink)
serv_uplink->sync = SSYNC_DONE;
+ restore_unsynced_topics();
}
return MOD_CONT;
}
diff --git a/version.log b/version.log
index 2a2c70dab..8c476a457 100644
--- a/version.log
+++ b/version.log
@@ -8,10 +8,14 @@
VERSION_MAJOR="1"
VERSION_MINOR="7"
VERSION_PATCH="8"
-VERSION_BUILD="634"
+VERSION_BUILD="635"
# $Log$
#
+# BUILD : 1.7.8 (635)
+# BUGS :
+# NOTES : Topics should be only updated when really needed during bursts now (on IRCDs that support it)
+#
# BUILD : 1.7.8 (634)
# BUGS : 321
# NOTES : Applied Trystans patch for shadow-ircd nick changing and vhosting - there are still issues with it tho.