[arch-commits] Commit in purple-facebook/trunk (PKGBUILD fix-taNewMessage-bug.patch)

Balló György bgyorgy at archlinux.org
Wed May 5 17:20:49 UTC 2021


    Date: Wednesday, May 5, 2021 @ 17:20:48
  Author: bgyorgy
Revision: 927808

upgpkg: purple-facebook 0.9.6-4: Apply more upstream fixes

Added:
  purple-facebook/trunk/fix-taNewMessage-bug.patch
Modified:
  purple-facebook/trunk/PKGBUILD

----------------------------+
 PKGBUILD                   |   17 ++++++-----
 fix-taNewMessage-bug.patch |   64 +++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 74 insertions(+), 7 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2021-05-05 17:20:11 UTC (rev 927807)
+++ PKGBUILD	2021-05-05 17:20:48 UTC (rev 927808)
@@ -2,20 +2,23 @@
 
 pkgname=purple-facebook
 pkgver=0.9.6
-pkgrel=3
+pkgrel=4
 pkgdesc='Facebook protocol plugin for libpurple'
 arch=('x86_64')
 url='https://github.com/dequis/purple-facebook'
 license=('GPL')
 depends=('json-glib' 'libpurple')
-source=("https://github.com/dequis/$pkgname/releases/download/v$pkgver/$pkgname-$pkgver.tar.gz")
-sha256sums=('1db6ed9e8f81cbd4ae10d75c04f5393e5cd4ca11ced74408ca6d07c7b888f3f7')
+source=("https://github.com/dequis/$pkgname/releases/download/v$pkgver/$pkgname-$pkgver.tar.gz"
+        'fix-taNewMessage-bug.patch')
+sha256sums=('1db6ed9e8f81cbd4ae10d75c04f5393e5cd4ca11ced74408ca6d07c7b888f3f7'
+            '404ebdf6d47991a00ddf24acc433db024e9c5e7cece52ba36e20ea620b09fb07')
 
 prepare() {
-  cd $pkgname-$pkgver
-  # Bump the FB_ORCA_AGENT version
-  # https://github.com/dequis/purple-facebook/commit/3f4e9500bed9c1a7f9bb6c5381823a4facde6602
-  sed -i 's/192.0.0.31.101/537.0.0.31.101/' pidgin/libpurple/protocols/facebook/api.h
+  cd $pkgname-$pkgver/pidgin
+  # Upstream fixes
+  patch -Np1 -i ../../fix-taNewMessage-bug.patch
+  sed -i 's/192.0.0.31.101/537.0.0.31.101/
+          /FB_API_TCHK(id == 2);/d' libpurple/protocols/facebook/api.h
 }
 
 build() {

Added: fix-taNewMessage-bug.patch
===================================================================
--- fix-taNewMessage-bug.patch	                        (rev 0)
+++ fix-taNewMessage-bug.patch	2021-05-05 17:20:48 UTC (rev 927808)
@@ -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



More information about the arch-commits mailing list