Теперь мы не должны отправлять 128 опкод самому себе. вроде
This commit is contained in:
parent
ef512b060f
commit
8d7a1dacb5
|
|
@ -71,6 +71,7 @@ class OnemeMobileController(ControllerBase):
|
||||||
)
|
)
|
||||||
|
|
||||||
# Отправляем пакет
|
# Отправляем пакет
|
||||||
|
if writer != eventData.get("writer"):
|
||||||
writer.write(packet)
|
writer.write(packet)
|
||||||
await writer.drain()
|
await writer.drain()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,12 +10,12 @@ class UserAgentModel(pydantic.BaseModel):
|
||||||
pushDeviceType: str
|
pushDeviceType: str
|
||||||
arch: str = None
|
arch: str = None
|
||||||
locale: str
|
locale: str
|
||||||
buildNumber: int
|
buildNumber: int = None
|
||||||
deviceName: str
|
deviceName: str
|
||||||
deviceLocale: str
|
deviceLocale: str
|
||||||
|
|
||||||
class HelloPayloadModel(pydantic.BaseModel):
|
class HelloPayloadModel(pydantic.BaseModel):
|
||||||
clientSessionId: int
|
clientSessionId: int = None
|
||||||
mt_instanceid: str = None
|
mt_instanceid: str = None
|
||||||
userAgent: UserAgentModel
|
userAgent: UserAgentModel
|
||||||
deviceId: str
|
deviceId: str
|
||||||
|
|
|
||||||
|
|
@ -525,10 +525,6 @@ class Processors:
|
||||||
"time": int(time.time() * 1000)
|
"time": int(time.time() * 1000)
|
||||||
}
|
}
|
||||||
|
|
||||||
print(
|
|
||||||
json.dumps(payload, indent=4)
|
|
||||||
)
|
|
||||||
|
|
||||||
# Собираем пакет
|
# Собираем пакет
|
||||||
packet = self.proto.pack_packet(
|
packet = self.proto.pack_packet(
|
||||||
cmd=self.proto.CMD_OK, seq=seq, opcode=self.opcodes.LOGIN, payload=payload
|
cmd=self.proto.CMD_OK, seq=seq, opcode=self.opcodes.LOGIN, payload=payload
|
||||||
|
|
@ -692,7 +688,8 @@ class Processors:
|
||||||
"chatId": 0 if chatId == senderId else chatId,
|
"chatId": 0 if chatId == senderId else chatId,
|
||||||
"message": bodyMessage,
|
"message": bodyMessage,
|
||||||
"prevMessageId": lastMessageId,
|
"prevMessageId": lastMessageId,
|
||||||
"time": messageTime
|
"time": messageTime,
|
||||||
|
"writer": writer
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -1263,7 +1260,8 @@ class Processors:
|
||||||
user.get('id'),
|
user.get('id'),
|
||||||
{
|
{
|
||||||
"eventType": "profile_updated",
|
"eventType": "profile_updated",
|
||||||
"profile": profile
|
"profile": profile,
|
||||||
|
"writer": writer
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue