Debug action to clobber local profile and key

// FREEBIE
pull/1/head
Michael Kirk 8 years ago
parent 75ceb62f2f
commit 903d792af4

@ -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…
Cancel
Save