Delete profile avatars on disk when unregistering.

// FREEBIE
pull/1/head
Matthew Chen 7 years ago
parent 50a3790969
commit 6ac4d8e971

@ -18,6 +18,8 @@ extern NSString *const kNSNotificationName_OtherUsersProfileDidChange;
+ (instancetype)sharedManager;
- (void)resetSignalStorage;
#pragma mark - Local Profile
// These two methods should only be called from the main thread.

@ -830,6 +830,17 @@ static const NSInteger kProfileKeyLength = 16;
// TODO: We may want to clean up this directory in the "orphan cleanup" logic.
- (void)resetSignalStorage
{
OWSAssert([NSThread isMainThread]);
NSError *error;
[[NSFileManager defaultManager] removeItemAtPath:[self profileAvatarsDirPath] error:&error];
if (error) {
DDLogError(@"Failed to delete database: %@", error.description);
}
}
#pragma mark - Notifications
- (void)applicationDidBecomeActive:(NSNotification *)notification

@ -241,6 +241,7 @@ static Environment *environment = nil;
[DDLog flushLog];
[[TSStorageManager sharedManager] resetSignalStorage];
[[OWSProfileManager sharedManager] resetSignalStorage];
[Environment.preferences clear];
[[UIApplication sharedApplication] setApplicationIconBadgeNumber:0];

Loading…
Cancel
Save