summaryrefslogtreecommitdiff
path: root/poezio/tabs/basetabs.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/basetabs.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/basetabs.py')
-rw-r--r--poezio/tabs/basetabs.py16
1 files changed, 9 insertions, 7 deletions
diff --git a/poezio/tabs/basetabs.py b/poezio/tabs/basetabs.py
index 431acf17..c88a8a10 100644
--- a/poezio/tabs/basetabs.py
+++ b/poezio/tabs/basetabs.py
@@ -669,7 +669,9 @@ class ChatTab(Tab):
if not self.execute_command(txt):
if txt.startswith('//'):
txt = txt[1:]
- self.command_say(xhtml.convert_simple_to_full_colors(txt))
+ asyncio.ensure_future(
+ self.command_say(xhtml.convert_simple_to_full_colors(txt))
+ )
self.cancel_paused_delay()
@command_args_parser.raw
@@ -794,7 +796,7 @@ class ChatTab(Tab):
self.last_sent_message = msg
@command_args_parser.raw
- def command_correct(self, line: str) -> None:
+ async def command_correct(self, line: str) -> None:
"""
/correct <fixed message>
"""
@@ -804,7 +806,7 @@ class ChatTab(Tab):
if not self.last_sent_message:
self.core.information('There is no message to correct.', 'Error')
return
- self.command_say(line, correct=True)
+ await self.command_say(line, correct=True)
def completion_correct(self, the_input):
if self.last_sent_message and the_input.get_argument_position() == 1:
@@ -838,7 +840,7 @@ class ChatTab(Tab):
self.state = 'scrolled'
@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):
pass
def goto_build_lines(self, new_date):
@@ -1110,10 +1112,10 @@ class OneToOneTab(ChatTab):
self.refresh()
@command_args_parser.raw
- def command_attention(self, message):
+ async def command_attention(self, message):
"""/attention [message]"""
if message != '':
- self.command_say(message, attention=True)
+ await self.command_say(message, attention=True)
else:
msg = self.core.xmpp.make_message(self.get_dest_jid())
msg['type'] = 'chat'
@@ -1121,7 +1123,7 @@ class OneToOneTab(ChatTab):
msg.send()
@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):
pass
@command_args_parser.ignored