Skip to content

Commit

Permalink
CallView: enable conference button only if some calls are not in it a…
Browse files Browse the repository at this point in the history
…nd bump v4
  • Loading branch information
bagage committed Feb 8, 2016
1 parent e5bf067 commit 876e949
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 27 deletions.
38 changes: 12 additions & 26 deletions Classes/CallView.m
Original file line number Diff line number Diff line change
Expand Up @@ -258,24 +258,9 @@ - (void)updateBottomBar:(LinphoneCall *)call state:(LinphoneCallState)state {

_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) {
Expand Down Expand Up @@ -718,6 +703,14 @@ - (IBAction)onRoutesClick:(id)sender {
}
}

- (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);
Expand All @@ -734,15 +727,8 @@ - (IBAction)onOptionsAddClick:(id)sender {
[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);
}

Expand Down
2 changes: 1 addition & 1 deletion linphone-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>3</string>
<string>4</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIApplicationExitsOnSuspend</key>
Expand Down

0 comments on commit 876e949

Please sign in to comment.