1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-01 15:26:37 +02:00

irc: track realnames using extended-join and WHO

This commit is contained in:
Max Teufel
2015-03-07 15:12:48 +01:00
parent a83ad08c48
commit e00d7f2bfd
6 changed files with 50 additions and 5 deletions
+25 -2
View File
@@ -473,6 +473,10 @@ IRC_PROTOCOL_CALLBACK(cap)
{
server->cap_account_notify = 1;
}
else if (strcmp (caps_supported[i], "extended-join") == 0)
{
server->cap_extended_join = 1;
}
}
weechat_string_free_split (caps_supported);
}
@@ -743,7 +747,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_account) ? pos_account : "*", (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);
@@ -4085,6 +4089,15 @@ IRC_PROTOCOL_CALLBACK(352)
(pos_attr[0] == 'G') ? 1 : 0);
}
/* update realname flag for nick */
if (ptr_channel && ptr_nick && pos_realname)
{
if (ptr_nick->realname)
free (ptr_nick->realname);
ptr_nick->realname = (pos_realname && server->cap_extended_join) ?
strdup (pos_realname) : NULL;
}
/* display output of who (manual who from user) */
if (!ptr_channel || (ptr_channel->checking_whox <= 0))
{
@@ -4195,7 +4208,7 @@ IRC_PROTOCOL_CALLBACK(353)
if (ptr_channel && ptr_channel->nicks)
{
if (!irc_nick_new (server, ptr_channel, nickname, pos_host,
prefixes, 0, "*"))
prefixes, 0, "*", NULL))
{
weechat_printf (
server->buffer,
@@ -4335,6 +4348,16 @@ IRC_PROTOCOL_CALLBACK(354)
strdup (pos_account) : strdup ("*");
}
/* update realname flag for nick */
if (ptr_nick)
{
if (ptr_nick->realname)
free (ptr_nick->realname);
ptr_nick->realname = (ptr_channel && pos_realname
&& server->cap_extended_join) ?
strdup (pos_realname) : NULL;
}
/* display output of who (manual who from user) */
if (!ptr_channel || (ptr_channel->checking_whox <= 0))
{