Refactor receive api

This commit is contained in:
AsamK 2021-11-03 20:43:39 +01:00
parent b615a4b04d
commit 9075cc1a30
36 changed files with 1510 additions and 970 deletions

View file

@ -1,10 +1,10 @@
package org.asamk.signal.json;
import org.whispersystems.signalservice.api.messages.shared.SharedContact;
import org.asamk.signal.manager.api.MessageEnvelope;
public record JsonContactAvatar(JsonAttachment attachment, boolean isProfile) {
static JsonContactAvatar from(SharedContact.Avatar avatar) {
return new JsonContactAvatar(JsonAttachment.from(avatar.getAttachment()), avatar.isProfile());
static JsonContactAvatar from(MessageEnvelope.Data.SharedContact.Avatar avatar) {
return new JsonContactAvatar(JsonAttachment.from(avatar.attachment()), avatar.isProfile());
}
}