primitivus (chat): added :topic (and :subject and :title aliases) to change subject with a dialog (/!\ urwid SàText need to be updated)

This commit is contained in:
Goffi 2016-07-24 19:00:50 +02:00
commit c0e4960c55

View file

@ -138,6 +138,14 @@ class EditBar(sat_widgets.ModalEdit):
# FIXME: Q&D way, need to be more generic
if isinstance(widget, quick_chat.QuickChat):
widget.setFilter(args)
elif command in ('topic', 'suject', 'title'):
try:
new_title = args[0].strip()
except IndexError:
new_title = None
widget = self.host.selected_widget
if isinstance(widget, quick_chat.QuickChat) and widget.type == C.CHAT_GROUP:
widget.onSubjectDialog(new_title)
else:
return
self.set_edit_text('')