diff options
author | lovetox <philipp@hoerist.com> | 2022-08-18 17:45:20 +0300 |
---|---|---|
committer | lovetox <philipp@hoerist.com> | 2022-08-18 17:45:20 +0300 |
commit | 3543572a85dacce94d09d63f7b215ed12ad0b1c4 (patch) | |
tree | 749e5905c149541bed5f2cc8e31c0b7d4654d75f | |
parent | c43adb629ef31f7240c74f008e338c73dba8464a (diff) |
refactor: Remove unused code
-rw-r--r-- | gajim/common/setting_values.py | 5 | ||||
-rw-r--r-- | gajim/common/storage/archive.py | 13 |
2 files changed, 0 insertions, 18 deletions
diff --git a/gajim/common/setting_values.py b/gajim/common/setting_values.py index d8fb02809..f18d10f28 100644 --- a/gajim/common/setting_values.py +++ b/gajim/common/setting_values.py @@ -128,7 +128,6 @@ IntSettings = Literal[ 'notification_timeout', 'preview_max_file_size', 'preview_size', - 'restore_timeout', ] StringSettings = Literal[ @@ -252,7 +251,6 @@ APP_SETTINGS = { 'preview_verify_https': True, 'print_status_in_chats': False, 'remote_control': False, - 'restore_timeout': -1, 'roster_theme': 'default', 'save_main_window_position': True, 'search_engine': 'https://duckduckgo.com/?q=%s', @@ -688,9 +686,6 @@ ADVANCED_SETTINGS = { 'notify_on_all_muc_messages': '', 'plugins_repository_enabled': _( 'If enabled, Gajim offers to download plugins hosted on gajim.org'), - 'restore_timeout': _( - 'How far back in time (minutes) chat history is restored. -1 ' - 'means no limit.'), 'save_main_window_position': _( 'If enabled, Gajim will save the main window position when hiding ' 'it, and restore it when showing the window again.'), diff --git a/gajim/common/storage/archive.py b/gajim/common/storage/archive.py index bf8961911..3520d38f3 100644 --- a/gajim/common/storage/archive.py +++ b/gajim/common/storage/archive.py @@ -178,7 +178,6 @@ class MessageArchiveStorage(SqliteStorage): self._con.row_factory = self._namedtuple_factory self._con.create_function('like', 1, self._like) - self._con.create_function('get_timeout', 0, self._get_timeout) self._get_jid_ids_from_db() @@ -258,18 +257,6 @@ class MessageArchiveStorage(SqliteStorage): self._execute_multiple(statements) @staticmethod - def _get_timeout() -> int: - ''' - returns the timeout in epoch - ''' - timeout = app.settings.get('restore_timeout') - - now = int(time.time()) - if timeout > 0: - timeout = now - (timeout * 60) - return timeout - - @staticmethod def _like(search_str: str) -> str: return f'%{search_str}%' |