summaryrefslogtreecommitdiff
path: root/poezio/tabs/conversationtab.py
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2022-02-15 22:43:10 +0100
committerMaxime Buquet <pep@bouah.net>2022-03-23 15:38:00 +0100
commit6174ca70d9bc36fde9d0a0c08ccb67e874a4711c (patch)
tree45cd819c9599a75c9af2dd0739dd7d03b8ba2060 /poezio/tabs/conversationtab.py
parentd6de6dccfa4b832a84edd394bee4f92a00069277 (diff)
downloadpoezio-6174ca70d9bc36fde9d0a0c08ccb67e874a4711c.tar.gz
poezio-6174ca70d9bc36fde9d0a0c08ccb67e874a4711c.tar.bz2
poezio-6174ca70d9bc36fde9d0a0c08ccb67e874a4711c.tar.xz
poezio-6174ca70d9bc36fde9d0a0c08ccb67e874a4711c.zip
internal: make command_say async
Diffstat (limited to 'poezio/tabs/conversationtab.py')
-rw-r--r--poezio/tabs/conversationtab.py9
1 files changed, 3 insertions, 6 deletions
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)