mirror of
https://github.com/openmax-server/server.git
synced 2026-05-22 19:41:41 +03:00
Починил изменение профиля
This commit is contained in:
@@ -53,6 +53,19 @@ class OnemeMobileController(ControllerBase):
|
|||||||
packet = self.proto.pack_packet(
|
packet = self.proto.pack_packet(
|
||||||
cmd=0, seq=1, opcode=self.proto.NOTIF_TYPING, payload=payload
|
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)
|
writer.write(packet)
|
||||||
|
|||||||
@@ -1121,14 +1121,22 @@ class Processors:
|
|||||||
username=user.get("username")
|
username=user.get("username")
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Данные пакета
|
||||||
|
payload = {
|
||||||
|
"profile": profile
|
||||||
|
}
|
||||||
|
|
||||||
# Отправляем ответ на запрос (CMD_OK)
|
# Отправляем ответ на запрос (CMD_OK)
|
||||||
packet = self.proto.pack_packet(
|
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)
|
await self._send(writer, packet)
|
||||||
|
|
||||||
# Отправляем уведомление об изменении профиля (CMD_NOF)
|
# Отправляем всем сессиям о изменении профиля
|
||||||
notif_packet = self.proto.pack_packet(
|
await self.event(
|
||||||
cmd=self.proto.CMD_NOF, seq=0, opcode=self.proto.NOTIF_PROFILE, payload=profile
|
user.get('id'),
|
||||||
|
{
|
||||||
|
"eventType": "profile_updated",
|
||||||
|
"profile": profile
|
||||||
|
}
|
||||||
)
|
)
|
||||||
await self._send(writer, notif_packet)
|
|
||||||
Reference in New Issue
Block a user