mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 18:40:39 +00:00
Update libsignal-service
This commit is contained in:
parent
86f50e0355
commit
409a707baa
6 changed files with 23 additions and 19 deletions
|
@ -708,7 +708,9 @@ public record MessageEnvelope(
|
|||
Optional<Hangup> hangup,
|
||||
Optional<Busy> busy,
|
||||
List<IceUpdate> iceUpdate,
|
||||
Optional<Opaque> opaque
|
||||
Optional<Opaque> opaque,
|
||||
boolean isMultiRing,
|
||||
boolean isUrgent
|
||||
) {
|
||||
|
||||
public static Call from(final SignalServiceCallMessage callMessage) {
|
||||
|
@ -722,7 +724,9 @@ public record MessageEnvelope(
|
|||
callMessage.getIceUpdateMessages()
|
||||
.map(m -> m.stream().map(IceUpdate::from).toList())
|
||||
.orElse(List.of()),
|
||||
callMessage.getOpaqueMessage().map(Opaque::from));
|
||||
callMessage.getOpaqueMessage().map(Opaque::from),
|
||||
callMessage.isMultiRing(),
|
||||
callMessage.isUrgent());
|
||||
}
|
||||
|
||||
public record Offer(long id, String sdp, Type type, byte[] opaque) {
|
||||
|
@ -895,7 +899,7 @@ public record MessageEnvelope(
|
|||
final AttachmentFileProvider fileProvider,
|
||||
Exception exception
|
||||
) {
|
||||
final var source = !envelope.isUnidentifiedSender() && envelope.hasSourceUuid()
|
||||
final var source = !envelope.isUnidentifiedSender() && envelope.hasSourceServiceId()
|
||||
? recipientResolver.resolveRecipient(envelope.getSourceAddress())
|
||||
: envelope.isUnidentifiedSender() && content != null
|
||||
? recipientResolver.resolveRecipient(content.getSender())
|
||||
|
|
|
@ -137,7 +137,7 @@ public final class IncomingMessageHandler {
|
|||
final Manager.ReceiveMessageHandler handler
|
||||
) {
|
||||
final var actions = new ArrayList<HandleAction>();
|
||||
if (envelope.hasSourceUuid()) {
|
||||
if (envelope.hasSourceServiceId()) {
|
||||
// Store uuid if we don't have it already
|
||||
// address/uuid in envelope is sent by server
|
||||
account.getRecipientTrustedResolver().resolveRecipientTrusted(envelope.getSourceAddress());
|
||||
|
@ -960,7 +960,7 @@ public final class IncomingMessageHandler {
|
|||
}
|
||||
|
||||
private SignalServiceAddress getSenderAddress(SignalServiceEnvelope envelope, SignalServiceContent content) {
|
||||
if (!envelope.isUnidentifiedSender() && envelope.hasSourceUuid()) {
|
||||
if (!envelope.isUnidentifiedSender() && envelope.hasSourceServiceId()) {
|
||||
return envelope.getSourceAddress();
|
||||
} else if (content != null) {
|
||||
return content.getSender();
|
||||
|
@ -970,7 +970,7 @@ public final class IncomingMessageHandler {
|
|||
}
|
||||
|
||||
private DeviceAddress getSender(SignalServiceEnvelope envelope, SignalServiceContent content) {
|
||||
if (!envelope.isUnidentifiedSender() && envelope.hasSourceUuid()) {
|
||||
if (!envelope.isUnidentifiedSender() && envelope.hasSourceServiceId()) {
|
||||
return new DeviceAddress(context.getRecipientHelper().resolveRecipient(envelope.getSourceAddress()),
|
||||
envelope.getSourceAddress().getServiceId(),
|
||||
envelope.getSourceDevice());
|
||||
|
@ -985,7 +985,7 @@ public final class IncomingMessageHandler {
|
|||
if (!envelope.hasDestinationUuid()) {
|
||||
return new DeviceAddress(account.getSelfRecipientId(), account.getAci(), account.getDeviceId());
|
||||
}
|
||||
final var addressOptional = SignalServiceAddress.fromRaw(envelope.getDestinationUuid(), null);
|
||||
final var addressOptional = SignalServiceAddress.fromRaw(envelope.getDestinationServiceId(), null);
|
||||
if (addressOptional.isEmpty()) {
|
||||
return new DeviceAddress(account.getSelfRecipientId(), account.getAci(), account.getDeviceId());
|
||||
}
|
||||
|
|
|
@ -147,7 +147,7 @@ public class ReceiveHelper {
|
|||
for (final var it : batch) {
|
||||
SignalServiceEnvelope envelope1 = new SignalServiceEnvelope(it.getEnvelope(),
|
||||
it.getServerDeliveredTimestamp());
|
||||
final var recipientId = envelope1.hasSourceUuid() ? account.getRecipientResolver()
|
||||
final var recipientId = envelope1.hasSourceServiceId() ? account.getRecipientResolver()
|
||||
.resolveRecipient(envelope1.getSourceAddress()) : null;
|
||||
logger.trace("Storing new message from {}", recipientId);
|
||||
// store message on disk, before acknowledging receipt to the server
|
||||
|
@ -226,7 +226,7 @@ public class ReceiveHelper {
|
|||
if (exception instanceof UntrustedIdentityException) {
|
||||
logger.debug("Keeping message with untrusted identity in message cache");
|
||||
final var address = ((UntrustedIdentityException) exception).getSender();
|
||||
if (!envelope.hasSourceUuid() && address.uuid().isPresent()) {
|
||||
if (!envelope.hasSourceServiceId() && address.uuid().isPresent()) {
|
||||
final var recipientId = account.getRecipientResolver()
|
||||
.resolveRecipient(ServiceId.from(address.uuid().get()));
|
||||
try {
|
||||
|
@ -273,7 +273,7 @@ public class ReceiveHelper {
|
|||
cachedMessage.delete();
|
||||
return null;
|
||||
}
|
||||
if (!envelope.hasSourceUuid()) {
|
||||
if (!envelope.hasSourceServiceId()) {
|
||||
final var identifier = ((UntrustedIdentityException) exception).getSender();
|
||||
final var recipientId = account.getRecipientResolver()
|
||||
.resolveRecipient(new RecipientAddress(identifier));
|
||||
|
|
|
@ -25,7 +25,7 @@ final class SignalWebSocketHealthMonitor implements HealthMonitor {
|
|||
|
||||
private final static Logger logger = LoggerFactory.getLogger(SignalWebSocketHealthMonitor.class);
|
||||
|
||||
private static final long KEEP_ALIVE_SEND_CADENCE = TimeUnit.SECONDS.toMillis(WebSocketConnection.KEEPALIVE_TIMEOUT_SECONDS);
|
||||
private static final long KEEP_ALIVE_SEND_CADENCE = TimeUnit.SECONDS.toMillis(WebSocketConnection.KEEPALIVE_FREQUENCY_SECONDS);
|
||||
private static final long MAX_TIME_SINCE_SUCCESSFUL_KEEP_ALIVE = KEEP_ALIVE_SEND_CADENCE * 3;
|
||||
|
||||
private SignalWebSocket signalWebSocket;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue