зеркало из https://github.com/nextcloud/talk-ios.git
Add hasUnreadMention to NCRoom object.
Signed-off-by: Ivan Sein <ivan@nextcloud.com>
This commit is contained in:
Родитель
af309fc537
Коммит
ebc37c0334
|
@ -104,6 +104,7 @@ extern NSString * const NCRoomObjectTypeSharePassword;
|
|||
- (BOOL)isNameEditable;
|
||||
- (BOOL)isLeavable;
|
||||
- (BOOL)userCanStartCall;
|
||||
- (BOOL)hasUnreadMention;
|
||||
- (NSString *)deletionMessage;
|
||||
- (NSString *)notificationLevelString;
|
||||
- (NSString *)stringForNotificationLevel:(NCRoomNotificationLevel)level;
|
||||
|
|
|
@ -176,6 +176,11 @@ NSString * const NCRoomObjectTypeSharePassword = @"share:password";
|
|||
return YES;
|
||||
}
|
||||
|
||||
- (BOOL)hasUnreadMention
|
||||
{
|
||||
return self.unreadMention || self.unreadMentionDirect || (self.type == kNCRoomTypeOneToOne && self.unreadMessages > 0);
|
||||
}
|
||||
|
||||
- (BOOL)isLeavable
|
||||
{
|
||||
// Allow users to leave when there are no moderators in the room
|
||||
|
|
|
@ -481,7 +481,7 @@ typedef void (^FetchRoomsCompletionBlock)(BOOL success);
|
|||
_lastRoomWithMentionIndexPath = nil;
|
||||
for (int i = 0; i < _rooms.count; i++) {
|
||||
NCRoom *room = [_rooms objectAtIndex:i];
|
||||
if (room.unreadMention || room.unreadMentionDirect || (room.type == kNCRoomTypeOneToOne && room.unreadMessages > 0)) {
|
||||
if (room.hasUnreadMention) {
|
||||
_lastRoomWithMentionIndexPath = [NSIndexPath indexPathForRow:i inSection:0];
|
||||
}
|
||||
}
|
||||
|
@ -601,7 +601,7 @@ typedef void (^FetchRoomsCompletionBlock)(BOOL success);
|
|||
if (_lastRoomWithMentionIndexPath) {
|
||||
for (int i = (int)lastVisibleRowIndexPath.row; i <= (int)_lastRoomWithMentionIndexPath.row; i++) {
|
||||
NCRoom *room = [_rooms objectAtIndex:i];
|
||||
if (room.unreadMention || room.unreadMentionDirect || (room.type == kNCRoomTypeOneToOne && room.unreadMessages > 0)) {
|
||||
if (room.hasUnreadMention) {
|
||||
_nextRoomWithMentionIndexPath = [NSIndexPath indexPathForRow:i inSection:0];
|
||||
break;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче