Commit 4aa26545 authored by Philipp Hörist's avatar Philipp Hörist

MUC: Use default value when printing the status

parent 7b558d69
Pipeline #2927 failed with stages
in 3 minutes and 3 seconds
...@@ -1862,12 +1862,15 @@ class GroupchatControl(ChatControlBase): ...@@ -1862,12 +1862,15 @@ class GroupchatControl(ChatControlBase):
status = '' if status is None else ' (%s)' % status status = '' if status is None else ' (%s)' % status
show = helpers.get_uf_show(event.properties.show.value) show = helpers.get_uf_show(event.properties.show.value)
status_default = app.config.get('print_status_muc_default')
if event.properties.is_muc_self_presence: if event.properties.is_muc_self_presence:
message = _('You are now {show}{status}').format(show=show, message = _('You are now {show}{status}').format(show=show,
status=status) status=status)
self.print_conversation(message, 'info', graphics=False) self.print_conversation(message, 'info', graphics=False)
elif app.config.get_per('rooms', self.room_jid, 'print_status'): elif app.config.get_per('rooms', self.room_jid,
'print_status', status_default):
message = _('{nick} is now {show}{status}').format(nick=nick, message = _('{nick} is now {show}{status}').format(nick=nick,
show=show, show=show,
status=status) status=status)
......
...@@ -135,12 +135,15 @@ class PrivateChatControl(ChatControl): ...@@ -135,12 +135,15 @@ class PrivateChatControl(ChatControl):
status = '' if status is None else ' (%s)' % status status = '' if status is None else ' (%s)' % status
show = helpers.get_uf_show(event.properties.show.value) show = helpers.get_uf_show(event.properties.show.value)
status_default = app.config.get('print_status_muc_default')
if event.properties.is_muc_self_presence: if event.properties.is_muc_self_presence:
message = _('You are now {show}{status}').format(show=show, message = _('You are now {show}{status}').format(show=show,
status=status) status=status)
self.print_conversation(message, 'info') self.print_conversation(message, 'info')
elif app.config.get_per('rooms', self.room_name, 'print_status'): elif app.config.get_per('rooms', self.room_name,
'print_status', status_default):
message = _('{nick} is now {show}{status}').format(nick=nick, message = _('{nick} is now {show}{status}').format(nick=nick,
show=show, show=show,
status=status) status=status)
......
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