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

irc: add variable "nick_host" in server structure

This commit is contained in:
Sébastien Helleu
2019-05-07 13:16:44 +02:00
parent 2073408b86
commit 06aa7034fb
13 changed files with 118 additions and 26 deletions
+20
View File
@@ -183,6 +183,26 @@ irc_nick_set_prefixes (struct t_irc_server *server, struct t_irc_nick *nick,
irc_nick_set_current_prefix (nick);
}
/*
* Sets host for nick.
*/
void
irc_nick_set_host (struct t_irc_nick *nick, const char *host)
{
/* if host is the same, just return */
if ((!nick->host && !host)
|| (nick->host && host && strcmp (nick->host, host) == 0))
{
return;
}
/* update the host in nick */
if (nick->host)
free (nick->host);
nick->host = (host) ? strdup (host) : NULL;
}
/*
* Checks if nick is "op" (or better than "op", for example channel admin or
* channel owner).