diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2010-11-10 12:11:56 +0100 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2010-11-10 12:11:56 +0100 |
commit | 32488331253f2379e0144b45bc036ee31623df07 (patch) | |
tree | 4e9c6906d69676c3cf7f5a1b01c4326cb77668ed /src/plugins/irc | |
parent | 97ea89c44fc29f8256cf976ab07bc0a196ea645a (diff) | |
download | weechat-32488331253f2379e0144b45bc036ee31623df07.zip |
Search nicklist group without leading digits in irc plugin
Diffstat (limited to 'src/plugins/irc')
-rw-r--r-- | src/plugins/irc/irc-channel.c | 8 | ||||
-rw-r--r-- | src/plugins/irc/irc-nick.c | 8 | ||||
-rw-r--r-- | src/plugins/irc/irc-nick.h | 4 |
3 files changed, 12 insertions, 8 deletions
diff --git a/src/plugins/irc/irc-channel.c b/src/plugins/irc/irc-channel.c index ac9ad55db..c7dcb97b6 100644 --- a/src/plugins/irc/irc-channel.c +++ b/src/plugins/irc/irc-channel.c @@ -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); } diff --git a/src/plugins/irc/irc-nick.c b/src/plugins/irc/irc-nick.c index b350616cb..3d42afca1 100644 --- a/src/plugins/irc/irc-nick.c +++ b/src/plugins/irc/irc-nick.c @@ -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); } diff --git a/src/plugins/irc/irc-nick.h b/src/plugins/irc/irc-nick.h index ed283da96..8df1c66fa 100644 --- a/src/plugins/irc/irc-nick.h +++ b/src/plugins/irc/irc-nick.h @@ -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; |