go to chat or create it when clicking chat button when in call

This commit is contained in:
Benjamin Reis 2018-05-23 14:40:04 +02:00
parent 00044040fd
commit ec6046882e
6 changed files with 288 additions and 259 deletions

File diff suppressed because it is too large Load diff

View file

@ -95,6 +95,7 @@
@property(weak, nonatomic) IBOutlet UIView *noActiveCallView;
@property(weak, nonatomic) IBOutlet UIView *conferenceView;
@property(strong, nonatomic) IBOutlet CallPausedTableView *conferenceCallsTable;
@property (weak, nonatomic) IBOutlet UIView *waitView;
- (IBAction)onRoutesClick:(id)sender;
- (IBAction)onRoutesBluetoothClick:(id)sender;

View file

@ -135,7 +135,7 @@ static UICompositeViewDescription *compositeDescription = nil;
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
_waitView.hidden = FALSE;
LinphoneManager.instance.nextCallIsTransfer = NO;
[self updateUnreadMessage:FALSE];
@ -711,7 +711,9 @@ static void hideSpinner(LinphoneCall *call, void *user_data) {
}
- (IBAction)onChatClick:(id)sender {
[PhoneMainView.instance changeCurrentView:ChatsListView.compositeViewDescription];
const LinphoneCall *currentCall = linphone_core_get_current_call(LC);
const LinphoneAddress *addr = currentCall ? linphone_call_get_remote_address(currentCall) : NULL;
[PhoneMainView.instance getOrCreateOneToOneChatRoom:addr waitView:_waitView];
}
- (IBAction)onRoutesBluetoothClick:(id)sender {

View file

@ -192,9 +192,6 @@ static UICompositeViewDescription *compositeDescription = nil;
- (IBAction)onChatClick:(id)event {
const LinphoneAddress *addr = linphone_call_log_get_remote_address(callLog);
if (addr == NULL)
return;
[PhoneMainView.instance getOrCreateOneToOneChatRoom:addr waitView:_waitView];
}

View file

@ -135,9 +135,6 @@
- (IBAction)onChatClick:(id)event {
LinphoneAddress *addr = [LinphoneUtils normalizeSipOrPhoneAddress:_addressLabel.text];
if (addr == NULL)
return;
[PhoneMainView.instance getOrCreateOneToOneChatRoom:addr waitView:_waitView];
linphone_address_destroy(addr);
}

View file

@ -865,6 +865,11 @@ static RootViewManager *rootViewManagerInstance = nil;
#pragma mark - Chat room Functions
- (void)getOrCreateOneToOneChatRoom:(const LinphoneAddress *)remoteAddress waitView:(UIView *)waitView {
if (!remoteAddress) {
[self changeCurrentView:ChatsListView.compositeViewDescription];
return;
}
const LinphoneAddress *local = linphone_proxy_config_get_contact(linphone_core_get_default_proxy_config(LC));
LinphoneChatRoom *room = linphone_core_find_one_to_one_chat_room(LC, local, remoteAddress);
if (!room) {