mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-26 03:20:50 +02:00
Merge branch 'develop' into ismail/4384_room_summary_store
This commit is contained in:
@@ -26,7 +26,7 @@
|
||||
|
||||
#import "MXRoom+Riot.h"
|
||||
|
||||
@interface HomeViewController () <SecureBackupSetupCoordinatorBridgePresenterDelegate>
|
||||
@interface HomeViewController () <SecureBackupSetupCoordinatorBridgePresenterDelegate, SpaceMembersCoordinatorBridgePresenterDelegate>
|
||||
{
|
||||
RecentsDataSource *recentsDataSource;
|
||||
|
||||
@@ -48,6 +48,8 @@
|
||||
|
||||
@property (nonatomic, assign, readwrite) BOOL roomListDataReady;
|
||||
|
||||
@property(nonatomic) SpaceMembersCoordinatorBridgePresenter *spaceMembersCoordinatorBridgePresenter;
|
||||
|
||||
@end
|
||||
|
||||
@implementation HomeViewController
|
||||
@@ -254,7 +256,72 @@
|
||||
[self cancelEditionMode:YES];
|
||||
}
|
||||
|
||||
[super onPlusButtonPressed];
|
||||
if (recentsDataSource.currentSpace != nil)
|
||||
{
|
||||
[self showPlusMenuForSpace];
|
||||
}
|
||||
else
|
||||
{
|
||||
[super onPlusButtonPressed];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)showPlusMenuForSpace
|
||||
{
|
||||
__weak typeof(self) weakSelf = self;
|
||||
|
||||
[currentAlert dismissViewControllerAnimated:NO completion:nil];
|
||||
|
||||
currentAlert = [UIAlertController alertControllerWithTitle:nil message:nil preferredStyle:UIAlertControllerStyleActionSheet];
|
||||
|
||||
[currentAlert addAction:[UIAlertAction actionWithTitle:NSLocalizedStringFromTable(@"spaces_explore_rooms", @"Vector", nil)
|
||||
style:UIAlertActionStyleDefault
|
||||
handler:^(UIAlertAction * action) {
|
||||
|
||||
if (weakSelf)
|
||||
{
|
||||
typeof(self) self = weakSelf;
|
||||
self->currentAlert = nil;
|
||||
|
||||
[self showRoomDirectory];
|
||||
}
|
||||
|
||||
}]];
|
||||
|
||||
[currentAlert addAction:[UIAlertAction actionWithTitle:NSLocalizedStringFromTable(@"room_details_people", @"Vector", nil)
|
||||
style:UIAlertActionStyleDefault
|
||||
handler:^(UIAlertAction * action) {
|
||||
|
||||
if (weakSelf)
|
||||
{
|
||||
typeof(self) self = weakSelf;
|
||||
self->currentAlert = nil;
|
||||
|
||||
self.spaceMembersCoordinatorBridgePresenter = [[SpaceMembersCoordinatorBridgePresenter alloc] initWithUserSessionsService:[UserSessionsService shared] session:self.mainSession spaceId:self.dataSource.currentSpace.spaceId];
|
||||
self.spaceMembersCoordinatorBridgePresenter.delegate = self;
|
||||
[self.spaceMembersCoordinatorBridgePresenter presentFrom:self animated:YES];
|
||||
}
|
||||
|
||||
}]];
|
||||
|
||||
|
||||
[currentAlert addAction:[UIAlertAction actionWithTitle:[NSBundle mxk_localizedStringForKey:@"cancel"]
|
||||
style:UIAlertActionStyleCancel
|
||||
handler:^(UIAlertAction * action) {
|
||||
|
||||
if (weakSelf)
|
||||
{
|
||||
typeof(self) self = weakSelf;
|
||||
self->currentAlert = nil;
|
||||
}
|
||||
|
||||
}]];
|
||||
|
||||
[currentAlert popoverPresentationController].sourceView = plusButtonImageView;
|
||||
[currentAlert popoverPresentationController].sourceRect = plusButtonImageView.bounds;
|
||||
|
||||
[currentAlert mxk_setAccessibilityIdentifier:@"RecentsVCCreateRoomAlert"];
|
||||
[self presentViewController:currentAlert animated:YES completion:nil];
|
||||
}
|
||||
|
||||
- (void)cancelEditionMode:(BOOL)forceRefresh
|
||||
@@ -534,7 +601,7 @@
|
||||
UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(onCollectionViewCellTap:)];
|
||||
[cell addGestureRecognizer:tapGesture];
|
||||
|
||||
if ([cellData.roomSummary.roomId isEqualToString:editedRoomId])
|
||||
if ([cellData.roomIdentifier isEqualToString:editedRoomId])
|
||||
{
|
||||
cell.editionArrowView.hidden = NO;
|
||||
}
|
||||
@@ -562,7 +629,17 @@
|
||||
|
||||
id<MXKRecentCellDataStoring> renderedCellData = (id<MXKRecentCellDataStoring>)roomCollectionViewCell.renderedCellData;
|
||||
|
||||
[self.delegate recentListViewController:self didSelectRoom:renderedCellData.roomSummary.roomId inMatrixSession:renderedCellData.mxSession];
|
||||
if (renderedCellData.isSuggestedRoom)
|
||||
{
|
||||
[self.delegate recentListViewController:self
|
||||
didSelectSuggestedRoom:renderedCellData.spaceChildInfo];
|
||||
}
|
||||
else
|
||||
{
|
||||
[self.delegate recentListViewController:self
|
||||
didSelectRoom:renderedCellData.roomIdentifier
|
||||
inMatrixSession:renderedCellData.mxSession];
|
||||
}
|
||||
}
|
||||
|
||||
// Hide the keyboard when user select a room
|
||||
@@ -861,7 +938,17 @@
|
||||
+ recentsDataSource.peopleCellDataArray.count
|
||||
+ recentsDataSource.conversationCellDataArray.count
|
||||
+ recentsDataSource.lowPriorityCellDataArray.count
|
||||
+ recentsDataSource.serverNoticeCellDataArray.count;
|
||||
+ recentsDataSource.serverNoticeCellDataArray.count
|
||||
+ recentsDataSource.suggestedRoomCellDataArray.count;
|
||||
}
|
||||
|
||||
#pragma mark - SpaceMembersCoordinatorBridgePresenterDelegate
|
||||
|
||||
- (void)spaceMembersCoordinatorBridgePresenterDelegateDidComplete:(SpaceMembersCoordinatorBridgePresenter *)coordinatorBridgePresenter
|
||||
{
|
||||
[coordinatorBridgePresenter dismissWithAnimated:YES completion:^{
|
||||
self.spaceMembersCoordinatorBridgePresenter = nil;
|
||||
}];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user