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 @@ -4428,6 +4428,33 @@ TEST(IrcProtocolWithServer, 734) CHECK_SRV("=!= Monitor list is full (10)"); } +/* + * 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))