Refactor contact and profile store

This commit is contained in:
AsamK 2021-04-30 22:17:13 +02:00
parent a96bd91770
commit 224d8194cc
31 changed files with 1393 additions and 729 deletions

View file

@ -18,6 +18,7 @@ import org.whispersystems.signalservice.api.messages.calls.SignalServiceCallMess
import org.whispersystems.signalservice.api.messages.multidevice.SignalServiceSyncMessage;
import org.whispersystems.signalservice.api.messages.shared.SharedContact;
import org.whispersystems.signalservice.api.push.SignalServiceAddress;
import org.whispersystems.signalservice.api.util.InvalidNumberException;
import java.io.IOException;
import java.util.Base64;
@ -667,7 +668,11 @@ public class ReceiveMessageHandler implements Manager.ReceiveMessageHandler {
private String formatContact(SignalServiceAddress address) {
final var number = address.getLegacyIdentifier();
var name = m.getContactOrProfileName(number);
String name = null;
try {
name = m.getContactOrProfileName(number);
} catch (InvalidNumberException ignored) {
}
if (name == null || name.isEmpty()) {
return number;
} else {