@@ 321,7 321,7 @@ class Session(BaseSession[str, Recipient]):
@catch_expired_session
@lock
- async def send_text(self, chat: Recipient, text: str, thread=None, **k):
+ async def on_text(self, chat: Recipient, text: str, thread=None, **k):
channel_id = await self.__get_channel_id(chat)
msg_id = await self.mm_client.send_message_to_channel(channel_id, text, thread)
self.messages_waiting_for_echo.add(msg_id)
@@ 329,9 329,7 @@ class Session(BaseSession[str, Recipient]):
@catch_expired_session
@lock
- async def send_file(
- self, chat: Recipient, url: str, http_response, thread=None, **k
- ):
+ async def on_file(self, chat: Recipient, url: str, http_response, thread=None, **k):
channel_id = await self.__get_channel_id(chat)
file_id = await self.mm_client.upload_file(channel_id, url, http_response)
msg_id = await self.mm_client.send_message_with_file(
@@ 341,25 339,25 @@ class Session(BaseSession[str, Recipient]):
return msg_id
@catch_expired_session
- async def active(self, c: Recipient, thread=None):
+ async def on_active(self, c: Recipient, thread=None):
pass
@catch_expired_session
- async def inactive(self, c: Recipient, thread=None):
+ async def on_inactive(self, c: Recipient, thread=None):
pass
@catch_expired_session
- async def composing(self, c: Recipient, thread=None):
+ async def on_composing(self, c: Recipient, thread=None):
channel_id = await self.__get_channel_id(c)
await self.ws.user_typing(channel_id) # type:ignore
@catch_expired_session
- async def paused(self, c: Recipient, thread=None):
+ async def on_paused(self, c: Recipient, thread=None):
# no equivalent in MM, seems to have an automatic timeout in clients
pass
@catch_expired_session
- async def displayed(self, c: Recipient, legacy_msg_id: Any, thread=None):
+ async def on_displayed(self, c: Recipient, legacy_msg_id: Any, thread=None):
channel_id = await self.__get_channel_id(c)
f = self.view_events[channel_id] = asyncio.Event()
await self.mm_client.view_channel(channel_id)
@@ 367,20 365,28 @@ class Session(BaseSession[str, Recipient]):
@catch_expired_session
@lock
- async def correct(self, c: Recipient, text: str, legacy_msg_id: Any, thread=None):
+ async def on_correct(
+ self,
+ c: Recipient,
+ text: str,
+ legacy_msg_id: str,
+ thread=None,
+ link_previews=(),
+ mentions=None,
+ ):
await self.mm_client.update_post(legacy_msg_id, text)
self.messages_waiting_for_echo.add(legacy_msg_id)
@catch_expired_session
- async def search(self, form_values: dict[str, str]):
+ async def on_search(self, form_values: dict[str, str]):
pass
@catch_expired_session
- async def retract(self, c: Recipient, legacy_msg_id: Any, thread=None):
+ async def on_retract(self, c: Recipient, legacy_msg_id: Any, thread=None):
await self.mm_client.delete_post(legacy_msg_id)
@catch_expired_session
- async def react(
+ async def on_react(
self, c: Recipient, legacy_msg_id: Any, emojis: list[str], thread=None
):
mm_reactions = await self.get_mm_reactions(
@@ 405,7 411,7 @@ class Session(BaseSession[str, Recipient]):
}
@catch_expired_session
- async def presence(
+ async def on_presence(
self,
resource: str,
show: PseudoPresenceShow,