Fix unknown contacts in new closed group screen

This commit is contained in:
nielsandriesse 2020-06-19 14:50:44 +10:00
parent fcf0910e51
commit baf379e6c7

View file

@ -7,8 +7,9 @@ final class NewClosedGroupVC : BaseVC, UITableViewDataSource, UITableViewDelegat
let storage = OWSPrimaryStorage.shared()
storage.dbReadConnection.read { transaction in
TSContactThread.enumerateCollectionObjects(with: transaction) { object, _ in
guard let thread = object as? TSContactThread, thread.isContactFriend else { return }
guard let thread = object as? TSContactThread, thread.shouldThreadBeVisible && thread.isContactFriend else { return }
let hexEncodedPublicKey = thread.contactIdentifier()
guard UserDisplayNameUtilities.getPrivateChatDisplayName(for: hexEncodedPublicKey) != nil else { return }
// We shouldn't be able to add slave devices to groups
if (storage.getMasterHexEncodedPublicKey(for: hexEncodedPublicKey, in: transaction) == nil) {
result.append(hexEncodedPublicKey)