diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2008-09-21 21:31:32 +0200 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2008-09-21 21:31:32 +0200 |
commit | f9722d4b2391d4d87c437ebce9ae597e8f65bda7 (patch) | |
tree | fc67569b167c71b712a5449b27fe075d0980eaeb /src/plugins/irc | |
parent | a8b12f25975568f3f4d6f8fc383d785bab9b24fa (diff) | |
download | weechat-f9722d4b2391d4d87c437ebce9ae597e8f65bda7.zip |
Add away indicator in "buffer name" bar item (for IRC plugin)
Diffstat (limited to 'src/plugins/irc')
-rw-r--r-- | src/plugins/irc/irc-bar-item.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/plugins/irc/irc-bar-item.c b/src/plugins/irc/irc-bar-item.c index 9f8258736..282fbb720 100644 --- a/src/plugins/irc/irc-bar-item.c +++ b/src/plugins/irc/irc-bar-item.c @@ -40,7 +40,7 @@ irc_bar_item_buffer_name (void *data, struct t_gui_bar_item *item, struct t_gui_window *window, int max_width, int max_height) { - char buf[256], buf_name[256], *name; + char buf[256], buf_name[256], away[128], *name; int number; struct t_gui_buffer *buffer; struct t_irc_server *server; @@ -92,6 +92,14 @@ irc_bar_item_buffer_name (void *data, struct t_gui_bar_item *item, IRC_COLOR_BAR_DELIM); } } + if (server && server->is_away) + { + snprintf (away, sizeof (away), " %s(%s%s%s)", + IRC_COLOR_BAR_DELIM, + IRC_COLOR_BAR_FG, + _("away"), + IRC_COLOR_BAR_DELIM); + } } else { @@ -100,12 +108,13 @@ irc_bar_item_buffer_name (void *data, struct t_gui_bar_item *item, snprintf (buf_name, sizeof (buf_name), "%s", name); } - snprintf (buf, sizeof (buf), "%s%d%s:%s%s", + snprintf (buf, sizeof (buf), "%s%d%s:%s%s%s", IRC_COLOR_STATUS_NUMBER, number, IRC_COLOR_BAR_DELIM, IRC_COLOR_STATUS_NAME, - buf_name); + buf_name, + away); return strdup (buf); } |