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
;
27 private long avatarId
;
29 public GroupInfo(byte[] groupId
) {
30 this.groupId
= groupId
;
33 public GroupInfo(@JsonProperty("groupId") byte[] groupId
, @JsonProperty("name") String name
, @JsonProperty("members") Collection
<String
> members
, @JsonProperty("avatarId") long avatarId
, @JsonProperty("color") String color
) {
34 this.groupId
= groupId
;
36 this.members
.addAll(members
);
37 this.avatarId
= avatarId
;
42 public long getAvatarId() {
47 public Set
<SignalServiceAddress
> getMembers() {
48 Set
<SignalServiceAddress
> addresses
= new HashSet
<>(members
.size());
49 for (String member
: members
) {
50 addresses
.add(new SignalServiceAddress(null, member
));
55 public void addMembers(Collection
<SignalServiceAddress
> members
) {
56 for (SignalServiceAddress member
: members
) {
57 this.members
.add(member
.getNumber().get());