diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2015-01-25 15:23:39 +0100 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2015-01-25 15:23:39 +0100 |
commit | fad11a6b937a5484b680df60ba15c450ea69f785 (patch) | |
tree | 7c212c0d1426e69a35179a191bdfbea12904808d /src/plugins | |
parent | 055d7de721d02f58ba80cfb945bb981947fc239d (diff) | |
download | weechat-fad11a6b937a5484b680df60ba15c450ea69f785.zip |
irc: remove useless save of variables in irc_nick_new() when updating nick
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/irc/irc-nick.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/plugins/irc/irc-nick.c b/src/plugins/irc/irc-nick.c index 92940a6db..54f0c6bd1 100644 --- a/src/plugins/irc/irc-nick.c +++ b/src/plugins/irc/irc-nick.c @@ -639,19 +639,15 @@ irc_nick_new (struct t_irc_server *server, struct t_irc_channel *channel, ptr_nick = irc_nick_search (server, channel, nickname); if (ptr_nick) { - /* save away status from existing nick (before removing it) */ - away = ptr_nick->away; - - /* save account from existing nick (before removing it) */ - account = ptr_nick->account; - /* remove old nick from nicklist */ irc_nick_nicklist_remove (server, channel, ptr_nick); /* update nick */ irc_nick_set_prefixes (server, ptr_nick, prefixes); ptr_nick->away = away; - ptr_nick->account = account; + if (ptr_nick->account) + free (ptr_nick->account); + ptr_nick->account = (account) ? strdup (account) : NULL; /* add new nick in nicklist */ irc_nick_nicklist_add (server, channel, ptr_nick); |