diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2017-06-13 20:29:38 +0200 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2017-06-13 20:29:38 +0200 |
commit | 92a40052af804c0455c3f4222a03de38dcdeaac5 (patch) | |
tree | deb6bb96eb49b000cb9c6b0d5992286ea939a518 /src/plugins/buflist | |
parent | fbf7156b1b02b99fa8259f2a4761969b6012523b (diff) | |
download | weechat-92a40052af804c0455c3f4222a03de38dcdeaac5.zip |
buflist: add variable ${merged} in bar item evaluation
Diffstat (limited to 'src/plugins/buflist')
-rw-r--r-- | src/plugins/buflist/buflist-bar-item.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/plugins/buflist/buflist-bar-item.c b/src/plugins/buflist/buflist-bar-item.c index 2612259be..0d3c3c45b 100644 --- a/src/plugins/buflist/buflist-bar-item.c +++ b/src/plugins/buflist/buflist-bar-item.c @@ -216,6 +216,7 @@ buflist_bar_item_buflist_cb (const void *pointer, void *data, { struct t_arraylist *buffers; struct t_gui_buffer *ptr_buffer, *ptr_current_buffer; + struct t_gui_buffer *ptr_buffer_prev, *ptr_buffer_next; struct t_gui_nick *ptr_gui_nick; struct t_gui_hotlist *ptr_hotlist; void *ptr_server, *ptr_channel; @@ -350,6 +351,29 @@ buflist_bar_item_buflist_cb (const void *pointer, void *data, } prev_number = number; + /* buffer merged */ + ptr_buffer_prev = weechat_hdata_move (buflist_hdata_buffer, + ptr_buffer, -1); + ptr_buffer_next = weechat_hdata_move (buflist_hdata_buffer, + ptr_buffer, 1); + if ((ptr_buffer_prev + && (weechat_hdata_integer (buflist_hdata_buffer, + ptr_buffer_prev, + "number") == number)) + || (ptr_buffer_next + && (weechat_hdata_integer (buflist_hdata_buffer, + ptr_buffer_next, + "number") == number))) + { + weechat_hashtable_set (buflist_hashtable_extra_vars, + "merged", "1"); + } + else + { + weechat_hashtable_set (buflist_hashtable_extra_vars, + "merged", "0"); + } + /* buffer name */ ptr_type = weechat_buffer_get_string (ptr_buffer, "localvar_type"); is_channel = (ptr_type && (strcmp (ptr_type, "channel") == 0)); |