summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorailin-nemui <ailin-nemui@users.noreply.github.com>2018-01-03 12:45:43 +0100
committerailin-nemui <ailin-nemui@users.noreply.github.com>2018-01-03 12:45:43 +0100
commit54d453623d879ea83d0818a80bd14151192953ec (patch)
tree1c81aa8c707fe7215feea1f8dff9b066ecd9f491 /src
parente405330e04dc344797f00c12cf8fd7f63b17e0e4 (diff)
downloadirssi-54d453623d879ea83d0818a80bd14151192953ec.zip
do not record topic change time when sender is blank
Diffstat (limited to 'src')
-rw-r--r--src/irc/core/channel-events.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/irc/core/channel-events.c b/src/irc/core/channel-events.c
index b0bddab2..46bbd5fa 100644
--- a/src/irc/core/channel-events.c
+++ b/src/irc/core/channel-events.c
@@ -138,7 +138,13 @@ static void channel_change_topic(IRC_SERVER_REC *server, const char *channel,
g_free_not_null(chanrec->topic_by);
chanrec->topic_by = g_strdup(setby);
- chanrec->topic_time = settime;
+ if (chanrec->topic_by == NULL) {
+ /* ensure invariant topic_time > 0 <=> topic_by != NULL.
+ this could be triggered by a topic command without sender */
+ chanrec->topic_time = 0;
+ } else {
+ chanrec->topic_time = settime;
+ }
signal_emit("channel topic changed", 1, chanrec);
}