/pidgin/main: e3828a8b7988: facebook: fixed group chat join mess...

James Geboski jgeboski at gmail.com
Thu Jan 14 16:46:42 EST 2016


Changeset: e3828a8b7988a5acad4da77a2912f35d64361c03
Author:	 James Geboski <jgeboski at gmail.com>
Date:	 2016-01-14 16:29 -0500
Branch:	 default
URL: https://hg.pidgin.im/pidgin/main/rev/e3828a8b7988

Description:

facebook: fixed group chat join messages with incoming messages

When a group chat is opened because of an incoming message, it still
spams join messages for each of the users. This should act just as it
does if the group chat is explicitly opened, where all joining messages
are hidden from the user initially.

diffstat:

 libpurple/protocols/facebook/facebook.c |  11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diffs (23 lines):

diff --git a/libpurple/protocols/facebook/facebook.c b/libpurple/protocols/facebook/facebook.c
--- a/libpurple/protocols/facebook/facebook.c
+++ b/libpurple/protocols/facebook/facebook.c
@@ -607,10 +607,17 @@ fb_cb_api_thread(FbApi *api, FbApiThread
 	FB_ID_TO_STR(thrd->tid, tid);
 
 	chat = purple_conversations_find_chat_with_account(tid, acct);
-	active = (chat != NULL) && !purple_chat_conversation_has_left(chat);
 
-	if (!active) {
+	if ((chat == NULL) || purple_chat_conversation_has_left(chat)) {
 		chat = purple_serv_got_joined_chat(gc, id, tid);
+		active = FALSE;
+	} else {
+		/* If there are no users in the group chat, including
+		 * the local user, then the group chat has yet to be
+		 * setup by this function. As a result, any group chat
+		 * without users is inactive.
+		 */
+		active = purple_chat_conversation_get_users_count(chat) > 0;
 	}
 
 	name = purple_account_get_username(acct);



More information about the Commits mailing list