Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/dequis/purple-facebook.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEion Robb <eion@robbmob.com>2020-10-21 01:38:02 +0300
committerGitHub <noreply@github.com>2020-10-21 01:38:02 +0300
commit7aa7aa1e96358cbe20cbe596f9e5e07f0e2cb348 (patch)
treede11117d963e341d8e33d444050875d3f2383e75
parent106d7acac2618c4348512c4feb52f1f43d11f724 (diff)
parent868f4e3025d60a2d0c9cd2b42983c7192c79d206 (diff)
Merge pull request #497 from baltitenger/master
Fix taNewMessage bug
-rw-r--r--patches/19-fix-taNewMessage-bug.patch64
1 files changed, 64 insertions, 0 deletions
diff --git a/patches/19-fix-taNewMessage-bug.patch b/patches/19-fix-taNewMessage-bug.patch
new file mode 100644
index 0000000..3c9593b
--- /dev/null
+++ b/patches/19-fix-taNewMessage-bug.patch
@@ -0,0 +1,64 @@
+--- a/libpurple/protocols/facebook/api.c
++++ b/libpurple/protocols/facebook/api.c
+@@ -1502,6 +1502,23 @@
+ fb_api_cb_publish_ms_event(FbApi *api, JsonNode *root, GSList *events, FbApiEventType type, GError **error);
+
+ static void
++fb_api_cb_publish_mst(FbThrift *thft, GError **error)
++{
++ if (fb_thrift_read_isstop(thft)) {
++ FB_API_TCHK(fb_thrift_read_stop(thft));
++ } else {
++ FbThriftType type;
++ gint16 id;
++
++ FB_API_TCHK(fb_thrift_read_field(thft, &type, &id, 0));
++ FB_API_TCHK(type == FB_THRIFT_TYPE_STRING);
++ FB_API_TCHK(id == 2);
++ FB_API_TCHK(fb_thrift_read_str(thft, NULL));
++ FB_API_TCHK(fb_thrift_read_stop(thft));
++ }
++}
++
++static void
+ fb_api_cb_publish_ms(FbApi *api, GByteArray *pload)
+ {
+ const gchar *data;
+@@ -1531,10 +1548,14 @@
+
+ /* Read identifier string (for Facebook employees) */
+ thft = fb_thrift_new(pload, 0);
+- fb_thrift_read_str(thft, NULL);
++ fb_api_cb_publish_mst(thft, &err);
+ size = fb_thrift_get_pos(thft);
+ g_object_unref(thft);
+
++ FB_API_ERROR_EMIT(api, err,
++ return;
++ );
++
+ g_return_if_fail(size < pload->len);
+ data = (gchar *) pload->data + size;
+ size = pload->len - size;
+@@ -1844,8 +1865,8 @@
+ pres->active = i32 != 0;
+ *press = g_slist_prepend(*press, pres);
+
+- fb_util_debug_info("Presence: %" FB_ID_FORMAT " (%d)",
+- i64, i32 != 0);
++ fb_util_debug_info("Presence: %" FB_ID_FORMAT " (%d) id: %d",
++ i64, i32 != 0, id);
+
+ while (id <= 6) {
+ if (fb_thrift_read_isstop(thft)) {
+@@ -1894,7 +1915,9 @@
+ }
+
+ /* Read the field stop */
+- FB_API_TCHK(fb_thrift_read_stop(thft));
++ if (fb_thrift_read_isstop(thft)) {
++ FB_API_TCHK(fb_thrift_read_stop(thft));
++ }
+ }
+
+ static void