diff options
-rw-r--r-- | facebook/facebook-api.c | 29 | ||||
-rw-r--r-- | facebook/facebook-api.h | 33 |
2 files changed, 50 insertions, 12 deletions
diff --git a/facebook/facebook-api.c b/facebook/facebook-api.c index fb0581d..6783ba4 100644 --- a/facebook/facebook-api.c +++ b/facebook/facebook-api.c @@ -922,23 +922,26 @@ fb_api_cb_mqtt_open(FbMqtt *mqtt, gpointer data) ? fb_api_get_agent_string(priv->tweak, 1) : FB_API_MQTT_AGENT); - /* Write the UNKNOWN ("cp"?) */ + /* Write the client capabilities */ fb_thrift_write_field(thft, FB_THRIFT_TYPE_I64, 3, 2); - fb_thrift_write_i64(thft, 23); + fb_thrift_write_i64(thft, FB_CP_ACKNOWLEDGED_DELIVERY | + FB_CP_PROCESSING_LASTACTIVE_PRESENCEINFO | + FB_CP_EXACT_KEEPALIVE | + FB_CP_DELTA_SENT_MESSAGE_ENABLED); - /* Write the UNKNOWN ("ecp"?) */ + /* Write the endpoint capabilitites */ fb_thrift_write_field(thft, FB_THRIFT_TYPE_I64, 4, 3); fb_thrift_write_i64(thft, 26); - /* Write the UNKNOWN */ + /* Write the publish payload format (deflate) */ fb_thrift_write_field(thft, FB_THRIFT_TYPE_I32, 5, 4); fb_thrift_write_i32(thft, 1); - /* Write the UNKNOWN ("no_auto_fg"?) */ + /* Write the noAutomaticForeground flag */ fb_thrift_write_field(thft, FB_THRIFT_TYPE_BOOL, 6, 5); fb_thrift_write_bool(thft, TRUE); - /* Write the visibility state */ + /* Write the visibility state (makeUserAvailableInForeground flag) */ fb_thrift_write_field(thft, FB_THRIFT_TYPE_BOOL, 7, 6); fb_thrift_write_bool(thft, !priv->invisible); @@ -946,15 +949,15 @@ fb_api_cb_mqtt_open(FbMqtt *mqtt, gpointer data) fb_thrift_write_field(thft, FB_THRIFT_TYPE_STRING, 8, 7); fb_thrift_write_str(thft, priv->did); - /* Write the UNKNOWN ("fg"?) */ + /* Write the isInitiallyForeground flag */ fb_thrift_write_field(thft, FB_THRIFT_TYPE_BOOL, 9, 8); fb_thrift_write_bool(thft, TRUE); - /* Write the UNKNOWN ("nwt"?) */ + /* Write the network type (WIFI) */ fb_thrift_write_field(thft, FB_THRIFT_TYPE_I32, 10, 9); fb_thrift_write_i32(thft, 1); - /* Write the UNKNOWN ("nwst"?) */ + /* Write the network subtype (none) */ fb_thrift_write_field(thft, FB_THRIFT_TYPE_I32, 11, 10); fb_thrift_write_i32(thft, 0); @@ -962,16 +965,18 @@ fb_api_cb_mqtt_open(FbMqtt *mqtt, gpointer data) fb_thrift_write_field(thft, FB_THRIFT_TYPE_I64, 12, 11); fb_thrift_write_i64(thft, priv->mid); - /* Write the UNKNOWN */ + /* Write the list of topics to subscribe */ fb_thrift_write_field(thft, FB_THRIFT_TYPE_LIST, 14, 12); fb_thrift_write_list(thft, FB_THRIFT_TYPE_I32, 0); + + /* Write the STOP for the struct */ fb_thrift_write_stop(thft); /* Write the token */ - fb_thrift_write_field(thft, FB_THRIFT_TYPE_STRING, 15, 14); + fb_thrift_write_field(thft, FB_THRIFT_TYPE_STRING, 5, 4); fb_thrift_write_str(thft, priv->token); - /* Write the STOP for the struct */ + /* Write the STOP for the message */ fb_thrift_write_stop(thft); bytes = fb_thrift_get_bytes(thft); diff --git a/facebook/facebook-api.h b/facebook/facebook-api.h index 3ed0e41..621800f 100644 --- a/facebook/facebook-api.h +++ b/facebook/facebook-api.h @@ -447,6 +447,39 @@ typedef enum } FbApiMessageFlags; /** +* FbApiClientCapabilities: +* @FB_CP_ACKNOWLEDGED_DELIVERY: +* @FB_CP_PROCESSING_LASTACTIVE_PRESENCEINFO: +* @FB_CP_EXACT_KEEPALIVE: +* @FB_CP_REQUIRES_JSON_UNICODE_ESCAPES: +* @FB_CP_DELTA_SENT_MESSAGE_ENABLED: +* @FB_CP_USE_ENUM_TOPIC: All topics are numeric. +* @FB_CP_SUPPRESS_GETDIFF_IN_CONNECT: +* @FB_CP_USE_THRIFT_FOR_INBOX: +* @FB_CP_USE_SEND_PINGRESP: +* @FB_CP_REQUIRE_REPLAY_PROTECTION: +* @FB_CP_DATA_SAVING_MODE: +* @FB_CP_TYPING_OFF_WHEN_SENDING_MESSAGE: +* +* The client capabilities. +*/ +typedef enum +{ + FB_CP_ACKNOWLEDGED_DELIVERY = 1 << 0, + FB_CP_PROCESSING_LASTACTIVE_PRESENCEINFO = 1 << 1, + FB_CP_EXACT_KEEPALIVE = 1 << 2, + FB_CP_REQUIRES_JSON_UNICODE_ESCAPES = 1 << 3, + FB_CP_DELTA_SENT_MESSAGE_ENABLED = 1 << 4, + FB_CP_USE_ENUM_TOPIC = 1 << 5, + FB_CP_SUPPRESS_GETDIFF_IN_CONNECT = 1 << 6, + FB_CP_USE_THRIFT_FOR_INBOX = 1 << 7, + FB_CP_USE_SEND_PINGRESP = 1 << 8, + FB_CP_REQUIRE_REPLAY_PROTECTION = 1 << 9, + FB_CP_DATA_SAVING_MODE = 1 << 10, + FB_CP_TYPING_OFF_WHEN_SENDING_MESSAGE = 1 << 11 +} FbApiClientCapabilities; + +/** * FbApi: * * Represents a Facebook Messenger connection. |