irc: update host of nicks on manual /who

This commit is contained in:
Sebastien Helleu 2011-06-16 18:31:56 +02:00
parent 52d7770ff1
commit 6015f51b33
2 changed files with 20 additions and 12 deletions

View File

@ -1,7 +1,7 @@
WeeChat ChangeLog
=================
Sébastien Helleu <flashcode@flashtux.org>
v0.3.6-dev, 2011-06-15
v0.3.6-dev, 2011-06-16
Version 0.3.6 (under dev!)
@ -16,6 +16,7 @@ Version 0.3.6 (under dev!)
/window scroll_horiz) (task #11112)
* api: fix bug with function config_set_desc_plugin (use immediately
description for option when function is called)
* irc: update host of nicks on manual /who
* irc: fix memory leak on plugin unload (free ignores)
* irc: fix memory leak in message parser (when called from other plugins like
relay) (bug #33387)

View File

@ -3412,24 +3412,31 @@ IRC_PROTOCOL_CALLBACK(352)
}
ptr_channel = irc_channel_search (server, argv[3]);
ptr_nick = (ptr_channel) ? irc_nick_search (ptr_channel, argv[7]) : NULL;
/* update host for nick */
if (ptr_nick)
{
if (ptr_nick->host)
free (ptr_nick->host);
length = strlen (argv[4]) + 1 + strlen (argv[5]) + 1;
ptr_nick->host = malloc (length);
if (ptr_nick->host)
snprintf (ptr_nick->host, length, "%s@%s", argv[4], argv[5]);
}
if (ptr_channel && (ptr_channel->checking_away > 0))
{
ptr_nick = irc_nick_search (ptr_channel, argv[7]);
if (ptr_nick)
if (ptr_nick && pos_attr)
{
if (ptr_nick->host)
free (ptr_nick->host);
length = strlen (argv[4]) + 1 + strlen (argv[5]) + 1;
ptr_nick->host = malloc (length);
if (ptr_nick->host)
snprintf (ptr_nick->host, length, "%s@%s", argv[4], argv[5]);
if (pos_attr)
irc_nick_set_away (server, ptr_channel, ptr_nick,
(pos_attr[0] == 'G') ? 1 : 0);
/* (re)set away flag */
irc_nick_set_away (server, ptr_channel, ptr_nick,
(pos_attr[0] == 'G') ? 1 : 0);
}
}
else
{
/* display output of who (manual who from user) */
weechat_printf_tags (irc_msgbuffer_get_target_buffer (server, NULL,
command, "who",
NULL),