mirror of
https://github.com/AsamK/signal-cli.git
synced 2026-11-29 08:55:48 +00:00
1 parent
0e0ef402fc
commit
bb3b9692e3
1 file changed
+9
-1
@@ -50,6 +50,7 @@ import java.util.HashMap;
|
||||
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;
|
||||
@@ -540,7 +541,14 @@ public class DbusManagerImpl implements Manager {
|
||||
|
||||
@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
|
||||
|
||||
Reference in new issue
Block a user