diff --git a/ChangeLog.adoc b/ChangeLog.adoc index 845c95952..ae69681d3 100644 --- a/ChangeLog.adoc +++ b/ChangeLog.adoc @@ -62,6 +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) * 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 2e25627e0..8439cc674 100644 --- a/src/plugins/irc/irc-protocol.c +++ b/src/plugins/irc/irc-protocol.c @@ -7550,6 +7550,7 @@ irc_protocol_recv_command (struct t_irc_server *server, IRCB(412, 1, 0, generic_error), /* no text to send */ IRCB(413, 1, 0, generic_error), /* no toplevel */ IRCB(414, 1, 0, generic_error), /* wilcard in toplevel domain */ + IRCB(415, 1, 0, generic_error), /* cannot send message to channel */ IRCB(421, 1, 0, generic_error), /* unknown command */ IRCB(422, 1, 0, generic_error), /* MOTD is missing */ IRCB(423, 1, 0, generic_error), /* no administrative info */ diff --git a/tests/unit/plugins/irc/test-irc-protocol.cpp b/tests/unit/plugins/irc/test-irc-protocol.cpp index ad83803ae..ca6bced25 100644 --- a/tests/unit/plugins/irc/test-irc-protocol.cpp +++ b/tests/unit/plugins/irc/test-irc-protocol.cpp @@ -3830,6 +3830,29 @@ TEST(IrcProtocolWithServer, 404) CHECK_SRV("-- #test2: Cannot send to channel"); } +/* + * Tests functions: + * irc_protocol_cb_415 (cannot send to channel) + */ + +TEST(IrcProtocolWithServer, 415) +{ + SRV_INIT_JOIN; + + /* not enough parameters */ + RECV(":server 415"); + CHECK_ERROR_PARAMS("415", 0, 2); + RECV(":server 415 alice"); + CHECK_ERROR_PARAMS("415", 1, 2); + + RECV(":server 415 alice #test"); + CHECK_SRV("-- #test"); + RECV(":server 415 alice #test :Cannot send message to channel (+R)"); + CHECK_CHAN("-- #test: Cannot send message to channel (+R)"); + RECV(":server 415 alice #test2 :Cannot send message to channel (+R)"); + CHECK_SRV("-- #test2: Cannot send message to channel (+R)"); +} + /* * Tests functions: * irc_protocol_cb_432 (erroneous nickname, not connected)