Deduplicate users in contact view helper.
This commit is contained in:
parent
be1e765e77
commit
2bb22d344e
@ -250,7 +250,15 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
[accountsToProcess addObject:[[SignalAccount alloc] initWithSignalServiceAddress:address]];
|
||||
}
|
||||
|
||||
NSMutableSet<SignalServiceAddress *> *addressSet = [NSMutableSet new];
|
||||
for (SignalAccount *signalAccount in accountsToProcess) {
|
||||
if ([addressSet containsObject:signalAccount.recipientAddress]) {
|
||||
OWSLogVerbose(@"Ignoring duplicate: %@", signalAccount.recipientAddress);
|
||||
// We prefer the copy from contactsManager which will appear first
|
||||
// in accountsToProcess; don't overwrite it.
|
||||
continue;
|
||||
}
|
||||
[addressSet addObject:signalAccount.recipientAddress];
|
||||
if (signalAccount.recipientPhoneNumber) {
|
||||
phoneNumberSignalAccountMap[signalAccount.recipientPhoneNumber] = signalAccount;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user