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

James Geboski <[email protected]>
Newsgroups gmane.comp.gnome.gaim.cvs
Message-ID <[email protected]>
Changeset: e3828a8b7988a5acad4da77a2912f35d64361c03
Author:	 James Geboski <[email protected]>
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);

_______________________________________________
Commits mailing list
[email protected]
https://pidgin.im/cgi-bin/mailman/listinfo/commits
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.