diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2023-04-24 21:44:34 +0200 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2023-04-24 21:44:34 +0200 |
commit | e00ec6710d2669032f115c4be0619a65033881b9 (patch) | |
tree | 8be6ec391dd38e4d8cc122c16504f0630d561251 | |
parent | 28bb33aa5a80d93afbc291a05ee8b033456e1ced (diff) | |
download | weechat-e00ec6710d2669032f115c4be0619a65033881b9.zip |
irc: add message 742 (mode cannot be set)
-rw-r--r-- | ChangeLog.adoc | 2 | ||||
-rw-r--r-- | src/plugins/irc/irc-protocol.c | 1 | ||||
-rw-r--r-- | tests/unit/plugins/irc/test-irc-protocol.cpp | 27 |
3 files changed, 29 insertions, 1 deletions
diff --git a/ChangeLog.adoc b/ChangeLog.adoc index ae69681d3..4fcd20d1a 100644 --- a/ChangeLog.adoc +++ b/ChangeLog.adoc @@ -62,7 +62,7 @@ Bug fixes:: * irc: update autojoin option with redirected channels when autojoin_dynamic is enabled (issue #1898) * irc: don't switch to buffer of joined channel if it was not manually joined nor present in server autojoin option * irc: fix target buffer for commands 432/433 (erroneous nickname/nickname already in use) when the nickname looks like a channel - * irc: add message 415 (cannot send message to channel) + * irc: add messages 415 (cannot send message to channel) and 742 (mode cannot be set) * lua: fix crash with print when the value to print is not a string (issue #1904, issue #1905) * spell: check buffer pointer received in info "spell_dict" * typing: fix crash when pointer buffer is not received in callback for signal "input_text_changed" (issue #1869) diff --git a/src/plugins/irc/irc-protocol.c b/src/plugins/irc/irc-protocol.c index 8439cc674..56ccbacd5 100644 --- a/src/plugins/irc/irc-protocol.c +++ b/src/plugins/irc/irc-protocol.c @@ -7608,6 +7608,7 @@ irc_protocol_recv_command (struct t_irc_server *server, IRCB(732, 1, 0, 732), /* list of monitored nicks */ IRCB(733, 1, 0, 733), /* end of monitor list */ IRCB(734, 1, 0, 734), /* monitor list is full */ + IRCB(742, 1, 0, generic_error), /* mode cannot be set */ IRCB(900, 1, 0, 900), /* logged in as (SASL) */ IRCB(901, 1, 0, 901), /* you are now logged out */ IRCB(902, 1, 0, sasl_end_fail), /* SASL auth failed (acc. locked) */ diff --git a/tests/unit/plugins/irc/test-irc-protocol.cpp b/tests/unit/plugins/irc/test-irc-protocol.cpp index ca6bced25..2965f9de8 100644 --- a/tests/unit/plugins/irc/test-irc-protocol.cpp +++ b/tests/unit/plugins/irc/test-irc-protocol.cpp @@ -4430,6 +4430,33 @@ TEST(IrcProtocolWithServer, 734) /* * Tests functions: + * irc_protocol_cb_742 (mode cannot be set) + */ + +TEST(IrcProtocolWithServer, 742) +{ + SRV_INIT_JOIN; + + /* not enough parameters */ + RECV(":server 742"); + CHECK_ERROR_PARAMS("742", 0, 2); + RECV(":server 742 alice"); + CHECK_ERROR_PARAMS("742", 1, 2); + + RECV(":server 742 alice #test"); + CHECK_SRV("-- #test"); + RECV(":server 742 alice #test n nstlk :MODE cannot be set due to channel " + "having an active MLOCK restriction policy"); + CHECK_CHAN("-- #test: n nstlk MODE cannot be set due to channel having " + "an active MLOCK restriction policy"); + RECV(":server 742 alice #test2 n nstlk :MODE cannot be set due to channel " + "having an active MLOCK restriction policy"); + CHECK_SRV("-- #test2: n nstlk MODE cannot be set due to channel having " + "an active MLOCK restriction policy"); +} + +/* + * Tests functions: * irc_protocol_cb_900 (logged in as (SASL)) */ |