From aacd6d53774de18fa6e570f2c701f2775ceb871d Mon Sep 17 00:00:00 2001 From: Marcel Hibbe Date: Tue, 18 Jan 2022 13:49:44 +0100 Subject: [PATCH] also register push token again on server&proxy no matter if it didn't change on device Signed-off-by: Marcel Hibbe --- .../com/nextcloud/talk/utils/PushUtils.java | 21 +------------------ 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/app/src/main/java/com/nextcloud/talk/utils/PushUtils.java b/app/src/main/java/com/nextcloud/talk/utils/PushUtils.java index 8a5c59c37..a5f06573e 100644 --- a/app/src/main/java/com/nextcloud/talk/utils/PushUtils.java +++ b/app/src/main/java/com/nextcloud/talk/utils/PushUtils.java @@ -229,29 +229,10 @@ public class PushUtils { devicePublicKeyBase64 = "-----BEGIN PUBLIC KEY-----\n" + devicePublicKeyBase64 + "\n-----END PUBLIC KEY-----\n"; if (userUtils.anyUserExists()) { - String providerValue; - PushConfigurationState accountPushData = null; for (Object userEntityObject : userUtils.getUsers()) { UserEntity userEntity = (UserEntity) userEntityObject; - providerValue = userEntity.getPushConfigurationState(); - if (!TextUtils.isEmpty(providerValue)) { - try { - accountPushData = LoganSquare.parse(providerValue, PushConfigurationState.class); - } catch (IOException e) { - Log.d(TAG, "Failed to parse account push data"); - accountPushData = null; - } - } else { - accountPushData = null; - } - - boolean userHasNoPushData = (TextUtils.isEmpty(providerValue) || accountPushData == null); - boolean userIsNotMarkedForDeletion = !userEntity.getScheduledForDeletion(); - boolean tokenHasChanged = - accountPushData != null && !accountPushData.getPushToken().equals(token); - - if (userIsNotMarkedForDeletion && (userHasNoPushData || tokenHasChanged)) { + if (!userEntity.getScheduledForDeletion()) { Map nextcloudRegisterPushMap = new HashMap<>(); nextcloudRegisterPushMap.put("format", "json"); nextcloudRegisterPushMap.put("pushTokenHash", pushTokenHash);