1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-05 01:03:14 +02:00

irc: add support of message 324 (channel modes) in option irc.look.display_join_message (closes #75)

This commit is contained in:
Sébastien Helleu
2014-05-08 11:55:18 +02:00
parent 7b4b6a3754
commit 36d519acb0
21 changed files with 92 additions and 75 deletions
+4 -3
View File
@@ -2346,9 +2346,10 @@ irc_config_init ()
irc_config_look_display_join_message = weechat_config_new_option (
irc_config_file, ptr_section,
"display_join_message", "string",
N_("comma-separated list of messages to display after joining a channel: "
"329 = channel creation date, 332 = topic, 333 = nick/date for topic, "
"353 = names on channel, 366 = names count"),
N_("comma-separated list of messages to display after joining a "
"channel: 324 = channel modes, 329 = channel creation date, "
"332 = topic, 333 = nick/date for topic, 353 = names on channel, "
"366 = names count"),
NULL, 0, 0, "329,332,333,366", NULL, 0, NULL, NULL,
&irc_config_change_look_display_join_message, NULL, NULL, NULL);
irc_config_look_display_old_topic = weechat_config_new_option (
+25 -15
View File
@@ -3048,21 +3048,31 @@ IRC_PROTOCOL_CALLBACK(324)
ptr_channel->modes);
}
}
weechat_printf_date_tags (irc_msgbuffer_get_target_buffer (server, NULL,
command, NULL,
(ptr_channel) ? ptr_channel->buffer : NULL),
date,
irc_protocol_tags (command, "irc_numeric", NULL,
address),
_("%sMode %s%s %s[%s%s%s]"),
weechat_prefix ("network"),
IRC_COLOR_CHAT_CHANNEL,
argv[3],
IRC_COLOR_CHAT_DELIMITERS,
IRC_COLOR_RESET,
(argc > 4) ?
((argv_eol[4][0] == ':') ? argv_eol[4] + 1 : argv_eol[4]) : "",
IRC_COLOR_CHAT_DELIMITERS);
if (!ptr_channel
|| (weechat_hashtable_has_key (ptr_channel->join_msg_received, command)
|| weechat_hashtable_has_key (irc_config_hashtable_display_join_message, command)))
{
weechat_printf_date_tags (
irc_msgbuffer_get_target_buffer (
server, NULL,
command, NULL,
(ptr_channel) ? ptr_channel->buffer : NULL),
date,
irc_protocol_tags (command, "irc_numeric", NULL,
address),
_("%sMode %s%s %s[%s%s%s]"),
weechat_prefix ("network"),
IRC_COLOR_CHAT_CHANNEL,
argv[3],
IRC_COLOR_CHAT_DELIMITERS,
IRC_COLOR_RESET,
(argc > 4) ?
((argv_eol[4][0] == ':') ? argv_eol[4] + 1 : argv_eol[4]) : "",
IRC_COLOR_CHAT_DELIMITERS);
}
if (ptr_channel)
weechat_hashtable_set (ptr_channel->join_msg_received, command, "1");
return WEECHAT_RC_OK;
}