Починил изменение профиля

This commit is contained in:
Alexey Polyakov 2026-03-18 21:06:33 +03:00
parent 91453d7173
commit 9c3038bc84
2 changed files with 27 additions and 6 deletions

View File

@ -53,6 +53,19 @@ class OnemeMobileController(ControllerBase):
packet = self.proto.pack_packet(
cmd=0, seq=1, opcode=self.proto.NOTIF_TYPING, payload=payload
)
elif eventType == "profile_updated":
# Данные события
profile = eventData.get("profile")
# Данные пакета
payload = {
"profile": profile
}
# Создаем пакет
packet = self.proto.pack_packet(
cmd=0, seq=1, opcode=self.proto.NOTIF_PROFILE, payload=payload
)
# Отправляем пакет
writer.write(packet)

View File

@ -1121,14 +1121,22 @@ class Processors:
username=user.get("username")
)
# Данные пакета
payload = {
"profile": profile
}
# Отправляем ответ на запрос (CMD_OK)
packet = self.proto.pack_packet(
cmd=self.proto.CMD_OK, seq=seq, opcode=self.proto.PROFILE, payload=profile
cmd=self.proto.CMD_OK, seq=seq, opcode=self.proto.PROFILE, payload=payload
)
await self._send(writer, packet)
# Отправляем уведомление об изменении профиля (CMD_NOF)
notif_packet = self.proto.pack_packet(
cmd=self.proto.CMD_NOF, seq=0, opcode=self.proto.NOTIF_PROFILE, payload=profile
)
await self._send(writer, notif_packet)
# Отправляем всем сессиям о изменении профиля
await self.event(
user.get('id'),
{
"eventType": "profile_updated",
"profile": profile
}
)