Improved hide notification when not needed

This commit is contained in:
Sylvain Berfini 2021-04-06 10:39:18 +02:00
parent c3f5a39007
commit 47f0f3ddf4

View file

@ -121,6 +121,17 @@ class CoreContext(val context: Context, coreConfig: Config) {
Log.i("[Context] Global state changed [$state]") Log.i("[Context] Global state changed [$state]")
if (state == GlobalState.On) { if (state == GlobalState.On) {
contactsManager.fetchContactsAsync() contactsManager.fetchContactsAsync()
}
}
override fun onAccountRegistrationStateChanged(
core: Core,
account: Account,
state: RegistrationState?,
message: String
) {
Log.i("[Context] Account [${account.params.identityAddress?.asStringUriOnly()}] registration state changed [$state]")
if (state == RegistrationState.Ok && account == core.defaultAccount) {
notificationsManager.stopForegroundNotificationIfPossible() notificationsManager.stopForegroundNotificationIfPossible()
} }
} }