1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-05 09:13:14 +02:00

Add "irc_is_nick" for function info_get to check if a string is a valid IRC nick name (patch #7133)

This commit is contained in:
Sebastien Helleu
2010-03-25 10:39:07 +01:00
parent 96e6ae3fc3
commit e59bbbb40a
16 changed files with 144 additions and 56 deletions
+10 -1
View File
@@ -79,6 +79,12 @@ irc_info_get_info_cb (void *data, const char *info_name,
return str_true;
return NULL;
}
else if (weechat_strcasecmp (info_name, "irc_is_nick") == 0)
{
if (irc_nick_is_nick (arguments))
return str_true;
return NULL;
}
else if (weechat_strcasecmp (info_name, "irc_nick") == 0)
{
ptr_server = irc_server_search (arguments);
@@ -396,9 +402,12 @@ void
irc_info_init ()
{
/* info hooks */
weechat_hook_info ("irc_is_channel", N_("1 if string is an IRC channel"),
weechat_hook_info ("irc_is_channel", N_("1 if string is a valid IRC channel name"),
N_("channel name"),
&irc_info_get_info_cb, NULL);
weechat_hook_info ("irc_is_nick", N_("1 if string is a valid IRC nick name"),
N_("nickname"),
&irc_info_get_info_cb, NULL);
weechat_hook_info ("irc_nick", N_("get current nick on a server"),
N_("server name"),
&irc_info_get_info_cb, NULL);