mirror of
https://github.com/openmax-server/server.git
synced 2026-05-22 19:41:41 +03:00
Теперь мы не должны отправлять 128 опкод самому себе. вроде
This commit is contained in:
@@ -71,8 +71,9 @@ class OnemeMobileController(ControllerBase):
|
||||
)
|
||||
|
||||
# Отправляем пакет
|
||||
writer.write(packet)
|
||||
await writer.drain()
|
||||
if writer != eventData.get("writer"):
|
||||
writer.write(packet)
|
||||
await writer.drain()
|
||||
|
||||
def launch(self, api):
|
||||
async def _start_all():
|
||||
|
||||
@@ -10,12 +10,12 @@ class UserAgentModel(pydantic.BaseModel):
|
||||
pushDeviceType: str
|
||||
arch: str = None
|
||||
locale: str
|
||||
buildNumber: int
|
||||
buildNumber: int = None
|
||||
deviceName: str
|
||||
deviceLocale: str
|
||||
|
||||
class HelloPayloadModel(pydantic.BaseModel):
|
||||
clientSessionId: int
|
||||
clientSessionId: int = None
|
||||
mt_instanceid: str = None
|
||||
userAgent: UserAgentModel
|
||||
deviceId: str
|
||||
|
||||
@@ -525,10 +525,6 @@ class Processors:
|
||||
"time": int(time.time() * 1000)
|
||||
}
|
||||
|
||||
print(
|
||||
json.dumps(payload, indent=4)
|
||||
)
|
||||
|
||||
# Собираем пакет
|
||||
packet = self.proto.pack_packet(
|
||||
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,
|
||||
"message": bodyMessage,
|
||||
"prevMessageId": lastMessageId,
|
||||
"time": messageTime
|
||||
"time": messageTime,
|
||||
"writer": writer
|
||||
}
|
||||
)
|
||||
|
||||
@@ -1263,7 +1260,8 @@ class Processors:
|
||||
user.get('id'),
|
||||
{
|
||||
"eventType": "profile_updated",
|
||||
"profile": profile
|
||||
"profile": profile,
|
||||
"writer": writer
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user