mirror of
https://github.com/chatmail/core.git
synced 2026-04-23 00:16:34 +03:00
deltachat_rpc_client: add webxdc API
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import json
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from ._utils import AttrDict
|
||||
@@ -47,3 +48,19 @@ class Message:
|
||||
async def mark_seen(self) -> None:
|
||||
"""Mark the message as seen."""
|
||||
await self._rpc.markseen_msgs(self.account.id, [self.id])
|
||||
|
||||
async def send_webxdc_status_update(self, update: dict, description: str) -> None:
|
||||
"""Send a webxdc status update. This message must be a webxdc."""
|
||||
await self._rpc.send_webxdc_status_update(
|
||||
self.account.id, self.id, json.dumps(update), description
|
||||
)
|
||||
|
||||
async def get_webxdc_status_updates(self, last_known_serial: int = 0) -> list:
|
||||
return json.loads(
|
||||
await self._rpc.get_webxdc_status_updates(
|
||||
self.account.id, self.id, last_known_serial
|
||||
)
|
||||
)
|
||||
|
||||
async def get_webxdc_info(self) -> dict:
|
||||
return await self._rpc.get_webxdc_info(self.account.id, self.id)
|
||||
|
||||
Reference in New Issue
Block a user