Merge pull request #6035 from vector-im/yostyle/join_and_show_room

When accepting an invite, expecting to see the room
This commit is contained in:
Yoan Pintas
2022-04-15 15:16:36 +02:00
committed by GitHub
7 changed files with 46 additions and 13 deletions
@@ -895,6 +895,11 @@ NSString *const RecentsViewControllerDataReadyNotification = @"RecentsViewContro
}
- (void)showRoomWithRoomId:(NSString*)roomId inMatrixSession:(MXSession*)matrixSession
{
[self showRoomWithRoomId:roomId andAutoJoinInvitedRoom:false inMatrixSession:matrixSession];
}
- (void)showRoomWithRoomId:(NSString*)roomId andAutoJoinInvitedRoom:(BOOL)autoJoinInvitedRoom inMatrixSession:(MXSession*)matrixSession
{
MXRoom *room = [matrixSession roomWithRoomId:roomId];
if (room.summary.membership == MXMembershipInvite)
@@ -912,7 +917,8 @@ NSString *const RecentsViewControllerDataReadyNotification = @"RecentsViewContro
eventId:nil
mxSession:matrixSession
threadParameters:nil
presentationParameters:presentationParameters];
presentationParameters:presentationParameters
autoJoinInvitedRoom:autoJoinInvitedRoom];
[[AppDelegate theDelegate] showRoomWithParameters:parameters completion:^{
self.userInteractionEnabled = YES;
@@ -1018,9 +1024,9 @@ NSString *const RecentsViewControllerDataReadyNotification = @"RecentsViewContro
return;
}
// Accept invitation
// Accept invitation and display the room
Analytics.shared.joinedRoomTrigger = AnalyticsJoinedRoomTriggerInvite;
[self joinRoom:invitedRoom completion:nil];
[self showRoomWithRoomId:invitedRoom.roomId andAutoJoinInvitedRoom:true inMatrixSession:invitedRoom.mxSession];
}
else if ([actionIdentifier isEqualToString:kInviteRecentTableViewCellDeclineButtonPressed])
{