Default to the new flow

This commit is contained in:
ismailgulek
2020-09-11 16:12:12 +03:00
parent 45811f956e
commit 5bf9345c7f
3 changed files with 4 additions and 91 deletions
@@ -1656,25 +1656,11 @@
typeof(self) self = weakSelf;
self->currentAlert = nil;
[self createAnEmptyRoom];
[self createNewRoom];
}
}]];
[currentAlert addAction:[UIAlertAction actionWithTitle:@"Create room (v2)"
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * action) {
if (weakSelf)
{
typeof(self) self = weakSelf;
self->currentAlert = nil;
[self createNewRoom];
}
}]];
[currentAlert addAction:[UIAlertAction actionWithTitle:NSLocalizedStringFromTable(@"room_recents_join_room", @"Vector", nil)
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * action) {
@@ -1719,79 +1705,6 @@
}
}
- (void)createAnEmptyRoom
{
// Sanity check
if (self.mainSession)
{
// Create one room at time
if (!currentRequest)
{
[self startActivityIndicator];
// Create an empty room.
MXWeakify(self);
currentRequest = [self.mainSession createRoom:nil
visibility:kMXRoomDirectoryVisibilityPrivate
roomAlias:nil
topic:nil
success:^(MXRoom *room) {
MXStrongifyAndReturnIfNil(self);
self->currentRequest = nil;
[self stopActivityIndicator];
if (self->currentAlert)
{
[self->currentAlert dismissViewControllerAnimated:NO completion:nil];
self->currentAlert = nil;
}
[self dispayRoomWithRoomId:room.roomId inMatrixSession:self.mainSession];
} failure:^(NSError *error) {
MXStrongifyAndReturnIfNil(self);
self->currentRequest = nil;
[self stopActivityIndicator];
if (self->currentAlert)
{
[self->currentAlert dismissViewControllerAnimated:NO completion:nil];
self->currentAlert = nil;
}
NSLog(@"[RecentsViewController] Create new room failed");
// Alert user
[[AppDelegate theDelegate] showErrorAsAlert:error];
}];
}
else
{
// Ask the user to wait
__weak __typeof(self) weakSelf = self;
currentAlert = [UIAlertController alertControllerWithTitle:nil
message:NSLocalizedStringFromTable(@"room_creation_wait_for_creation", @"Vector", nil)
preferredStyle:UIAlertControllerStyleAlert];
[currentAlert addAction:[UIAlertAction actionWithTitle:[NSBundle mxk_localizedStringForKey:@"ok"]
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * action) {
if (weakSelf)
{
typeof(self) self = weakSelf;
self->currentAlert = nil;
}
}]];
[currentAlert mxk_setAccessibilityIdentifier:@"RecentsVCRoomCreationInProgressAlert"];
[self presentViewController:currentAlert animated:YES completion:nil];
}
}
}
- (void)joinARoom
{
[currentAlert dismissViewControllerAnimated:NO completion:nil];