From 6174ca70d9bc36fde9d0a0c08ccb67e874a4711c Mon Sep 17 00:00:00 2001 From: mathieui Date: Tue, 15 Feb 2022 22:43:10 +0100 Subject: internal: make command_say async --- poezio/tabs/conversationtab.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'poezio/tabs/conversationtab.py') diff --git a/poezio/tabs/conversationtab.py b/poezio/tabs/conversationtab.py index 9cf68d75..76c86d70 100644 --- a/poezio/tabs/conversationtab.py +++ b/poezio/tabs/conversationtab.py @@ -172,7 +172,7 @@ class ConversationTab(OneToOneTab): @refresh_wrapper.always @command_args_parser.raw - def command_say(self, line: str, attention: bool = False, correct: bool = False): + async def command_say(self, line: str, attention: bool = False, correct: bool = False): msg: SMessage = self.core.xmpp.make_message( mto=self.get_dest_jid(), mfrom=self.core.xmpp.boundjid @@ -189,7 +189,6 @@ class ConversationTab(OneToOneTab): self.core.events.trigger('conversation_say', msg, self) if not msg['body']: return - replaced = False if correct or msg['replace']['id']: msg['replace']['id'] = self.last_sent_message['id'] # type: ignore else: @@ -209,12 +208,10 @@ class ConversationTab(OneToOneTab): if not msg['body']: return self.set_last_sent_message(msg, correct=correct) - asyncio.ensure_future( - self.core.handler.on_normal_message(msg) - ) - # Our receipts slixmpp hack msg._add_receipt = True # type: ignore msg.send() + await self.core.handler.on_normal_message(msg) + # Our receipts slixmpp hack self.cancel_paused_delay() @command_args_parser.quoted(0, 1) -- cgit v1.2.3