Merge pull request #196 from RyanRory/sync-contact-fix

Fix Threads Not Being Shown After Sync
pull/198/head
Niels Andriesse 5 years ago committed by GitHub
commit 588c1347d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -188,6 +188,9 @@ public final class SyncMessagesProtocol : NSObject {
storage.setFriendRequestStatus(.friends, for: hexEncodedPublicKey, transaction: transaction) storage.setFriendRequestStatus(.friends, for: hexEncodedPublicKey, transaction: transaction)
default: break default: break
} }
let thread = TSContactThread.getOrCreateThread(withContactId: hexEncodedPublicKey, transaction: transaction)
thread.shouldThreadBeVisible = true
thread.save(with: transaction)
} }
} }
@ -205,6 +208,7 @@ public final class SyncMessagesProtocol : NSObject {
var thread: TSGroupThread! = TSGroupThread(groupId: groupModel.groupId, transaction: transaction) var thread: TSGroupThread! = TSGroupThread(groupId: groupModel.groupId, transaction: transaction)
if thread == nil { if thread == nil {
thread = TSGroupThread.getOrCreateThread(with: groupModel, transaction: transaction) thread = TSGroupThread.getOrCreateThread(with: groupModel, transaction: transaction)
thread.shouldThreadBeVisible = true
thread.save(with: transaction) thread.save(with: transaction)
} }
ClosedGroupsProtocol.establishSessionsIfNeeded(with: groupModel.groupMemberIds, in: thread, using: transaction) ClosedGroupsProtocol.establishSessionsIfNeeded(with: groupModel.groupMemberIds, in: thread, using: transaction)

Loading…
Cancel
Save