mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-17 11:08:06 +00:00
CallView: enable conference button only if some calls are not in it and bump v4
This commit is contained in:
parent
e5bf06757d
commit
876e949cb7
2 changed files with 13 additions and 27 deletions
|
|
@ -258,24 +258,9 @@ static void hideSpinner(LinphoneCall *call, void *user_data) {
|
|||
|
||||
_optionsButton.enabled = (!call || !linphone_call_media_in_progress(call));
|
||||
_optionsTransferButton.enabled = call && !linphone_call_media_in_progress(call);
|
||||
// Show Pause/Conference button following call count
|
||||
if (linphone_core_get_calls_nb(LC) > 1) {
|
||||
bool enabled = ((linphone_core_get_current_call(LC) != NULL) || linphone_core_is_in_conference(LC));
|
||||
const MSList *list = linphone_core_get_calls(LC);
|
||||
while (list != NULL) {
|
||||
LinphoneCall *call = (LinphoneCall *)list->data;
|
||||
LinphoneCallState state = linphone_call_get_state(call);
|
||||
if (state == LinphoneCallIncomingReceived || state == LinphoneCallOutgoingInit ||
|
||||
state == LinphoneCallOutgoingProgress || state == LinphoneCallOutgoingRinging ||
|
||||
state == LinphoneCallOutgoingEarlyMedia || state == LinphoneCallConnected) {
|
||||
enabled = false;
|
||||
}
|
||||
list = list->next;
|
||||
}
|
||||
_optionsConferenceButton.enabled = enabled;
|
||||
} else {
|
||||
_optionsConferenceButton.enabled = NO;
|
||||
}
|
||||
// enable conference button if 2 calls are present and at least one is not in the conference
|
||||
_optionsConferenceButton.enabled = ((linphone_core_get_calls_nb(LC) > 1) &&
|
||||
(linphone_core_get_calls_nb(LC) != linphone_core_get_conference_size(LC)));
|
||||
|
||||
// Disable transfert in conference
|
||||
if (linphone_core_get_current_call(LC) == NULL) {
|
||||
|
|
@ -718,6 +703,14 @@ static void hideSpinner(LinphoneCall *call, void *user_data) {
|
|||
}
|
||||
}
|
||||
|
||||
- (IBAction)onOptionsClick:(id)sender {
|
||||
if ([_optionsView isHidden]) {
|
||||
[self hideOptions:FALSE animated:ANIMATED];
|
||||
} else {
|
||||
[self hideOptions:TRUE animated:ANIMATED];
|
||||
}
|
||||
}
|
||||
|
||||
- (IBAction)onOptionsTransferClick:(id)sender {
|
||||
[self hideOptions:TRUE animated:TRUE];
|
||||
DialerView *view = VIEW(DialerView);
|
||||
|
|
@ -734,15 +727,8 @@ static void hideSpinner(LinphoneCall *call, void *user_data) {
|
|||
[PhoneMainView.instance changeCurrentView:view.compositeViewDescription];
|
||||
}
|
||||
|
||||
- (IBAction)onOptionsClick:(id)sender {
|
||||
if ([_optionsView isHidden]) {
|
||||
[self hideOptions:FALSE animated:ANIMATED];
|
||||
} else {
|
||||
[self hideOptions:TRUE animated:ANIMATED];
|
||||
}
|
||||
}
|
||||
|
||||
- (IBAction)onOptionsConferenceClick:(id)sender {
|
||||
[self hideOptions:TRUE animated:TRUE];
|
||||
linphone_core_add_all_to_conference(LC);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@
|
|||
</dict>
|
||||
</array>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>3</string>
|
||||
<string>4</string>
|
||||
<key>LSRequiresIPhoneOS</key>
|
||||
<true/>
|
||||
<key>UIApplicationExitsOnSuspend</key>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue