mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-12-28 11:58:35 +03:00
test on new endpoint
This commit is contained in:
parent
15c3bb7fc3
commit
dbfa5e1fd5
1 changed files with 8 additions and 4 deletions
|
@ -156,12 +156,16 @@ val upHandler = object: MessagingReceiverHandler {
|
|||
override fun onNewEndpoint(context: Context?, endpoint: String, instance: String) {
|
||||
initVar(context!!)
|
||||
Timber.i("onNewEndpoint: adding $endpoint")
|
||||
UPHelper.storeUpEndpoint(context, endpoint)
|
||||
if (vectorPreferences.areNotificationEnabledForDevice() && activeSessionHolder.hasActiveSession()) {
|
||||
val gateway = UPHelper.customOrDefaultGateway(context, endpoint)
|
||||
if (UPHelper.getUpEndpoint(context) != endpoint ||
|
||||
UPHelper.getPushGateway(context) != gateway) {
|
||||
UPHelper.storePushGateway(context, gateway)
|
||||
UPHelper.storeUpEndpoint(context, endpoint)
|
||||
pusherManager.registerPusher(context, endpoint, gateway)
|
||||
} else {
|
||||
Timber.i("onNewEndpoint: skipped")
|
||||
}
|
||||
}
|
||||
val mode = BackgroundSyncMode.FDROID_BACKGROUND_SYNC_MODE_DISABLED
|
||||
vectorPreferences.setFdroidSyncBackgroundMode(mode)
|
||||
|
|
Loading…
Reference in a new issue