mirror of
https://github.com/weechat/weechat.git
synced 2026-07-05 17:23:15 +02:00
irc: rename server variable "nick_host" to "host"
This commit is contained in:
@@ -761,33 +761,33 @@ irc_server_set_nick (struct t_irc_server *server, const char *nick)
|
||||
}
|
||||
|
||||
/*
|
||||
* Sets nick host for server.
|
||||
* Sets host for server.
|
||||
*/
|
||||
|
||||
void
|
||||
irc_server_set_nick_host (struct t_irc_server *server, const char *host)
|
||||
irc_server_set_host (struct t_irc_server *server, const char *host)
|
||||
{
|
||||
struct t_irc_channel *ptr_channel;
|
||||
|
||||
/* if host is the same, just return */
|
||||
if ((!server->nick_host && !host)
|
||||
|| (server->nick_host && host && strcmp (server->nick_host, host) == 0))
|
||||
if ((!server->host && !host)
|
||||
|| (server->host && host && strcmp (server->host, host) == 0))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
/* update the nick host in server */
|
||||
if (server->nick_host)
|
||||
free (server->nick_host);
|
||||
server->nick_host = (host) ? strdup (host) : NULL;
|
||||
if (server->host)
|
||||
free (server->host);
|
||||
server->host = (host) ? strdup (host) : NULL;
|
||||
|
||||
/* set local variable "nick_host" for server and all channels/pv */
|
||||
weechat_buffer_set (server->buffer, "localvar_set_nick_host", host);
|
||||
/* set local variable "host" for server and all channels/pv */
|
||||
weechat_buffer_set (server->buffer, "localvar_set_host", host);
|
||||
for (ptr_channel = server->channels; ptr_channel;
|
||||
ptr_channel = ptr_channel->next_channel)
|
||||
{
|
||||
weechat_buffer_set (ptr_channel->buffer,
|
||||
"localvar_set_nick_host", host);
|
||||
"localvar_set_host", host);
|
||||
}
|
||||
|
||||
weechat_bar_item_update ("irc_host");
|
||||
@@ -1379,7 +1379,7 @@ irc_server_alloc (const char *name)
|
||||
new_server->nick_alternate_number = -1;
|
||||
new_server->nick = NULL;
|
||||
new_server->nick_modes = NULL;
|
||||
new_server->nick_host = NULL;
|
||||
new_server->host = NULL;
|
||||
new_server->checking_cap_ls = 0;
|
||||
new_server->cap_ls = weechat_hashtable_new (32,
|
||||
WEECHAT_HASHTABLE_STRING,
|
||||
@@ -1907,8 +1907,8 @@ irc_server_free_data (struct t_irc_server *server)
|
||||
free (server->nick);
|
||||
if (server->nick_modes)
|
||||
free (server->nick_modes);
|
||||
if (server->nick_host)
|
||||
free (server->nick_host);
|
||||
if (server->host)
|
||||
free (server->host);
|
||||
if (server->isupport)
|
||||
free (server->isupport);
|
||||
if (server->prefix_modes)
|
||||
@@ -5116,10 +5116,10 @@ irc_server_disconnect (struct t_irc_server *server, int switch_address,
|
||||
weechat_bar_item_update ("input_prompt");
|
||||
weechat_bar_item_update ("irc_nick_modes");
|
||||
}
|
||||
if (server->nick_host)
|
||||
if (server->host)
|
||||
{
|
||||
free (server->nick_host);
|
||||
server->nick_host = NULL;
|
||||
free (server->host);
|
||||
server->host = NULL;
|
||||
weechat_bar_item_update ("irc_host");
|
||||
weechat_bar_item_update ("irc_nick_host");
|
||||
}
|
||||
@@ -5681,7 +5681,7 @@ irc_server_hdata_server_cb (const void *pointer, void *data,
|
||||
WEECHAT_HDATA_VAR(struct t_irc_server, nick_alternate_number, INTEGER, 0, NULL, NULL);
|
||||
WEECHAT_HDATA_VAR(struct t_irc_server, nick, STRING, 0, NULL, NULL);
|
||||
WEECHAT_HDATA_VAR(struct t_irc_server, nick_modes, STRING, 0, NULL, NULL);
|
||||
WEECHAT_HDATA_VAR(struct t_irc_server, nick_host, STRING, 0, NULL, NULL);
|
||||
WEECHAT_HDATA_VAR(struct t_irc_server, host, STRING, 0, NULL, NULL);
|
||||
WEECHAT_HDATA_VAR(struct t_irc_server, checking_cap_ls, INTEGER, 0, NULL, NULL);
|
||||
WEECHAT_HDATA_VAR(struct t_irc_server, cap_ls, HASHTABLE, 0, NULL, NULL);
|
||||
WEECHAT_HDATA_VAR(struct t_irc_server, checking_cap_list, INTEGER, 0, NULL, NULL);
|
||||
@@ -5907,7 +5907,7 @@ irc_server_add_to_infolist (struct t_infolist *infolist,
|
||||
return 0;
|
||||
if (!weechat_infolist_new_var_string (ptr_item, "nick_modes", server->nick_modes))
|
||||
return 0;
|
||||
if (!weechat_infolist_new_var_string (ptr_item, "nick_host", server->nick_host))
|
||||
if (!weechat_infolist_new_var_string (ptr_item, "host", server->host))
|
||||
return 0;
|
||||
if (!weechat_infolist_new_var_integer (ptr_item, "checking_cap_ls", server->checking_cap_ls))
|
||||
return 0;
|
||||
@@ -6295,7 +6295,7 @@ irc_server_print_log ()
|
||||
weechat_log_printf (" nick_alternate_number: %d", ptr_server->nick_alternate_number);
|
||||
weechat_log_printf (" nick . . . . . . . . : '%s'", ptr_server->nick);
|
||||
weechat_log_printf (" nick_modes . . . . . : '%s'", ptr_server->nick_modes);
|
||||
weechat_log_printf (" nick_host. . . . . . : '%s'", ptr_server->nick_host);
|
||||
weechat_log_printf (" host . . . . . . . . : '%s'", ptr_server->host);
|
||||
weechat_log_printf (" checking_cap_ls. . . : %d", ptr_server->checking_cap_ls);
|
||||
weechat_log_printf (" cap_ls . . . . . . . : 0x%lx (hashtable: '%s')",
|
||||
ptr_server->cap_ls,
|
||||
|
||||
Reference in New Issue
Block a user