1
0
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:
Sebastien Helleu
2009-02-10 12:05:39 +01:00
parent b2f34610fd
commit edba781297
11 changed files with 58 additions and 8 deletions
+9
View File
@@ -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"),