Implement support for the IRCv3 SETNAME specification. (#2571)

This commit is contained in:
Sadie Powell 2021-05-23 19:12:10 +01:00 committed by GitHub
parent f0554b27df
commit e4fd69e3d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 1 deletions

View File

@ -1724,6 +1724,7 @@ static const char * const supported_caps[] = {
"userhost-in-names", "userhost-in-names",
"cap-notify", "cap-notify",
"chghost", "chghost",
"setname",
/* ZNC */ /* ZNC */
"znc.in/server-time-iso", "znc.in/server-time-iso",

View File

@ -1157,6 +1157,11 @@ process_named_msg (session *sess, char *type, char *word[], char *word_eol[],
NULL, 0xff, tags_data); NULL, 0xff, tags_data);
return; return;
case WORDL('S', 'E', 'T', 'N'):
inbound_user_info (sess, NULL, NULL, NULL, NULL, nick, STRIP_COLON(word, word_eol, 3),
NULL, 0xff, tags_data);
return;
case WORDL('I','N','V','I'): case WORDL('I','N','V','I'):
if (ignore_check (word[1], IG_INVI)) if (ignore_check (word[1], IG_INVI))
return; return;

View File

@ -130,8 +130,11 @@ userlist_add_hostname (struct session *sess, char *nick, char *hostname,
g_free (user->hostname); g_free (user->hostname);
user->hostname = g_strdup (hostname); user->hostname = g_strdup (hostname);
} }
if (!user->realname && realname && *realname) if (realname && *realname && g_strcmp0 (user->realname, realname) != 0)
{
g_free (user->realname);
user->realname = g_strdup (realname); user->realname = g_strdup (realname);
}
if (!user->servername && servername) if (!user->servername && servername)
user->servername = g_strdup (servername); user->servername = g_strdup (servername);
if (!user->account && account && strcmp (account, "0") != 0) if (!user->account && account && strcmp (account, "0") != 0)