summaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2022-07-31 09:58:29 +0200
committerSébastien Helleu <flashcode@flashtux.org>2022-07-31 09:58:29 +0200
commite77ea9dc26b1238708c841e395eb3544c0519452 (patch)
tree0c3d71cffbeece63406cd3bc0a2a4f2cfd453693 /src/plugins
parent324f0aaa2d22de33de7b356fb13c3e795750f69b (diff)
downloadweechat-e77ea9dc26b1238708c841e395eb3544c0519452.zip
buflist: add variable "${hotlist_priority_number}" (integer version of "${hotlist_priority}")
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/buflist/buflist-bar-item.c7
-rw-r--r--src/plugins/buflist/buflist-command.c2
2 files changed, 9 insertions, 0 deletions
diff --git a/src/plugins/buflist/buflist-bar-item.c b/src/plugins/buflist/buflist-bar-item.c
index 39aa598d9..82be155aa 100644
--- a/src/plugins/buflist/buflist-bar-item.c
+++ b/src/plugins/buflist/buflist-bar-item.c
@@ -316,6 +316,7 @@ buflist_bar_item_buflist_cb (const void *pointer, void *data,
int item_index, num_buffers, is_channel, is_private;
int i, j, length_max_number, current_buffer, number, prev_number, priority;
int rc, count, line_number, line_number_current_buffer;
+ int hotlist_priority_number;
/* make C compiler happy */
(void) data;
@@ -517,6 +518,7 @@ buflist_bar_item_buflist_cb (const void *pointer, void *data,
ptr_hotlist_format = weechat_config_string (
buflist_config_format_hotlist_level_none);
ptr_hotlist_priority = hotlist_priority_none;
+ hotlist_priority_number = -1;
if (ptr_hotlist)
{
priority = weechat_hdata_integer (buflist_hdata_hotlist,
@@ -526,12 +528,17 @@ buflist_bar_item_buflist_cb (const void *pointer, void *data,
ptr_hotlist_format = weechat_config_string (
buflist_config_format_hotlist_level[priority]);
ptr_hotlist_priority = hotlist_priority[priority];
+ hotlist_priority_number = priority;
}
}
weechat_hashtable_set (buflist_hashtable_extra_vars,
"color_hotlist", ptr_hotlist_format);
weechat_hashtable_set (buflist_hashtable_extra_vars,
"hotlist_priority", ptr_hotlist_priority);
+ snprintf (str_number, sizeof (str_number),
+ "%d", hotlist_priority_number);
+ weechat_hashtable_set (buflist_hashtable_extra_vars,
+ "hotlist_priority_number", str_number);
str_hotlist = NULL;
if (ptr_hotlist)
{
diff --git a/src/plugins/buflist/buflist-command.c b/src/plugins/buflist/buflist-command.c
index 9b8e9f65b..11bb74acb 100644
--- a/src/plugins/buflist/buflist-command.c
+++ b/src/plugins/buflist/buflist-command.c
@@ -167,6 +167,8 @@ buflist_command_init ()
" - ${hotlist}: the raw hotlist\n"
" - ${hotlist_priority}: \"none\", \"low\", \"message\", "
"\"private\" or \"highlight\"\n"
+ " - ${hotlist_priority_number}: -1 = none, 0 = low, 1 = message, "
+ "2 = private, 3 = highlight\n"
" - ${format_lag}: the lag for an IRC server buffer, empty if "
"there's no lag (evaluation of option buflist.format.lag)\n"
" - ${format_tls_version}: indicator of TLS version for a server "