1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-26 12:56:37 +02:00

irc: add value "353" in option irc.look.display_join_message

So now the values mean:
- 353: names on channel
- 366: names count (before this commit it meant 353 + 366)
This commit is contained in:
Sebastien Helleu
2014-01-28 18:31:03 +01:00
parent ff92b79712
commit f285fdafa0
22 changed files with 85 additions and 59 deletions
+2 -2
View File
@@ -48,8 +48,8 @@ struct t_irc_channel
int limit; /* user limit (0 is limit not set) */
char *key; /* channel key (NULL if no key set) */
struct t_hashtable *join_msg_received; /* messages received after join: */
/* 366=names, 332/333=topic, */
/* 329=creation date */
/* 353=names, 366=names count, */
/* 332/333=topic, 329=creation date */
int checking_away; /* = 1 if checking away with WHO cmd */
char *away_message; /* to display away only once in pv */
int has_quit_server; /* =1 if nick has quit (pv only), to */
+2 -2
View File
@@ -2314,8 +2314,8 @@ irc_config_init ()
"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, "
"366 = names on channel"),
NULL, 0, 0, "329,332,333", NULL, 0, NULL, NULL,
"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 (
irc_config_file, ptr_section,
+12 -5
View File
@@ -4074,10 +4074,10 @@ IRC_PROTOCOL_CALLBACK(366)
ptr_channel = irc_channel_search (server, argv[3]);
if (ptr_channel && ptr_channel->nicks)
{
if (weechat_hashtable_has_key (ptr_channel->join_msg_received, command)
|| weechat_hashtable_has_key (irc_config_hashtable_display_join_message, command))
/* display users on channel */
if (weechat_hashtable_has_key (ptr_channel->join_msg_received, "353")
|| weechat_hashtable_has_key (irc_config_hashtable_display_join_message, "353"))
{
/* display users on channel */
infolist = weechat_infolist_get ("nicklist", ptr_channel->buffer, NULL);
if (infolist)
{
@@ -4165,8 +4165,12 @@ IRC_PROTOCOL_CALLBACK(366)
}
weechat_infolist_free (infolist);
}
}
/* display number of nicks, ops, halfops & voices on the channel */
/* display number of nicks, ops, halfops & voices on the channel */
if (weechat_hashtable_has_key (ptr_channel->join_msg_received, "366")
|| weechat_hashtable_has_key (irc_config_hashtable_display_join_message, "366"))
{
irc_nick_count (server, ptr_channel, &num_nicks, &num_op, &num_halfop,
&num_voice, &num_normal);
str_nicks_count[0] = '\0';
@@ -4257,7 +4261,10 @@ IRC_PROTOCOL_CALLBACK(366)
}
if (ptr_channel)
weechat_hashtable_set (ptr_channel->join_msg_received, command, "1");
{
weechat_hashtable_set (ptr_channel->join_msg_received, "353", "1");
weechat_hashtable_set (ptr_channel->join_msg_received, "366", "1");
}
weechat_bar_item_update ("input_prompt");