diff --git a/SignalServiceKit/src/Loki/Protocol/Multi Device/MultiDeviceProtocol.swift b/SignalServiceKit/src/Loki/Protocol/Multi Device/MultiDeviceProtocol.swift index 282275699..6173d544a 100644 --- a/SignalServiceKit/src/Loki/Protocol/Multi Device/MultiDeviceProtocol.swift +++ b/SignalServiceKit/src/Loki/Protocol/Multi Device/MultiDeviceProtocol.swift @@ -64,7 +64,6 @@ public final class MultiDeviceProtocol : NSObject { } } return threadPromise.then2 { thread -> Promise in - return threadPromise.then(on: OWSDispatch.sendingQueue()) { thread -> Promise in let message = messageSend.message let messageSender = SSKEnvironment.shared.messageSender let (promise, seal) = Promise.pending() @@ -73,7 +72,9 @@ public final class MultiDeviceProtocol : NSObject { && message.shouldBeSaved() // shouldBeSaved indicates it isn't a transient message if !shouldSendAutoGeneratedFR { let messageSendCopy = copy(messageSend, for: destination, with: seal) - messageSender.sendMessage(messageSendCopy) + OWSDispatch.sendingQueue().async { + messageSender.sendMessage(messageSendCopy) + } } else { Storage.write { transaction in getAutoGeneratedMultiDeviceFRMessageSend(for: destination.hexEncodedPublicKey, in: transaction, seal: seal) @@ -131,7 +132,9 @@ public final class MultiDeviceProtocol : NSObject { }.catch2 { error in // Proceed even if updating the recipient's device links failed, so that message sending // is independent of whether the file server is online - messageSender.sendMessage(messageSend) + OWSDispatch.sendingQueue().async { + messageSender.sendMessage(messageSend) + } } }