Skip to content
This repository was archived by the owner on Feb 11, 2026. It is now read-only.

Commit 607fd77

Browse files
committed
Добавил обработку уведомлений и обновил версию приложения до 25.12.14
1 parent 6601d94 commit 607fd77

2 files changed

Lines changed: 15 additions & 1 deletion

File tree

src/pymax/interfaces.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,13 +282,27 @@ async def _handle_file_upload(self, data: dict[str, Any]) -> None:
282282
fut.set_result(data)
283283
self.logger.debug("Fulfilled file upload waiter for %s=%s", key, id_)
284284

285+
async def _send_notification_response(self, chat_id: int, message_id: str) -> None:
286+
await self._send_and_wait(
287+
opcode=Opcode.NOTIF_MESSAGE,
288+
payload={"chatId": chat_id, "messageId": message_id},
289+
cmd=0,
290+
)
291+
self.logger.debug(
292+
"Sent NOTIF_MESSAGE_RECEIVED for chat_id=%s message_id=%s", chat_id, message_id
293+
)
294+
285295
async def _handle_message_notifications(self, data: dict) -> None:
286296
if data.get("opcode") != Opcode.NOTIF_MESSAGE.value:
287297
return
288298
payload = data.get("payload", {})
289299
msg = Message.from_dict(payload)
290300
if not msg:
291301
return
302+
303+
if msg.chat_id and msg.id:
304+
await self._send_notification_response(msg.chat_id, str(msg.id))
305+
292306
handlers_map = {
293307
MessageStatus.EDITED: self._on_message_edit_handlers,
294308
MessageStatus.REMOVED: self._on_message_delete_handlers,

src/pymax/static/constant.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
DEFAULT_LOCALE: Final[str] = "ru"
1414
DEFAULT_DEVICE_LOCALE: Final[str] = "ru"
1515
DEFAULT_DEVICE_NAME: Final[str] = "Chrome"
16-
DEFAULT_APP_VERSION: Final[str] = "25.12.13"
16+
DEFAULT_APP_VERSION: Final[str] = "25.12.14"
1717
DEFAULT_SCREEN: Final[str] = "1080x1920 1.0x"
1818
DEFAULT_OS_VERSION: Final[str] = "Linux"
1919
DEFAULT_USER_AGENT: Final[str] = (

0 commit comments

Comments
 (0)