Commit c6e8b299 authored by Philipp Hörist's avatar Philipp Hörist

Settings: Make send_chatstate an account setting

parent 28ec7ab8
......@@ -175,7 +175,6 @@ APP_SETTINGS = {
'show_chatstate_in_roster': True,
'show_chatstate_in_tabs': True,
'show_chatstate_in_banner': True,
'send_chatstate_default': 'composing_only',
'muclumbus_api_jid': 'rodrigo.de.mucobedo@dreckshal.de',
'muclumbus_api_http_uri': 'https://search.jabbercat.org/api/1.0/search',
'muclumbus_api_pref': 'http',
......@@ -187,7 +186,6 @@ APP_SETTINGS = {
'gc_notify_on_all_messages_public_default': False,
'gc_print_status_default': False,
'gc_print_join_left_default': False,
'gc_send_chatstate_default': 'composing_only',
'check_for_update': True,
'last_update_check': '',
'always_ask_for_status_message': False,
......@@ -259,11 +257,13 @@ ACCOUNT_SETTINGS = {
'opened_chat_controls': '',
'recent_groupchats': '',
'filetransfer_preference' : 'httpupload',
'send_chatstate_default': 'composing_only',
'gc_send_chatstate_default': 'composing_only',
},
'contact': {
'speller_language': '',
'send_chatstate': HAS_APP_DEFAULT,
'send_chatstate': HAS_ACCOUNT_DEFAULT,
'encryption': '',
},
......@@ -274,7 +274,7 @@ ACCOUNT_SETTINGS = {
'print_join_left': HAS_APP_DEFAULT,
'minimize_on_autojoin': True,
'minimize_on_close': True,
'send_chatstate': HAS_APP_DEFAULT,
'send_chatstate': HAS_ACCOUNT_DEFAULT,
'encryption': '',
},
}
......
......@@ -284,7 +284,13 @@ class _Settings:
# Migrate deprecated settings
value = app_settings.pop('send_chatstate_muc_default', None)
if value is not None:
app_settings['gc_send_chatstate_default'] = value
for account in self._account_settings['account']:
self._account_settings[account]['account']['gc_send_chatstate_default'] = value
value = app_settings.pop('send_chatstate_default', None)
if value is not None:
for account in self._account_settings['account']:
self._account_settings[account]['account']['send_chatstate_default'] = value
value = app_settings.pop('print_join_left_default', None)
if value is not None:
......@@ -303,6 +309,9 @@ class _Settings:
self._settings['app'] = app_settings
self._commit_settings('app')
for account in self._account_settings:
self._commit_account_settings(account)
def _migrate_encryption_settings(self) -> None:
# Migrate encryption settings into contact/group chat settings
encryption_settings = app.config.get_all_per('encryption')
......
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