From b6a70eb6dea8e26af1d51bf0c8a13574e9b434cb Mon Sep 17 00:00:00 2001
From: lovetox <philipp@hoerist.com>
Date: Tue, 28 Apr 2020 10:09:51 +0200
Subject: [PATCH] Move SHOW_LIST into the const module

---
 gajim/common/app.py     |  3 ---
 gajim/common/const.py   | 12 ++++++++++++
 gajim/common/helpers.py |  8 ++++----
 3 files changed, 16 insertions(+), 7 deletions(-)

diff --git a/gajim/common/app.py b/gajim/common/app.py
index 531d6bda1d..b8f1994534 100644
--- a/gajim/common/app.py
+++ b/gajim/common/app.py
@@ -131,9 +131,6 @@
 
 cert_store = None
 
-SHOW_LIST = ['offline', 'connecting', 'online', 'chat', 'away', 'xa', 'dnd',
-             'error']
-
 # zeroconf account name
 ZEROCONF_ACC_NAME = 'Local'
 
diff --git a/gajim/common/const.py b/gajim/common/const.py
index 7981e2916f..3a169d6732 100644
--- a/gajim/common/const.py
+++ b/gajim/common/const.py
@@ -954,3 +954,15 @@ def is_error(self):
     Namespace.JINGLE_IBB,
     Namespace.AVATAR_METADATA + '+notify',
 ]
+
+
+SHOW_LIST = [
+    'offline',
+    'connecting',
+    'online',
+    'chat',
+    'away',
+    'xa',
+    'dnd',
+    'error'
+]
diff --git a/gajim/common/helpers.py b/gajim/common/helpers.py
index 7593da5c36..449b6e6f8d 100644
--- a/gajim/common/helpers.py
+++ b/gajim/common/helpers.py
@@ -84,6 +84,7 @@
 from gajim.common.const import URIType
 from gajim.common.const import URIAction
 from gajim.common.const import GIO_TLS_ERRORS
+from gajim.common.const import SHOW_LIST
 from gajim.common.structs import URI
 
 if app.is_installed('PYCURL'):
@@ -603,10 +604,10 @@ def get_global_show():
                                   'sync_with_global_status'):
             continue
         status = get_connection_status(account)
-        index = app.SHOW_LIST.index(status)
+        index = SHOW_LIST.index(status)
         if index > maxi:
             maxi = index
-    return app.SHOW_LIST[maxi]
+    return SHOW_LIST[maxi]
 
 def get_global_status_message():
     maxi = 0
@@ -615,13 +616,12 @@ def get_global_status_message():
                                   'sync_with_global_status'):
             continue
         status = app.connections[account].status
-        index = app.SHOW_LIST.index(status)
+        index = SHOW_LIST.index(status)
         if index > maxi:
             maxi = index
             status_message = app.connections[account].status_message
     return status_message
 
-
 def statuses_unified():
     """
     Test if all statuses are the same
-- 
GitLab