/soc/2015/jgeboski/facebook: 53db47311bda: facebook: fixed unrea...
James Geboski
jgeboski at gmail.com
Mon Aug 10 01:13:42 EDT 2015
Changeset: 53db47311bda398c9c238c410e6c53a3581cccfd
Author: James Geboski <jgeboski at gmail.com>
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);
More information about the Commits
mailing list