mirror of
https://github.com/weechat/weechat.git
synced 2026-07-04 16:53:14 +02:00
Add "buffer_nicklist" bar item and scroll feature in bars with /bar scroll
This commit is contained in:
@@ -189,10 +189,10 @@ irc_nick_new (struct t_irc_server *server, struct t_irc_channel *channel,
|
||||
irc_nick_get_gui_infos (ptr_nick, &prefix,
|
||||
&prefix_color, channel->buffer, &ptr_group);
|
||||
snprintf (str_prefix_color, sizeof (str_prefix_color),
|
||||
"nicklist_prefix%d",
|
||||
"weechat.color.nicklist_prefix%d",
|
||||
prefix_color);
|
||||
weechat_nicklist_add_nick (channel->buffer, ptr_group,
|
||||
ptr_nick->name, ptr_nick->color,
|
||||
ptr_nick->name, "weechat.color.nicklist",
|
||||
prefix, str_prefix_color, 1);
|
||||
|
||||
return ptr_nick;
|
||||
@@ -235,10 +235,11 @@ irc_nick_new (struct t_irc_server *server, struct t_irc_channel *channel,
|
||||
irc_nick_get_gui_infos (new_nick, &prefix, &prefix_color,
|
||||
channel->buffer, &ptr_group);
|
||||
snprintf (str_prefix_color, sizeof (str_prefix_color),
|
||||
"nicklist_prefix%d",
|
||||
"weechat.color.nicklist_prefix%d",
|
||||
prefix_color);
|
||||
|
||||
weechat_nicklist_add_nick (channel->buffer, ptr_group,
|
||||
new_nick->name, new_nick->color,
|
||||
new_nick->name, "weechat.color.nicklist",
|
||||
prefix, str_prefix_color, 1);
|
||||
|
||||
/* all is ok, return address of new nick */
|
||||
@@ -290,7 +291,7 @@ irc_nick_change (struct t_irc_server *server, struct t_irc_channel *channel,
|
||||
"nicklist_prefix%d",
|
||||
prefix_color);
|
||||
weechat_nicklist_add_nick (channel->buffer, ptr_group,
|
||||
nick->name, nick->color,
|
||||
nick->name, "weechat.color.nicklist",
|
||||
prefix, str_prefix_color, 1);
|
||||
}
|
||||
|
||||
@@ -324,7 +325,7 @@ irc_nick_set (struct t_irc_channel *channel,
|
||||
"nicklist_prefix%d",
|
||||
prefix_color);
|
||||
weechat_nicklist_add_nick (channel->buffer, ptr_group,
|
||||
nick->name, nick->color,
|
||||
nick->name, "weechat.color.nicklist",
|
||||
prefix, str_prefix_color, 1);
|
||||
}
|
||||
|
||||
|
||||
@@ -3568,6 +3568,7 @@ irc_protocol_cmd_366 (struct t_irc_server *server, const char *command,
|
||||
{
|
||||
struct t_irc_channel *ptr_channel;
|
||||
struct t_plugin_infolist *infolist;
|
||||
struct t_config_option *ptr_option;
|
||||
int num_nicks, num_op, num_halfop, num_voice, num_normal, length, i;
|
||||
char *string, *prefix;
|
||||
|
||||
@@ -3590,8 +3591,12 @@ irc_protocol_cmd_366 (struct t_irc_server *server, const char *command,
|
||||
if (strcmp (weechat_infolist_string (infolist, "type"),
|
||||
"nick") == 0)
|
||||
{
|
||||
weechat_config_search_with_string (weechat_infolist_string (infolist,
|
||||
"prefix_color"),
|
||||
NULL, NULL, &ptr_option,
|
||||
NULL);
|
||||
length +=
|
||||
strlen (weechat_infolist_string (infolist, "prefix_color")) +
|
||||
((ptr_option) ? strlen (weechat_color (weechat_config_string (ptr_option))) : 0) +
|
||||
strlen (weechat_infolist_string (infolist, "prefix")) +
|
||||
strlen (IRC_COLOR_CHAT) +
|
||||
strlen (weechat_infolist_string (infolist, "name")) + 1;
|
||||
@@ -3612,9 +3617,12 @@ irc_protocol_cmd_366 (struct t_irc_server *server, const char *command,
|
||||
prefix = weechat_infolist_string (infolist, "prefix");
|
||||
if (prefix[0] && (prefix[0] != ' '))
|
||||
{
|
||||
strcat (string,
|
||||
weechat_color (weechat_infolist_string (infolist,
|
||||
"prefix_color")));
|
||||
weechat_config_search_with_string (weechat_infolist_string (infolist,
|
||||
"prefix_color"),
|
||||
NULL, NULL, &ptr_option,
|
||||
NULL);
|
||||
if (ptr_option)
|
||||
strcat (string, weechat_color (weechat_config_string (ptr_option)));
|
||||
strcat (string, prefix);
|
||||
}
|
||||
strcat (string, IRC_COLOR_CHAT);
|
||||
|
||||
@@ -451,15 +451,13 @@ plugin_api_infolist_get_add_nicklist (struct t_plugin_infolist *infolist,
|
||||
return 0;
|
||||
if (!plugin_infolist_new_var_string (ptr_item, "name", ptr_nick->name))
|
||||
return 0;
|
||||
if (!plugin_infolist_new_var_string (ptr_item, "color",
|
||||
gui_color_search_config_str (ptr_nick->color)))
|
||||
if (!plugin_infolist_new_var_string (ptr_item, "color", ptr_nick->color))
|
||||
return 0;
|
||||
prefix[0] = ptr_nick->prefix;
|
||||
prefix[1] = '\0';
|
||||
if (!plugin_infolist_new_var_string (ptr_item, "prefix", prefix))
|
||||
return 0;
|
||||
if (!plugin_infolist_new_var_string (ptr_item, "prefix_color",
|
||||
gui_color_search_config_str (ptr_nick->prefix_color)))
|
||||
if (!plugin_infolist_new_var_string (ptr_item, "prefix_color", ptr_nick->prefix_color))
|
||||
return 0;
|
||||
if (!plugin_infolist_new_var_integer (ptr_item, "visible", ptr_nick->visible))
|
||||
return 0;
|
||||
@@ -470,8 +468,7 @@ plugin_api_infolist_get_add_nicklist (struct t_plugin_infolist *infolist,
|
||||
return 0;
|
||||
if (!plugin_infolist_new_var_string (ptr_item, "name", ptr_group->name))
|
||||
return 0;
|
||||
if (!plugin_infolist_new_var_string (ptr_item, "color",
|
||||
gui_color_search_config_str (ptr_group->color)))
|
||||
if (!plugin_infolist_new_var_string (ptr_item, "color", ptr_group->color))
|
||||
return 0;
|
||||
if (!plugin_infolist_new_var_integer (ptr_item, "visible", ptr_group->visible))
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user