Теперь мы не должны отправлять 128 опкод самому себе. вроде

This commit is contained in:
Alexey Polyakov 2026-03-22 16:51:31 +03:00
parent ef512b060f
commit 8d7a1dacb5
3 changed files with 9 additions and 10 deletions

View File

@ -71,8 +71,9 @@ class OnemeMobileController(ControllerBase):
) )
# Отправляем пакет # Отправляем пакет
writer.write(packet) if writer != eventData.get("writer"):
await writer.drain() writer.write(packet)
await writer.drain()
def launch(self, api): def launch(self, api):
async def _start_all(): async def _start_all():

View File

@ -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

View File

@ -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
} }
) )