Fix synced messages not being marked as sent
This commit is contained in:
parent
e38aaa4e0e
commit
f84f94de60
|
@ -31,7 +31,17 @@ extension Storage {
|
|||
let thread = TSThread.fetch(uniqueId: threadID, transaction: transaction) else { return nil }
|
||||
let tsMessage: TSMessage
|
||||
if message.sender == getUserPublicKey() {
|
||||
tsMessage = TSOutgoingMessage.from(message, associatedWith: thread, using: transaction)
|
||||
let tsOutgoingMessage = TSOutgoingMessage.from(message, associatedWith: thread, using: transaction)
|
||||
var recipients: [String] = []
|
||||
if let syncTarget = message.syncTarget {
|
||||
recipients.append(syncTarget)
|
||||
} else if let thread = thread as? TSGroupThread, thread.isClosedGroup {
|
||||
recipients = thread.groupModel.groupMemberIds
|
||||
}
|
||||
recipients.forEach { recipient in
|
||||
tsOutgoingMessage.update(withSentRecipient: recipient, wasSentByUD: true, transaction: transaction)
|
||||
}
|
||||
tsMessage = tsOutgoingMessage
|
||||
} else {
|
||||
tsMessage = TSIncomingMessage.from(message, quotedMessage: quotedMessage, linkPreview: linkPreview, associatedWith: thread)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue