Refactor Manager interface

This commit is contained in:
AsamK 2021-09-18 10:19:56 +02:00
parent b91c162159
commit d72b838560
33 changed files with 416 additions and 169 deletions

View file

@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
import org.asamk.signal.manager.Manager;
import org.whispersystems.signalservice.api.messages.SignalServiceDataMessage;
import org.whispersystems.signalservice.api.push.SignalServiceAddress;
import static org.asamk.signal.util.Util.getLegacyIdentifier;
@ -26,7 +27,7 @@ public class JsonMention {
final int length;
JsonMention(SignalServiceDataMessage.Mention mention, Manager m) {
final var address = m.resolveSignalServiceAddress(mention.getUuid());
final var address = m.resolveSignalServiceAddress(new SignalServiceAddress(mention.getUuid()));
this.name = getLegacyIdentifier(address);
this.number = address.getNumber().orNull();
this.uuid = address.getUuid().toString();

View file

@ -86,7 +86,7 @@ public class JsonMessageEnvelope {
}
String name;
try {
name = m.getContactOrProfileName(RecipientIdentifier.Single.fromString(this.source, m.getUsername()));
name = m.getContactOrProfileName(RecipientIdentifier.Single.fromString(this.source, m.getSelfNumber()));
} catch (InvalidNumberException | NullPointerException e) {
name = null;
}