Fix timestamp issue

This commit is contained in:
Niels Andriesse 2021-04-23 14:50:56 +10:00
parent cfb1d78d35
commit 5021357661

View file

@ -78,6 +78,7 @@ public final class OpenGroupPollerV2 : NSObject {
let envelope = SNProtoEnvelope.builder(type: .sessionMessage, timestamp: message.sentTimestamp) let envelope = SNProtoEnvelope.builder(type: .sessionMessage, timestamp: message.sentTimestamp)
envelope.setContent(data) envelope.setContent(data)
envelope.setSource(message.sender!) // Safe because messages with a nil sender are filtered out envelope.setSource(message.sender!) // Safe because messages with a nil sender are filtered out
envelope.setServerTimestamp(message.sentTimestamp)
let job = MessageReceiveJob(data: try! envelope.buildSerializedData(), openGroupMessageServerID: UInt64(message.serverID!), openGroupID: openGroupID, isBackgroundPoll: isBackgroundPoll) let job = MessageReceiveJob(data: try! envelope.buildSerializedData(), openGroupMessageServerID: UInt64(message.serverID!), openGroupID: openGroupID, isBackgroundPoll: isBackgroundPoll)
SNMessagingKitConfiguration.shared.storage.write { transaction in SNMessagingKitConfiguration.shared.storage.write { transaction in
SessionMessagingKit.JobQueue.shared.add(job, using: transaction) SessionMessagingKit.JobQueue.shared.add(job, using: transaction)