From 89260e843fd56ee44729f35f049cb9890fa02187 Mon Sep 17 00:00:00 2001 From: Michael Kirk Date: Fri, 30 Jun 2017 15:57:06 -1000 Subject: [PATCH] Unregistered users should have 0 badge count // FREEBIE --- Signal/src/AppDelegate.m | 3 +++ Signal/src/environment/Environment.m | 2 ++ 2 files changed, 5 insertions(+) diff --git a/Signal/src/AppDelegate.m b/Signal/src/AppDelegate.m index 0c45b54df..9c48e7c67 100644 --- a/Signal/src/AppDelegate.m +++ b/Signal/src/AppDelegate.m @@ -169,6 +169,9 @@ static NSString *const kURLHostVerifyPrefix = @"verify"; ifRegistered:NO runAsync:^{ dispatch_async(dispatch_get_main_queue(), ^{ + // Unregistered user should have no unread messages. e.g. if you delete your account. + [[UIApplication sharedApplication] setApplicationIconBadgeNumber:0]; + DDLogInfo(@"%@ running post launch block for unregistered user.", self.tag); [TSSocketManager requestSocketOpen]; diff --git a/Signal/src/environment/Environment.m b/Signal/src/environment/Environment.m index f37b37659..5b041d717 100644 --- a/Signal/src/environment/Environment.m +++ b/Signal/src/environment/Environment.m @@ -242,6 +242,8 @@ static Environment *environment = nil; [[TSStorageManager sharedManager] resetSignalStorage]; [Environment.preferences clear]; + [[UIApplication sharedApplication] setApplicationIconBadgeNumber:0]; + [DebugLogger.sharedLogger wipeLogs]; exit(0); }