pidgin/pidgin

Set realname and identname to nickname by default in IRC
release-2.x.y
2022-04-21, Belgin Știrbu
770040cb6000
Parents 1eb2029a50c1
Children ed2b25ccdf2c
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/
--- 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;
--- a/libpurple/protocols/irc/irc.h Mon Apr 18 21:20:36 2022 -0500
+++ b/libpurple/protocols/irc/irc.h Thu Apr 21 20:19:21 2022 -0500
@@ -40,7 +40,6 @@
#define IRC_DEFAULT_CHARSET "UTF-8"
#define IRC_DEFAULT_AUTODETECT FALSE
-#define IRC_DEFAULT_ALIAS "purple"
#define IRC_DEFAULT_QUIT "Leaving."