Messages: Regular notifications should be ignored when the room is in mentions only mode.

This commit is contained in:
giomfo
2016-09-12 21:22:34 +02:00
parent dde04d57af
commit 1de9860ca0
2 changed files with 34 additions and 0 deletions
+14
View File
@@ -22,6 +22,8 @@
#import "MXKRoomBubbleTableViewCell+Vector.h"
#import "AvatarGenerator.h"
#import "MXRoom+Vector.h"
@implementation RoomDataSource
- (instancetype)initWithRoomId:(NSString *)roomId andMatrixSession:(MXSession *)matrixSession
@@ -51,6 +53,18 @@
return self;
}
// Ignore regular notification count if the room is in 'mentions only" mode
- (NSUInteger)notificationCount
{
if (self.room.isMentionsOnly)
{
// Only the highlighted missed messages are counted
return super.highlightCount;
}
return super.notificationCount;
}
- (void)didReceiveReceiptEvent:(MXEvent *)receiptEvent roomState:(MXRoomState *)roomState
{
// Override this callback to force rendering of each cell with read receipts information.