@@ -60,6 +60,16 @@ public class ZulipApp extends Application {
60
60
private Set <String > mutedTopics ;
61
61
private static final String MUTED_TOPIC_KEY = "mutedTopics" ;
62
62
63
+ private final static String GLOBAL_SETTINGS = "HumbugActivity" ;
64
+ private final static String SERVER_SETTINGS = "serverSettings" ;
65
+ private final static String GLOBAL_SETTINGS_CURRENT = "currentRealm" ;
66
+ private static final String GLOBAL_SETTINGS_REALMS = "REALMS" ;
67
+
68
+
69
+ public int currentRealm = 0 ;
70
+
71
+ public HashSet serverStringSet ;
72
+ private SharedPreferences globalSettings ;
63
73
/**
64
74
* Handler to manage batching of unread messages
65
75
*/
@@ -98,13 +108,10 @@ public void onCreate() {
98
108
99
109
// This used to be from HumbugActivity.getPreferences, so we keep that
100
110
// file name.
101
- this .settings = getSharedPreferences ("HumbugActivity" ,
102
- Context .MODE_PRIVATE );
111
+ globalSettings = getSharedPreferences (GLOBAL_SETTINGS , Context .MODE_PRIVATE );
112
+ currentRealm = globalSettings .getInt (GLOBAL_SETTINGS_CURRENT , currentRealm );
113
+ serverStringSet = new HashSet <String >(globalSettings .getStringSet (GLOBAL_SETTINGS_REALMS , new HashSet <String >()));
103
114
104
- max_message_id = settings .getInt ("max_message_id" , -1 );
105
- eventQueueId = settings .getString ("eventQueueId" , null );
106
- lastEventId = settings .getInt ("lastEventId" , -1 );
107
- pointer = settings .getInt ("pointer" , -1 );
108
115
109
116
110
117
this .api_key = settings .getString (API_KEY , null );
0 commit comments