@@ -49,6 +49,16 @@ public class ZulipApp extends Application {
4949 private Set <String > mutedTopics ;
5050 private static final String MUTED_TOPIC_KEY = "mutedTopics" ;
5151
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 ;
5262 /**
5363 * Handler to manage batching of unread messages
5464 */
@@ -86,13 +96,10 @@ public void onCreate() {
8696
8797 // This used to be from HumbugActivity.getPreferences, so we keep that
8898 // 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 >()));
91102
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 );
96103
97104 if (BuildHelper .shouldLogToCrashlytics ()) {
98105 // TODO(lfaraone): figure out what to do about crash reporting
0 commit comments