mirror of
https://github.com/signalapp/Signal-Server
synced 2026-04-21 19:48:01 +01:00
Add paymentActivation capability
This commit is contained in:
@@ -17,7 +17,8 @@ public class UserCapabilities {
|
||||
account.isAnnouncementGroupSupported(),
|
||||
account.isChangeNumberSupported(),
|
||||
account.isStoriesSupported(),
|
||||
account.isGiftBadgesSupported());
|
||||
account.isGiftBadgesSupported(),
|
||||
false); // Hardcode to false until all clients support the flow
|
||||
}
|
||||
|
||||
@JsonProperty("gv1-migration")
|
||||
@@ -38,6 +39,9 @@ public class UserCapabilities {
|
||||
@JsonProperty
|
||||
private boolean giftBadges;
|
||||
|
||||
@JsonProperty
|
||||
private boolean paymentActivation;
|
||||
|
||||
public UserCapabilities() {
|
||||
}
|
||||
|
||||
@@ -47,7 +51,8 @@ public class UserCapabilities {
|
||||
final boolean announcementGroup,
|
||||
final boolean changeNumber,
|
||||
final boolean stories,
|
||||
final boolean giftBadges) {
|
||||
final boolean giftBadges,
|
||||
final boolean paymentActivation) {
|
||||
|
||||
this.gv1Migration = gv1Migration;
|
||||
this.senderKey = senderKey;
|
||||
@@ -55,6 +60,7 @@ public class UserCapabilities {
|
||||
this.changeNumber = changeNumber;
|
||||
this.stories = stories;
|
||||
this.giftBadges = giftBadges;
|
||||
this.paymentActivation = paymentActivation;
|
||||
}
|
||||
|
||||
public boolean isGv1Migration() {
|
||||
@@ -80,4 +86,6 @@ public class UserCapabilities {
|
||||
public boolean isGiftBadges() {
|
||||
return giftBadges;
|
||||
}
|
||||
|
||||
public boolean isPaymentActivation() { return paymentActivation; }
|
||||
}
|
||||
|
||||
@@ -221,6 +221,10 @@ public class Account {
|
||||
return allEnabledDevicesHaveCapability(DeviceCapabilities::isGiftBadges);
|
||||
}
|
||||
|
||||
public boolean isPaymentActivationSupported() {
|
||||
return allEnabledDevicesHaveCapability(DeviceCapabilities::isPaymentActivation);
|
||||
}
|
||||
|
||||
private boolean allEnabledDevicesHaveCapability(Predicate<DeviceCapabilities> predicate) {
|
||||
requireNotStale();
|
||||
|
||||
|
||||
@@ -277,12 +277,15 @@ public class Device {
|
||||
@JsonProperty
|
||||
private boolean giftBadges;
|
||||
|
||||
@JsonProperty
|
||||
private boolean paymentActivation;
|
||||
|
||||
public DeviceCapabilities() {
|
||||
}
|
||||
|
||||
public DeviceCapabilities(boolean storage, boolean transfer,
|
||||
final boolean senderKey, final boolean announcementGroup, final boolean changeNumber,
|
||||
final boolean pni, final boolean stories, final boolean giftBadges) {
|
||||
final boolean pni, final boolean stories, final boolean giftBadges, final boolean paymentActivation) {
|
||||
this.storage = storage;
|
||||
this.transfer = transfer;
|
||||
this.senderKey = senderKey;
|
||||
@@ -291,6 +294,7 @@ public class Device {
|
||||
this.pni = pni;
|
||||
this.stories = stories;
|
||||
this.giftBadges = giftBadges;
|
||||
this.paymentActivation = paymentActivation;
|
||||
}
|
||||
|
||||
public boolean isStorage() {
|
||||
@@ -324,5 +328,9 @@ public class Device {
|
||||
public boolean isGiftBadges() {
|
||||
return giftBadges;
|
||||
}
|
||||
|
||||
public boolean isPaymentActivation() {
|
||||
return paymentActivation;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user