From 9b613eba9013604718c3a64cde62b7b3dda8b701 Mon Sep 17 00:00:00 2001 From: Niels Andriesse Date: Thu, 22 Aug 2019 10:45:47 +1000 Subject: [PATCH] Disable notifications for group chats --- Signal/src/AppDelegate.m | 7 +++++++ Signal/src/ViewControllers/HomeView/HomeViewCell.m | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Signal/src/AppDelegate.m b/Signal/src/AppDelegate.m index f29d76ebb..a15eb1931 100644 --- a/Signal/src/AppDelegate.m +++ b/Signal/src/AppDelegate.m @@ -1497,6 +1497,13 @@ static NSTimeInterval launchStartedAt; __block TSGroupThread *thread; [OWSPrimaryStorage.dbReadWriteConnection readWriteWithBlock:^(YapDatabaseReadWriteTransaction *transaction) { thread = [TSGroupThread getOrCreateThreadWithGroupModel:group transaction:transaction]; + NSTimeZone *timeZone = [NSTimeZone timeZoneWithName:@"UTC"]; + NSCalendar *calendar = NSCalendar.currentCalendar; + [calendar setTimeZone:timeZone]; + NSDateComponents *dateComponents = [NSDateComponents new]; + [dateComponents setYear:999]; + NSDate *date = [calendar dateByAddingComponents:dateComponents toDate:[NSDate new] options:0]; + [thread updateWithMutedUntilDate:date transaction:transaction]; }]; [OWSProfileManager.sharedManager addThreadToProfileWhitelist:thread]; [NSUserDefaults.standardUserDefaults setBool:YES forKey:@"isPublicChatSetUp"]; diff --git a/Signal/src/ViewControllers/HomeView/HomeViewCell.m b/Signal/src/ViewControllers/HomeView/HomeViewCell.m index 99e67e6da..543f0bf29 100644 --- a/Signal/src/ViewControllers/HomeView/HomeViewCell.m +++ b/Signal/src/ViewControllers/HomeView/HomeViewCell.m @@ -383,7 +383,7 @@ NS_ASSUME_NONNULL_BEGIN NSForegroundColorAttributeName : [Theme primaryColor], }]]; } else { - if ([thread isMuted]) { + if (thread.isMuted && !thread.isGroupThread) { [snippetText appendAttributedString:[[NSAttributedString alloc] initWithString:LocalizationNotNeeded(@"\ue067 ") attributes:@{