diff options
-rw-r--r-- | ChangeLog.adoc | 1 | ||||
-rw-r--r-- | src/plugins/irc/irc-protocol.c | 34 | ||||
-rw-r--r-- | tests/unit/plugins/irc/test-irc-protocol.cpp | 18 |
3 files changed, 20 insertions, 33 deletions
diff --git a/ChangeLog.adoc b/ChangeLog.adoc index fc3137e0a..eced24657 100644 --- a/ChangeLog.adoc +++ b/ChangeLog.adoc @@ -38,6 +38,7 @@ Bug fixes:: * irc: fix parsing of message 223 (m_filter) sent by InspIRCd server (issue #1751) * irc: fix parsing of message 338 (whois, host) sent by Rizon server (issue #1737) * irc: fix display of message 344 received as whois geo info (issue #1736) + * irc: fix display of message 901 (you are now logged out) (issue #1758) * irc: fix display of IRC numeric messages with no parameters * python: fix crash in hook callbacks after script loading failure (issue #1740) * scripts: auto-load scripts with supported extensions only (issue #1698) diff --git a/src/plugins/irc/irc-protocol.c b/src/plugins/irc/irc-protocol.c index 406d22b10..3d23738b5 100644 --- a/src/plugins/irc/irc-protocol.c +++ b/src/plugins/irc/irc-protocol.c @@ -7002,35 +7002,23 @@ IRC_PROTOCOL_CALLBACK(900) } /* - * Callback for the IRC command "901": you are now logged in. + * Callback for the IRC command "901": you are now logged out. * * Command looks like: - * 901 mynick nick user host :You are now logged in. (id nick, username user, hostname host) + * 901 mynick nick!user@host :You are now logged out. */ IRC_PROTOCOL_CALLBACK(901) { - char *str_params; - - IRC_PROTOCOL_MIN_PARAMS(4); + IRC_PROTOCOL_MIN_PARAMS(3); - if (num_params >= 5) - { - str_params = irc_protocol_string_params (params, 4, num_params - 1); - weechat_printf_date_tags ( - irc_msgbuffer_get_target_buffer (server, NULL, command, NULL, NULL), - date, - irc_protocol_tags (command, tags, "irc_numeric", NULL, NULL), - "%s%s", - weechat_prefix ("network"), - str_params); - if (str_params) - free (str_params); - } - else - { - IRC_PROTOCOL_RUN_CALLBACK(numeric); - } + weechat_printf_date_tags ( + irc_msgbuffer_get_target_buffer (server, NULL, command, NULL, NULL), + date, + irc_protocol_tags (command, tags, "irc_numeric", NULL, NULL), + "%s%s", + weechat_prefix ("network"), + params[2]); return WEECHAT_RC_OK; } @@ -7266,7 +7254,7 @@ irc_protocol_recv_command (struct t_irc_server *server, IRCB(733, 1, 0, 733), /* end of monitor list */ IRCB(734, 1, 0, 734), /* monitor list is full */ IRCB(900, 1, 0, 900), /* logged in as (SASL) */ - IRCB(901, 1, 0, 901), /* you are now logged in */ + IRCB(901, 1, 0, 901), /* you are now logged out */ IRCB(902, 1, 0, sasl_end_fail), /* SASL auth failed (acc. locked) */ IRCB(903, 1, 0, sasl_end_ok), /* SASL auth successful */ IRCB(904, 1, 0, sasl_end_fail), /* SASL auth failed */ diff --git a/tests/unit/plugins/irc/test-irc-protocol.cpp b/tests/unit/plugins/irc/test-irc-protocol.cpp index 436ad2e54..3dd718726 100644 --- a/tests/unit/plugins/irc/test-irc-protocol.cpp +++ b/tests/unit/plugins/irc/test-irc-protocol.cpp @@ -4074,7 +4074,7 @@ TEST(IrcProtocolWithServer, 900) /* * Tests functions: - * irc_protocol_cb_901 (you are now logged in) + * irc_protocol_cb_901 (you are now logged out) */ TEST(IrcProtocolWithServer, 901) @@ -4083,18 +4083,16 @@ TEST(IrcProtocolWithServer, 901) /* not enough parameters */ RECV(":server 901"); - CHECK_ERROR_PARAMS("901", 0, 4); + CHECK_ERROR_PARAMS("901", 0, 3); RECV(":server 901 alice"); - CHECK_ERROR_PARAMS("901", 1, 4); - RECV(":server 901 alice user"); - CHECK_ERROR_PARAMS("901", 2, 4); - RECV(":server 901 alice user host"); - CHECK_ERROR_PARAMS("901", 3, 4); + CHECK_ERROR_PARAMS("901", 1, 3); + RECV(":server 901 alice nick!user@host"); + CHECK_ERROR_PARAMS("901", 2, 3); - RECV(":server 901 alice nick user host logged"); + RECV(":server 901 alice nick!user@host logged"); CHECK_SRV("-- logged"); - RECV(":server 901 alice nick user host :You are now logged in as nick"); - CHECK_SRV("-- You are now logged in as nick"); + RECV(":server 901 alice nick!user@host :You are now logged out"); + CHECK_SRV("-- You are now logged out"); } /* |