summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog.adoc1
-rw-r--r--src/plugins/irc/irc-protocol.c17
-rw-r--r--tests/unit/plugins/irc/test-irc-protocol.cpp22
3 files changed, 40 insertions, 0 deletions
diff --git a/ChangeLog.adoc b/ChangeLog.adoc
index 257879c06..5e50bdac3 100644
--- a/ChangeLog.adoc
+++ b/ChangeLog.adoc
@@ -21,6 +21,7 @@ https://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes]
New features::
* core: add option "certs" in command /debug
+ * irc: add support of TAGMSG messages (issue #1654)
* irc: enable all capabilities by default (if supported by server and WeeChat), change default value of option irc.server_default.capabilities to "*" (issue #320)
* irc: add options irc.look.display_account_message and irc.look.display_extended_join (issue #320)
* irc: add command /setname, add support of message and capability "setname" (issue #1653)
diff --git a/src/plugins/irc/irc-protocol.c b/src/plugins/irc/irc-protocol.c
index 2890496a7..53631e1b2 100644
--- a/src/plugins/irc/irc-protocol.c
+++ b/src/plugins/irc/irc-protocol.c
@@ -2904,6 +2904,22 @@ IRC_PROTOCOL_CALLBACK(setname)
}
/*
+ * Callback for the IRC message "SETNAME": set real name
+ * (with capability "setname").
+ *
+ * Message looks like:
+ * @msgid=6gqz7dxd22v7r3x9pvukkp8nni;+tag1 :nick!user@host TAGMSG #channel
+ */
+
+IRC_PROTOCOL_CALLBACK(tagmsg)
+{
+ IRC_PROTOCOL_MIN_ARGS(3);
+
+ /* no action by default */
+ return WEECHAT_RC_OK;
+}
+
+/*
* Callback for an IRC message with mode and reason (numeric).
*/
@@ -6669,6 +6685,7 @@ irc_protocol_recv_command (struct t_irc_server *server,
IRCB(privmsg, 1, 1, privmsg), /* message received */
IRCB(quit, 1, 1, quit), /* close all connections and quit */
IRCB(setname, 0, 1, setname), /* set realname */
+ IRCB(tagmsg, 0, 1, tagmsg), /* tag message */
IRCB(topic, 0, 1, topic), /* get/set channel topic */
IRCB(wallops, 1, 1, wallops), /* wallops */
IRCB(warn, 1, 0, warn), /* warning received from server */
diff --git a/tests/unit/plugins/irc/test-irc-protocol.cpp b/tests/unit/plugins/irc/test-irc-protocol.cpp
index 04eaf6b4b..34c310c9c 100644
--- a/tests/unit/plugins/irc/test-irc-protocol.cpp
+++ b/tests/unit/plugins/irc/test-irc-protocol.cpp
@@ -1305,6 +1305,28 @@ TEST(IrcProtocolWithServer, setname_with_setname_cap)
/*
* Tests functions:
+ * irc_protocol_cb_tagmsg
+ */
+
+TEST(IrcProtocolWithServer, tagmsg)
+{
+ server_recv (":server 001 alice");
+
+ server_recv (":alice!user@host JOIN #test");
+ server_recv (":bob!user@host JOIN #test");
+
+ /* not enough arguments */
+ server_recv (":bob!user@host TAGMSG");
+
+ /* no tags */
+ server_recv (":bob!user@host TAGMSG #test");
+
+ /* with tags */
+ server_recv ("@tag1=123;tag2=456 :bob!user@host TAGMSG #test");
+}
+
+/*
+ * Tests functions:
* irc_protocol_cb_topic
*/