mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-26 11:51:10 +01:00
Add whoami check for receipt_credentials.
This commit is contained in:
committed by
Greyson Parrelli
parent
0dbab7ede0
commit
23f90e070e
@@ -1,33 +0,0 @@
|
||||
package org.whispersystems.signalservice.internal.push;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
public class WhoAmIResponse {
|
||||
@JsonProperty
|
||||
public String uuid;
|
||||
|
||||
@JsonProperty
|
||||
public String pni;
|
||||
|
||||
@JsonProperty
|
||||
public String number;
|
||||
|
||||
@JsonProperty
|
||||
public String usernameHash;
|
||||
|
||||
public String getAci() {
|
||||
return uuid;
|
||||
}
|
||||
|
||||
public String getPni() {
|
||||
return pni;
|
||||
}
|
||||
|
||||
public String getNumber() {
|
||||
return number;
|
||||
}
|
||||
|
||||
public String getUsernameHash() {
|
||||
return usernameHash;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package org.whispersystems.signalservice.internal.push
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator
|
||||
import com.fasterxml.jackson.annotation.JsonProperty
|
||||
|
||||
/**
|
||||
* Response object for /v1/accounts/whoami
|
||||
*/
|
||||
data class WhoAmIResponse @JsonCreator constructor(
|
||||
@JsonProperty("uuid") val aci: String? = null,
|
||||
@JsonProperty val pni: String? = null,
|
||||
@JsonProperty val number: String,
|
||||
@JsonProperty val usernameHash: String? = null,
|
||||
@JsonProperty val entitlements: Entitlements? = null
|
||||
) {
|
||||
data class Entitlements @JsonCreator constructor(
|
||||
@JsonProperty val badges: List<BadgeEntitlement>? = null,
|
||||
@JsonProperty val backup: BackupEntitlement? = null
|
||||
)
|
||||
|
||||
data class BadgeEntitlement @JsonCreator constructor(
|
||||
@JsonProperty val id: String?,
|
||||
@JsonProperty val visible: Boolean?,
|
||||
@JsonProperty val expirationSeconds: Long?
|
||||
)
|
||||
|
||||
data class BackupEntitlement @JsonCreator constructor(
|
||||
@JsonProperty val backupLevel: Long?,
|
||||
@JsonProperty val expirationSeconds: Long?
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user