mirror of
https://github.com/weechat/weechat.git
synced 2026-06-30 14:56:39 +02:00
core: fix click in item "buffer_nicklist" when nicklist is a root bar (bug #38080)
Argument "*" is now silently ignored in command /window. When item "buffer_nicklist" is in a root bar, we use current window/buffer to find which nick has been clicked (same behaviour as callback used to display bar item "buffer_nicklist").
This commit is contained in:
@@ -5376,6 +5376,10 @@ COMMAND_CALLBACK(window)
|
||||
return WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
/* silently ignore argument "*" (can heppen when clicking in a root bar) */
|
||||
if (strcmp (argv_eol[1], "*") == 0)
|
||||
return WEECHAT_RC_OK;
|
||||
|
||||
/* refresh screen */
|
||||
if (string_strcasecmp (argv[1], "refresh") == 0)
|
||||
{
|
||||
|
||||
+14
-9
@@ -1539,18 +1539,23 @@ gui_bar_item_focus_buffer_nicklist (void *data,
|
||||
/* make C compiler happy */
|
||||
(void) data;
|
||||
|
||||
str_window = hashtable_get (info, "_window");
|
||||
str_bar_item_line = hashtable_get (info, "_bar_item_line");
|
||||
|
||||
if (!str_window || !str_window[0]
|
||||
|| !str_bar_item_line || !str_bar_item_line[0])
|
||||
if (!str_bar_item_line || !str_bar_item_line[0])
|
||||
return NULL;
|
||||
|
||||
rc = sscanf (str_window, "%lx", &value);
|
||||
if ((rc == EOF) || (rc == 0))
|
||||
return NULL;
|
||||
|
||||
window = (struct t_gui_window *)value;
|
||||
str_window = hashtable_get (info, "_window");
|
||||
if (str_window && str_window[0])
|
||||
{
|
||||
rc = sscanf (str_window, "%lx", &value);
|
||||
if ((rc == EOF) || (rc == 0))
|
||||
return NULL;
|
||||
window = (struct t_gui_window *)value;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* no window, is it a root bar? then use current window */
|
||||
window = gui_current_window;
|
||||
}
|
||||
if (!window)
|
||||
return NULL;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user