1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-27 21:36:37 +02:00

irc: add support for IRCv3.2 invite-notify

irc: add nick tag to numeric 341 for consistency
This commit is contained in:
Simmo Saan
2015-12-30 16:57:44 +02:00
parent 295158d3e1
commit 61bede8805
+41 -13
View File
@@ -720,6 +720,11 @@ IRC_PROTOCOL_CALLBACK(generic_error)
*
* Message looks like:
* :nick!user@host INVITE mynick :#channel
*
* With invite-notify capability
* (http://ircv3.net/specs/extensions/invite-notify-3.2.html):
* :<inviter> INVITE <target> <channel>
* :ChanServ!ChanServ@example.com INVITE Attila #channel
*/
IRC_PROTOCOL_CALLBACK(invite)
@@ -730,18 +735,41 @@ IRC_PROTOCOL_CALLBACK(invite)
if (ignored)
return WEECHAT_RC_OK;
weechat_printf_date_tags (
irc_msgbuffer_get_target_buffer (server, nick, command, NULL, NULL),
date,
irc_protocol_tags (command, "notify_highlight", nick, address),
_("%sYou have been invited to %s%s%s by %s%s%s"),
weechat_prefix ("network"),
IRC_COLOR_CHAT_CHANNEL,
(argv[3][0] == ':') ? argv[3] + 1 : argv[3],
IRC_COLOR_RESET,
irc_nick_color_for_msg (server, 1, NULL, nick),
nick,
IRC_COLOR_RESET);
if (irc_server_strcasecmp (server, argv[2], server->nick) == 0)
{
weechat_printf_date_tags (
irc_msgbuffer_get_target_buffer (server, nick, command, NULL, NULL),
date,
irc_protocol_tags (command, "notify_highlight", nick, address),
_("%sYou have been invited to %s%s%s by %s%s%s"),
weechat_prefix ("network"),
IRC_COLOR_CHAT_CHANNEL,
(argv[3][0] == ':') ? argv[3] + 1 : argv[3],
IRC_COLOR_RESET,
irc_nick_color_for_msg (server, 1, NULL, nick),
nick,
IRC_COLOR_RESET);
}
else
{
/* CAP invite-notify */
/* imitate numeric 341 output */
weechat_printf_date_tags (
irc_msgbuffer_get_target_buffer (server, nick, command, NULL, NULL),
date,
irc_protocol_tags (command, 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),
nick,
IRC_COLOR_RESET,
irc_nick_color_for_msg (server, 1, NULL, argv[2]),
argv[2],
IRC_COLOR_RESET,
IRC_COLOR_CHAT_CHANNEL,
(argv[3][0] == ':') ? argv[3] + 1 : argv[3],
IRC_COLOR_RESET);
}
return WEECHAT_RC_OK;
}
@@ -3768,7 +3796,7 @@ IRC_PROTOCOL_CALLBACK(341)
weechat_printf_date_tags (
irc_msgbuffer_get_target_buffer (server, argv[2], command, NULL, NULL),
date,
irc_protocol_tags (command, "irc_numeric", NULL, address),
irc_protocol_tags (command, "irc_numeric", argv[2], 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, argv[2]),