diff options
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/irc/irc-channel.c | 2 | ||||
-rw-r--r-- | src/plugins/irc/irc-protocol.c | 13 |
2 files changed, 9 insertions, 6 deletions
diff --git a/src/plugins/irc/irc-channel.c b/src/plugins/irc/irc-channel.c index 74bc9ba39..dc8df4eb8 100644 --- a/src/plugins/irc/irc-channel.c +++ b/src/plugins/irc/irc-channel.c @@ -653,7 +653,7 @@ irc_channel_remove_account (struct t_irc_server *server, { if (ptr_nick->account) free (ptr_nick->account); - ptr_nick->account = strdup ("*"); + ptr_nick->account = NULL; } } } diff --git a/src/plugins/irc/irc-protocol.c b/src/plugins/irc/irc-protocol.c index 7f7cd7fa9..ac9836835 100644 --- a/src/plugins/irc/irc-protocol.c +++ b/src/plugins/irc/irc-protocol.c @@ -206,9 +206,12 @@ IRC_PROTOCOL_CALLBACK(account) { struct t_irc_channel *ptr_channel; struct t_irc_nick *ptr_nick; + char *pos_account; IRC_PROTOCOL_MIN_ARGS(3); + pos_account = (argv[2] && argv[2][0] != '*') ? argv[2] : NULL; + for (ptr_channel = server->channels; ptr_channel; ptr_channel = ptr_channel->next_channel) { @@ -217,8 +220,8 @@ IRC_PROTOCOL_CALLBACK(account) { if (ptr_nick->account) free (ptr_nick->account); - ptr_nick->account = (server->cap_account_notify) ? - strdup (argv[2]) : strdup ("*"); + ptr_nick->account = (server->cap_account_notify && pos_account) ? + strdup (pos_account) : NULL; } } @@ -747,7 +750,7 @@ IRC_PROTOCOL_CALLBACK(join) /* add nick in channel */ ptr_nick = irc_nick_new (server, ptr_channel, nick, address, NULL, 0, - (pos_account) ? pos_account : "*", (pos_realname) ? pos_realname : NULL); + (pos_account) ? pos_account : NULL, (pos_realname) ? pos_realname : NULL); /* rename the nick if it was in list with a different case */ irc_channel_nick_speaking_rename_if_present (server, ptr_channel, nick); @@ -4208,7 +4211,7 @@ IRC_PROTOCOL_CALLBACK(353) if (ptr_channel && ptr_channel->nicks) { if (!irc_nick_new (server, ptr_channel, nickname, pos_host, - prefixes, 0, "*", NULL)) + prefixes, 0, NULL, NULL)) { weechat_printf ( server->buffer, @@ -4345,7 +4348,7 @@ IRC_PROTOCOL_CALLBACK(354) free (ptr_nick->account); ptr_nick->account = (ptr_channel && pos_account && server->cap_account_notify) ? - strdup (pos_account) : strdup ("*"); + strdup (pos_account) : NULL; } /* update realname flag for nick */ |