diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2009-05-28 16:36:24 +0200 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2009-05-28 16:36:24 +0200 |
commit | 27d1ba5093d1fd3e00065a20b820f034fb842f87 (patch) | |
tree | 744b0424fda324b61876db5af3cca3834aafef86 /src/plugins/irc/irc-bar-item.c | |
parent | 0e040e8301aff16022887a85c00d03b3df97dfa5 (diff) | |
download | weechat-27d1ba5093d1fd3e00065a20b820f034fb842f87.zip |
Add color for bar item "away" (irc.color.item_away)
Diffstat (limited to 'src/plugins/irc/irc-bar-item.c')
-rw-r--r-- | src/plugins/irc/irc-bar-item.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/plugins/irc/irc-bar-item.c b/src/plugins/irc/irc-bar-item.c index 1223c2893..9a199d109 100644 --- a/src/plugins/irc/irc-bar-item.c +++ b/src/plugins/irc/irc-bar-item.c @@ -42,6 +42,8 @@ irc_bar_item_away (void *data, struct t_gui_bar_item *item, { struct t_gui_buffer *buffer; struct t_irc_server *server; + char *buf; + int length; /* make C compiler happy */ (void) data; @@ -54,7 +56,17 @@ irc_bar_item_away (void *data, struct t_gui_bar_item *item, irc_buffer_get_server_channel (buffer, &server, NULL); if (server && server->is_away) - return strdup (_("away")); + { + length = strlen (_("away") + 64 + 1); + buf = malloc (length); + if (buf) + { + snprintf (buf, length, "%s%s", + IRC_COLOR_ITEM_AWAY, + _("away")); + return buf; + } + } } return NULL; |