Commit dd0be85d authored by Maxime Buquet's avatar Maxime Buquet

Merge branch 'affiliation-info' into 'master'

Make /affiliation display in the info win, not in the muc win

See merge request poezio/poezio!113
parents 0c9f2ca3 6117c97a
...@@ -1667,19 +1667,10 @@ class MucTab(ChatTab): ...@@ -1667,19 +1667,10 @@ class MucTab(ChatTab):
} }
if all_errors: if all_errors:
self.add_message( self.core.information('Can’t access affiliations', 'Error')
'Can\'t access affiliations',
return None return None
self._text_buffer.add_message(InfoMessage('Affiliations')) lines = ['Affiliations']
for iq in iqs: for iq in iqs:
if isinstance(iq, (IqError, IqTimeout)): if isinstance(iq, (IqError, IqTimeout)):
continue continue
...@@ -1691,15 +1682,13 @@ class MucTab(ChatTab): ...@@ -1691,15 +1682,13 @@ class MucTab(ChatTab):
affiliation = items[0].get('affiliation') affiliation = items[0].get('affiliation')
aff_char = aff_colors[affiliation] aff_char = aff_colors[affiliation]
self._text_buffer.add_message( lines.append(' %s%s' % (aff_char, affiliation.capitalize()))
InfoMessage(' %s%s' % (aff_char, affiliation.capitalize())),
items = map(lambda i: i.get('jid'), items) items = map(lambda i: i.get('jid'), items)
for ajid in sorted(items): for ajid in sorted(items):
self._text_buffer.add_message(InfoMessage(' %s' % ajid)) lines.append(' %s' % ajid)
self.core.refresh_window() self.core.information('\n'.join(lines), 'Info')
return None return None
@command_args_parser.raw @command_args_parser.raw
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment