summaryrefslogtreecommitdiff
path: root/src/plugins/irc
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2010-10-29 18:41:06 +0200
committerSebastien Helleu <flashcode@flashtux.org>2010-10-29 18:41:06 +0200
commit804551122a3f56d623485e66c6b2188e6a784fab (patch)
tree0de910cda1470d9fa60219c7700758c247d86ab0 /src/plugins/irc
parent32db2eac25e01ee3cc65089df50c38214ef75238 (diff)
downloadweechat-804551122a3f56d623485e66c6b2188e6a784fab.zip
Use function nicklist_nick_set to change nick color (instead of removing/adding nick in nicklist)
Diffstat (limited to 'src/plugins/irc')
-rw-r--r--src/plugins/irc/irc-nick.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/src/plugins/irc/irc-nick.c b/src/plugins/irc/irc-nick.c
index ae6ee1faf..f368aab90 100644
--- a/src/plugins/irc/irc-nick.c
+++ b/src/plugins/irc/irc-nick.c
@@ -407,6 +407,24 @@ irc_nick_nicklist_remove (struct t_irc_server *server,
}
/*
+ * irc_nick_nicklist_set: set a property for nick in buffer nicklist
+ */
+
+void
+irc_nick_nicklist_set (struct t_irc_channel *channel,
+ struct t_irc_nick *nick,
+ const char *property, const char *value)
+{
+ struct t_gui_nick *ptr_nick;
+
+ ptr_nick = weechat_nicklist_search_nick (channel->buffer, NULL, nick->name);
+ if (ptr_nick)
+ {
+ weechat_nicklist_nick_set (channel->buffer, ptr_nick, property, value);
+ }
+}
+
+/*
* irc_nick_get_prefix_color_name: return name of color with a prefix number
*/
@@ -700,9 +718,10 @@ irc_nick_set_away (struct t_irc_server *server, struct t_irc_channel *channel,
{
if ((is_away && !nick->away) || (!is_away && nick->away))
{
- irc_nick_nicklist_remove (server, channel, nick);
nick->away = is_away;
- irc_nick_nicklist_add (server, channel, nick);
+ irc_nick_nicklist_set (channel, nick, "color",
+ (nick->away) ?
+ "weechat.color.nicklist_away" : "bar_fg");
}
}
}