@@ -49,6 +49,16 @@ public class ZulipApp extends Application {
49
49
Set <String > mutedTopics ;
50
50
private static final String MUTED_TOPIC_KEY = "mutedTopics" ;
51
51
52
+ private final static String GLOBAL_SETTINGS = "HumbugActivity" ;
53
+ private final static String SERVER_SETTINGS = "serverSettings" ;
54
+ private final static String GLOBAL_SETTINGS_CURRENT = "currentRealm" ;
55
+ private static final String GLOBAL_SETTINGS_REALMS = "REALMS" ;
56
+
57
+
58
+ public int currentRealm = 0 ;
59
+
60
+ public HashSet serverStringSet ;
61
+ private SharedPreferences globalSettings ;
52
62
/**
53
63
* Handler to manage batching of unread messages
54
64
*/
@@ -86,13 +96,10 @@ public void onCreate() {
86
96
87
97
// This used to be from HumbugActivity.getPreferences, so we keep that
88
98
// file name.
89
- this .settings = getSharedPreferences ("HumbugActivity" ,
90
- Context .MODE_PRIVATE );
99
+ globalSettings = getSharedPreferences (GLOBAL_SETTINGS , Context .MODE_PRIVATE );
100
+ currentRealm = globalSettings .getInt (GLOBAL_SETTINGS_CURRENT , currentRealm );
101
+ serverStringSet = new HashSet <String >(globalSettings .getStringSet (GLOBAL_SETTINGS_REALMS , new HashSet <String >()));
91
102
92
- max_message_id = settings .getInt ("max_message_id" , -1 );
93
- eventQueueId = settings .getString ("eventQueueId" , null );
94
- lastEventId = settings .getInt ("lastEventId" , -1 );
95
- pointer = settings .getInt ("pointer" , -1 );
96
103
97
104
if (BuildHelper .shouldLogToCrashlytics ()) {
98
105
// TODO(lfaraone): figure out what to do about crash reporting
0 commit comments