diff options
author | Simmo Saan <simmo.saan@gmail.com> | 2020-07-05 11:38:27 +0300 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2020-07-21 08:18:43 +0200 |
commit | b69e47d0a2f553315ba75b8b3132fa41154e8c1f (patch) | |
tree | 9e5947a33c382394c76214284c4c23f869023fc3 /src/plugins | |
parent | 84e30438d42c1726d506b6ca93feaf7c854ec303 (diff) | |
download | weechat-b69e47d0a2f553315ba75b8b3132fa41154e8c1f.zip |
irc: add pointer "irc_nick" in hashtable sent to hook focus callback (closes #1535)
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/irc/irc-bar-item.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/plugins/irc/irc-bar-item.c b/src/plugins/irc/irc-bar-item.c index 8b2cd2004..6240ce92c 100644 --- a/src/plugins/irc/irc-bar-item.c +++ b/src/plugins/irc/irc-bar-item.c @@ -656,6 +656,7 @@ irc_bar_item_focus_buffer_nicklist (const void *pointer, void *data, struct t_gui_buffer *buffer; struct t_irc_nick *ptr_nick; const char *str_buffer, *nick; + char str_value[128]; str_buffer = weechat_hashtable_get (info, "_buffer"); if (!str_buffer || !str_buffer[0]) @@ -679,9 +680,15 @@ irc_bar_item_focus_buffer_nicklist (const void *pointer, void *data, if (nick) { ptr_nick = irc_nick_search (ptr_server, ptr_channel, nick); - if (ptr_nick && ptr_nick->host) + if (ptr_nick) { - weechat_hashtable_set (info, "irc_host", ptr_nick->host); + snprintf (str_value, sizeof (str_value), + "0x%lx", (unsigned long)ptr_nick); + weechat_hashtable_set (info, "irc_nick", str_value); + + if (ptr_nick->host) + weechat_hashtable_set (info, "irc_host", ptr_nick->host); + return info; } } |