summaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2011-06-16 18:31:56 +0200
committerSebastien Helleu <flashcode@flashtux.org>2011-06-16 18:31:56 +0200
commit6015f51b334cc881d3fbebc93267fc4bb4e5225f (patch)
tree74b265d332020c64b6452519283b999a1f2e2f23 /src/plugins
parent52d7770ff1788afe22141537b826505fe070548f (diff)
downloadweechat-6015f51b334cc881d3fbebc93267fc4bb4e5225f.zip
irc: update host of nicks on manual /who
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/irc/irc-protocol.c29
1 files changed, 18 insertions, 11 deletions
diff --git a/src/plugins/irc/irc-protocol.c b/src/plugins/irc/irc-protocol.c
index 7e7ad300e..f65e5537f 100644
--- a/src/plugins/irc/irc-protocol.c
+++ b/src/plugins/irc/irc-protocol.c
@@ -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),