Move startPrivateOneToOneRoomWithUserId from MatrixHandler to AppDelegate.

This commit is contained in:
giomfo
2015-05-04 14:49:30 +02:00
parent 69c90c9c95
commit 02fd35292d
7 changed files with 63 additions and 49 deletions
@@ -18,7 +18,6 @@
// application info
#import "AppDelegate.h"
#import "MatrixHandler.h"
// contacts management
#import "ContactManager.h"
@@ -370,7 +369,6 @@ NSString *const kInvitationMessage = @"I'd like to chat with you with matrix. Pl
__weak typeof(self) weakSelf = self;
NSArray* matrixIDs = contact.matrixIdentifiers;
MatrixHandler *mxHandler = [MatrixHandler sharedHandler];
// matrix user ?
if (matrixIDs.count) {
@@ -390,7 +388,7 @@ NSString *const kInvitationMessage = @"I'd like to chat with you with matrix. Pl
[self.startChatMenu addActionWithTitle:@"OK" style:MXKAlertActionStyleDefault handler:^(MXKAlert *alert) {
weakSelf.startChatMenu = nil;
[mxHandler startPrivateOneToOneRoomWithUserId:matrixID];
[[AppDelegate theDelegate] startPrivateOneToOneRoomWithUserId:matrixID];
}];
} else {
self.startChatMenu = [[MXKAlert alloc] initWithTitle:[NSString stringWithFormat:@"Chat with "] message:nil style:MXKAlertStyleActionSheet];
@@ -399,7 +397,7 @@ NSString *const kInvitationMessage = @"I'd like to chat with you with matrix. Pl
[self.startChatMenu addActionWithTitle:matrixID style:MXKAlertActionStyleDefault handler:^(MXKAlert *alert) {
weakSelf.startChatMenu = nil;
[mxHandler startPrivateOneToOneRoomWithUserId:matrixID];
[[AppDelegate theDelegate] startPrivateOneToOneRoomWithUserId:matrixID];
}];
}