mirror of
https://github.com/weechat/weechat.git
synced 2026-07-08 10:43:13 +02:00
Add irc info "irc_nick" to get current nick on a server
This commit is contained in:
@@ -78,6 +78,13 @@ irc_info_get_info_cb (void *data, const char *info_name,
|
||||
return str_true;
|
||||
return NULL;
|
||||
}
|
||||
else if (weechat_strcasecmp (info_name, "irc_nick") == 0)
|
||||
{
|
||||
ptr_server = irc_server_search (arguments);
|
||||
if (ptr_server)
|
||||
return ptr_server->nick;
|
||||
return NULL;
|
||||
}
|
||||
else if (weechat_strcasecmp (info_name, "irc_nick_from_host") == 0)
|
||||
{
|
||||
return irc_protocol_get_nick_from_host (arguments);
|
||||
@@ -365,6 +372,8 @@ irc_info_init ()
|
||||
/* info hooks */
|
||||
weechat_hook_info ("irc_is_channel", N_("1 if string is an IRC channel"),
|
||||
&irc_info_get_info_cb, NULL);
|
||||
weechat_hook_info ("irc_nick", N_("get current nick on a server"),
|
||||
&irc_info_get_info_cb, NULL);
|
||||
weechat_hook_info ("irc_nick_from_host", N_("get nick from IRC host"),
|
||||
&irc_info_get_info_cb, NULL);
|
||||
weechat_hook_info ("irc_buffer", N_("get buffer pointer for an IRC server/channel"),
|
||||
|
||||
Reference in New Issue
Block a user