1
0
mirror of https://github.com/anope/anope.git synced 2026-07-10 21:23:13 +02:00

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
This commit is contained in:
Adam-
2010-04-15 17:36:23 +00:00
parent f590c52321
commit 87e96d6f52
2 changed files with 17 additions and 5 deletions
+15 -4
View File
@@ -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], "");
}
}
}
+2 -1
View File
@@ -9,9 +9,10 @@ VERSION_MAJOR="1"
VERSION_MINOR="8"
VERSION_PATCH="4"
VERSION_EXTRA="-svn"
VERSION_BUILD="2895"
VERSION_BUILD="2896"
# $Log$ # Changes since the 1.8.4 Release
#Revision 2896 - Fixed bug #1153 - Always save channel topics internally, even if the new topic matches the last saved topic
#Revision 2895 - Fixed bug #1154 - Fixed a potential crash in cs_clear ops
#Revision 2894 - Check if a command routine exists before all command calls
#Revision 2893 - Closed a forgotten file pointer in os_info that would make Windows backups of os_info.db fail