1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-12 14:14:48 +02:00

irc: ignore self join if the channel is already joined (closes #2291)

There is an issue with some IRC servers that may send a JOIN with self nick
once already on the channel, this results in a clear of the nicklist on the
second JOIN received.

This fix silently ignores the second self JOIN if the channel is already
joined (with at least one nick).
This commit is contained in:
Sébastien Helleu
2025-12-14 13:44:02 +01:00
parent b42f7a400e
commit 9b4fd66de7
3 changed files with 8 additions and 1 deletions
+4 -1
View File
@@ -2070,7 +2070,6 @@ TEST(IrcProtocolWithServer, join)
LONGS_EQUAL(0, ptr_channel->has_quit_server);
LONGS_EQUAL(0, ptr_channel->cycle);
LONGS_EQUAL(0, ptr_channel->part);
LONGS_EQUAL(0, ptr_channel->part);
STRCMP_EQUAL(NULL, ptr_channel->pv_remote_nick_color);
POINTERS_EQUAL(NULL, ptr_channel->hook_autorejoin);
@@ -2090,6 +2089,10 @@ TEST(IrcProtocolWithServer, join)
CHECK(ptr_channel->buffer);
/* second self JOIN should be ignored if already joined */
RECV(":alice!user@host JOIN #test ");
CHECK_NO_MSG;
RECV(":bob!user@host JOIN #test * : ");
CHECK_CHAN("-->", "bob ( ) (user@host) has joined #test",
"irc_join,irc_smart_filter,nick_bob,host_user@host,log4");