Disable notifications for group chats

pull/39/head
Niels Andriesse 6 years ago
parent a022a699fb
commit 9b613eba90

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

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

Loading…
Cancel
Save