diff options
author | mathieui <mathieui@mathieui.net> | 2016-07-14 12:29:42 +0200 |
---|---|---|
committer | mathieui <mathieui@mathieui.net> | 2016-07-14 12:29:42 +0200 |
commit | 4b3dde2a2757519965a4c3ad2e818509b7785562 (patch) | |
tree | 1db8552dd5aa49ddf177cdbfd69ac18718443276 | |
parent | 275a67864dad282271e9b3b3fdcf5ec33c98be87 (diff) | |
download | poezio-4b3dde2a2757519965a4c3ad2e818509b7785562.tar.gz poezio-4b3dde2a2757519965a4c3ad2e818509b7785562.tar.bz2 poezio-4b3dde2a2757519965a4c3ad2e818509b7785562.tar.xz poezio-4b3dde2a2757519965a4c3ad2e818509b7785562.zip |
Improve /topic display
-rw-r--r-- | poezio/tabs/muctab.py | 20 |
1 files 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 |