From 1c857c1bdce235a31e1856e098ae62c0a9902f4e Mon Sep 17 00:00:00 2001 From: David Woodhouse Date: Fri, 16 Mar 2018 22:36:26 +0000 Subject: [PATCH 3/7] Pidgin: use alias from existing PurpleConvChatBuddy, don't make one up Since the PRPL can provide aliases and libpurple passes them on, there's no good reason why Pidgin should be ignoring that and trying to make them up for itself. Fixes #17295 --- pidgin/gtkconv.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/pidgin/gtkconv.c b/pidgin/gtkconv.c index 74dbe69..10eaf82 100644 --- a/pidgin/gtkconv.c +++ b/pidgin/gtkconv.c @@ -4419,13 +4419,16 @@ update_chat_alias(PurpleBuddy *buddy, PurpleConversation *conv, PurpleConnection const char *alias = name; char *tmp; char *alias_key = NULL; - PurpleBuddy *buddy2; if (!purple_strequal(chat->nick, purple_normalize(conv->account, name))) { /* This user is not me, so look into updating the alias. */ - - if ((buddy2 = purple_find_buddy(conv->account, name)) != NULL) { - alias = purple_buddy_get_contact_alias(buddy2); + GList *users = purple_conv_chat_get_users(PURPLE_CONV_CHAT(conv)); + for (; users; users = users->next) { + PurpleConvChatBuddy *cb = users->data; + if (purple_strequal(name, cb->name)) { + alias = cb->alias; + break; + } } tmp = g_utf8_casefold(alias, -1); -- 2.7.4