Commit 19c45510 authored by Philipp Hörist's avatar Philipp Hörist

MUC: Fix printing status/show

- rename config values to something more appropriate
parent 633795b7
Pipeline #2926 passed with stages
in 3 minutes and 17 seconds
......@@ -235,8 +235,8 @@ class Config:
'show_location_in_roster': [opt_bool, True, '', True],
'avatar_position_in_roster': [opt_str, 'right', _('Define the position of the avatar in roster. Can be left or right'), True],
'print_status_in_chats': [opt_bool, False, _('If False, Gajim will no longer print status line in chats when a contact changes their status and/or their status message.')],
'print_join_leave_in_mucs': [opt_bool, False, _('Default Setting: Show a status message for every join or leave in a group chat')],
'print_status_in_mucs': [opt_bool, False, _('Default Setting: Show a status message for all status (away, dnd, etc.) changes of users in a group chat')],
'print_join_left_default': [opt_bool, False, _('Default Setting: Show a status message for every join or leave in a group chat')],
'print_status_muc_default': [opt_bool, False, _('Default Setting: Show a status message for all status (away, dnd, etc.) changes of users in a group chat')],
'log_contact_status_changes': [opt_bool, False],
'log_xhtml_messages': [opt_bool, False, _('Log XHTML messages instead of plain text messages.')],
'restored_messages_small': [opt_bool, True, _('If true, restored messages will use a smaller font than the default one.')],
......
......@@ -397,7 +397,7 @@ class GroupchatControl(ChatControlBase):
act.connect('change-state', self._on_notify_on_all_messages)
self.parent_win.window.add_action(act)
status_default = app.config.get('print_status_in_mucs')
status_default = app.config.get('print_status_muc_default')
value = app.config.get_per('rooms', self.contact.jid,
'print_status', status_default)
......@@ -407,7 +407,7 @@ class GroupchatControl(ChatControlBase):
act.connect('change-state', self._on_print_status)
self.parent_win.window.add_action(act)
join_default = app.config.get('print_join_leave_in_mucs')
join_default = app.config.get('print_join_left_default')
value = app.config.get_per('rooms', self.contact.jid,
'print_join_left', join_default)
......@@ -2008,8 +2008,9 @@ class GroupchatControl(ChatControlBase):
#Group Chat: We have been removed from the room
message = _('{nick} has been removed from the room{by}{reason}')
join_default = app.config.get('print_join_left_default')
print_join_left = app.config.get_per(
'rooms', self.room_jid, 'print_join_left')
'rooms', self.room_jid, 'print_join_left', join_default)
if StatusCode.REMOVED_ERROR in status_codes:
# Handle 333 before 307, some MUCs add both
......@@ -2060,8 +2061,9 @@ class GroupchatControl(ChatControlBase):
return
nick = event.properties.muc_nickname
join_default = app.config.get('print_join_left_default')
print_join_left = app.config.get_per(
'rooms', self.room_jid, 'print_join_left')
'rooms', self.room_jid, 'print_join_left', join_default)
self.add_contact_to_roster(nick)
......
......@@ -161,10 +161,10 @@ class Preferences(Gtk.ApplicationWindow):
self._ui.sync_threshold_combobox.set_id_column(0)
self._ui.sync_threshold_combobox.set_active_id(str(public_threshold))
st = app.config.get('print_join_leave_in_mucs')
st = app.config.get('print_join_left_default')
self._ui.join_leave_checkbutton.set_active(st)
st = app.config.get('print_status_in_mucs')
st = app.config.get('print_status_muc_default')
self._ui.status_change_checkbutton.set_active(st)
# Displayed chat state notifications
......@@ -620,10 +620,10 @@ class Preferences(Gtk.ApplicationWindow):
app.config.set('public_room_sync_threshold', int(active))
def _on_join_leave_toggled(self, widget):
self.on_checkbutton_toggled(widget, 'print_join_leave_in_mucs')
self.on_checkbutton_toggled(widget, 'print_join_left_default')
def _on_status_change_toggled(self, widget):
self.on_checkbutton_toggled(widget, 'print_status_in_mucs')
self.on_checkbutton_toggled(widget, 'print_status_muc_default')
def on_show_chatstate_in_tabs_toggled(self, widget):
self.on_checkbutton_toggled(widget, 'show_chatstate_in_tabs')
......
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