mirror of
https://github.com/weechat/weechat.git
synced 2026-06-30 23:06:38 +02:00
Search nicklist group without leading digits in irc plugin
This commit is contained in:
@@ -238,12 +238,14 @@ irc_channel_new (struct t_irc_server *server, int channel_type,
|
||||
prefix_modes = irc_server_get_prefix_modes (server);
|
||||
for (i = 0; prefix_modes[i]; i++)
|
||||
{
|
||||
snprintf (str_group, sizeof (str_group),
|
||||
"%03d|%c", i, prefix_modes[i]);
|
||||
snprintf (str_group, sizeof (str_group), "%03d|%c",
|
||||
i, prefix_modes[i]);
|
||||
weechat_nicklist_add_group (new_buffer, NULL, str_group,
|
||||
"weechat.color.nicklist_group", 1);
|
||||
}
|
||||
weechat_nicklist_add_group (new_buffer, NULL, IRC_NICK_GROUP_OTHER,
|
||||
snprintf (str_group, sizeof (str_group), "%03d|%s",
|
||||
IRC_NICK_GROUP_OTHER_NUMBER, IRC_NICK_GROUP_OTHER_NAME);
|
||||
weechat_nicklist_add_group (new_buffer, NULL, str_group,
|
||||
"weechat.color.nicklist_group", 1);
|
||||
}
|
||||
|
||||
|
||||
@@ -343,7 +343,7 @@ irc_nick_get_nicklist_group (struct t_irc_server *server,
|
||||
struct t_irc_nick *nick)
|
||||
{
|
||||
int index;
|
||||
char str_group[32];
|
||||
char str_group[2];
|
||||
const char *prefix_modes;
|
||||
struct t_gui_nick_group *ptr_group;
|
||||
|
||||
@@ -355,13 +355,13 @@ irc_nick_get_nicklist_group (struct t_irc_server *server,
|
||||
if (index < 0)
|
||||
{
|
||||
ptr_group = weechat_nicklist_search_group (buffer, NULL,
|
||||
IRC_NICK_GROUP_OTHER);
|
||||
IRC_NICK_GROUP_OTHER_NAME);
|
||||
}
|
||||
else
|
||||
{
|
||||
prefix_modes = irc_server_get_prefix_modes (server);
|
||||
snprintf (str_group, sizeof (str_group),
|
||||
"%03d|%c", index, prefix_modes[index]);
|
||||
str_group[0] = prefix_modes[index];
|
||||
str_group[1] = '\0';
|
||||
ptr_group = weechat_nicklist_search_group (buffer, NULL, str_group);
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,9 @@
|
||||
#define IRC_NICK_VALID_CHARS "abcdefghijklmnopqrstuvwxyzABCDEFGHI" \
|
||||
"JKLMNOPQRSTUVWXYZ0123456789-[]\\`_^{|}"
|
||||
|
||||
#define IRC_NICK_GROUP_OTHER "999|..."
|
||||
/* nicklist group for nicks without prefix is "999|..." */
|
||||
#define IRC_NICK_GROUP_OTHER_NUMBER 999
|
||||
#define IRC_NICK_GROUP_OTHER_NAME "..."
|
||||
|
||||
struct t_irc_server;
|
||||
struct t_irc_channel;
|
||||
|
||||
Reference in New Issue
Block a user