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) {
|
override fun onNewEndpoint(context: Context?, endpoint: String, instance: String) {
|
||||||
initVar(context!!)
|
initVar(context!!)
|
||||||
Timber.i("onNewEndpoint: adding $endpoint")
|
Timber.i("onNewEndpoint: adding $endpoint")
|
||||||
UPHelper.storeUpEndpoint(context, endpoint)
|
|
||||||
if (vectorPreferences.areNotificationEnabledForDevice() && activeSessionHolder.hasActiveSession()) {
|
if (vectorPreferences.areNotificationEnabledForDevice() && activeSessionHolder.hasActiveSession()) {
|
||||||
val gateway = UPHelper.customOrDefaultGateway(context, endpoint)
|
val gateway = UPHelper.customOrDefaultGateway(context, endpoint)
|
||||||
UPHelper.storePushGateway(context, gateway)
|
if (UPHelper.getUpEndpoint(context) != endpoint ||
|
||||||
UPHelper.storeUpEndpoint(context, endpoint)
|
UPHelper.getPushGateway(context) != gateway) {
|
||||||
pusherManager.registerPusher(context, endpoint, 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
|
val mode = BackgroundSyncMode.FDROID_BACKGROUND_SYNC_MODE_DISABLED
|
||||||
vectorPreferences.setFdroidSyncBackgroundMode(mode)
|
vectorPreferences.setFdroidSyncBackgroundMode(mode)
|
||||||
|
|
Loading…
Reference in a new issue