diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/channels.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/channels.c b/src/channels.c index bd1a5e913..14cb6a396 100644 --- a/src/channels.c +++ b/src/channels.c @@ -1115,6 +1115,7 @@ void do_cmode(const char *source, int ac, char **av) void do_topic(const char *source, int ac, char **av) { Channel *c = findchan(av[0]); + ChannelInfo *ci; int ts; time_t topic_time; @@ -1140,6 +1141,15 @@ void do_topic(const char *source, int ac, char **av) /* We can be sure that the topic will be in sync here -GD */ c->topic_sync = 1; + /* 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 + */ + if ((ac > 3) && *av[3] && (ci = c->ci) && ci->last_topic + && (strcmp(av[3], ci->last_topic) == 0) + && (strcmp(av[1], ci->last_topic_setter) == 0)) + return; + if (check_topiclock(c, topic_time)) return; |