diff --git a/gajim/application.py b/gajim/application.py index 2b8c68917..21dcb1bdc 100644 --- a/gajim/application.py +++ b/gajim/application.py @@ -358,6 +358,8 @@ class GajimApplication(Gtk.Application): accounts_list = sorted(app.config.get_per('accounts')) if not accounts_list: return + if 'Local' in accounts_list: + accounts_list.remove('Local') if len(accounts_list) > 1: for acc in accounts_list: self.add_account_actions(acc) @@ -365,6 +367,8 @@ class GajimApplication(Gtk.Application): self.add_account_actions(accounts_list[0]) def add_account_actions(self, account): + if account == 'Local': + return for action in self.account_actions: action_name, func, state, type_ = action action_name = account + action_name @@ -384,6 +388,8 @@ class GajimApplication(Gtk.Application): self.remove_action(action_name) def set_account_actions_state(self, account, new_state=False): + if account == 'Local': + return for action in self.account_actions: action_name, _, state, _ = action if not new_state and state in ('online', 'feature'): diff --git a/gajim/common/contacts.py b/gajim/common/contacts.py index a04348a48..e3b2c4c31 100644 --- a/gajim/common/contacts.py +++ b/gajim/common/contacts.py @@ -237,8 +237,12 @@ class LegacyContactsAPI: GC_Contacts()) self._metacontact_manager.add_account(account_name) - def get_accounts(self): - return list(self._accounts.keys()) + def get_accounts(self, zeroconf=True): + accounts = list(self._accounts.keys()) + if not zeroconf: + if 'Local' in accounts: + accounts.remove('Local') + return accounts def remove_account(self, account): del self._accounts[account] diff --git a/gajim/gui_menu_builder.py b/gajim/gui_menu_builder.py index a26a047eb..c4c3f1467 100644 --- a/gajim/gui_menu_builder.py +++ b/gajim/gui_menu_builder.py @@ -781,7 +781,7 @@ def build_accounts_menu(): acc_menu = menubar.get_item_link(menu_position, 'submenu') acc_menu.remove_all() - accounts_list = sorted(app.contacts.get_accounts()) + accounts_list = sorted(app.contacts.get_accounts(zeroconf=False)) if not accounts_list: no_accounts = _('No Accounts available') acc_menu.append_item(Gio.MenuItem.new(no_accounts, None))