From 4b3dde2a2757519965a4c3ad2e818509b7785562 Mon Sep 17 00:00:00 2001 From: mathieui Date: Thu, 14 Jul 2016 12:29:42 +0200 Subject: Improve /topic display --- poezio/tabs/muctab.py | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/poezio/tabs/muctab.py b/poezio/tabs/muctab.py index 7ec7935c..e0f3b6e2 100644 --- a/poezio/tabs/muctab.py +++ b/poezio/tabs/muctab.py @@ -651,12 +651,22 @@ class MucTab(ChatTab): /topic [new topic] """ if not subject: + info_text = dump_tuple(get_theme().COLOR_INFORMATION_TEXT) + norm_text = dump_tuple(get_theme().COLOR_NORMAL_TEXT) + if self.topic_from: + user = self.get_user_by_name(self.topic_from) + if user: + user_text = dump_tuple(user.color) + user_string = '\x19%s}(set by \x19%s}%s\x19%s})' % ( + info_text, user_text, user.nick, info_text) + else: + user_string = self.topic_from + else: + user_string = '' + self._text_buffer.add_message( - "\x19%s}The subject of the room is: %s %s" % - (dump_tuple(get_theme().COLOR_INFORMATION_TEXT), - self.topic, - '(set by %s)' % self.topic_from if self.topic_from - else '')) + "\x19%s}The subject of the room is: \x19%s}%s %s" % + (info_text, norm_text, self.topic, user_string)) self.refresh() return -- cgit v1.2.3