mirror of
https://github.com/oxen-io/session-ios.git
synced 2023-12-13 21:30:14 +01:00
fix when rejoining open groups messages sent were not loaded (case 4)
This commit is contained in:
parent
56dface3ba
commit
837aa54e07
|
@ -150,6 +150,7 @@ public final class LokiPublicChatPoller : NSObject {
|
|||
if !wasSentByCurrentUser {
|
||||
content.setDataMessage(try! dataMessage.build())
|
||||
} else {
|
||||
SyncMessagesProtocol.addForceSyncMessageTimestamp(message.timestamp, from: senderHexEncodedPublicKey)
|
||||
let syncMessageSentBuilder = SSKProtoSyncMessageSent.builder()
|
||||
syncMessageSentBuilder.setMessage(try! dataMessage.build())
|
||||
syncMessageSentBuilder.setDestination(userHexEncodedPublicKey)
|
||||
|
|
|
@ -96,6 +96,15 @@ public final class SyncMessagesProtocol : NSObject {
|
|||
let hexEncodedPublicKey = envelope.source!
|
||||
return LokiDatabaseUtilities.isUserLinkedDevice(hexEncodedPublicKey, transaction: transaction)
|
||||
}
|
||||
|
||||
@objc(addForceSyncMessageTimestamp:from:)
|
||||
public static func addForceSyncMessageTimestamp(_ timestamp: UInt64, from hexEncodedPublicKey: String) {
|
||||
var timestamps: Set<UInt64> = syncMessageTimestamps[hexEncodedPublicKey] ?? []
|
||||
if timestamps.contains(timestamp) {
|
||||
timestamps.remove(timestamp)
|
||||
}
|
||||
syncMessageTimestamps[hexEncodedPublicKey] = timestamps
|
||||
}
|
||||
|
||||
// TODO: We should probably look at why sync messages are being duplicated rather than doing this
|
||||
@objc(isDuplicateSyncMessage:fromHexEncodedPublicKey:)
|
||||
|
|
Loading…
Reference in a new issue