mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-28 02:37:46 +00:00
Fix crashes
This commit is contained in:
parent
fbd197897f
commit
362256dc94
@ -202,8 +202,6 @@ public class ApplicationContext extends MultiDexApplication implements Dependenc
|
||||
mixpanel.trackMap(event, properties);
|
||||
return Unit.INSTANCE;
|
||||
};
|
||||
// Loki - Set up public chat manager
|
||||
lokiPublicChatManager = new LokiPublicChatManager(this);
|
||||
// Loki - Set the cache
|
||||
LokiDotNetAPI.setCache(new Cache(this.getCacheDir(), OK_HTTP_CACHE_SIZE));
|
||||
// Loki - Update device mappings
|
||||
@ -213,6 +211,8 @@ public class ApplicationContext extends MultiDexApplication implements Dependenc
|
||||
checkNeedsRevocation();
|
||||
}
|
||||
}
|
||||
// Loki - Set up public chat manager
|
||||
lokiPublicChatManager = new LokiPublicChatManager(this);
|
||||
updatePublicChatProfileAvatarIfNeeded();
|
||||
}
|
||||
|
||||
@ -282,10 +282,12 @@ public class ApplicationContext extends MultiDexApplication implements Dependenc
|
||||
public @Nullable LokiPublicChatAPI getLokiPublicChatAPI() {
|
||||
if (lokiPublicChatAPI == null && IdentityKeyUtil.hasIdentityKey(this)) {
|
||||
String userHexEncodedPublicKey = TextSecurePreferences.getLocalNumber(this);
|
||||
byte[] userPrivateKey = IdentityKeyUtil.getIdentityKeyPair(this).getPrivateKey().serialize();
|
||||
LokiAPIDatabase apiDatabase = DatabaseFactory.getLokiAPIDatabase(this);
|
||||
LokiUserDatabase userDatabase = DatabaseFactory.getLokiUserDatabase(this);
|
||||
lokiPublicChatAPI = new LokiPublicChatAPI(userHexEncodedPublicKey, userPrivateKey, apiDatabase, userDatabase);
|
||||
if (userHexEncodedPublicKey != null) {
|
||||
byte[] userPrivateKey = IdentityKeyUtil.getIdentityKeyPair(this).getPrivateKey().serialize();
|
||||
LokiAPIDatabase apiDatabase = DatabaseFactory.getLokiAPIDatabase(this);
|
||||
LokiUserDatabase userDatabase = DatabaseFactory.getLokiUserDatabase(this);
|
||||
lokiPublicChatAPI = new LokiPublicChatAPI(userHexEncodedPublicKey, userPrivateKey, apiDatabase, userDatabase);
|
||||
}
|
||||
}
|
||||
return lokiPublicChatAPI;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user