Skip to content

Commit

Permalink
[Spaces] M10.8 Browsing users in a space #4682
Browse files Browse the repository at this point in the history
- Present space members screen from people tab if space has been selected
  • Loading branch information
gileluard committed Aug 22, 2021
1 parent 91d9169 commit 2e690e5
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions Riot/Modules/People/PeopleViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,14 @@

#import "Riot-Swift.h"

@interface PeopleViewController ()
@interface PeopleViewController () <SpaceMemberListCoordinatorBridgePresenterDelegate>
{
NSInteger directRoomsSectionNumber;
RecentsDataSource *recentsDataSource;
}

@property(nonatomic) SpaceMemberListCoordinatorBridgePresenter *spaceMemberListCoordinatorBridgePresenter;

@end

@implementation PeopleViewController
Expand Down Expand Up @@ -119,7 +121,16 @@ - (void)refreshCurrentSelectedCell:(BOOL)forceVisible

- (void)onPlusButtonPressed
{
[self performSegueWithIdentifier:@"presentStartChat" sender:self];
if (self.dataSource.currentSpace != nil)
{
self.spaceMemberListCoordinatorBridgePresenter = [[SpaceMemberListCoordinatorBridgePresenter alloc] initWithSession:self.mainSession spaceId:self.dataSource.currentSpace.spaceId];
self.spaceMemberListCoordinatorBridgePresenter.delegate = self;
[self.spaceMemberListCoordinatorBridgePresenter presentFrom:self animated:YES];
}
else
{
[self performSegueWithIdentifier:@"presentStartChat" sender:self];
}
}

#pragma mark -
Expand Down Expand Up @@ -172,4 +183,13 @@ - (NSUInteger)totalItemCounts
+ recentsDataSource.conversationCellDataArray.count;
}

#pragma mark - SpaceMemberListCoordinatorBridgePresenterDelegate

- (void)spaceMemberListCoordinatorBridgePresenterDelegateDidComplete:(SpaceMemberListCoordinatorBridgePresenter *)coordinatorBridgePresenter
{
[coordinatorBridgePresenter dismissWithAnimated:YES completion:^{
self.spaceMemberListCoordinatorBridgePresenter = nil;
}];
}

@end

0 comments on commit 2e690e5

Please sign in to comment.