summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAdam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864>2010-04-15 17:36:23 +0000
committerAdam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864>2010-04-15 17:36:23 +0000
commit87e96d6f528fd38aef754c3a1f5d837d2ad67614 (patch)
tree7f402d3d35e6d09e9ed835de25a5918ec77ce51f /src
parentf590c52321ad35b7aadd358996a1d10b1bd7bcd0 (diff)
Fixed bug #1153 - Always save channel topics internally, even if the new topic matches the last saved topic. Also only call the topic updated event once we are uplinked, as then the topic really is being changed by someone.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2896 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src')
-rw-r--r--src/channels.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/channels.c b/src/channels.c
index aa7ed4712..3a038cab4 100644
--- a/src/channels.c
+++ b/src/channels.c
@@ -1274,10 +1274,18 @@ void do_topic(const char *source, int ac, char **av)
/* If the current topic we have matches the last known topic for this
* channel exactly, there's no need to update anything and we can as
* well just return silently without updating anything. -GD
+ * But we still need to update the topic internally for the channel - Adam
*/
if ((ac > 3) && *av[3] && ci && ci->last_topic
&& (strcmp(av[3], ci->last_topic) == 0)
&& (strcmp(topicsetter, ci->last_topic_setter) == 0)) {
+
+ if (c->topic)
+ free(c->topic);
+ c->topic = sstrdup(av[3]);
+ strscpy(c->topic_setter, topicsetter, sizeof(c->topic_setter));
+ c->topic_time = topic_time;
+
free(topicsetter);
return;
}
@@ -1301,10 +1309,13 @@ void do_topic(const char *source, int ac, char **av)
record_topic(av[0]);
- if (ci && ci->last_topic) {
- send_event(EVENT_TOPIC_UPDATED, 2, av[0], ci->last_topic);
- } else {
- send_event(EVENT_TOPIC_UPDATED, 2, av[0], "");
+ /* Only call events if we are synced with the uplink */
+ if (serv_uplink && is_sync(serv_uplink)) {
+ if (ci && ci->last_topic) {
+ send_event(EVENT_TOPIC_UPDATED, 2, av[0], ci->last_topic);
+ } else {
+ send_event(EVENT_TOPIC_UPDATED, 2, av[0], "");
+ }
}
}