That fuck shit the fascists are using
1package org.tm.archive.groups;
2
3import androidx.annotation.NonNull;
4import androidx.annotation.WorkerThread;
5
6import org.signal.core.util.logging.Log;
7import org.tm.archive.recipients.Recipient;
8import org.tm.archive.recipients.RecipientId;
9
10import java.util.Collection;
11import java.util.HashSet;
12
13public final class GroupsV2CapabilityChecker {
14
15 private static final String TAG = Log.tag(GroupsV2CapabilityChecker.class);
16
17 private GroupsV2CapabilityChecker() {}
18
19 @WorkerThread
20 static boolean allAndSelfHaveServiceId(@NonNull Collection<RecipientId> recipientIds) {
21 HashSet<RecipientId> recipientIdsSet = new HashSet<>(recipientIds);
22
23 recipientIdsSet.add(Recipient.self().getId());
24
25 return allHaveServiceId(recipientIdsSet);
26 }
27
28 @WorkerThread
29 static boolean allHaveServiceId(@NonNull Collection<RecipientId> recipientIds) {
30 return Recipient.resolvedList(recipientIds)
31 .stream()
32 .allMatch(Recipient::hasServiceId);
33 }
34}