summaryrefslogtreecommitdiff
path: root/poezio/tabs/conversationtab.py
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2019-09-29 18:12:48 +0200
committermathieui <mathieui@mathieui.net>2020-05-09 19:46:17 +0200
commita5e92800477f6195a6b2e8c6e64a56859117d5b8 (patch)
treef53550024091a12deeee88c0d9897d0aeba9f4bf /poezio/tabs/conversationtab.py
parentfefbb0b08887b761ad7a1cf95cf6b9f5f30013a6 (diff)
downloadpoezio-a5e92800477f6195a6b2e8c6e64a56859117d5b8.tar.gz
poezio-a5e92800477f6195a6b2e8c6e64a56859117d5b8.tar.bz2
poezio-a5e92800477f6195a6b2e8c6e64a56859117d5b8.tar.xz
poezio-a5e92800477f6195a6b2e8c6e64a56859117d5b8.zip
Pass a message to add_message instead of messed up kwargs everywhere
Changes LOTS of things
Diffstat (limited to 'poezio/tabs/conversationtab.py')
-rw-r--r--poezio/tabs/conversationtab.py25
1 files changed, 15 insertions, 10 deletions
diff --git a/poezio/tabs/conversationtab.py b/poezio/tabs/conversationtab.py
index 410c5eda..70005f0f 100644
--- a/poezio/tabs/conversationtab.py
+++ b/poezio/tabs/conversationtab.py
@@ -28,6 +28,7 @@ from poezio.roster import roster
from poezio.text_buffer import CorrectionError
from poezio.theming import get_theme, dump_tuple
from poezio.decorators import command_args_parser
+from poezio.ui.types import InfoMessage
log = logging.getLogger(__name__)
@@ -179,7 +180,7 @@ class ConversationTab(OneToOneTab):
(' and their last status was %s' % status)
if status else '',
)
- self.add_message(msg)
+ self.add_message(InfoMessage(msg), typ=0)
self.core.refresh_window()
self.core.xmpp.plugin['xep_0012'].get_last_activity(
@@ -200,17 +201,21 @@ class ConversationTab(OneToOneTab):
if resource:
status = (
'Status: %s' % resource.status) if resource.status else ''
- self._text_buffer.add_message(
- "\x19%(info_col)s}Show: %(show)s, %(status)s\x19o" % {
- 'show': resource.presence or 'available',
- 'status': status,
- 'info_col': dump_tuple(get_theme().COLOR_INFORMATION_TEXT)
- })
+ self.add_message(
+ InfoMessage(
+ "Show: %(show)s, %(status)s" % {
+ 'show': resource.presence or 'available',
+ 'status': status,
+ }
+ ),
+ typ=0,
+ )
return True
else:
- self._text_buffer.add_message(
- "\x19%(info_col)s}No information available\x19o" %
- {'info_col': dump_tuple(get_theme().COLOR_INFORMATION_TEXT)})
+ self.add_message(
+ InfoMessage("No information available"),
+ typ=0,
+ )
return True
@command_args_parser.quoted(0, 1)