mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-17 11:08:06 +00:00
go to chat or create it when clicking chat button when in call
This commit is contained in:
parent
00044040fd
commit
ec6046882e
6 changed files with 288 additions and 259 deletions
File diff suppressed because it is too large
Load diff
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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];
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue