mirror of
https://github.com/irssi/irssi.git
synced 2024-12-04 14:46:39 -05:00
Revert "Revert "Flag topic as unset if it is zero length""
This reverts commit 817179a760
.
This commit is contained in:
parent
1bbd9f393c
commit
bbca1a5a0f
1
.gitignore
vendored
1
.gitignore
vendored
@ -59,6 +59,7 @@ tests/irc/core/test-irc.trs
|
|||||||
*.la
|
*.la
|
||||||
*.lo
|
*.lo
|
||||||
*.o
|
*.o
|
||||||
|
*.swp
|
||||||
*~
|
*~
|
||||||
|
|
||||||
*.tar.bz2
|
*.tar.bz2
|
||||||
|
@ -126,23 +126,25 @@ static void channel_change_topic(IRC_SERVER_REC *server, const char *channel,
|
|||||||
|
|
||||||
chanrec = channel_find(SERVER(server), channel);
|
chanrec = channel_find(SERVER(server), channel);
|
||||||
if (chanrec == NULL) return;
|
if (chanrec == NULL) return;
|
||||||
/* the topic may be send out encoded, so we need to
|
|
||||||
|
g_free_and_null(chanrec->topic);
|
||||||
|
g_free_and_null(chanrec->topic_by);
|
||||||
|
chanrec->topic_time = 0;
|
||||||
|
|
||||||
|
/* the topic may be sent out encoded, so we need to
|
||||||
recode it back or /topic <tab> will not work properly */
|
recode it back or /topic <tab> will not work properly */
|
||||||
recoded = recode_in(SERVER(server), topic, channel);
|
recoded = recode_in(SERVER(server), topic, channel);
|
||||||
if (topic != NULL) {
|
if (recoded == NULL || *recoded == '\0') {
|
||||||
g_free_not_null(chanrec->topic);
|
signal_emit("channel topic changed", 1, chanrec);
|
||||||
chanrec->topic = recoded == NULL ? NULL : g_strdup(recoded);
|
|
||||||
}
|
|
||||||
g_free(recoded);
|
g_free(recoded);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
g_free_not_null(chanrec->topic_by);
|
chanrec->topic = recoded;
|
||||||
chanrec->topic_by = g_strdup(setby);
|
chanrec->topic_by = g_strdup(setby);
|
||||||
|
if (chanrec->topic_by != NULL) {
|
||||||
if (chanrec->topic_by == NULL) {
|
|
||||||
/* ensure invariant topic_time > 0 <=> topic_by != NULL.
|
/* ensure invariant topic_time > 0 <=> topic_by != NULL.
|
||||||
this could be triggered by a topic command without sender */
|
this could be triggered by a topic command without sender */
|
||||||
chanrec->topic_time = 0;
|
|
||||||
} else {
|
|
||||||
chanrec->topic_time = settime;
|
chanrec->topic_time = settime;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user