mirror of
https://github.com/weechat/weechat.git
synced 2026-06-12 14:14:48 +02:00
irc: fix display of TOPIC message with an empty trailing parameter
This commit is contained in:
+1
-1
@@ -26,7 +26,7 @@ New features::
|
||||
Bug fixes::
|
||||
|
||||
* irc: fix duplicated channels in autojoin option when autojoin_dynamic is enabled (issue #1795)
|
||||
* irc: fix display of QUIT message with an empty trailing parameter (issue #1797)
|
||||
* irc: fix display of TOPIC and QUIT messages with an empty trailing parameter (issue #1797)
|
||||
* relay: fix parsing of IRC messages received from clients (issue #1796)
|
||||
|
||||
[[v3.6]]
|
||||
|
||||
@@ -3258,7 +3258,7 @@ IRC_PROTOCOL_CALLBACK(topic)
|
||||
if (ptr_channel)
|
||||
irc_channel_join_smart_filtered_unmask (ptr_channel, nick);
|
||||
|
||||
if (str_topic)
|
||||
if (str_topic && str_topic[0])
|
||||
{
|
||||
topic_color = irc_color_decode (
|
||||
str_topic,
|
||||
@@ -3361,7 +3361,10 @@ IRC_PROTOCOL_CALLBACK(topic)
|
||||
}
|
||||
|
||||
if (ptr_channel)
|
||||
irc_channel_set_topic (ptr_channel, str_topic);
|
||||
{
|
||||
irc_channel_set_topic (ptr_channel,
|
||||
(str_topic && str_topic[0]) ? str_topic : NULL);
|
||||
}
|
||||
|
||||
if (str_topic)
|
||||
free (str_topic);
|
||||
|
||||
@@ -1966,6 +1966,11 @@ TEST(IrcProtocolWithServer, topic)
|
||||
CHECK_CHAN("-- alice has unset topic for #test");
|
||||
POINTERS_EQUAL(NULL, ptr_channel->topic);
|
||||
|
||||
/* empty topic (with empty trailing parameter) */
|
||||
RECV(":alice!user@host TOPIC #test :");
|
||||
CHECK_CHAN("-- alice has unset topic for #test");
|
||||
POINTERS_EQUAL(NULL, ptr_channel->topic);
|
||||
|
||||
/* new topic */
|
||||
RECV(":alice!user@host TOPIC #test :new topic ");
|
||||
CHECK_CHAN("-- alice has changed topic for #test to \"new topic \"");
|
||||
|
||||
Reference in New Issue
Block a user