You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
session-ios/SignalUtilitiesKit/Utilities/MessageSender+Utilities.swift

18 lines
763 B
Swift

import PromiseKit
public extension MessageSender {
static func send(_ message: Message, in thread: TSThread, using transaction: YapDatabaseReadWriteTransaction) {
message.threadID = thread.uniqueId!
let destination = Message.Destination.from(thread)
let job = MessageSendJob(message: message, destination: destination)
SessionMessagingKit.JobQueue.shared.add(job, using: transaction)
}
static func sendNonDurably(_ message: Message, in thread: TSThread, using transaction: YapDatabaseReadWriteTransaction) -> Promise<Void> {
message.threadID = thread.uniqueId!
let destination = Message.Destination.from(thread)
return MessageSender.send(message, to: destination, using: transaction)
}
}