Daniel Brötzmann pushed to branch master at gajim / gajim

Commits:

3 changed files:

Changes:

  • gajim/common/application.py
    ... ... @@ -116,6 +116,7 @@ def _on_disconnect(event: AccountDisonnected) -> None:
    116 116
     
    
    117 117
         def _shutdown_core(self) -> None:
    
    118 118
             # Commit any outstanding SQL transactions
    
    119
    +        app.storage.archive.cleanup_chat_history()
    
    119 120
             app.storage.cache.shutdown()
    
    120 121
             app.storage.archive.shutdown()
    
    121 122
     
    

  • gajim/common/storage/archive.py
    ... ... @@ -181,7 +181,6 @@ def init(self, **kwargs: Any) -> None:
    181 181
             self._con.create_function("get_timeout", 0, self._get_timeout)
    
    182 182
     
    
    183 183
             self._get_jid_ids_from_db()
    
    184
    -        self._cleanup_chat_history()
    
    185 184
     
    
    186 185
         def _namedtuple_factory(self,
    
    187 186
                                 cursor: sqlite.Cursor,
    
    ... ... @@ -1391,7 +1390,7 @@ def remove_all_history(self) -> None:
    1391 1390
             self._execute_multiple(statements)
    
    1392 1391
             log.info('Removed all chat history')
    
    1393 1392
     
    
    1394
    -    def _cleanup_chat_history(self) -> None:
    
    1393
    +    def cleanup_chat_history(self) -> None:
    
    1395 1394
             """
    
    1396 1395
             Remove messages from account where messages are older than max_age
    
    1397 1396
             """
    

  • gajim/gtk/accounts.py
    ... ... @@ -722,6 +722,7 @@ def __init__(self, account: str) -> None:
    722 722
     
    
    723 723
             history_max_age = {
    
    724 724
                 -1: _('Forever'),
    
    725
    +            0: _('Until Gajim is Closed'),
    
    725 726
                 86400: _('1 Day'),
    
    726 727
                 604800: _('1 Week'),
    
    727 728
                 2629743: _('1 Month'),