Merge branch 'mkirk/remove-profile-key-debug'
This commit is contained in:
commit
7dbf372f77
@ -50,6 +50,7 @@ extern const NSUInteger kOWSProfileManager_MaxAvatarDiameter;
|
||||
// These methods are for debugging.
|
||||
- (void)clearProfileWhitelist;
|
||||
- (void)logProfileWhitelist;
|
||||
- (void)regenerateLocalProfile;
|
||||
#endif
|
||||
|
||||
- (void)addThreadToProfileWhitelist:(TSThread *)thread;
|
||||
|
||||
@ -663,6 +663,21 @@ const NSUInteger kOWSProfileManager_MaxAvatarDiameter = 640;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
- (void)regenerateLocalProfile
|
||||
{
|
||||
@synchronized(self)
|
||||
{
|
||||
_localUserProfile = nil;
|
||||
DDLogWarn(@"%@ Removing local user profile", self.tag);
|
||||
[self.dbConnection readWriteWithBlock:^(YapDatabaseReadWriteTransaction *_Nonnull transaction) {
|
||||
[transaction removeObjectForKey:kLocalProfileUniqueId inCollection:[UserProfile collection]];
|
||||
}];
|
||||
|
||||
// rebuild localUserProfile
|
||||
OWSAssert(self.localUserProfile);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
- (void)addUserToProfileWhitelist:(NSString *)recipientId
|
||||
|
||||
@ -62,6 +62,10 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
actionBlock:^{
|
||||
[OWSProfileManager.sharedManager logProfileWhitelist];
|
||||
}]];
|
||||
[items addObject:[OWSTableItem itemWithTitle:@"Regenerate Profile/ProfileKey"
|
||||
actionBlock:^{
|
||||
[[OWSProfileManager sharedManager] regenerateLocalProfile];
|
||||
}]];
|
||||
#endif
|
||||
[items addObject:[OWSTableItem itemWithTitle:@"Clear hasDismissedOffers"
|
||||
actionBlock:^{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user