Thu, 21 Apr 2022 20:19:21 -0500
Set realname and identname to nickname by default in IRC
If the user doesn't set a realname or identname, use the nickname.
Testing Done:
Tested several nicknames on IRC.
Bugs closed: PIDGIN-17610
Reviewed at https://reviews.imfreedom.org/r/1386/
| libpurple/protocols/irc/irc.c | file | annotate | diff | comparison | revisions | |
| libpurple/protocols/irc/irc.h | file | annotate | diff | comparison | revisions |
--- a/libpurple/protocols/irc/irc.c Mon Apr 18 21:20:36 2022 -0500 +++ b/libpurple/protocols/irc/irc.c Thu Apr 21 20:19:21 2022 -0500 @@ -426,9 +426,10 @@ realname = purple_account_get_string(irc->account, "realname", ""); identname = purple_account_get_string(irc->account, "username", ""); + nickname = purple_connection_get_display_name(gc); if (identname == NULL || *identname == '\0') { - identname = g_get_user_name(); + identname = nickname; } if (identname != NULL && strchr(identname, ' ') != NULL) { @@ -446,7 +447,7 @@ } buf = irc_format(irc, "vvvv:", "USER", tmp ? tmp : identname, "*", server, - strlen(realname) ? realname : IRC_DEFAULT_ALIAS); + strlen(realname) ? realname : nickname); g_free(tmp); g_free(server); if (irc_send(irc, buf) < 0) { @@ -454,7 +455,7 @@ return FALSE; } g_free(buf); - nickname = purple_connection_get_display_name(gc); + buf = irc_format(irc, "vn", "NICK", nickname); irc->reqnick = g_strdup(nickname); irc->nickused = FALSE;