From f8bab558b23dbb9d493362a7caa4a786070ba564 Mon Sep 17 00:00:00 2001 From: nielsandriesse Date: Tue, 16 Jun 2020 11:31:19 +1000 Subject: [PATCH] Fix build --- .../Loki/Protocol/Multi Device/MultiDeviceProtocol.swift | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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) + } } }