]> nmode's Git Repositories - signal-cli/blob - src/main/java/org/asamk/signal/storage/contacts/ContactInfo.java
Store contact uuids in contact store
[signal-cli] / src / main / java / org / asamk / signal / storage / contacts / ContactInfo.java
1 package org.asamk.signal.storage.contacts;
2
3 import com.fasterxml.jackson.annotation.JsonIgnore;
4 import com.fasterxml.jackson.annotation.JsonProperty;
5
6 import org.whispersystems.signalservice.api.push.SignalServiceAddress;
7
8 import java.util.UUID;
9
10 public class ContactInfo {
11
12 @JsonProperty
13 public String name;
14
15 @JsonProperty
16 public String number;
17
18 @JsonProperty
19 public UUID uuid;
20
21 @JsonProperty
22 public String color;
23
24 @JsonProperty
25 public String profileKey;
26
27 @JsonProperty(defaultValue = "false")
28 public boolean blocked;
29
30 @JsonProperty
31 public Integer inboxPosition;
32
33 @JsonProperty(defaultValue = "false")
34 public boolean archived;
35
36 public ContactInfo() {
37 }
38
39 public ContactInfo(SignalServiceAddress address) {
40 this.number = address.getNumber().orNull();
41 this.uuid = address.getUuid().orNull();
42 }
43
44 @JsonIgnore
45 public SignalServiceAddress getAddress() {
46 return new SignalServiceAddress(uuid, number);
47 }
48 }