import org.whispersystems.signalservice.api.messages.multidevice.SignalServiceSyncMessage;
import org.whispersystems.signalservice.api.messages.multidevice.ViewOnceOpenMessage;
import org.whispersystems.signalservice.api.messages.multidevice.ViewedMessage;
+import org.whispersystems.signalservice.api.push.ServiceId;
import java.io.File;
import java.io.IOException;
}
public record Name(
- Optional<String> display,
+ Optional<String> nickname,
Optional<String> given,
Optional<String> family,
Optional<String> prefix,
) {
static Name from(org.whispersystems.signalservice.api.messages.shared.SharedContact.Name name) {
- return new Name(name.getDisplay(),
+ return new Name(name.getNickname(),
name.getGiven(),
name.getFamily(),
name.getPrefix(),
) {
static Address from(org.whispersystems.signalservice.api.messages.shared.SharedContact.PostalAddress address) {
- return new Address(Address.Type.from(address.getType()),
+ return new Address(Type.from(address.getType()),
address.getLabel(),
address.getStreet(),
address.getPobox(),
DELETE,
BLOCK,
BLOCK_AND_DELETE,
- UNBLOCK_AND_ACCEPT;
+ UNBLOCK_AND_ACCEPT,
+ SPAM,
+ BLOCK_AND_SPAM;
static Type from(MessageRequestResponseMessage.Type type) {
return switch (type) {
case BLOCK -> BLOCK;
case BLOCK_AND_DELETE -> BLOCK_AND_DELETE;
case UNBLOCK_AND_ACCEPT -> UNBLOCK_AND_ACCEPT;
+ case SPAM -> SPAM;
+ case BLOCK_AND_SPAM -> BLOCK_AND_SPAM;
};
}
}
Optional<Busy> busy,
List<IceUpdate> iceUpdate,
Optional<Opaque> opaque,
- boolean isMultiRing,
boolean isUrgent
) {
.map(m -> m.stream().map(IceUpdate::from).toList())
.orElse(List.of()),
callMessage.getOpaqueMessage().map(Opaque::from),
- callMessage.isMultiRing(),
callMessage.isUrgent());
}
- public record Offer(long id, String sdp, Type type, byte[] opaque) {
+ public record Offer(long id, Type type, byte[] opaque) {
static Offer from(OfferMessage offerMessage) {
- return new Offer(offerMessage.getId(),
- offerMessage.getSdp(),
- Type.from(offerMessage.getType()),
- offerMessage.getOpaque());
+ return new Offer(offerMessage.getId(), Type.from(offerMessage.getType()), offerMessage.getOpaque());
}
public enum Type {
}
}
- public record Answer(long id, String sdp, byte[] opaque) {
+ public record Answer(long id, byte[] opaque) {
static Answer from(AnswerMessage answerMessage) {
- return new Answer(answerMessage.getId(), answerMessage.getSdp(), answerMessage.getOpaque());
+ return new Answer(answerMessage.getId(), answerMessage.getOpaque());
}
}
}
}
- public record IceUpdate(long id, String sdp, byte[] opaque) {
+ public record IceUpdate(long id, byte[] opaque) {
static IceUpdate from(IceUpdateMessage iceUpdateMessage) {
- return new IceUpdate(iceUpdateMessage.getId(), iceUpdateMessage.getSdp(), iceUpdateMessage.getOpaque());
+ return new IceUpdate(iceUpdateMessage.getId(), iceUpdateMessage.getOpaque());
}
}
final AttachmentFileProvider fileProvider,
Exception exception
) {
- final var source = !envelope.isUnidentifiedSender() && envelope.hasSourceServiceId()
- ? recipientResolver.resolveRecipient(envelope.getSourceAddress())
+ final var serviceId = envelope.getSourceServiceId().map(ServiceId::parseOrNull).orElse(null);
+ final var source = !envelope.isUnidentifiedSender() && serviceId != null
+ ? recipientResolver.resolveRecipient(serviceId)
: envelope.isUnidentifiedSender() && content != null
? recipientResolver.resolveRecipient(content.getSender())
: exception instanceof ProtocolException e