Disable notifications for group chats

This commit is contained in:
Niels Andriesse 2019-08-22 10:45:47 +10:00
parent a022a699fb
commit 9b613eba90
2 changed files with 8 additions and 1 deletions

View File

@ -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"];

View File

@ -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:@{