mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-22 09:32:52 +02:00
@@ -227,6 +227,13 @@ NSString *const kRecentsDataSourceTapOnDirectoryServerChange = @"kRecentsDataSou
|
||||
|
||||
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
|
||||
{
|
||||
// Sanity check
|
||||
if (tableView.tag != self.recentsDataSourceMode)
|
||||
{
|
||||
// The view controller of this table view is not the current selected one in the tab bar controller.
|
||||
return 0;
|
||||
}
|
||||
|
||||
NSInteger sectionsCount = 0;
|
||||
|
||||
// Check whether all data sources are ready before rendering recents
|
||||
@@ -272,6 +279,13 @@ NSString *const kRecentsDataSourceTapOnDirectoryServerChange = @"kRecentsDataSou
|
||||
|
||||
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
|
||||
{
|
||||
// Sanity check
|
||||
if (tableView.tag != self.recentsDataSourceMode)
|
||||
{
|
||||
// The view controller of this table view is not the current selected one in the tab bar controller.
|
||||
return 0;
|
||||
}
|
||||
|
||||
NSUInteger count = 0;
|
||||
|
||||
if (section == favoritesSection && !(shrinkedSectionsBitMask & RECENTSDATASOURCE_SECTION_FAVORITES))
|
||||
@@ -660,6 +674,14 @@ NSString *const kRecentsDataSourceTapOnDirectoryServerChange = @"kRecentsDataSou
|
||||
|
||||
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
|
||||
{
|
||||
// Sanity check
|
||||
if (tableView.tag != self.recentsDataSourceMode)
|
||||
{
|
||||
// The view controller of this table view is not the current selected one in the tab bar controller.
|
||||
// Return a fake cell to prevent app from crashing
|
||||
return [[UITableViewCell alloc] init];
|
||||
}
|
||||
|
||||
if (indexPath.section == directorySection)
|
||||
{
|
||||
NSIndexPath *indexPathInPublicRooms = [NSIndexPath indexPathForRow:indexPath.row inSection:0];
|
||||
@@ -808,6 +830,19 @@ NSString *const kRecentsDataSourceTapOnDirectoryServerChange = @"kRecentsDataSou
|
||||
return 0;
|
||||
}
|
||||
|
||||
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath
|
||||
{
|
||||
// Sanity check
|
||||
if (tableView.tag != self.recentsDataSourceMode)
|
||||
{
|
||||
// The view controller of this table view is not the current selected one in the tab bar controller.
|
||||
return NO;
|
||||
}
|
||||
|
||||
// Invited rooms are not editable.
|
||||
return (indexPath.section != invitesSection);
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
|
||||
- (NSInteger)cellIndexPosWithRoomId:(NSString*)roomId andMatrixSession:(MXSession*)matrixSession within:(NSMutableArray*)cellDataArray
|
||||
@@ -1192,12 +1227,6 @@ NSString *const kRecentsDataSourceTapOnDirectoryServerChange = @"kRecentsDataSou
|
||||
}
|
||||
}
|
||||
|
||||
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath
|
||||
{
|
||||
// Invited rooms are not editable.
|
||||
return (indexPath.section != invitesSection);
|
||||
}
|
||||
|
||||
#pragma mark - drag and drop managemenent
|
||||
|
||||
- (BOOL)isDraggableCellAt:(NSIndexPath*)path
|
||||
|
||||
Reference in New Issue
Block a user