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:
@@ -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).
|
||||
|
||||
Reference in New Issue
Block a user