diff --git a/src/pymax/interfaces.py b/src/pymax/interfaces.py index abe8ed7..b91cb7a 100644 --- a/src/pymax/interfaces.py +++ b/src/pymax/interfaces.py @@ -287,12 +287,12 @@ async def _handle_file_upload(self, data: dict[str, Any]) -> None: self.logger.debug("Fulfilled file upload waiter for %s=%s", key, id_) async def _send_notification_response(self, chat_id: int, message_id: str) -> None: - if self._socket is not None and self.is_connected: + if self._socket is None or not self.is_connected: return - await self._send_and_wait( + await self._queue_message( opcode=Opcode.NOTIF_MESSAGE, payload={"chatId": chat_id, "messageId": message_id}, - cmd=0, + cmd=1, ) self.logger.debug( "Sent NOTIF_MESSAGE_RECEIVED for chat_id=%s message_id=%s", chat_id, message_id diff --git a/src/pymax/static/constant.py b/src/pymax/static/constant.py index 77db333..6feed26 100644 --- a/src/pymax/static/constant.py +++ b/src/pymax/static/constant.py @@ -77,7 +77,7 @@ DEFAULT_DEVICE_LOCALE: Final[str] = "ru" DEFAULT_DEVICE_NAME: Final[str] = choice(DEVICE_NAMES) DEFAULT_APP_VERSION: Final[str] = "25.12.14" -DEFAULT_SCREEN: Final[str] = "1080x1920 1.0x" +DEFAULT_SCREEN: Final[str] = choice(SCREEN_SIZES) DEFAULT_OS_VERSION: Final[str] = choice(OS_VERSIONS) DEFAULT_USER_AGENT: Final[str] = ua_generator.generate().text DEFAULT_BUILD_NUMBER: Final[int] = 0x97CB