import java.util.HashSet;
import java.util.List;
import java.util.Map;
+import java.util.Objects;
import java.util.Optional;
import java.util.Set;
import java.util.UUID;
@Override
public List<Pair<RecipientAddress, Contact>> getContacts() {
- throw new UnsupportedOperationException();
+ return signal.listNumbers().stream().map(n -> {
+ final var contactName = signal.getContactName(n);
+ if (contactName.length() == 0) {
+ return null;
+ }
+ return new Pair<>(new RecipientAddress(null, n),
+ new Contact(contactName, null, 0, signal.isContactBlocked(n), false));
+ }).filter(Objects::nonNull).toList();
}
@Override
((List<String>) group.get("Admins").getValue()).stream()
.map(m -> new RecipientAddress(null, m))
.collect(Collectors.toSet()),
+ ((List<String>) group.get("Banned").getValue()).stream()
+ .map(m -> new RecipientAddress(null, m))
+ .collect(Collectors.toSet()),
(boolean) group.get("IsBlocked").getValue(),
(int) group.get("MessageExpirationTimer").getValue(),
GroupPermission.valueOf((String) group.get("PermissionAddMember").getValue()),
? Optional.empty()
: Optional.of(new RecipientAddress(null, syncReceived.getDestination())),
Set.of(),
- new MessageEnvelope.Data(syncReceived.getTimestamp(),
+ Optional.of(new MessageEnvelope.Data(syncReceived.getTimestamp(),
syncReceived.getGroupId().length > 0
? Optional.of(new MessageEnvelope.Data.GroupContext(GroupId.unknownVersion(
syncReceived.getGroupId()), false, 0))
Optional.empty(),
List.of(),
List.of(),
- List.of()))),
+ List.of())))),
Optional.empty(),
List.of(),
List.of(),