mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 02:20:39 +00:00
parent
0e0ef402fc
commit
bb3b9692e3
1 changed files with 9 additions and 1 deletions
|
@ -50,6 +50,7 @@ import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Objects;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
@ -540,7 +541,14 @@ public class DbusManagerImpl implements Manager {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<Pair<RecipientAddress, Contact>> getContacts() {
|
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
|
@Override
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue