mirror of
https://github.com/oxen-io/session-android.git
synced 2025-01-11 23:23:39 +00:00
Potentially fix crash
This commit is contained in:
parent
607b3d6a96
commit
b4f1640d0b
@ -194,10 +194,10 @@ public class ApplicationContext extends MultiDexApplication implements Dependenc
|
|||||||
FriendRequestProtocol.Companion.configureIfNeeded(apiDB, userPublicKey);
|
FriendRequestProtocol.Companion.configureIfNeeded(apiDB, userPublicKey);
|
||||||
MentionsManager.Companion.configureIfNeeded(userPublicKey, threadDB, userDB);
|
MentionsManager.Companion.configureIfNeeded(userPublicKey, threadDB, userDB);
|
||||||
SessionMetaProtocol.Companion.configureIfNeeded(apiDB, userPublicKey);
|
SessionMetaProtocol.Companion.configureIfNeeded(apiDB, userPublicKey);
|
||||||
MultiDeviceProtocol.Companion.configureIfNeeded(apiDB);
|
|
||||||
SessionManagementProtocol.Companion.configureIfNeeded(sessionResetImpl, threadDB, this);
|
|
||||||
SyncMessagesProtocol.Companion.configureIfNeeded(apiDB, userPublicKey);
|
SyncMessagesProtocol.Companion.configureIfNeeded(apiDB, userPublicKey);
|
||||||
}
|
}
|
||||||
|
MultiDeviceProtocol.Companion.configureIfNeeded(apiDB);
|
||||||
|
SessionManagementProtocol.Companion.configureIfNeeded(sessionResetImpl, threadDB, this);
|
||||||
setUpP2PAPIIfNeeded();
|
setUpP2PAPIIfNeeded();
|
||||||
LokiPushNotificationAcknowledgement.Companion.configureIfNeeded(BuildConfig.DEBUG);
|
LokiPushNotificationAcknowledgement.Companion.configureIfNeeded(BuildConfig.DEBUG);
|
||||||
if (setUpStorageAPIIfNeeded()) {
|
if (setUpStorageAPIIfNeeded()) {
|
||||||
|
@ -154,21 +154,21 @@ class HomeActivity : PassphraseRequiredActionBarActivity, ConversationClickListe
|
|||||||
adapter.typingThreadIDs = threadIDs ?: setOf()
|
adapter.typingThreadIDs = threadIDs ?: setOf()
|
||||||
})
|
})
|
||||||
// Set up remaining components if needed
|
// Set up remaining components if needed
|
||||||
|
val application = ApplicationContext.getInstance(this)d
|
||||||
|
val apiDB = DatabaseFactory.getLokiAPIDatabase(this)
|
||||||
|
val threadDB = DatabaseFactory.getLokiThreadDatabase(this)
|
||||||
|
val userDB = DatabaseFactory.getLokiUserDatabase(this)
|
||||||
val userPublicKey = TextSecurePreferences.getLocalNumber(this)
|
val userPublicKey = TextSecurePreferences.getLocalNumber(this)
|
||||||
|
val sessionResetImpl = LokiSessionResetImplementation(this)
|
||||||
if (userPublicKey != null) {
|
if (userPublicKey != null) {
|
||||||
val application = ApplicationContext.getInstance(this)
|
|
||||||
val apiDB = DatabaseFactory.getLokiAPIDatabase(this)
|
|
||||||
val threadDB = DatabaseFactory.getLokiThreadDatabase(this)
|
|
||||||
val userDB = DatabaseFactory.getLokiUserDatabase(this)
|
|
||||||
val sessionResetImpl = LokiSessionResetImplementation(this)
|
|
||||||
FriendRequestProtocol.configureIfNeeded(apiDB, userPublicKey)
|
FriendRequestProtocol.configureIfNeeded(apiDB, userPublicKey)
|
||||||
MentionsManager.configureIfNeeded(userPublicKey, threadDB, userDB)
|
MentionsManager.configureIfNeeded(userPublicKey, threadDB, userDB)
|
||||||
SessionMetaProtocol.configureIfNeeded(apiDB, userPublicKey)
|
SessionMetaProtocol.configureIfNeeded(apiDB, userPublicKey)
|
||||||
MultiDeviceProtocol.configureIfNeeded(apiDB)
|
|
||||||
SessionManagementProtocol.configureIfNeeded(sessionResetImpl, threadDB, application)
|
|
||||||
SyncMessagesProtocol.configureIfNeeded(apiDB, userPublicKey)
|
SyncMessagesProtocol.configureIfNeeded(apiDB, userPublicKey)
|
||||||
application.lokiPublicChatManager.startPollersIfNeeded()
|
application.lokiPublicChatManager.startPollersIfNeeded()
|
||||||
}
|
}
|
||||||
|
SessionManagementProtocol.configureIfNeeded(sessionResetImpl, threadDB, application)
|
||||||
|
MultiDeviceProtocol.configureIfNeeded(apiDB)
|
||||||
// TODO: Temporary hack to unbork existing clients
|
// TODO: Temporary hack to unbork existing clients
|
||||||
val allContacts = DatabaseFactory.getRecipientDatabase(this).allAddresses.map {
|
val allContacts = DatabaseFactory.getRecipientDatabase(this).allAddresses.map {
|
||||||
MultiDeviceProtocol.shared.getMasterDevice(it.serialize()) ?: it.serialize()
|
MultiDeviceProtocol.shared.getMasterDevice(it.serialize()) ?: it.serialize()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user