1
0
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:
Max Teufel
2015-01-24 14:23:29 +01:00
parent f379adffd0
commit eea6b07edc
3 changed files with 29 additions and 2 deletions
+23 -1
View File
@@ -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);
}
}
}
+2
View File
@@ -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,
+4 -1
View File
@@ -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 ("*");
}
}