]> nmode's Git Repositories - signal-cli/blob - lib/src/main/java/org/asamk/signal/manager/storage/contacts/LegacyContactInfo.java
0d297e7f625fd55834126ef69eb5c0b6ff3e991f
[signal-cli] / lib / src / main / java / org / asamk / signal / manager / storage / contacts / LegacyContactInfo.java
1 package org.asamk.signal.manager.storage.contacts;
2
3 import com.fasterxml.jackson.annotation.JsonIgnore;
4 import com.fasterxml.jackson.annotation.JsonProperty;
5
6 import org.asamk.signal.manager.storage.recipients.RecipientAddress;
7 import org.whispersystems.signalservice.api.push.ServiceId;
8
9 import java.util.UUID;
10
11 import static com.fasterxml.jackson.annotation.JsonProperty.Access.WRITE_ONLY;
12
13 public class LegacyContactInfo {
14
15 @JsonProperty
16 public String name;
17
18 @JsonProperty
19 public String number;
20
21 @JsonProperty
22 public UUID uuid;
23
24 @JsonProperty
25 public String color;
26
27 @JsonProperty(defaultValue = "0")
28 public int messageExpirationTime;
29
30 @JsonProperty(access = WRITE_ONLY)
31 public String profileKey;
32
33 @JsonProperty(defaultValue = "false")
34 public boolean blocked;
35
36 @JsonProperty
37 public Integer inboxPosition;
38
39 @JsonProperty(defaultValue = "false")
40 public boolean archived;
41
42 public LegacyContactInfo() {
43 }
44
45 @JsonIgnore
46 public RecipientAddress getAddress() {
47 return new RecipientAddress(uuid == null ? null : ServiceId.from(uuid), number);
48 }
49 }