mirror of
https://github.com/weechat/weechat.git
synced 2026-06-29 06:16:40 +02:00
irc: don't keep valid account names when account-notify is disabled
This commit is contained in:
@@ -678,6 +678,25 @@ irc_channel_get_auto_chantype (struct t_irc_server *server,
|
||||
return chantype;
|
||||
}
|
||||
|
||||
/*
|
||||
* Removes account for all nicks on a channel.
|
||||
*/
|
||||
|
||||
void
|
||||
irc_channel_remove_account (struct t_irc_server *server,
|
||||
struct t_irc_channel *channel)
|
||||
{
|
||||
struct t_irc_nick *ptr_nick;
|
||||
|
||||
if (channel->type == IRC_CHANNEL_TYPE_CHANNEL)
|
||||
{
|
||||
for (ptr_nick = channel->nicks; ptr_nick; ptr_nick = ptr_nick->next_nick)
|
||||
{
|
||||
ptr_nick->account = strdup ("*");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Removes away for all nicks on a channel.
|
||||
*/
|
||||
@@ -698,7 +717,7 @@ irc_channel_remove_away (struct t_irc_server *server,
|
||||
}
|
||||
|
||||
/*
|
||||
* Checks for away on a channel.
|
||||
* Checks for WHOX information on a channel.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -718,7 +737,10 @@ irc_channel_check_whox (struct t_irc_server *server,
|
||||
"WHO %s %%cuhsnfdar", channel->name);
|
||||
}
|
||||
else
|
||||
{
|
||||
irc_channel_remove_account(server, channel);
|
||||
irc_channel_remove_away(server, channel);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -107,6 +107,8 @@ extern int irc_channel_is_channel (struct t_irc_server *server,
|
||||
const char *string);
|
||||
extern const char *irc_channel_get_auto_chantype (struct t_irc_server *server,
|
||||
const char *channel_name);
|
||||
extern void irc_channel_remove_account (struct t_irc_server *server,
|
||||
struct t_irc_channel *channel);
|
||||
extern void irc_channel_remove_away (struct t_irc_server *server,
|
||||
struct t_irc_channel *channel);
|
||||
extern void irc_channel_check_whox (struct t_irc_server *server,
|
||||
|
||||
@@ -318,7 +318,10 @@ IRC_PROTOCOL_CALLBACK(account)
|
||||
{
|
||||
if (ptr_nick->account)
|
||||
free (ptr_nick->account);
|
||||
ptr_nick->account = strdup (argv[2]);
|
||||
if (server->cap_account_notify)
|
||||
ptr_nick->account = strdup (argv[2]);
|
||||
else
|
||||
ptr_nick->account = strdup ("*");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user