mirror of
https://github.com/signalapp/Signal-Server
synced 2026-04-21 08:28:11 +01:00
Add delete sync capability
This commit is contained in:
@@ -232,6 +232,8 @@ public class DeviceController {
|
||||
|
||||
if (capabilities == null) {
|
||||
throw new WebApplicationException(Response.status(422, "Missing device capabilities").build());
|
||||
} else if (isCapabilityDowngrade(account, capabilities)) {
|
||||
throw new WebApplicationException(Response.status(409).build());
|
||||
}
|
||||
|
||||
final String signalAgent;
|
||||
@@ -387,6 +389,10 @@ public class DeviceController {
|
||||
return Optional.of(aci);
|
||||
}
|
||||
|
||||
private static boolean isCapabilityDowngrade(Account account, DeviceCapabilities capabilities) {
|
||||
return account.isDeleteSyncSupported() && !capabilities.deleteSync();
|
||||
}
|
||||
|
||||
private static String getUsedTokenKey(final String token) {
|
||||
return "usedToken::" + token;
|
||||
}
|
||||
|
||||
@@ -447,7 +447,7 @@ public class ProfileController {
|
||||
return new BaseProfileResponse(account.getIdentityKey(IdentityType.ACI),
|
||||
account.getUnidentifiedAccessKey().map(UnidentifiedAccessChecksum::generateFor).orElse(null),
|
||||
account.isUnrestrictedUnidentifiedAccess(),
|
||||
new UserCapabilities(),
|
||||
UserCapabilities.createForAccount(account),
|
||||
profileBadgeConverter.convert(
|
||||
getAcceptableLanguagesForRequest(containerRequestContext),
|
||||
account.getBadges(),
|
||||
@@ -459,7 +459,7 @@ public class ProfileController {
|
||||
return new BaseProfileResponse(account.getIdentityKey(IdentityType.PNI),
|
||||
null,
|
||||
false,
|
||||
new UserCapabilities(),
|
||||
UserCapabilities.createForAccount(account),
|
||||
Collections.emptyList(),
|
||||
new PniServiceIdentifier(account.getPhoneNumberIdentifier()));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user