mirror of
https://github.com/nextcloud/talk-android
synced 2025-02-03 05:03:04 +00:00
refactor check if token should be registered
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
parent
1bd28f5ef4
commit
b339aa9d33
@ -245,9 +245,12 @@ public class PushUtils {
|
||||
accountPushData = null;
|
||||
}
|
||||
|
||||
if (((TextUtils.isEmpty(providerValue) || accountPushData == null)
|
||||
&& !userEntity.getScheduledForDeletion()) ||
|
||||
(accountPushData != null && !accountPushData.getPushToken().equals(token) && !userEntity.getScheduledForDeletion())) {
|
||||
boolean userHasNoPushData = (TextUtils.isEmpty(providerValue) || accountPushData == null);
|
||||
boolean userIsNotMarkedForDeletion = !userEntity.getScheduledForDeletion();
|
||||
boolean tokenHasChanged =
|
||||
accountPushData != null && !accountPushData.getPushToken().equals(token);
|
||||
|
||||
if (userIsNotMarkedForDeletion && (userHasNoPushData || tokenHasChanged)) {
|
||||
|
||||
Map<String, String> nextcloudRegisterPushMap = new HashMap<>();
|
||||
nextcloudRegisterPushMap.put("format", "json");
|
||||
|
Loading…
Reference in New Issue
Block a user