diff --git a/src/common/config.py b/src/common/config.py index a45f47e2a..d6f26e9f4 100644 --- a/src/common/config.py +++ b/src/common/config.py @@ -274,6 +274,7 @@ class Config: 'autopriority_dnd': [ opt_int, 20], 'autopriority_invisible': [ opt_int, 10], 'autoconnect': [ opt_bool, False, '', True ], + 'dont_restore_last_status': [ opt_bool, False, _('If enabled, don\'t restore the last status that was used.') ], 'autoreconnect': [ opt_bool, True ], 'active': [ opt_bool, True], 'proxy': [ opt_str, '', '', True ], diff --git a/src/gajim.py b/src/gajim.py index 248859449..bbe968e41 100755 --- a/src/gajim.py +++ b/src/gajim.py @@ -2777,12 +2777,16 @@ class Interface: # dict of account that want to connect sorted by status for a in gajim.connections: if gajim.config.get_per('accounts', a, 'autoconnect'): - self.roster.send_status(a, - gajim.config.get_per('accounts', a, - 'last_status'), - helpers.from_one_line( - gajim.config.get_per('accounts', a, - 'last_status_msg'))) + if not gajim.config.get_per('accounts', a, + 'dont_restore_last_status'): + self.roster.send_status(a, + gajim.config.get_per('accounts', + a, 'last_status'), + helpers.from_one_line( + gajim.config.get_per('accounts', + a, 'last_status_msg'))) + else: + self.roster.send_status(a, 'online', '') return False def show_systray(self):