Only include contacts with a visible thread

This commit is contained in:
nielsandriesse 2021-02-24 14:16:52 +11:00
parent 643bfbdb41
commit be466c26fc
1 changed files with 2 additions and 0 deletions

View File

@ -32,6 +32,8 @@ extension ConfigurationMessage {
OWSUserProfile.enumerateCollectionObjects(with: transaction) { object, stop in
guard let profile = object as? OWSUserProfile, let displayName = profile.profileName else { return }
let publicKey = profile.recipientId
let threadID = TSContactThread.threadId(fromContactId: publicKey)
guard let thread = TSContactThread.fetch(uniqueId: threadID, transaction: transaction), thread.shouldThreadBeVisible else { return }
let profilePictureURL = profile.avatarUrlPath
let profileKey = profile.profileKey?.keyData
let contact = ConfigurationMessage.Contact(publicKey: publicKey, displayName: displayName,