Enhancement: Improve room creation process

#529

Prompt user to let him choose betwwen:
- Start chat by selecting people
or
- Create a new empty room
This commit is contained in:
giomfo
2016-09-06 17:37:22 +02:00
parent 6f6e4e4b03
commit 73d21eac29
7 changed files with 1067 additions and 2 deletions
@@ -936,6 +936,41 @@
}
- (void)onNewRoomPressed
{
__weak typeof(self) weakSelf = self;
[currentAlert dismiss:NO];
currentAlert = [[MXKAlert alloc] initWithTitle:nil message:nil style:MXKAlertStyleActionSheet];
[currentAlert addActionWithTitle:NSLocalizedStringFromTable(@"room_recents_start_chat_with", @"Vector", nil) style:MXKAlertActionStyleDefault handler:^(MXKAlert *alert) {
__strong __typeof(weakSelf)strongSelf = weakSelf;
strongSelf->currentAlert = nil;
[strongSelf performSegueWithIdentifier:@"presentStartChat" sender:strongSelf];
}];
[currentAlert addActionWithTitle:NSLocalizedStringFromTable(@"room_recents_create_empty_room", @"Vector", nil) style:MXKAlertActionStyleDefault handler:^(MXKAlert *alert) {
__strong __typeof(weakSelf)strongSelf = weakSelf;
strongSelf->currentAlert = nil;
[strongSelf createEmptyRoom];
}];
currentAlert.cancelButtonIndex = [currentAlert addActionWithTitle:[NSBundle mxk_localizedStringForKey:@"cancel"] style:MXKAlertActionStyleCancel handler:^(MXKAlert *alert) {
__strong __typeof(weakSelf)strongSelf = weakSelf;
strongSelf->currentAlert = nil;
}];
currentAlert.sourceView = createNewRoomImageView;
[currentAlert showInViewController:self];
}
- (void)createEmptyRoom
{
// Sanity check
if (self.mainSession)