1 package org
.asamk
.signal
.storage
.groups
;
3 import com
.fasterxml
.jackson
.annotation
.JsonIgnore
;
4 import com
.fasterxml
.jackson
.annotation
.JsonProperty
;
6 import org
.whispersystems
.signalservice
.api
.push
.SignalServiceAddress
;
8 import java
.util
.Collection
;
9 import java
.util
.HashSet
;
12 public class GroupInfo
{
15 public final byte[] groupId
;
21 public Set
<String
> members
= new HashSet
<>();
23 public boolean active
;
26 @JsonProperty(defaultValue
= "false")
27 public boolean blocked
;
29 public Integer inboxPosition
;
30 @JsonProperty(defaultValue
= "false")
31 public boolean archived
;
33 private long avatarId
;
35 public GroupInfo(byte[] groupId
) {
36 this.groupId
= groupId
;
39 public GroupInfo(@JsonProperty("groupId") byte[] groupId
, @JsonProperty("name") String name
, @JsonProperty("members") Collection
<String
> members
, @JsonProperty("avatarId") long avatarId
, @JsonProperty("color") String color
, @JsonProperty("blocked") boolean blocked
) {
40 this.groupId
= groupId
;
42 this.members
.addAll(members
);
43 this.avatarId
= avatarId
;
45 this.blocked
= blocked
;
49 public long getAvatarId() {
54 public Set
<SignalServiceAddress
> getMembers() {
55 Set
<SignalServiceAddress
> addresses
= new HashSet
<>(members
.size());
56 for (String member
: members
) {
57 addresses
.add(new SignalServiceAddress(null, member
));
62 public void addMembers(Collection
<SignalServiceAddress
> members
) {
63 for (SignalServiceAddress member
: members
) {
64 this.members
.add(member
.getNumber().get());