Welcome to mirror list, hosted at ThFree Co, Russian Federation.

dev.gajim.org/gajim/gajim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Hörist <philipp@hoerist.com>2022-10-09 14:18:27 +0300
committerPhilipp Hörist <philipp@hoerist.com>2022-10-09 14:20:05 +0300
commitbec5899274e49573302f5c2e423a22328f699e4f (patch)
tree502085f58a691bf75dd8744d4e4cad6e53ca614f
parent61fec3e4037536c42fa3e83e4ad19f3ae1432ec2 (diff)
refactor: Remove usage of get_number_of_accounts()
-rw-r--r--gajim/common/app.py7
-rw-r--r--gajim/gtk/account_side_bar.py2
-rw-r--r--gajim/gtk/chat_banner.py2
3 files changed, 2 insertions, 9 deletions
diff --git a/gajim/common/app.py b/gajim/common/app.py
index fa2155e97..757594603 100644
--- a/gajim/common/app.py
+++ b/gajim/common/app.py
@@ -341,13 +341,6 @@ def get_jid_without_resource(jid: str) -> str:
return jid.split('/')[0]
-def get_number_of_accounts() -> int:
- '''
- Return the number of ALL accounts
- '''
- return len(connections.keys())
-
-
def get_number_of_connected_accounts(
accounts_list: Optional[list[str]] = None) -> int:
'''
diff --git a/gajim/gtk/account_side_bar.py b/gajim/gtk/account_side_bar.py
index 03d96a257..c071c08ae 100644
--- a/gajim/gtk/account_side_bar.py
+++ b/gajim/gtk/account_side_bar.py
@@ -136,7 +136,7 @@ class Account(Gtk.ListBoxRow, EventHelper):
self._unread_label.set_visible(bool(count))
def _update_account_color_visibility(self, *args: Any) -> None:
- visible = app.get_number_of_accounts() > 1
+ visible = len(app.settings.get_active_accounts()) > 1
self._account_color_bar.set_visible(visible)
diff --git a/gajim/gtk/chat_banner.py b/gajim/gtk/chat_banner.py
index 62c327222..3bba0da09 100644
--- a/gajim/gtk/chat_banner.py
+++ b/gajim/gtk/chat_banner.py
@@ -314,7 +314,7 @@ class ChatBanner(Gtk.Box, EventHelper):
self._account_badge.set_visible(False)
return
- visible = app.get_number_of_accounts() > 1
+ visible = len(app.settings.get_active_accounts()) > 1
if visible:
self._account_badge.set_account(self._contact.account)