summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMax Teufel <max@teufelsnetz.com>2015-03-07 15:21:38 +0100
committerMax Teufel <max@teufelsnetz.com>2015-03-07 16:09:40 +0100
commit522b04155a34242cebbfca5ca9ef5e74eb9798c9 (patch)
treeb66151d6afc7a0df2aa63fc930185fa7ee89b689 /src
parentc591404b40872c7e48166e1d687c833813fbf90d (diff)
downloadweechat-522b04155a34242cebbfca5ca9ef5e74eb9798c9.zip
irc: use NULL instead of "*" for unidentified nicks
Diffstat (limited to 'src')
-rw-r--r--src/plugins/irc/irc-channel.c2
-rw-r--r--src/plugins/irc/irc-protocol.c13
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 */