Skip to content

Commit b18f3bc

Browse files
committed
Merge branch 'charlesmchen/unregisterVsProfileCache'
2 parents 50a3790 + 0377421 commit b18f3bc

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

Signal/src/Profiles/OWSProfileManager.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ extern NSString *const kNSNotificationName_OtherUsersProfileDidChange;
1818

1919
+ (instancetype)sharedManager;
2020

21+
- (void)resetProfileStorage;
22+
2123
#pragma mark - Local Profile
2224

2325
// These two methods should only be called from the main thread.

Signal/src/Profiles/OWSProfileManager.m

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -830,6 +830,17 @@ - (NSString *)profileAvatarsDirPath
830830

831831
// TODO: We may want to clean up this directory in the "orphan cleanup" logic.
832832

833+
- (void)resetProfileStorage
834+
{
835+
OWSAssert([NSThread isMainThread]);
836+
837+
NSError *error;
838+
[[NSFileManager defaultManager] removeItemAtPath:[self profileAvatarsDirPath] error:&error];
839+
if (error) {
840+
DDLogError(@"Failed to delete database: %@", error.description);
841+
}
842+
}
843+
833844
#pragma mark - Notifications
834845

835846
- (void)applicationDidBecomeActive:(NSNotification *)notification

Signal/src/environment/Environment.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,7 @@ + (void)resetAppData {
241241
[DDLog flushLog];
242242

243243
[[TSStorageManager sharedManager] resetSignalStorage];
244+
[[OWSProfileManager sharedManager] resetProfileStorage];
244245
[Environment.preferences clear];
245246
[[UIApplication sharedApplication] setApplicationIconBadgeNumber:0];
246247

0 commit comments

Comments
 (0)