MUC: Use default value when printing the status

This commit is contained in:
Philipp Hörist 2019-01-05 20:10:08 +01:00
parent 7b558d692c
commit 4aa265451d
2 changed files with 8 additions and 2 deletions

View File

@ -1862,12 +1862,15 @@ class GroupchatControl(ChatControlBase):
status = '' if status is None else ' (%s)' % status
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:
message = _('You are now {show}{status}').format(show=show,
status=status)
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,
show=show,
status=status)

View File

@ -135,12 +135,15 @@ class PrivateChatControl(ChatControl):
status = '' if status is None else ' (%s)' % status
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:
message = _('You are now {show}{status}').format(show=show,
status=status)
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,
show=show,
status=status)