diff --git a/Classes/Base.lproj/CallView.xib b/Classes/Base.lproj/CallView.xib index 1e1bb5183..ab5f35348 100644 --- a/Classes/Base.lproj/CallView.xib +++ b/Classes/Base.lproj/CallView.xib @@ -1,7 +1,12 @@ - - + + + + + - + + + @@ -55,6 +60,7 @@ + @@ -89,14 +95,14 @@ - + - - + + @@ -107,14 +113,14 @@ - + - + @@ -135,12 +141,12 @@ - + - + @@ -148,7 +154,7 @@ - + - + - + - - + + @@ -255,11 +261,11 @@ @@ -280,7 +286,7 @@ - + @@ -290,7 +296,7 @@ - + @@ -300,7 +306,7 @@ - + @@ -310,7 +316,7 @@ - + @@ -320,7 +326,7 @@ - + @@ -330,7 +336,7 @@ - + @@ -340,7 +346,7 @@ - + @@ -350,7 +356,7 @@ - + @@ -360,7 +366,7 @@ - + @@ -370,12 +376,12 @@ - + - + - + + - + - - - + + - + - + - + - + @@ -723,29 +740,29 @@ - + - + - + - + - + - + - + - + - + - + - - + + - + - + + - + - - - + - - - - - - - - + + + + + + + + @@ -1283,62 +1310,62 @@ - + - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + - - - - - - - + + + + + + + - - - - - - - - + + + + + + + + - - - - + + + + - - - - + + + + diff --git a/Classes/CallView.h b/Classes/CallView.h index 77c517f20..67ed65566 100644 --- a/Classes/CallView.h +++ b/Classes/CallView.h @@ -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; diff --git a/Classes/CallView.m b/Classes/CallView.m index 4f416edb4..fe5a43625 100644 --- a/Classes/CallView.m +++ b/Classes/CallView.m @@ -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 { diff --git a/Classes/HistoryDetailsView.m b/Classes/HistoryDetailsView.m index 2e2cd994e..708a10185 100644 --- a/Classes/HistoryDetailsView.m +++ b/Classes/HistoryDetailsView.m @@ -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]; } diff --git a/Classes/LinphoneUI/UIContactDetailsCell.m b/Classes/LinphoneUI/UIContactDetailsCell.m index ed4b55256..90c79066e 100644 --- a/Classes/LinphoneUI/UIContactDetailsCell.m +++ b/Classes/LinphoneUI/UIContactDetailsCell.m @@ -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); } diff --git a/Classes/PhoneMainView.m b/Classes/PhoneMainView.m index 7dc589f07..77366626d 100644 --- a/Classes/PhoneMainView.m +++ b/Classes/PhoneMainView.m @@ -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) {