]>
nmode's Git Repositories - signal-cli/blob - lib/src/main/java/org/asamk/signal/manager/storage/groups/GroupInfoV1.java
8cf6cb94773f999d56b18d7752c0480269edc83c
1 package org
.asamk
.signal
.manager
.storage
.groups
;
3 import org
.asamk
.signal
.manager
.groups
.GroupIdV1
;
4 import org
.asamk
.signal
.manager
.groups
.GroupIdV2
;
5 import org
.asamk
.signal
.manager
.groups
.GroupInviteLinkUrl
;
6 import org
.asamk
.signal
.manager
.groups
.GroupUtils
;
7 import org
.asamk
.signal
.manager
.storage
.recipients
.RecipientId
;
9 import java
.util
.Collection
;
10 import java
.util
.HashSet
;
13 public class GroupInfoV1
extends GroupInfo
{
15 private final GroupIdV1 groupId
;
17 private GroupIdV2 expectedV2Id
;
21 public Set
<RecipientId
> members
= new HashSet
<>();
23 public int messageExpirationTime
;
24 public boolean blocked
;
25 public boolean archived
;
27 public GroupInfoV1(GroupIdV1 groupId
) {
28 this.groupId
= groupId
;
32 final GroupIdV1 groupId
,
33 final GroupIdV2 expectedV2Id
,
35 final Set
<RecipientId
> members
,
37 final int messageExpirationTime
,
38 final boolean blocked
,
39 final boolean archived
41 this.groupId
= groupId
;
42 this.expectedV2Id
= expectedV2Id
;
44 this.members
= members
;
46 this.messageExpirationTime
= messageExpirationTime
;
47 this.blocked
= blocked
;
48 this.archived
= archived
;
52 public GroupIdV1
getGroupId() {
56 public GroupIdV2
getExpectedV2Id() {
57 if (expectedV2Id
== null) {
58 expectedV2Id
= GroupUtils
.getGroupIdV2(groupId
);
64 public String
getTitle() {
69 public GroupInviteLinkUrl
getGroupInviteLink() {
73 public Set
<RecipientId
> getMembers() {
78 public boolean isBlocked() {
83 public void setBlocked(final boolean blocked
) {
84 this.blocked
= blocked
;
88 public int getMessageExpirationTime() {
89 return messageExpirationTime
;
92 public void addMembers(Collection
<RecipientId
> members
) {
93 this.members
.addAll(members
);
96 public void removeMember(RecipientId recipientId
) {
97 this.members
.removeIf(member
-> member
.equals(recipientId
));