/soc/2015/jgeboski/facebook: 53db47311bda: facebook: fixed unrea...

James Geboski <[email protected]>
Newsgroups gmane.comp.gnome.gaim.cvs
Message-ID <[email protected]>
Changeset: 53db47311bda398c9c238c410e6c53a3581cccfd
Author:	 James Geboski <[email protected]>
Date:	 2015-08-10 01:12 -0400
Branch:	 facebook
URL: https://hg.pidgin.im/soc/2015/jgeboski/facebook/rev/53db47311bda

Description:

facebook: fixed unread messages for group chats

diffstat:

 libpurple/protocols/facebook/api.c |  11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diffs (38 lines):

diff --git a/libpurple/protocols/facebook/api.c b/libpurple/protocols/facebook/api.c
--- a/libpurple/protocols/facebook/api.c
+++ b/libpurple/protocols/facebook/api.c
@@ -1749,6 +1749,7 @@ fb_api_cb_unread_msgs(PurpleHttpConnecti
 	FbApi *api = data;
 	FbApiMessage msg;
 	FbHttpParams *params;
+	FbId tid;
 	FbJsonValues *values;
 	GError *err = NULL;
 	gpointer mptr;
@@ -1782,9 +1783,9 @@ fb_api_cb_unread_msgs(PurpleHttpConnecti
 
 	fb_api_message_reset(&msg, FALSE);
 	str = fb_json_values_next_str(values, "0");
-	msg.tid = FB_ID_FROM_STR(str);
-
+	tid = FB_ID_FROM_STR(str);
 	fb_json_values_free(values);
+
 	values = fb_json_values_new(node);
 	fb_json_values_add(values, FB_JSON_TYPE_BOOL, TRUE, "$.unread");
 	fb_json_values_add(values, FB_JSON_TYPE_STR, TRUE,
@@ -1798,10 +1799,12 @@ fb_api_cb_unread_msgs(PurpleHttpConnecti
 			continue;
 		}
 
+		str = fb_json_values_next_str(values, "0");
+		body = fb_json_values_next_str(values, NULL);
+
 		fb_api_message_reset(&msg, FALSE);
-		str = fb_json_values_next_str(values, NULL);
 		msg.uid = FB_ID_FROM_STR(str);
-		body = fb_json_values_next_str(values, NULL);
+		msg.tid = tid;
 
 		if (body != NULL) {
 			msg.text = g_strdup(body);

_______________________________________________
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.