From 2f17542c7a866f1963b0b51b01736652d53dd70d Mon Sep 17 00:00:00 2001 From: dequis Date: Thu, 30 Mar 2017 00:53:46 -0300 Subject: [PATCH] Send orca-formatted user agent for all HTTP requests too Fixes "Failed to parse thread information" errors when joining channels. Facebook rolled a hotfix update today and they are requiring the same user agent for HTTP requests too. As far as I can see the main affected request is ThreadQuery. Hopefully this also solves issues some a tiny minority of people were still having with sync sequence ids. --- facebook/facebook-api.h | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/facebook/facebook-api.h b/facebook/facebook-api.h index fa38d3d..7236b48 100644 --- a/facebook/facebook-api.h +++ b/facebook/facebook-api.h @@ -88,27 +88,37 @@ */ #define FB_API_SECRET "374e60f8b9bb6b8cbb30f78030438895" +/** + * FB_ORCA_AGENT + * + * The part of the user agent that looks like the official client, since the + * server started checking this. + * + * We announce ourselves as compatible with Orca-Android 38.0 since that's the + * closest version to the last major protocol update. Some parts use older + * features, some parts use newer ones. + * + * Fun fact: this version sends old-style MQIsdp CONNECT messages for the first + * connection, with JSON payloads instead of compressed thrift. + * + */ + +#define FB_ORCA_AGENT "[FBAN/Orca-Android;FBAV/38.0.0.22.155;FBBV/14477681]" + /** * FB_API_AGENT: * * The HTTP User-Agent header. */ -#define FB_API_AGENT "Facebook plugin / BitlBee / " PACKAGE_VERSION +#define FB_API_AGENT "Facebook plugin / BitlBee / " PACKAGE_VERSION " " FB_ORCA_AGENT /** * FB_API_MQTT_AGENT * * The client information string sent in the MQTT CONNECT message - * - * We announce ourselves as compatible with Orca-Android 38.0 since that's the - * closest version to the last major protocol update. Some parts use older - * features, some parts use newer ones. - * - * Fun fact: this version sends old-style MQIsdp CONNECT messages for the first - * connection, with JSON payloads instead of compressed thrift. */ -#define FB_API_MQTT_AGENT FB_API_AGENT " [FBAN/Orca-Android;FBAV/38.0.0.22.155;FBBV/14477681]" +#define FB_API_MQTT_AGENT FB_API_AGENT /**