summaryrefslogtreecommitdiff
path: root/poezio/windows
diff options
context:
space:
mode:
authorMaxime Buquet <pep@bouah.net>2018-12-15 22:02:31 +0100
committerMaxime Buquet <pep@bouah.net>2018-12-15 22:02:31 +0100
commit167920a9d086f7cd7092d7bced25dd18f549d59a (patch)
treee4592bd9be5d1068d7f5586ea3c8567108b72914 /poezio/windows
parente992107ecff9a2f3f1282a87bdc8edfadcd01090 (diff)
parent7d0d4ddb517a27bf5e49a292dad6d70d97056a4f (diff)
downloadpoezio-167920a9d086f7cd7092d7bced25dd18f549d59a.tar.gz
poezio-167920a9d086f7cd7092d7bced25dd18f549d59a.tar.bz2
poezio-167920a9d086f7cd7092d7bced25dd18f549d59a.tar.xz
poezio-167920a9d086f7cd7092d7bced25dd18f549d59a.zip
Merge branch 'muc-info-win-additional-info' into 'master'
Allow additional information elements in MucInfoWin same as ConversationInfoWin See merge request poezio/poezio!17
Diffstat (limited to 'poezio/windows')
-rw-r--r--poezio/windows/info_wins.py17
1 files changed, 14 insertions, 3 deletions
diff --git a/poezio/windows/info_wins.py b/poezio/windows/info_wins.py
index 0a8f0f27..d1426e67 100644
--- a/poezio/windows/info_wins.py
+++ b/poezio/windows/info_wins.py
@@ -87,8 +87,8 @@ class PrivateInfoWin(InfoWin):
Write all information added by plugins by getting the
value returned by the callbacks.
"""
- for key in information:
- self.addstr(information[key](jid),
+ for plugin in information.values():
+ self.addstr(plugin(jid),
to_curses_attr(get_theme().COLOR_INFORMATION_BAR))
def write_room_name(self, name):
@@ -257,7 +257,7 @@ class MucInfoWin(InfoWin):
def __init__(self):
InfoWin.__init__(self)
- def refresh(self, room, window=None, user=None):
+ def refresh(self, room, window=None, user=None, information=None):
log.debug('Refresh: %s', self.__class__.__name__)
self._win.erase()
self.write_room_name(room)
@@ -265,11 +265,22 @@ class MucInfoWin(InfoWin):
self.write_own_nick(room)
self.write_disconnected(room)
self.write_role(room, user)
+ if information:
+ self.write_additional_information(information, room)
if window:
self.print_scroll_position(window)
self.finish_line(get_theme().COLOR_INFORMATION_BAR)
self._refresh()
+ def write_additional_information(self, information, jid):
+ """
+ Write all information added by plugins by getting the
+ value returned by the callbacks.
+ """
+ for plugin in information.values():
+ self.addstr(plugin(jid),
+ to_curses_attr(get_theme().COLOR_INFORMATION_BAR))
+
def write_room_name(self, room):
self.addstr('[', to_curses_attr(get_theme().COLOR_INFORMATION_BAR))
self.addstr(room.name,