mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-05-01 21:56:58 +02:00
Merge remote-tracking branch 'origin/develop' into public_rooms_search
Conflicts: Vector/Base.lproj/Main.storyboard Vector/Model/RoomList/RecentsDataSource.m
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
/*
|
||||
Copyright 2015 OpenMarket Ltd
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <MatrixSDK/MatrixSDK.h>
|
||||
|
||||
#import "MXKRecentCellData.h"
|
||||
/**
|
||||
`RecentCellData` is Vector cuustomized MXKRecentCellData` cell.
|
||||
*/
|
||||
@interface RecentCellData : MXKRecentCellData
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
Copyright 2015 OpenMarket Ltd
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
#import "RecentCellData.h"
|
||||
|
||||
#import "MXRoom+Vector.h"
|
||||
|
||||
@implementation RecentCellData
|
||||
// trick to hide the mother class property as it is readonly one.
|
||||
// self.roomDisplayname returns this value instead of the mother class.
|
||||
@synthesize roomDisplayname;
|
||||
|
||||
- (void)update
|
||||
{
|
||||
[super update];
|
||||
roomDisplayname = self.roomDataSource.room.vectorDisplayname;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -25,6 +25,10 @@
|
||||
|
||||
#import "PublicRoomsDirectoryDataSource.h"
|
||||
|
||||
#import "MXRoom+Vector.h"
|
||||
|
||||
#import "RecentCellData.h"
|
||||
|
||||
@interface RecentsDataSource()
|
||||
{
|
||||
NSMutableArray* invitesCellDataArray;
|
||||
@@ -67,6 +71,9 @@
|
||||
sectionsCount = 0;
|
||||
|
||||
roomTagsListenerByUserId = [[NSMutableDictionary alloc] init];
|
||||
|
||||
// Set default data and view classes
|
||||
[self registerCellDataClass:RecentCellData.class forCellIdentifier:kMXKRecentCellIdentifier];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
@@ -141,6 +148,28 @@
|
||||
}
|
||||
}
|
||||
|
||||
- (BOOL)isRoomNotifiedAtIndexPath:(NSIndexPath *)indexPath
|
||||
{
|
||||
MXRoom* room = [self getRoomAtIndexPath:indexPath];
|
||||
|
||||
if (room)
|
||||
{
|
||||
return !room.areRoomNotificationsMuted;
|
||||
}
|
||||
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (void)muteRoomNotifications:(BOOL)mute atIndexPath:(NSIndexPath *)indexPath
|
||||
{
|
||||
MXRoom* room = [self getRoomAtIndexPath:indexPath];
|
||||
|
||||
// sanity check
|
||||
if (room)
|
||||
{
|
||||
[room toggleRoomNotifications:mute];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)refreshRoomsSectionsAndReload
|
||||
{
|
||||
@@ -698,7 +727,7 @@
|
||||
|
||||
- (void)moveRoomCell:(MXRoom*)room from:(NSIndexPath*)oldPath to:(NSIndexPath*)newPath success:(void (^)())moveSuccess failure:(void (^)(NSError *error))moveFailure;
|
||||
{
|
||||
NSLog(@"[RecentsDataSource] moveCellFrom (%d, %d) to (%d, %d)", oldPath.section, oldPath.row, newPath.section, newPath.row);
|
||||
NSLog(@"[RecentsDataSource] moveCellFrom (%tu, %tu) to (%tu, %tu)", oldPath.section, oldPath.row, newPath.section, newPath.row);
|
||||
|
||||
if ([self canCellMoveFrom:oldPath to:newPath] && ![newPath isEqual:oldPath])
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user