|
@@ -175,17 +175,22 @@ class AndroidMQTT:
|
|
|
|
|
|
def _form_client_id(self) -> bytes:
|
|
|
subscribe_topics = [
|
|
|
- RealtimeTopic.PUBSUB,
|
|
|
- RealtimeTopic.SUB_IRIS_RESPONSE,
|
|
|
- RealtimeTopic.REALTIME_SUB,
|
|
|
- RealtimeTopic.REGION_HINT,
|
|
|
- RealtimeTopic.SEND_MESSAGE_RESPONSE,
|
|
|
- RealtimeTopic.MESSAGE_SYNC,
|
|
|
- RealtimeTopic.UNKNOWN_179,
|
|
|
- RealtimeTopic.UNKNOWN_PP,
|
|
|
+ RealtimeTopic.PUBSUB, # 88
|
|
|
+ RealtimeTopic.SUB_IRIS_RESPONSE, # 135
|
|
|
+ RealtimeTopic.RS_REQ, # 244
|
|
|
+ RealtimeTopic.REALTIME_SUB, # 149
|
|
|
+ RealtimeTopic.REGION_HINT, # 150
|
|
|
+ RealtimeTopic.RS_RESP, # 245
|
|
|
+ RealtimeTopic.T_RTC_LOG, # 274
|
|
|
+ RealtimeTopic.SEND_MESSAGE_RESPONSE, # 133
|
|
|
+ RealtimeTopic.MESSAGE_SYNC, # 146
|
|
|
+ RealtimeTopic.LIGHTSPEED_RESPONSE, # 179
|
|
|
+ RealtimeTopic.UNKNOWN_PP, # 34
|
|
|
]
|
|
|
subscribe_topic_ids = [int(topic.encoded) for topic in subscribe_topics]
|
|
|
- password = f"sessionid={self.state.cookies['sessionid']}"
|
|
|
+ password = f"authorization={self.state.session.authorization}"
|
|
|
+ # if not self.state.session.authorization:
|
|
|
+ # password = f"sessionid={self.state.cookies['sessionid']}"
|
|
|
cfg = RealtimeConfig(
|
|
|
client_identifier=self.state.device.phone_id[:20],
|
|
|
client_info=RealtimeClientInfo(
|
|
@@ -218,7 +223,7 @@ class AndroidMQTT:
|
|
|
"platform": "android",
|
|
|
"ig_mqtt_route": "django",
|
|
|
"pubsub_msg_type_blacklist": "direct, typing_type",
|
|
|
- "auth_cache_enabled": "0",
|
|
|
+ "auth_cache_enabled": "1",
|
|
|
},
|
|
|
)
|
|
|
return zlib.compress(cfg.to_thrift(), level=9)
|
|
@@ -619,7 +624,13 @@ class AndroidMQTT:
|
|
|
resp = await self.request(
|
|
|
RealtimeTopic.SUB_IRIS,
|
|
|
RealtimeTopic.SUB_IRIS_RESPONSE,
|
|
|
- {"seq_id": seq_id, "snapshot_at_ms": snapshot_at_ms},
|
|
|
+ {
|
|
|
+ "seq_id": seq_id,
|
|
|
+ "snapshot_at_ms": snapshot_at_ms,
|
|
|
+ "snapshot_app_version": self.state.application.APP_VERSION,
|
|
|
+ "timezone_offset": int(self.state.device.timezone_offset),
|
|
|
+ "subscription_type": "message",
|
|
|
+ },
|
|
|
timeout=20,
|
|
|
)
|
|
|
self.log.debug("Iris subscribe response: %s", resp.payload.decode("utf-8"))
|