mirror of
https://github.com/signalapp/Signal-Server
synced 2026-04-20 13:07:58 +01:00
Gracefully handle NotPushRegisteredException
This commit is contained in:
@@ -52,8 +52,7 @@ public class MessageSender {
|
||||
this.pushLatencyManager = pushLatencyManager;
|
||||
}
|
||||
|
||||
public void sendMessage(final Account account, final Device device, final Envelope message, final boolean online)
|
||||
throws NotPushRegisteredException {
|
||||
public void sendMessage(final Account account, final Device device, final Envelope message, final boolean online) {
|
||||
|
||||
final String channel;
|
||||
|
||||
@@ -64,7 +63,7 @@ public class MessageSender {
|
||||
} else if (device.getFetchesMessages()) {
|
||||
channel = "websocket";
|
||||
} else {
|
||||
throw new AssertionError();
|
||||
channel = "none";
|
||||
}
|
||||
|
||||
final boolean clientPresent;
|
||||
@@ -89,10 +88,7 @@ public class MessageSender {
|
||||
|
||||
final boolean useVoip = StringUtils.isNotBlank(device.getVoipApnId());
|
||||
RedisOperation.unchecked(() -> pushLatencyManager.recordPushSent(account.getUuid(), device.getId(), useVoip, message.getUrgent()));
|
||||
} catch (final NotPushRegisteredException e) {
|
||||
if (!device.getFetchesMessages()) {
|
||||
throw e;
|
||||
}
|
||||
} catch (final NotPushRegisteredException ignored) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,8 +55,6 @@ public class ReceiptSender {
|
||||
for (final Device destinationDevice : destinationAccount.getDevices()) {
|
||||
try {
|
||||
messageSender.sendMessage(destinationAccount, destinationDevice, message.build(), false);
|
||||
} catch (final NotPushRegisteredException e) {
|
||||
logger.debug("User no longer push registered for delivery receipt: {}", e.getMessage());
|
||||
} catch (final Exception e) {
|
||||
logger.warn("Could not send delivery receipt", e);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user