Reinstate notification when SignalAccounts change

// FREEBIE
pull/1/head
Michael Kirk 7 years ago
parent 6f7cae691c
commit c07d7777cb

@ -46,6 +46,10 @@ NS_ASSUME_NONNULL_BEGIN
actionBlock:^{
[DebugUIContacts deleteAllContacts];
}],
[OWSTableItem itemWithTitle:@"Clear SignalAccount Cache"
actionBlock:^{
[DebugUIContacts clearSignalAccountCache];
}],
]];
}
@ -1280,6 +1284,12 @@ NS_ASSUME_NONNULL_BEGIN
}];
}
+ (void)clearSignalAccountCache
{
DDLogWarn(@"%@ Deleting all signal accounts.", self.logTag);
[SignalAccount removeAllObjectsInCollection];
}
+ (void)deleteAllContacts
{
[self deleteContactsWithFilter:^(CNContact *contact) {

@ -273,6 +273,10 @@ NSString *const OWSContactsManagerSignalAccountsDidChangeNotification
self.signalAccountMap = [signalAccountMap copy];
self.signalAccounts = [signalAccounts copy];
[self.profileManager setContactRecipientIds:signalAccountMap.allKeys];
[[NSNotificationCenter defaultCenter]
postNotificationNameAsync:OWSContactsManagerSignalAccountsDidChangeNotification
object:nil];
}
// TODO dependency inject, avoid circular dependencies.

Loading…
Cancel
Save