Skip to content

Commit

Permalink
Send orca-formatted user agent for all HTTP requests too
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dequis committed Mar 30, 2017
1 parent 797b620 commit 2f17542
Showing 1 changed file with 19 additions and 9 deletions.
28 changes: 19 additions & 9 deletions facebook/facebook-api.h
Original file line number Diff line number Diff line change
Expand Up @@ -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


/**
Expand Down

0 comments on commit 2f17542

Please sign in to comment.