summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2021-12-30 21:11:22 +0100
committerSébastien Helleu <flashcode@flashtux.org>2021-12-30 21:11:22 +0100
commitb66298d369cc72b593368d70abb0a994009eb44e (patch)
tree95d231a11debf6b57c5a169bfefe469bb89de858 /src
parent5c6fc8c4bd190124a6542e1340ebcabee928e980 (diff)
downloadweechat-b66298d369cc72b593368d70abb0a994009eb44e.zip
irc: add IRC message tags in messages displayed (closes #1680)
Diffstat (limited to 'src')
-rw-r--r--src/plugins/irc/irc-channel.c1
-rw-r--r--src/plugins/irc/irc-command.c3
-rw-r--r--src/plugins/irc/irc-ctcp.c46
-rw-r--r--src/plugins/irc/irc-ctcp.h4
-rw-r--r--src/plugins/irc/irc-input.c8
-rw-r--r--src/plugins/irc/irc-protocol.c293
-rw-r--r--src/plugins/irc/irc-protocol.h7
7 files changed, 233 insertions, 129 deletions
diff --git a/src/plugins/irc/irc-channel.c b/src/plugins/irc/irc-channel.c
index a64212bf0..c99a1a736 100644
--- a/src/plugins/irc/irc-channel.c
+++ b/src/plugins/irc/irc-channel.c
@@ -1442,6 +1442,7 @@ irc_channel_display_nick_back_in_pv (struct t_irc_server *server,
irc_protocol_tags (
"nick_back",
NULL,
+ NULL,
(nick) ? nick->name : NULL,
(nick) ? nick->host : NULL),
_("%s%s%s %s(%s%s%s)%s is back on server"),
diff --git a/src/plugins/irc/irc-command.c b/src/plugins/irc/irc-command.c
index 20e83aa94..f41e96ccf 100644
--- a/src/plugins/irc/irc-command.c
+++ b/src/plugins/irc/irc-command.c
@@ -915,6 +915,7 @@ irc_command_me_channel_display (struct t_irc_server *server,
channel->buffer,
0,
irc_protocol_tags ("privmsg",
+ NULL,
"irc_action,self_msg,notify_none,no_highlight",
server->nick, NULL),
"%s%s%s%s%s%s%s",
@@ -1746,6 +1747,7 @@ IRC_COMMAND_CALLBACK(ctcp)
ptr_server, ctcp_target, NULL, "ctcp", NULL),
0,
irc_protocol_tags ("privmsg",
+ NULL,
"irc_ctcp,self_msg,notify_none,no_highlight",
NULL, NULL),
_("%sCTCP query to %s%s%s: %s%s%s%s%s"),
@@ -3579,6 +3581,7 @@ IRC_COMMAND_CALLBACK(msg)
0,
irc_protocol_tags (
"privmsg",
+ NULL,
"self_msg,notify_none,no_highlight",
ptr_server->nick, NULL),
"%sMSG%s(%s%s%s)%s: %s",
diff --git a/src/plugins/irc/irc-ctcp.c b/src/plugins/irc/irc-ctcp.c
index 921c4831d..bfe69840c 100644
--- a/src/plugins/irc/irc-ctcp.c
+++ b/src/plugins/irc/irc-ctcp.c
@@ -111,6 +111,7 @@ irc_ctcp_get_reply (struct t_irc_server *server, const char *ctcp)
void
irc_ctcp_display_request (struct t_irc_server *server,
time_t date,
+ struct t_hashtable *tags,
const char *command,
struct t_irc_channel *channel,
const char *nick,
@@ -129,7 +130,7 @@ irc_ctcp_display_request (struct t_irc_server *server,
server, nick, NULL, "ctcp",
(channel) ? channel->buffer : NULL),
date,
- irc_protocol_tags (command, "irc_ctcp", NULL, address),
+ irc_protocol_tags (command, tags, "irc_ctcp", NULL, address),
_("%sCTCP requested by %s%s%s: %s%s%s%s%s%s"),
weechat_prefix ("network"),
irc_nick_color_for_msg (server, 0, NULL, nick),
@@ -149,6 +150,7 @@ irc_ctcp_display_request (struct t_irc_server *server,
void
irc_ctcp_display_reply_from_nick (struct t_irc_server *server, time_t date,
+ struct t_hashtable *tags,
const char *command, const char *nick,
const char *address, const char *arguments)
{
@@ -196,7 +198,7 @@ irc_ctcp_display_reply_from_nick (struct t_irc_server *server, time_t date,
irc_msgbuffer_get_target_buffer (
server, nick, NULL, "ctcp", NULL),
date,
- irc_protocol_tags (command, "irc_ctcp", NULL, NULL),
+ irc_protocol_tags (command, tags, "irc_ctcp", NULL, NULL),
/* TRANSLATORS: %.3fs is a float number + "s" ("seconds") */
_("%sCTCP reply from %s%s%s: %s%s%s %.3fs"),
weechat_prefix ("network"),
@@ -215,7 +217,7 @@ irc_ctcp_display_reply_from_nick (struct t_irc_server *server, time_t date,
irc_msgbuffer_get_target_buffer (
server, nick, NULL, "ctcp", NULL),
date,
- irc_protocol_tags (command, "irc_ctcp", NULL, address),
+ irc_protocol_tags (command, tags, "irc_ctcp", NULL, address),
_("%sCTCP reply from %s%s%s: %s%s%s%s%s"),
weechat_prefix ("network"),
irc_nick_color_for_msg (server, 0, NULL, nick),
@@ -234,7 +236,7 @@ irc_ctcp_display_reply_from_nick (struct t_irc_server *server, time_t date,
irc_msgbuffer_get_target_buffer (
server, nick, NULL, "ctcp", NULL),
date,
- irc_protocol_tags (command, NULL, NULL, address),
+ irc_protocol_tags (command, tags, NULL, NULL, address),
_("%sCTCP reply from %s%s%s: %s%s%s%s%s"),
weechat_prefix ("network"),
irc_nick_color_for_msg (server, 0, NULL, nick),
@@ -259,9 +261,11 @@ irc_ctcp_display_reply_from_nick (struct t_irc_server *server, time_t date,
void
irc_ctcp_reply_to_nick (struct t_irc_server *server,
+ struct t_hashtable *tags,
const char *command,
struct t_irc_channel *channel,
- const char *nick, const char *ctcp,
+ const char *nick,
+ const char *ctcp,
const char *arguments)
{
struct t_hashtable *hashtable;
@@ -307,6 +311,7 @@ irc_ctcp_reply_to_nick (struct t_irc_server *server,
0,
irc_protocol_tags (
command,
+ tags,
"irc_ctcp,irc_ctcp_reply,self_msg,notify_none,"
"no_highlight",
NULL, NULL),
@@ -994,7 +999,8 @@ irc_ctcp_recv_dcc (struct t_irc_server *server, const char *nick,
*/
void
-irc_ctcp_recv (struct t_irc_server *server, time_t date, const char *command,
+irc_ctcp_recv (struct t_irc_server *server, time_t date,
+ struct t_hashtable *tags, const char *command,
struct t_irc_channel *channel, const char *address,
const char *nick, const char *remote_nick,
const char *arguments, const char *message)
@@ -1056,6 +1062,7 @@ irc_ctcp_recv (struct t_irc_server *server, time_t date, const char *command,
date,
irc_protocol_tags (
command,
+ tags,
(nick_is_me) ?
"irc_action,self_msg,notify_none,no_highlight" :
"irc_action,notify_message",
@@ -1098,6 +1105,7 @@ irc_ctcp_recv (struct t_irc_server *server, time_t date, const char *command,
date,
irc_protocol_tags (
command,
+ tags,
(nick_is_me) ?
"irc_action,self_msg,notify_none,no_highlight" :
"irc_action,notify_private",
@@ -1120,8 +1128,9 @@ irc_ctcp_recv (struct t_irc_server *server, time_t date, const char *command,
else if (weechat_strcasecmp (ptr_args + 1, "PING") == 0)
{
reply = irc_ctcp_get_reply (server, ptr_args + 1);
- irc_ctcp_display_request (server, date, command, channel, nick,
- address, ptr_args + 1, pos_args, reply);
+ irc_ctcp_display_request (server, date, tags, command, channel,
+ nick, address, ptr_args + 1, pos_args,
+ reply);
if (!reply || reply[0])
{
if (reply)
@@ -1129,15 +1138,16 @@ irc_ctcp_recv (struct t_irc_server *server, time_t date, const char *command,
decoded_reply = irc_ctcp_replace_variables (server, reply);
if (decoded_reply)
{
- irc_ctcp_reply_to_nick (server, command, channel, nick,
- ptr_args + 1, decoded_reply);
+ irc_ctcp_reply_to_nick (server, tags, command, channel,
+ nick, ptr_args + 1,
+ decoded_reply);
free (decoded_reply);
}
}
else
{
- irc_ctcp_reply_to_nick (server, command, channel, nick,
- ptr_args + 1, pos_args);
+ irc_ctcp_reply_to_nick (server, tags, command, channel,
+ nick, ptr_args + 1, pos_args);
}
}
}
@@ -1152,8 +1162,8 @@ irc_ctcp_recv (struct t_irc_server *server, time_t date, const char *command,
reply = irc_ctcp_get_reply (server, ptr_args + 1);
if (reply)
{
- irc_ctcp_display_request (server, date, command, channel, nick,
- address, ptr_args + 1, pos_args,
+ irc_ctcp_display_request (server, date, tags, command, channel,
+ nick, address, ptr_args + 1, pos_args,
reply);
if (reply[0])
@@ -1161,8 +1171,9 @@ irc_ctcp_recv (struct t_irc_server *server, time_t date, const char *command,
decoded_reply = irc_ctcp_replace_variables (server, reply);
if (decoded_reply)
{
- irc_ctcp_reply_to_nick (server, command, channel, nick,
- ptr_args + 1, decoded_reply);
+ irc_ctcp_reply_to_nick (server, tags, command, channel,
+ nick, ptr_args + 1,
+ decoded_reply);
free (decoded_reply);
}
}
@@ -1176,7 +1187,8 @@ irc_ctcp_recv (struct t_irc_server *server, time_t date, const char *command,
server, nick, NULL, "ctcp",
(channel) ? channel->buffer : NULL),
date,
- irc_protocol_tags (command, "irc_ctcp", NULL, address),
+ irc_protocol_tags (command, tags, "irc_ctcp", NULL,
+ address),
_("%sUnknown CTCP requested by %s%s%s: %s%s%s%s%s"),
weechat_prefix ("network"),
irc_nick_color_for_msg (server, 0, NULL, nick),
diff --git a/src/plugins/irc/irc-ctcp.h b/src/plugins/irc/irc-ctcp.h
index 809d98505..80c6184d3 100644
--- a/src/plugins/irc/irc-ctcp.h
+++ b/src/plugins/irc/irc-ctcp.h
@@ -36,6 +36,7 @@ extern const char *irc_ctcp_get_reply (struct t_irc_server *server,
const char *ctcp);
extern void irc_ctcp_display_reply_from_nick (struct t_irc_server *server,
time_t date,
+ struct t_hashtable *tags,
const char *command,
const char *nick,
const char *address,
@@ -43,7 +44,8 @@ extern void irc_ctcp_display_reply_from_nick (struct t_irc_server *server,
extern char *irc_ctcp_replace_variables (struct t_irc_server *server,
const char *format);
extern void irc_ctcp_recv (struct t_irc_server *server, time_t date,
- const char *command, struct t_irc_channel *channel,
+ struct t_hashtable *tags, const char *command,
+ struct t_irc_channel *channel,
const char *address, const char *nick,
const char *remote_nick, const char *arguments,
const char *message);
diff --git a/src/plugins/irc/irc-input.c b/src/plugins/irc/irc-input.c
index e30b05ac2..81739dc92 100644
--- a/src/plugins/irc/irc-input.c
+++ b/src/plugins/irc/irc-input.c
@@ -102,7 +102,9 @@ irc_input_user_message_display (struct t_gui_buffer *buffer, int action,
buffer,
0,
irc_protocol_tags (
- "privmsg", str_tags,
+ "privmsg",
+ NULL,
+ str_tags,
(ptr_nick) ? ptr_nick->name : ptr_server->nick,
NULL),
"%s%s%s%s%s %s",
@@ -119,7 +121,9 @@ irc_input_user_message_display (struct t_gui_buffer *buffer, int action,
buffer,
0,
irc_protocol_tags (
- "privmsg", str_tags,
+ "privmsg",
+ NULL,
+ str_tags,
(ptr_nick) ? ptr_nick->name : ptr_server->nick,
NULL),
"%s%s",
diff --git a/src/plugins/irc/irc-protocol.c b/src/plugins/irc/irc-protocol.c
index d02409e15..2d8a5eb70 100644
--- a/src/plugins/irc/irc-protocol.c
+++ b/src/plugins/irc/irc-protocol.c
@@ -111,22 +111,80 @@ irc_protocol_log_level_for_command (const char *command)
}
/*
+ * Adds IRC tag key/value in a dynamic string.
+ *
+ * As commas are not allowed in WeeChat tags, they are replaced by semicolons.
+ */
+
+void
+irc_protocol_tags_add_cb (void *data,
+ struct t_hashtable *hashtable,
+ const void *key,
+ const void *value)
+{
+ char **str_tags, *str_temp, *str_temp2;
+
+ /* make C compiler happy */
+ (void) hashtable;
+
+ str_tags = (char **)data;
+
+ if (*str_tags[0])
+ weechat_string_dyn_concat (str_tags, ",", -1);
+
+ weechat_string_dyn_concat (str_tags, "irc_tag_", -1);
+
+ /* key */
+ str_temp = weechat_string_replace ((const char *)key, ",", ";");
+ str_temp2 = weechat_string_replace (str_temp, "_", "-");
+ if (str_temp2)
+ weechat_string_dyn_concat (str_tags, str_temp2, -1);
+ if (str_temp)
+ free (str_temp);
+ if (str_temp2)
+ free (str_temp2);
+ weechat_string_dyn_concat (str_tags, "_", -1);
+
+ /* value */
+ str_temp = weechat_string_replace ((const char *)value, ",", ";");
+ weechat_string_dyn_concat (str_tags, str_temp, -1);
+ if (str_temp)
+ free (str_temp);
+}
+
+/*
* Builds tags list with IRC command and optional tags and nick.
*/
const char *
-irc_protocol_tags (const char *command, const char *tags, const char *nick,
+irc_protocol_tags (const char *command, struct t_hashtable *irc_msg_tags,
+ const char *extra_tags, const char *nick,
const char *address)
{
- static char string[1024];
- int log_level;
- char str_log_level[32];
+ static char string[4096];
+ int log_level, has_irc_tags;
+ char str_log_level[32], **str_irc_tags;
str_log_level[0] = '\0';
- if (!command && !tags && !nick)
+ has_irc_tags = (irc_msg_tags
+ && weechat_hashtable_get_integer (irc_msg_tags,
+ "items_count") > 0);
+
+ if (!command && !has_irc_tags && !extra_tags && !nick)
return NULL;
+ if (has_irc_tags)
+ {
+ str_irc_tags = weechat_string_dyn_alloc (256);
+ weechat_hashtable_map (irc_msg_tags, irc_protocol_tags_add_cb,
+ str_irc_tags);
+ }
+ else
+ {
+ str_irc_tags = NULL;
+ }
+
if (command && command[0])
{
log_level = irc_protocol_log_level_for_command (command);
@@ -138,17 +196,22 @@ irc_protocol_tags (const char *command, const char *tags, const char *nick,
}
snprintf (string, sizeof (string),
- "%s%s%s%s%s%s%s%s%s",
+ "%s%s%s%s%s%s%s%s%s%s%s",
(command && command[0]) ? "irc_" : "",
(command && command[0]) ? command : "",
- (tags && tags[0]) ? "," : "",
- (tags && tags[0]) ? tags : "",
+ (str_irc_tags && *str_irc_tags[0]) ? "," : "",
+ (str_irc_tags && *str_irc_tags[0]) ? *str_irc_tags : "",
+ (extra_tags && extra_tags[0]) ? "," : "",
+ (extra_tags && extra_tags[0]) ? extra_tags : "",
(nick && nick[0]) ? ",nick_" : "",
(nick && nick[0]) ? nick : "",
(address && address[0]) ? ",host_" : "",
(address && address[0]) ? address : "",
str_log_level);
+ if (str_irc_tags)
+ weechat_string_dyn_free (str_irc_tags, 1);
+
return string;
}
@@ -322,6 +385,7 @@ irc_protocol_string_params (const char **params, int arg_start, int arg_end)
void
irc_protocol_print_error_warning_msg (struct t_irc_server *server,
time_t date,
+ struct t_hashtable *tags,
const char *command,
const char *prefix,
const char *label,
@@ -340,7 +404,7 @@ irc_protocol_print_error_warning_msg (struct t_irc_server *server,
weechat_printf_date_tags (
irc_msgbuffer_get_target_buffer (server, NULL, command, NULL, NULL),
date,
- irc_protocol_tags (command, NULL, NULL, NULL),
+ irc_protocol_tags (command, tags, NULL, NULL, NULL),
"%s%s%s%s%s%s[%s%s%s]%s %s",
(prefix) ? prefix : "",
(label) ? label : "",
@@ -419,6 +483,7 @@ IRC_PROTOCOL_CALLBACK(account)
date,
irc_protocol_tags (
command,
+ tags,
smart_filter ? "irc_smart_filter" : NULL,
nick, address),
(pos_account) ? _("%s%s%s%s has identified as %s") : _("%s%s%s%s has unidentified"),
@@ -1207,6 +1272,7 @@ IRC_PROTOCOL_CALLBACK(chghost)
date,
irc_protocol_tags (
command,
+ tags,
smart_filter ? "irc_smart_filter" : NULL,
nick, address),
_("%s%s%s%s (%s%s%s)%s has changed host to %s%s"),
@@ -1248,7 +1314,7 @@ IRC_PROTOCOL_CALLBACK(error)
weechat_printf_date_tags (
irc_msgbuffer_get_target_buffer (server, NULL, command, NULL, NULL),
date,
- irc_protocol_tags (command, NULL, NULL, NULL),
+ irc_protocol_tags (command, tags, NULL, NULL, NULL),
"%s%s",
weechat_prefix ("error"),
str_error);
@@ -1306,7 +1372,7 @@ IRC_PROTOCOL_CALLBACK(generic_error)
|| (strcmp (command, "402") == 0)) ? "whois" : NULL,
ptr_buffer),
date,
- irc_protocol_tags (command, NULL, NULL, NULL),
+ irc_protocol_tags (command, tags, NULL, NULL, NULL),
"%s%s%s%s%s%s",
weechat_prefix ("network"),
(ptr_channel && pos_chan_nick
@@ -1340,6 +1406,7 @@ IRC_PROTOCOL_CALLBACK(fail)
irc_protocol_print_error_warning_msg (
server,
date,
+ tags,
command,
weechat_prefix ("error"),
_("Failure:"),
@@ -1376,7 +1443,7 @@ IRC_PROTOCOL_CALLBACK(invite)
weechat_printf_date_tags (
irc_msgbuffer_get_target_buffer (server, nick, command, NULL, NULL),
date,
- irc_protocol_tags (command, "notify_highlight", nick, address),
+ irc_protocol_tags (command, tags, "notify_highlight", nick, address),
_("%sYou have been invited to %s%s%s by %s%s%s"),
weechat_prefix ("network"),
IRC_COLOR_CHAT_CHANNEL,
@@ -1393,7 +1460,7 @@ IRC_PROTOCOL_CALLBACK(invite)
weechat_printf_date_tags (
irc_msgbuffer_get_target_buffer (server, nick, command, NULL, NULL),
date,
- irc_protocol_tags (command, NULL, nick, address),
+ irc_protocol_tags (command, tags, NULL, nick, address),
_("%s%s%s%s has invited %s%s%s to %s%s%s"),
weechat_prefix ("network"),
irc_nick_color_for_msg (server, 1, NULL, nick),
@@ -1547,6 +1614,7 @@ IRC_PROTOCOL_CALLBACK(join)
ptr_channel->buffer),
date,
irc_protocol_tags (command,
+ tags,
smart_filter ? "irc_smart_filter" : NULL,
nick, address),
_("%s%s%s%s%s%s%s%s%s%s%s%s has joined %s%s%s"),
@@ -1627,7 +1695,7 @@ IRC_PROTOCOL_CALLBACK(kick)
irc_msgbuffer_get_target_buffer (server, NULL, command, NULL,
ptr_channel->buffer),
date,
- irc_protocol_tags (command, NULL, NULL, address),
+ irc_protocol_tags (command, tags, NULL, NULL, address),
_("%s%s%s%s has kicked %s%s%s %s(%s%s%s)"),
weechat_prefix ("quit"),
irc_nick_color_for_msg (server, 1, ptr_nick, nick),
@@ -1647,7 +1715,7 @@ IRC_PROTOCOL_CALLBACK(kick)
irc_msgbuffer_get_target_buffer (server, NULL, command, NULL,
ptr_channel->buffer),
date,
- irc_protocol_tags (command, NULL, NULL, address),
+ irc_protocol_tags (command, tags, NULL, NULL, address),
_("%s%s%s%s has kicked %s%s%s"),
weechat_prefix ("quit"),
irc_nick_color_for_msg (server, 1, ptr_nick, nick),
@@ -1747,7 +1815,7 @@ IRC_PROTOCOL_CALLBACK(kill)
irc_msgbuffer_get_target_buffer (server, NULL, command, NULL,
ptr_channel->buffer),
date,
- irc_protocol_tags (command, NULL, NULL, address),
+ irc_protocol_tags (command, tags, NULL, NULL, address),
_("%s%sYou were killed by %s%s%s %s(%s%s%s)"),
weechat_prefix ("quit"),
IRC_COLOR_MESSAGE_KICK,
@@ -1765,7 +1833,7 @@ IRC_PROTOCOL_CALLBACK(kill)
irc_msgbuffer_get_target_buffer (server, NULL, command, NULL,
ptr_channel->buffer),
date,
- irc_protocol_tags (command, NULL, NULL, address),
+ irc_protocol_tags (command, tags, NULL, NULL, address),
_("%s%sYou were killed by %s%s%s"),
weechat_prefix ("quit"),
IRC_COLOR_MESSAGE_KICK,
@@ -1842,6 +1910,7 @@ IRC_PROTOCOL_CALLBACK(mode)
ptr_buffer),
date,
irc_protocol_tags (command,
+ tags,
(smart_filter && !local_mode) ?
"irc_smart_filter" : NULL,
NULL, address),
@@ -1866,7 +1935,7 @@ IRC_PROTOCOL_CALLBACK(mode)
weechat_printf_date_tags (
irc_msgbuffer_get_target_buffer (server, NULL, command, NULL, NULL),
date,
- irc_protocol_tags (command, NULL, NULL, address),
+ irc_protocol_tags (command, tags, NULL, NULL, address),
_("%sUser mode %s[%s%s%s]%s by %s%s"),
weechat_prefix ("network"),
IRC_COLOR_CHAT_DELIMITERS,
@@ -1930,7 +1999,7 @@ IRC_PROTOCOL_CALLBACK(nick)
weechat_printf_date_tags (
server->buffer,
date,
- irc_protocol_tags (command, str_tags, NULL, address),
+ irc_protocol_tags (command, tags, str_tags, NULL, address),
_("%sYou are now known as %s%s%s"),
weechat_prefix ("network"),
IRC_COLOR_CHAT_NICK_SELF,
@@ -1997,6 +2066,7 @@ IRC_PROTOCOL_CALLBACK(nick)
weechat_printf_date_tags (ptr_channel->buffer,
date,
irc_protocol_tags (command,
+ tags,
str_tags,
NULL,
address),
@@ -2029,8 +2099,8 @@ IRC_PROTOCOL_CALLBACK(nick)
weechat_printf_date_tags (
ptr_channel->buffer,
date,
- irc_protocol_tags (command, str_tags, NULL,
- address),
+ irc_protocol_tags (command, tags, str_tags,
+ NULL, address),
_("%s%s%s%s is now known as %s%s%s"),
weechat_prefix ("network"),
weechat_config_boolean (irc_config_look_color_nicks_in_server_messages) ?
@@ -2083,6 +2153,7 @@ IRC_PROTOCOL_CALLBACK(note)
irc_protocol_print_error_warning_msg (
server,
date,
+ tags,
command,
weechat_prefix ("network"),
_("Note:"),
@@ -2135,8 +2206,8 @@ IRC_PROTOCOL_CALLBACK(notice)
if (nick && (pos_args[0] == '\01'))
{
- irc_ctcp_display_reply_from_nick (server, date, command, nick, address,
- pos_args);
+ irc_ctcp_display_reply_from_nick (server, date, tags, command, nick,
+ address, pos_args);
}
else
{
@@ -2208,6 +2279,7 @@ IRC_PROTOCOL_CALLBACK(notice)
(ptr_channel) ? ptr_channel->buffer : server->buffer,
date,
irc_protocol_tags (command,
+ tags,
(is_channel_orig) ?
"notify_message" :
weechat_config_string (irc_config_look_notice_welcome_tags),
@@ -2283,7 +2355,7 @@ IRC_PROTOCOL_CALLBACK(notice)
weechat_printf_date_tags (
ptr_channel->buffer,
date,
- irc_protocol_tags (command, "notify_private", nick,
+ irc_protocol_tags (command, tags, "notify_private", nick,
address),
"%s%s%s%s: %s",
weechat_prefix ("network"),
@@ -2312,6 +2384,7 @@ IRC_PROTOCOL_CALLBACK(notice)
ptr_buffer,
date,
irc_protocol_tags (command,
+ tags,
(notify_private) ? "notify_private" : NULL,
server->nick, address),
"%s%s%s%s -> %s%s%s: %s",
@@ -2333,6 +2406,7 @@ IRC_PROTOCOL_CALLBACK(notice)
ptr_buffer,
date,
irc_protocol_tags (command,
+ tags,
(notify_private) ? "notify_private" : NULL,
nick, address),
"%s%s%s%s",
@@ -2403,6 +2477,7 @@ IRC_PROTOCOL_CALLBACK(part)
server, NULL, command, NULL, ptr_channel->buffer),
date,
irc_protocol_tags (command,
+ tags,
(local_part
|| (ptr_channel->type != IRC_CHANNEL_TYPE_CHANNEL)
|| !weechat_config_boolean (irc_config_look_smart_filter)
@@ -2436,6 +2511,7 @@ IRC_PROTOCOL_CALLBACK(part)
server, NULL, command, NULL, ptr_channel->buffer),
date,
irc_protocol_tags (command,
+ tags,
(local_part
|| (ptr_channel->type != IRC_CHANNEL_TYPE_CHANNEL)
|| !weechat_config_boolean (irc_config_look_smart_filter)
@@ -2591,7 +2667,7 @@ IRC_PROTOCOL_CALLBACK(pong)
weechat_printf_date_tags (
irc_msgbuffer_get_target_buffer (server, NULL, command, NULL, NULL),
date,
- irc_protocol_tags (command, NULL, NULL, NULL),
+ irc_protocol_tags (command, tags, NULL, NULL, NULL),
"PONG%s%s",
(str_params) ? ": " : "",
(str_params) ? str_params : "");
@@ -2664,7 +2740,7 @@ IRC_PROTOCOL_CALLBACK(privmsg)
/* CTCP to channel */
if (msg_args[0] == '\01')
{
- irc_ctcp_recv (server, date, command, ptr_channel,
+ irc_ctcp_recv (server, date, tags, command, ptr_channel,
address, nick, NULL, msg_args, irc_message);
goto end;
}
@@ -2687,7 +2763,7 @@ IRC_PROTOCOL_CALLBACK(privmsg)
weechat_printf_date_tags (
ptr_channel->buffer,
date,
- irc_protocol_tags (command, "notify_message", nick,
+ irc_protocol_tags (command, tags, "notify_message", nick,
address),
"%s%s%s%s%s(%s%s%s)%s: %s",
weechat_prefix ("network"),
@@ -2716,7 +2792,7 @@ IRC_PROTOCOL_CALLBACK(privmsg)
weechat_printf_date_tags (
ptr_channel->buffer,
date,
- irc_protocol_tags (command, str_tags, nick, address),
+ irc_protocol_tags (command, tags, str_tags, nick, address),
"%s%s",
irc_nick_as_prefix (server, ptr_nick,
(ptr_nick) ? NULL : nick,
@@ -2743,7 +2819,7 @@ IRC_PROTOCOL_CALLBACK(privmsg)
/* CTCP to user */
if (msg_args[0] == '\01')
{
- irc_ctcp_recv (server, date, command, NULL,
+ irc_ctcp_recv (server, date, tags, command, NULL,
address, nick, remote_nick, msg_args, irc_message);
goto end;
}
@@ -2817,7 +2893,7 @@ IRC_PROTOCOL_CALLBACK(privmsg)
weechat_printf_date_tags (
ptr_channel->buffer,
date,
- irc_protocol_tags (command, str_tags, nick, address),
+ irc_protocol_tags (command, tags, str_tags, nick, address),
"%s%s",
irc_nick_as_prefix (
server, NULL, nick,
@@ -2901,6 +2977,7 @@ IRC_PROTOCOL_CALLBACK(quit)
date,
irc_protocol_tags (
command,
+ tags,
(local_quit
|| (ptr_channel->type != IRC_CHANNEL_TYPE_CHANNEL)
|| !weechat_config_boolean (irc_config_look_smart_filter)
@@ -2933,6 +3010,7 @@ IRC_PROTOCOL_CALLBACK(quit)
date,
irc_protocol_tags (
command,
+ tags,
(local_quit
|| (ptr_channel->type != IRC_CHANNEL_TYPE_CHANNEL)
|| !weechat_config_boolean (irc_config_look_smart_filter)
@@ -3019,7 +3097,7 @@ IRC_PROTOCOL_CALLBACK(setname)
weechat_printf_date_tags (
irc_msgbuffer_get_target_buffer (server, NULL, command, NULL, NULL),
date,
- irc_protocol_tags (command, NULL, NULL, NULL),
+ irc_protocol_tags (command, tags, NULL, NULL, NULL),
_("%sYour real name has been set to \"%s\""),
weechat_prefix ("network"),
(realname_color) ? realname_color : "");
@@ -3029,7 +3107,7 @@ IRC_PROTOCOL_CALLBACK(setname)
weechat_printf_date_tags (
irc_msgbuffer_get_target_buffer (server, NULL, command, NULL, NULL),
date,
- irc_protocol_tags (command, NULL, NULL, NULL),
+ irc_protocol_tags (command, tags, NULL, NULL, NULL),
_("%sReal name of %s%s%s has been set to \"%s\""),
weechat_prefix ("network"),
irc_nick_color_for_msg (server, 1, NULL, nick),
@@ -3126,7 +3204,7 @@ IRC_PROTOCOL_CALLBACK(server_mode_reason)
weechat_printf_date_tags (
irc_msgbuffer_get_target_buffer (server, NULL, command, NULL, NULL),
date,
- irc_protocol_tags (command, "irc_numeric", NULL, NULL),
+ irc_protocol_tags (command, tags, "irc_numeric", NULL, NULL),
"%s%s%s%s",
weechat_prefix ("network"),
pos_mode,
@@ -3161,7 +3239,7 @@ IRC_PROTOCOL_CALLBACK(numeric)
weechat_printf_date_tags (
irc_msgbuffer_get_target_buffer (server, NULL, command, NULL, NULL),
date,
- irc_protocol_tags (command, "irc_numeric", NULL, NULL),
+ irc_protocol_tags (command, tags, "irc_numeric", NULL, NULL),
"%s%s",
weechat_prefix ("network"),
str_params);
@@ -3225,7 +3303,7 @@ IRC_PROTOCOL_CALLBACK(topic)
irc_msgbuffer_get_target_buffer (
server, NULL, command, NULL, ptr_buffer),
date,
- irc_protocol_tags (command, NULL, NULL, address),
+ irc_protocol_tags (command, tags, NULL, NULL, address),
_("%s%s%s%s has changed topic for %s%s%s from \"%s%s%s\" to "
"\"%s%s%s\""),
weechat_prefix ("network"),
@@ -3250,7 +3328,7 @@ IRC_PROTOCOL_CALLBACK(topic)
irc_msgbuffer_get_target_buffer (
server, NULL, command, NULL, ptr_buffer),
date,
- irc_protocol_tags (command, NULL, NULL, address),
+ irc_protocol_tags (command, tags, NULL, NULL, address),
_("%s%s%s%s has changed topic for %s%s%s to \"%s%s%s\""),
weechat_prefix ("network"),
irc_nick_color_for_msg (server, 1, ptr_nick, nick),
@@ -3278,7 +3356,7 @@ IRC_PROTOCOL_CALLBACK(topic)
irc_msgbuffer_get_target_buffer (
server, NULL, command, NULL, ptr_buffer),
date,
- irc_protocol_tags (command, NULL, NULL, address),
+ irc_protocol_tags (command, tags, NULL, NULL, address),
_("%s%s%s%s has unset topic for %s%s%s (old topic: "
"\"%s%s%s\")"),
weechat_prefix ("network"),
@@ -3300,7 +3378,7 @@ IRC_PROTOCOL_CALLBACK(topic)
irc_msgbuffer_get_target_buffer (
server, NULL, command, NULL, ptr_buffer),
date,
- irc_protocol_tags (command, NULL, NULL, address),
+ irc_protocol_tags (command, tags, NULL, NULL, address),
_("%s%s%s%s has unset topic for %s%s%s"),
weechat_prefix ("network"),
irc_nick_color_for_msg (server, 1, ptr_nick, nick),
@@ -3345,7 +3423,7 @@ IRC_PROTOCOL_CALLBACK(wallops)
weechat_printf_date_tags (
irc_msgbuffer_get_target_buffer (server, nick, command, NULL, NULL),
date,
- irc_protocol_tags (command, "notify_private", nick, address),
+ irc_protocol_tags (command, tags, "notify_private", nick, address),
_("%sWallops from %s: %s"),
weechat_prefix ("network"),
(nick_address[0]) ? nick_address : "?",
@@ -3371,6 +3449,7 @@ IRC_PROTOCOL_CALLBACK(warn)
irc_protocol_print_error_warning_msg (
server,
date,
+ tags,
command,
weechat_prefix ("error"),
_("Warning:"),
@@ -3658,7 +3737,7 @@ IRC_PROTOCOL_CALLBACK(008)
weechat_printf_date_tags (
irc_msgbuffer_get_target_buffer (server, params[0], command, NULL, NULL),
date,
- irc_protocol_tags (command, "irc_numeric", NULL, address),
+ irc_protocol_tags (command, tags, "irc_numeric", NULL, address),
_("%sServer notice mask for %s%s%s: %s"),
weechat_prefix ("network"),
irc_nick_color_for_msg (server, 1, NULL, params[0]),
@@ -3690,7 +3769,7 @@ IRC_PROTOCOL_CALLBACK(221)
weechat_printf_date_tags (
irc_msgbuffer_get_target_buffer (server, params[0], command, NULL, NULL),
date,
- irc_protocol_tags (command, "irc_numeric", NULL, address),
+ irc_protocol_tags (command, tags, "irc_numeric", NULL, address),
_("%sUser mode for %s%s%s is %s[%s%s%s]"),
weechat_prefix ("network"),
irc_nick_color_for_msg (server, 1, NULL, params[0]),
@@ -3747,7 +3826,7 @@ IRC_PROTOCOL_CALLBACK(301)
irc_msgbuffer_get_target_buffer (
server, params[1], command, "whois", ptr_buffer),
date,
- irc_protocol_tags (command, "irc_numeric", NULL, address),
+ irc_protocol_tags (command, tags, "irc_numeric", NULL, address),
_("%s%s[%s%s%s]%s is away: %s"),
weechat_prefix ("network"),
IRC_COLOR_CHAT_DELIMITERS,
@@ -3787,7 +3866,7 @@ IRC_PROTOCOL_CALLBACK(303)
weechat_printf_date_tags (
irc_msgbuffer_get_target_buffer (server, NULL, command, NULL, NULL),
date,
- irc_protocol_tags (command, "irc_numeric", NULL, NULL),
+ irc_protocol_tags (command, tags, "irc_numeric", NULL, NULL),
_("%sUsers online: %s%s"),
weechat_prefix ("network"),
IRC_COLOR_CHAT_NICK,
@@ -3819,7 +3898,7 @@ IRC_PROTOCOL_CALLBACK(305)
irc_msgbuffer_get_target_buffer (
server, NULL, command, "unaway", NULL),
date,
- irc_protocol_tags (command, "irc_numeric", NULL, NULL),
+ irc_protocol_tags (command, tags, "irc_numeric", NULL, NULL),
"%s%s",
weechat_prefix ("network"),
str_away_msg);
@@ -3855,7 +3934,7 @@ IRC_PROTOCOL_CALLBACK(306)
irc_msgbuffer_get_target_buffer (
server, NULL, command, "away", NULL),
date,
- irc_protocol_tags (command, "irc_numeric", NULL, NULL),
+ irc_protocol_tags (command, tags, "irc_numeric", NULL, NULL),
"%s%s",
weechat_prefix ("network"),
str_away_msg);
@@ -3890,7 +3969,7 @@ IRC_PROTOCOL_CALLBACK(whois_nick_msg)
irc_msgbuffer_get_target_buffer (
server, params[1], command, "whois", NULL),
date,
- irc_protocol_tags (command, "irc_numeric", NULL, NULL),
+ irc_protocol_tags (command, tags, "irc_numeric", NULL, NULL),
"%s%s[%s%s%s] %s%s",
weechat_prefix ("network"),
IRC_COLOR_CHAT_DELIMITERS,
@@ -3925,7 +4004,7 @@ IRC_PROTOCOL_CALLBACK(whowas_nick_msg)
irc_msgbuffer_get_target_buffer (
server, params[1], command, "whowas", NULL),
date,
- irc_protocol_tags (command, "irc_numeric", NULL, NULL),
+ irc_protocol_tags (command, tags, "irc_numeric", NULL, NULL),
"%s%s[%s%s%s] %s%s",
weechat_prefix ("network"),
IRC_COLOR_CHAT_DELIMITERS,
@@ -3960,7 +4039,7 @@ IRC_PROTOCOL_CALLBACK(311)
irc_msgbuffer_get_target_buffer (
server, params[1], command, "whois", NULL),
date,
- irc_protocol_tags (command, "irc_numeric", NULL, NULL),
+ irc_protocol_tags (command, tags, "irc_numeric", NULL, NULL),
"%s%s[%s%s%s] (%s%s@%s%s)%s: %s",
weechat_prefix ("network"),
IRC_COLOR_CHAT_DELIMITERS,
@@ -3999,7 +4078,7 @@ IRC_PROTOCOL_CALLBACK(312)
irc_msgbuffer_get_target_buffer (
server, params[1], command, "whois", NULL),
date,
- irc_protocol_tags (command, "irc_numeric", NULL, NULL),
+ irc_protocol_tags (command, tags, "irc_numeric", NULL, NULL),
"%s%s[%s%s%s] %s%s %s(%s%s%s)",
weechat_prefix ("network"),
IRC_COLOR_CHAT_DELIMITERS,
@@ -4038,7 +4117,7 @@ IRC_PROTOCOL_CALLBACK(314)
irc_msgbuffer_get_target_buffer (
server, params[1], command, "whowas", NULL),
date,
- irc_protocol_tags (command, "irc_numeric", NULL, NULL),
+ irc_protocol_tags (command, tags, "irc_numeric", NULL, NULL),
_("%s%s[%s%s%s] (%s%s@%s%s)%s was %s"),
weechat_prefix ("network"),
IRC_COLOR_CHAT_DELIMITERS,
@@ -4084,7 +4163,7 @@ IRC_PROTOCOL_CALLBACK(315)
irc_msgbuffer_get_target_buffer (
server, NULL, command, "who", NULL),
date,
- irc_protocol_tags (command, "irc_numeric", NULL, NULL),
+ irc_protocol_tags (command, tags, "irc_numeric", NULL, NULL),
"%s%s[%s%s%s]%s %s",
weechat_prefix ("network"),
IRC_COLOR_CHAT_DELIMITERS,
@@ -4131,7 +4210,7 @@ IRC_PROTOCOL_CALLBACK(317)
weechat_printf_date_tags (
ptr_buffer,
date,
- irc_protocol_tags (command, "irc_numeric", NULL, NULL),
+ irc_protocol_tags (command, tags, "irc_numeric", NULL, NULL),
_("%s%s[%s%s%s]%s idle: %s%d %s%s, %s%02d %s%s %s%02d %s%s %s%02d "
"%s%s, signon at: %s%s"),
weechat_prefix ("network"),
@@ -4164,7 +4243,7 @@ IRC_PROTOCOL_CALLBACK(317)
weechat_printf_date_tags (
ptr_buffer,
date,
- irc_protocol_tags (command, "irc_numeric", NULL, NULL),
+ irc_protocol_tags (command, tags, "irc_numeric", NULL, NULL),
_("%s%s[%s%s%s]%s idle: %s%02d %s%s %s%02d %s%s %s%02d %s%s, "
"signon at: %s%s"),
weechat_prefix ("network"),
@@ -4211,7 +4290,7 @@ IRC_PROTOCOL_CALLBACK(321)
irc_msgbuffer_get_target_buffer (
server, NULL, command, "list", NULL),
date,
- irc_protocol_tags (command, "irc_numeric", NULL, NULL),
+ irc_protocol_tags (command, tags, "irc_numeric", NULL, NULL),
"%s%s%s%s",
weechat_prefix ("network"),
params[1],
@@ -4245,7 +4324,7 @@ IRC_PROTOCOL_CALLBACK(322)
irc_msgbuffer_get_target_buffer (
server, NULL, command, "list", NULL),
date,
- irc_protocol_tags (command, "irc_numeric", NULL, NULL),
+ irc_protocol_tags (command, tags, "irc_numeric", NULL, NULL),
"%s%s%s%s(%s%s%s)%s%s%s",
weechat_prefix ("network"),
IRC_COLOR_CHAT_CHANNEL,
@@ -4282,7 +4361,7 @@ IRC_PROTOCOL_CALLBACK(323)
weechat_printf_date_tags (
irc_msgbuffer_get_target_buffer (server, NULL, command, "list", NULL),
date,
- irc_protocol_tags (command, "irc_numeric", NULL, NULL),
+ irc_protocol_tags (command, tags, "irc_numeric", NULL, NULL),
"%s%s",
weechat_prefix ("network"),
str_params);
@@ -4331,7 +4410,7 @@ IRC_PROTOCOL_CALLBACK(324)
server, NULL, command, NULL,
(ptr_channel) ? ptr_channel->buffer : NULL),
date,
- irc_protocol_tags (command, "irc_numeric", NULL, address),
+ irc_protocol_tags (command, tags, "irc_numeric", NULL, address),
_("%sMode %s%s %s[%s%s%s]"),
weechat_prefix ("network"),
IRC_COLOR_CHAT_CHANNEL,
@@ -4378,7 +4457,7 @@ IRC_PROTOCOL_CALLBACK(327)
weechat_printf_date_tags (
ptr_buffer,
date,
- irc_protocol_tags (command, "irc_numeric", NULL, NULL),
+ irc_protocol_tags (command, tags, "irc_numeric", NULL, NULL),
"%s%s[%s%s%s] %s%s %s %s(%s%s%s)",
weechat_prefix ("network"),
IRC_COLOR_CHAT_DELIMITERS,
@@ -4398,7 +4477,7 @@ IRC_PROTOCOL_CALLBACK(327)
weechat_printf_date_tags (
ptr_buffer,
date,
- irc_protocol_tags (command, "irc_numeric", NULL, NULL),
+ irc_protocol_tags (command, tags, "irc_numeric", NULL, NULL),
"%s%s[%s%s%s] %s%s %s",
weechat_prefix ("network"),
IRC_COLOR_CHAT_DELIMITERS,
@@ -4438,7 +4517,7 @@ IRC_PROTOCOL_CALLBACK(328)
irc_msgbuffer_get_target_buffer (
server, NULL, command, NULL, ptr_channel->buffer),
date,
- irc_protocol_tags (command, "irc_numeric", NULL, NULL),
+ irc_protocol_tags (command, tags, "irc_numeric", NULL, NULL),
_("%sURL for %s%s%s: %s"),
weechat_prefix ("network"),
IRC_COLOR_CHAT_CHANNEL,
@@ -4479,7 +4558,7 @@ IRC_PROTOCOL_CALLBACK(329)
irc_msgbuffer_get_target_buffer (
server, NULL, command, NULL, ptr_channel->buffer),
date,
- irc_protocol_tags (command, "irc_numeric",
+ irc_protocol_tags (command, tags, "irc_numeric",
NULL, NULL),
/* TRANSLATORS: "%s" after "created on" is a date */
_("%sChannel created on %s"),
@@ -4492,7 +4571,7 @@ IRC_PROTOCOL_CALLBACK(329)
weechat_printf_date_tags (
irc_msgbuffer_get_target_buffer (server, NULL, command, NULL, NULL),
date,
- irc_protocol_tags (command, "irc_numeric", NULL, NULL),
+ irc_protocol_tags (command, tags, "irc_numeric", NULL, NULL),
/* TRANSLATORS: "%s" after "created on" is a date */
_("%sChannel %s%s%s created on %s"),
weechat_prefix ("network"),
@@ -4533,7 +4612,7 @@ IRC_PROTOCOL_CALLBACK(330_343)
irc_msgbuffer_get_target_buffer (
server, params[1], command, "whois", NULL),
date,
- irc_protocol_tags (command, "irc_numeric", NULL, NULL),
+ irc_protocol_tags (command, tags, "irc_numeric", NULL, NULL),
"%s%s[%s%s%s] %s%s %s%s",
weechat_prefix ("network"),
IRC_COLOR_CHAT_DELIMITERS,
@@ -4557,7 +4636,7 @@ IRC_PROTOCOL_CALLBACK(330_343)
irc_msgbuffer_get_target_buffer (
server, params[1], command, "whois", ptr_buffer),
date,
- irc_protocol_tags (command, "irc_numeric", NULL, NULL),
+ irc_protocol_tags (command, tags, "irc_numeric", NULL, NULL),
"%s%s[%s%s%s] %s%s",
weechat_prefix ("network"),
IRC_COLOR_CHAT_DELIMITERS,
@@ -4593,7 +4672,7 @@ IRC_PROTOCOL_CALLBACK(331)
irc_msgbuffer_get_target_buffer (
server, params[1], command, NULL, ptr_buffer),
date,
- irc_protocol_tags (command, "irc_numeric", NULL, NULL),
+ irc_protocol_tags (command, tags, "irc_numeric", NULL, NULL),
_("%sNo topic set for channel %s%s"),
weechat_prefix ("network"),
IRC_COLOR_CHAT_CHANNEL,
@@ -4654,7 +4733,7 @@ IRC_PROTOCOL_CALLBACK(332)
irc_msgbuffer_get_target_buffer (
server, NULL, command, NULL, ptr_buffer),
date,
- irc_protocol_tags (command, "irc_numeric", NULL, NULL),
+ irc_protocol_tags (command, tags, "irc_numeric", NULL, NULL),
_("%sTopic for %s%s%s is \"%s%s%s\""),
weechat_prefix ("network"),
IRC_COLOR_CHAT_CHANNEL,
@@ -4719,7 +4798,7 @@ IRC_PROTOCOL_CALLBACK(333)
irc_msgbuffer_get_target_buffer (
server, NULL, command, NULL, ptr_channel->buffer),
date,
- irc_protocol_tags (command, "irc_numeric", NULL, NULL),
+ irc_protocol_tags (command, tags, "irc_numeric", NULL, NULL),
/* TRANSLATORS: "%s" after "on" is a date */
_("%sTopic set by %s%s%s%s%s%s%s%s%s on %s"),
weechat_prefix ("network"),
@@ -4740,7 +4819,7 @@ IRC_PROTOCOL_CALLBACK(333)
irc_msgbuffer_get_target_buffer (
server, NULL, command, NULL, ptr_channel->buffer),
date,
- irc_protocol_tags (command, "irc_numeric", NULL, NULL),
+ irc_protocol_tags (command, tags, "irc_numeric", NULL, NULL),
/* TRANSLATORS: "%s" after "on" is a date */
_("%sTopic set on %s"),
weechat_prefix ("network"),
@@ -4756,7 +4835,7 @@ IRC_PROTOCOL_CALLBACK(333)
irc_msgbuffer_get_target_buffer (
server, NULL, command, NULL, NULL),
date,
- irc_protocol_tags (command, "irc_numeric", NULL, NULL),
+ irc_protocol_tags (command, tags, "irc_numeric", NULL, NULL),
/* TRANSLATORS: "%s" after "on" is a date */
_("%sTopic for %s%s%s set by %s%s%s%s%s%s%s%s%s on %s"),
weechat_prefix ("network"),
@@ -4780,7 +4859,7 @@ IRC_PROTOCOL_CALLBACK(333)
irc_msgbuffer_get_target_buffer (
server, NULL, command, NULL, NULL),
date,
- irc_protocol_tags (command, "irc_numeric", NULL, NULL),
+ irc_protocol_tags (command, tags, "irc_numeric", NULL, NULL),
/* TRANSLATORS: "%s" after "on" is a date */
_("%sTopic for %s%s%s set on %s"),
weechat_prefix ("network"),
@@ -4816,7 +4895,7 @@ IRC_PROTOCOL_CALLBACK(338)
irc_msgbuffer_get_target_buffer (
server, params[1], command, "whois", NULL),
date,
- irc_protocol_tags (command, "irc_numeric", NULL, NULL),
+ irc_protocol_tags (command, tags, "irc_numeric", NULL, NULL),
"%s%s[%s%s%s]%s %s %s%s",
weechat_prefix ("network"),
IRC_COLOR_CHAT_DELIMITERS,
@@ -4849,7 +4928,7 @@ IRC_PROTOCOL_CALLBACK(341)
weechat_printf_date_tags (
irc_msgbuffer_get_target_buffer (server, params[0], command, NULL, NULL),
date,
- irc_protocol_tags (command, "irc_numeric", params[0], address),
+ irc_protocol_tags (command, tags, "irc_numeric", params[0], address),
_("%s%s%s%s has invited %s%s%s to %s%s%s"),
weechat_prefix ("network"),
irc_nick_color_for_msg (server, 1, NULL, params[0]),
@@ -4883,7 +4962,7 @@ IRC_PROTOCOL_CALLBACK(344)
weechat_printf_date_tags (
irc_msgbuffer_get_target_buffer (server, NULL, command, "reop", NULL),
date,
- irc_protocol_tags (command, "irc_numeric", NULL, NULL),
+ irc_protocol_tags (command, tags, "irc_numeric", NULL, NULL),
_("%sChannel reop %s%s%s: %s%s"),
weechat_prefix ("network"),
IRC_COLOR_CHAT_CHANNEL,
@@ -4916,7 +4995,7 @@ IRC_PROTOCOL_CALLBACK(345)
weechat_printf_date_tags (
irc_msgbuffer_get_target_buffer (server, NULL, command, "reop", NULL),
date,
- irc_protocol_tags (command, "irc_numeric", NULL, NULL),
+ irc_protocol_tags (command, tags, "irc_numeric", NULL, NULL),
"%s%s%s%s: %s",
weechat_prefix ("network"),
IRC_COLOR_CHAT_CHANNEL,
@@ -4987,7 +5066,7 @@ IRC_PROTOCOL_CALLBACK(346)
irc_msgbuffer_get_target_buffer (
server, NULL, command, "invitelist", ptr_buffer),
date,
- irc_protocol_tags (command, "irc_numeric", NULL, NULL),
+ irc_protocol_tags (command, tags, "irc_numeric", NULL, NULL),
/* TRANSLATORS: "%s" after "on" is a date */
_("%s%s[%s%s%s] %s%s%s%s invited by %s on %s"),
weechat_prefix ("network"),
@@ -5010,7 +5089,7 @@ IRC_PROTOCOL_CALLBACK(346)
irc_msgbuffer_get_target_buffer (
server, NULL, command, "invitelist", ptr_buffer),
date,
- irc_protocol_tags (command, "irc_numeric", NULL, NULL),
+ irc_protocol_tags (command, tags, "irc_numeric", NULL, NULL),
_("%s%s[%s%s%s] %s%s%s%s invited by %s"),
weechat_prefix ("network"),
IRC_COLOR_CHAT_DELIMITERS,
@@ -5032,7 +5111,7 @@ IRC_PROTOCOL_CALLBACK(346)
irc_msgbuffer_get_target_buffer (
server, NULL, command, "invitelist", ptr_buffer),
date,
- irc_protocol_tags (command, "irc_numeric", NULL, NULL),
+ irc_protocol_tags (command, tags, "irc_numeric", NULL, NULL),
_("%s%s[%s%s%s] %s%s%s%s invited"),
weechat_prefix ("network"),
IRC_COLOR_CHAT_DELIMITERS,
@@ -5087,7 +5166,7 @@ IRC_PROTOCOL_CALLBACK(347)
irc_msgbuffer_get_target_buffer (
server, NULL, command, "invitelist", ptr_buffer),
date,
- irc_protocol_tags (command, "irc_numeric", NULL, NULL),
+ irc_protocol_tags (command, tags, "irc_numeric", NULL, NULL),
"%s%s[%s%s%s]%s%s%s",
weechat_prefix ("network"),
IRC_COLOR_CHAT_DELIMITERS,
@@ -5160,7 +5239,7 @@ IRC_PROTOCOL_CALLBACK(348)
irc_msgbuffer_get_target_buffer (
server, NULL, command, "exceptionlist", ptr_buffer),
date,
- irc_protocol_tags (command, "irc_numeric", NULL, NULL),
+ irc_protocol_tags (command, tags, "irc_numeric", NULL, NULL),
/* TRANSLATORS: "%s" after "on" is a date */
_("%s%s[%s%s%s]%s%s exception %s%s%s by %s on %s"),
weechat_prefix ("network"),
@@ -5184,7 +5263,7 @@ IRC_PROTOCOL_CALLBACK(348)
irc_msgbuffer_get_target_buffer (
server, NULL, command, "exceptionlist", ptr_buffer),
date,
- irc_protocol_tags (command, "irc_numeric", NULL, NULL),
+ irc_protocol_tags (command, tags, "irc_numeric", NULL, NULL),
_("%s%s[%s%s%s]%s%s exception %s%s%s by %s"),
weechat_prefix ("network"),
IRC_COLOR_CHAT_DELIMITERS,
@@ -5207,7 +5286,7 @@ IRC_PROTOCOL_CALLBACK(348)
irc_msgbuffer_get_target_buffer (
server, NULL, command, "exceptionlist", ptr_buffer),
date,
- irc_protocol_tags (command, "irc_numeric", NULL, NULL),
+ irc_protocol_tags (command, tags, "irc_numeric", NULL, NULL),
_("%s%s[%s%s%s]%s%s exception %s%s"),
weechat_prefix ("network"),
IRC_COLOR_CHAT_DELIMITERS,
@@ -5262,7 +5341,7 @@ IRC_PROTOCOL_CALLBACK(349)
irc_msgbuffer_get_target_buffer (
server, NULL, command, "exceptionlist", ptr_buffer),
date,
- irc_protocol_tags (command, "irc_numeric", NULL, NULL),
+ irc_protocol_tags (command, tags, "irc_numeric", NULL, NULL),
"%s%s[%s%s%s]%s%s%s",
weechat_prefix ("network"),
IRC_COLOR_CHAT_DELIMITERS,
@@ -5302,7 +5381,7 @@ IRC_PROTOCOL_CALLBACK(351)
weechat_printf_date_tags (
ptr_buffer,
date,
- irc_protocol_tags (command, "irc_numeric", NULL, NULL),
+ irc_protocol_tags (command, tags, "irc_numeric", NULL, NULL),
"%s%s %s (%s)",
weechat_prefix ("network"),
params[1],
@@ -5316,7 +5395,7 @@ IRC_PROTOCOL_CALLBACK(351)
weechat_printf_date_tags (
ptr_buffer,
date,
- irc_protocol_tags (command, "irc_numeric", NULL, NULL),
+ irc_protocol_tags (command, tags, "irc_numeric", NULL, NULL),
"%s%s %s",
weechat_prefix ("network"),
params[1],
@@ -5408,7 +5487,7 @@ IRC_PROTOCOL_CALLBACK(352)
irc_msgbuffer_get_target_buffer (
server, NULL, command, "who", NULL),
date,
- irc_protocol_tags (command, "irc_numeric", NULL, NULL),
+ irc_protocol_tags (command, tags, "irc_numeric", NULL, NULL),
"%s%s[%s%s%s] %s%s %s(%s%s@%s%s)%s %s%s%s%s%s(%s%s%s)",
weechat_prefix ("network"),
IRC_COLOR_CHAT_DELIMITERS,
@@ -5580,7 +5659,7 @@ IRC_PROTOCOL_CALLBACK(353)
irc_msgbuffer_get_target_buffer (
server, NULL, command, "names", NULL),
date,
- irc_protocol_tags (command, "irc_numeric", NULL, NULL),
+ irc_protocol_tags (command, tags, "irc_numeric", NULL, NULL),
_("%sNicks %s%s%s: %s[%s%s%s]"),
weechat_prefix ("network"),
IRC_COLOR_CHAT_CHANNEL,
@@ -5634,7 +5713,7 @@ IRC_PROTOCOL_CALLBACK(354)
irc_msgbuffer_get_target_buffer (
server, NULL, command, "who", NULL),
date,
- irc_protocol_tags (command, "irc_numeric", NULL, NULL),
+ irc_protocol_tags (command, tags, "irc_numeric", NULL, NULL),
"%s%s[%s%s%s]%s%s%s",
weechat_prefix ("network"),
IRC_COLOR_CHAT_DELIMITERS,
@@ -5705,7 +5784,7 @@ IRC_PROTOCOL_CALLBACK(354)
irc_msgbuffer_get_target_buffer (
server, NULL, command, "who", NULL),
date,
- irc_protocol_tags (command, "irc_numeric", NULL, NULL),
+ irc_protocol_tags (command, tags, "irc_numeric", NULL, NULL),
"%s%s[%s%s%s] %s%s %s[%s%s%s] (%s%s@%s%s)%s %s %s %s(%s%s%s)",
weechat_prefix ("network"),
IRC_COLOR_CHAT_DELIMITERS,
@@ -5836,7 +5915,7 @@ IRC_PROTOCOL_CALLBACK(366)
ptr_channel->buffer),
date,
irc_protocol_tags (
- command, "irc_numeric", NULL, NULL),
+ command, tags, "irc_numeric", NULL, NULL),
_("%sNicks %s%s%s: %s[%s%s]"),
weechat_prefix ("network"),
IRC_COLOR_CHAT_CHANNEL,
@@ -5903,7 +5982,7 @@ IRC_PROTOCOL_CALLBACK(366)
irc_msgbuffer_get_target_buffer (
server, NULL, command, "names", ptr_channel->buffer),
date,
- irc_protocol_tags (command, "irc_numeric", NULL, NULL),
+ irc_protocol_tags (command, tags, "irc_numeric", NULL, NULL),
_("%sChannel %s%s%s: %s%d%s %s %s(%s%s)"),
weechat_prefix ("network"),
IRC_COLOR_CHAT_CHANNEL,
@@ -5933,7 +6012,7 @@ IRC_PROTOCOL_CALLBACK(366)
irc_msgbuffer_get_target_buffer (
server, NULL, command, "names", NULL),
date,
- irc_protocol_tags (command, "irc_numeric", NULL, NULL),
+ irc_protocol_tags (command, tags, "irc_numeric", NULL, NULL),
"%s%s%s%s: %s",
weechat_prefix ("network"),
IRC_COLOR_CHAT_CHANNEL,
@@ -6014,7 +6093,7 @@ IRC_PROTOCOL_CALLBACK(367)
irc_msgbuffer_get_target_buffer (
server, NULL, command, "banlist", ptr_buffer),
date,
- irc_protocol_tags (command, "irc_numeric", NULL, NULL),
+ irc_protocol_tags (command, tags, "irc_numeric", NULL, NULL),
/* TRANSLATORS: "%s" after "on" is a date */
_("%s%s[%s%s%s] %s%s%s%s banned by %s on %s"),
weechat_prefix ("network"),
@@ -6037,7 +6116,7 @@ IRC_PROTOCOL_CALLBACK(367)
irc_msgbuffer_get_target_buffer (
server, NULL, command, "banlist", ptr_buffer),
date,
- irc_protocol_tags (command, "irc_numeric", NULL, NULL),
+ irc_protocol_tags (command, tags, "irc_numeric", NULL, NULL),
_("%s%s[%s%s%s] %s%s%s%s banned by %s"),
weechat_prefix ("network"),
IRC_COLOR_CHAT_DELIMITERS,
@@ -6059,7 +6138,7 @@ IRC_PROTOCOL_CALLBACK(367)
irc_msgbuffer_get_target_buffer (
server, NULL, command, "banlist", ptr_buffer),
date,
- irc_protocol_tags (command, "irc_numeric", NULL, NULL),
+ irc_protocol_tags (command, tags, "irc_numeric", NULL, NULL),
_("%s%s[%s%s%s] %s%s%s%s banned"),
weechat_prefix ("network"),
IRC_COLOR_CHAT_DELIMITERS,
@@ -6117,7 +6196,7 @@ IRC_PROTOCOL_CALLBACK(368)
irc_msgbuffer_get_target_buffer (
server, NULL, command, "banlist", ptr_buffer),
date,
- irc_protocol_tags (command, "irc_numeric", NULL, NULL),
+ irc_protocol_tags (command, tags, "irc_numeric", NULL, NULL),
"%s%s[%s%s%s]%s%s%s",
weechat_prefix ("network"),
IRC_COLOR_CHAT_DELIMITERS,
@@ -6319,7 +6398,7 @@ IRC_PROTOCOL_CALLBACK(438)
weechat_printf_date_tags (
ptr_buffer,
date,
- irc_protocol_tags (command, "irc_numeric", NULL, NULL),
+ irc_protocol_tags (command, tags, "irc_numeric", NULL, NULL),
"%s%s (%s => %s)",
weechat_prefix ("network"),
str_params,
@@ -6333,7 +6412,7 @@ IRC_PROTOCOL_CALLBACK(438)
weechat_printf_date_tags (
ptr_buffer,
date,
- irc_protocol_tags (command, "irc_numeric", NULL, NULL),
+ irc_protocol_tags (command, tags, "irc_numeric", NULL, NULL),
"%s%s %s",
weechat_prefix ("network"),
params[0],
@@ -6512,7 +6591,7 @@ IRC_PROTOCOL_CALLBACK(728)
irc_msgbuffer_get_target_buffer (
server, NULL, command, "quietlist", ptr_buffer),
date,
- irc_protocol_tags (command, "irc_numeric", NULL, NULL),
+ irc_protocol_tags (command, tags, "irc_numeric", NULL, NULL),
/* TRANSLATORS: "%s" after "on" is a date */
_("%s%s[%s%s%s] %s%s%s%s quieted by %s on %s"),
weechat_prefix ("network"),
@@ -6535,7 +6614,7 @@ IRC_PROTOCOL_CALLBACK(728)
irc_msgbuffer_get_target_buffer (
server, NULL, command, "quietlist", ptr_buffer),
date,
- irc_protocol_tags (command, "irc_numeric", NULL, NULL),
+ irc_protocol_tags (command, tags, "irc_numeric", NULL, NULL),
_("%s%s[%s%s%s] %s%s%s%s quieted by %s"),
weechat_prefix ("network"),
IRC_COLOR_CHAT_DELIMITERS,
@@ -6557,7 +6636,7 @@ IRC_PROTOCOL_CALLBACK(728)
irc_msgbuffer_get_target_buffer (
server, NULL, command, "quietlist", ptr_buffer),
date,
- irc_protocol_tags (command, "irc_numeric", NULL, NULL),
+ irc_protocol_tags (command, tags, "irc_numeric", NULL, NULL),
_("%s%s[%s%s%s] %s%s%s%s quieted"),
weechat_prefix ("network"),
IRC_COLOR_CHAT_DELIMITERS,
@@ -6615,7 +6694,7 @@ IRC_PROTOCOL_CALLBACK(729)
irc_msgbuffer_get_target_buffer (
server, NULL, command, "quietlist", ptr_buffer),
date,
- irc_protocol_tags (command, "irc_numeric", NULL, NULL),
+ irc_protocol_tags (command, tags, "irc_numeric", NULL, NULL),
"%s%s[%s%s%s]%s%s%s",
weechat_prefix ("network"),
IRC_COLOR_CHAT_DELIMITERS,
@@ -6748,7 +6827,7 @@ IRC_PROTOCOL_CALLBACK(732)
irc_msgbuffer_get_target_buffer (
server, NULL, command, "monitor", NULL),
date,
- irc_protocol_tags (command, "irc_numeric", NULL, NULL),
+ irc_protocol_tags (command, tags, "irc_numeric", NULL, NULL),
"%s%s",
weechat_prefix ("network"),
(str_nicks) ? str_nicks : "");
@@ -6779,7 +6858,7 @@ IRC_PROTOCOL_CALLBACK(733)
irc_msgbuffer_get_target_buffer (
server, NULL, command, "monitor", NULL),
date,
- irc_protocol_tags (command, "irc_numeric", NULL, NULL),
+ irc_protocol_tags (command, tags, "irc_numeric", NULL, NULL),
"%s%s",
weechat_prefix ("network"),
(str_params) ? str_params : "");
@@ -6810,7 +6889,7 @@ IRC_PROTOCOL_CALLBACK(734)
irc_msgbuffer_get_target_buffer (
server, NULL, command, "monitor", NULL),
date,
- irc_protocol_tags (command, "irc_numeric", NULL, NULL),
+ irc_protocol_tags (command, tags, "irc_numeric", NULL, NULL),
"%s%s (%s)",
weechat_prefix ("error"),
(str_params) ? str_params : "",
@@ -6846,7 +6925,7 @@ IRC_PROTOCOL_CALLBACK(900)
weechat_printf_date_tags (
irc_msgbuffer_get_target_buffer (server, NULL, command, NULL, NULL),
date,
- irc_protocol_tags (command, "irc_numeric", NULL, NULL),
+ irc_protocol_tags (command, tags, "irc_numeric", NULL, NULL),
"%s%s %s(%s%s%s)",
weechat_prefix ("network"),
str_params,
@@ -6860,7 +6939,7 @@ IRC_PROTOCOL_CALLBACK(900)
weechat_printf_date_tags (
irc_msgbuffer_get_target_buffer (server, NULL, command, NULL, NULL),
date,
- irc_protocol_tags (command, "irc_numeric", NULL, NULL),
+ irc_protocol_tags (command, tags, "irc_numeric", NULL, NULL),
"%s%s",
weechat_prefix ("network"),
str_params);
@@ -6893,7 +6972,7 @@ IRC_PROTOCOL_CALLBACK(901)
weechat_printf_date_tags (
irc_msgbuffer_get_target_buffer (server, NULL, command, NULL, NULL),
date,
- irc_protocol_tags (command, "irc_numeric", NULL, NULL),
+ irc_protocol_tags (command, tags, "irc_numeric", NULL, NULL),
"%s%s",
weechat_prefix ("network"),
str_params);
diff --git a/src/plugins/irc/irc-protocol.h b/src/plugins/irc/irc-protocol.h
index 50ea3cf11..35e135a64 100644
--- a/src/plugins/irc/irc-protocol.h
+++ b/src/plugins/irc/irc-protocol.h
@@ -93,8 +93,11 @@ struct t_irc_protocol_msg
t_irc_recv_func *recv_function; /* function called when msg is received */
};
-extern const char *irc_protocol_tags (const char *command, const char *tags,
- const char *nick, const char *address);
+extern const char *irc_protocol_tags (const char *command,
+ struct t_hashtable *irc_msg_tags,
+ const char *extra_tags,
+ const char *nick,
+ const char *address);
extern time_t irc_protocol_parse_time (const char *time);
extern void irc_protocol_recv_command (struct t_irc_server *server,
const char *irc_message,