--- a/libpurple/purplechatuser.c Fri Dec 04 02:56:46 2020 -0600
+++ b/libpurple/purplechatuser.c Fri Dec 04 02:57:01 2020 -0600
@@ -1,5 +1,6 @@
+ * Purple - Internet Messaging Library + * Copyright (C) Pidgin Developers <devel@pidgin.im> * Purple is the legal property of its developers, whose names are too numerous
* to list here. Please refer to the COPYRIGHT file distributed with this
@@ -25,22 +26,18 @@
PurpleChatConversation *chat; /* The chat */
gchar *name; /* The chat participant's name in the
gchar *alias; /* The chat participant's alias, if known;
- gchar *alias_key; /* A string by which this user will be
- sorted, or @c NULL if the user should be
- (This is currently always NULL. */
gboolean buddy; /* TRUE if this chat participant is on
the buddy list; FALSE otherwise. */
PurpleChatUserFlags flags; /* A bitwise OR of flags for this
participant, such as whether they
are a channel operator. */
@@ -133,6 +130,7 @@
purple_chat_user_init(PurpleChatUser *user) {
+ user->constructed = FALSE; @@ -148,6 +146,8 @@
if(purple_blist_find_buddy(account, chat_user->name) != NULL) {
+ chat_user->constructed = TRUE; @@ -155,7 +155,6 @@
PurpleChatUser *chat_user = PURPLE_CHAT_USER(object);
g_free(chat_user->alias);
- g_free(chat_user->alias_key);
G_OBJECT_CLASS(purple_chat_user_parent_class)->finalize(object);
@@ -253,9 +252,15 @@
g_object_notify_by_pspec(G_OBJECT(chat_user), properties[PROP_FLAGS]);
- ops = purple_conversation_get_ui_ops(PURPLE_CONVERSATION(chat_user->chat));
- if(ops != NULL && ops->chat_update_user != NULL) {
- ops->chat_update_user(chat_user);
+ /* Only update the UI once the object is fully constructed. This avoids an + * issue where at least with XMPP, user names will be duplicated in the + if(chat_user->constructed) { + ops = purple_conversation_get_ui_ops(PURPLE_CONVERSATION(chat_user->chat)); + if(ops != NULL && ops->chat_update_user != NULL) { + ops->chat_update_user(chat_user); purple_signal_emit(purple_conversations_get_handle(),
@@ -323,15 +328,15 @@
/* figure out what name we need to check for user a */
/* figure out what name we need to check for user b */
--- a/libpurple/purplechatuser.h Fri Dec 04 02:56:46 2020 -0600
+++ b/libpurple/purplechatuser.h Fri Dec 04 02:57:01 2020 -0600
@@ -1,5 +1,6 @@
+ * Purple - Internet Messaging Library + * Copyright (C) Pidgin Developers <devel@pidgin.im> * Purple is the legal property of its developers, whose names are too numerous
* to list here. Please refer to the COPYRIGHT file distributed with this
@@ -63,7 +64,6 @@
PURPLE_CHAT_USER_FOUNDER = 0x0008,
PURPLE_CHAT_USER_TYPING = 0x0010,
PURPLE_CHAT_USER_AWAY = 0x0020
@@ -84,6 +84,8 @@
#include <libpurple/conversationtypes.h>
* @chat: The chat that the buddy belongs to.
@@ -192,4 +194,6 @@
gint purple_chat_user_compare(PurpleChatUser *a, PurpleChatUser *b);
#endif /* PURPLE_CHAT_USER_H */