mirror of
https://github.com/signalapp/Signal-Server
synced 2026-04-26 05:18:06 +01:00
New API to support multiple accounts per # (FREEBIE)
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
package org.whispersystems.textsecuregcm.util;
|
||||
|
||||
public class NumberData {
|
||||
private String number;
|
||||
private boolean active;
|
||||
private boolean supportsSms;
|
||||
|
||||
public NumberData(String number, boolean active, boolean supportsSms) {
|
||||
this.number = number;
|
||||
this.active = active;
|
||||
this.supportsSms = supportsSms;
|
||||
}
|
||||
|
||||
public boolean isActive() {
|
||||
return active;
|
||||
}
|
||||
|
||||
public boolean isSupportsSms() {
|
||||
return supportsSms;
|
||||
}
|
||||
|
||||
public String getNumber() {
|
||||
return number;
|
||||
}
|
||||
}
|
||||
@@ -16,12 +16,24 @@
|
||||
*/
|
||||
package org.whispersystems.textsecuregcm.util;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.google.common.annotations.VisibleForTesting;
|
||||
|
||||
public class VerificationCode {
|
||||
|
||||
@JsonProperty
|
||||
private String verificationCode;
|
||||
@JsonIgnore
|
||||
private String verificationCodeDisplay;
|
||||
@JsonIgnore
|
||||
private String verificationCodeSpeech;
|
||||
|
||||
@VisibleForTesting VerificationCode() {}
|
||||
|
||||
public VerificationCode(int verificationCode) {
|
||||
this.verificationCode = verificationCode + "";
|
||||
this.verificationCodeDisplay = this.verificationCode.substring(0, 3) + "-" +
|
||||
@@ -54,4 +66,7 @@ public class VerificationCode {
|
||||
return delimited;
|
||||
}
|
||||
|
||||
@VisibleForTesting public boolean equals(Object o) {
|
||||
return o instanceof VerificationCode && verificationCode.equals(((VerificationCode) o).verificationCode);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user