mirror of
https://codeberg.org/monocles/monocles_chat.git
synced 2025-01-15 14:12:21 +01:00
continue option to disable calls
This commit is contained in:
parent
99b1924be5
commit
ba1a2b0443
1 changed files with 21 additions and 8 deletions
|
@ -10,6 +10,7 @@ import java.util.Map;
|
|||
|
||||
import de.monocles.chat.KeyboardHeightProvider;
|
||||
import de.monocles.chat.WebxdcPage;
|
||||
import eu.siacs.conversations.entities.Presences;
|
||||
import eu.siacs.conversations.ui.adapter.CommandAdapter;
|
||||
import eu.siacs.conversations.utils.Random;
|
||||
import eu.siacs.conversations.xml.Element;
|
||||
|
@ -1738,8 +1739,8 @@ public class ConversationFragment extends XmppFragment
|
|||
final MenuItem menuParticipants = menu.findItem(R.id.action_participants);
|
||||
final MenuItem menuContactDetails = menu.findItem(R.id.action_contact_details);
|
||||
final MenuItem menuCall = menu.findItem(R.id.action_call);
|
||||
final MenuItem menuDisableCall = menu.findItem(R.id.action_call);
|
||||
final MenuItem menuEnableCall = menu.findItem(R.id.action_call);
|
||||
final MenuItem menuDisableCall = menu.findItem(R.id.action_disable_calls);
|
||||
final MenuItem menuEnableCall = menu.findItem(R.id.action_enable_calls);
|
||||
final MenuItem menuOngoingCall = menu.findItem(R.id.action_ongoing_call);
|
||||
final MenuItem menuVideoCall = menu.findItem(R.id.action_video_call);
|
||||
final MenuItem menuMediaBrowser = menu.findItem(R.id.action_mediabrowser);
|
||||
|
@ -1769,16 +1770,23 @@ public class ConversationFragment extends XmppFragment
|
|||
if (ongoingRtpSession.isPresent()) {
|
||||
menuOngoingCall.setVisible(true);
|
||||
menuCall.setVisible(false);
|
||||
menuDisableCall.setVisible(true);
|
||||
menuEnableCall.setVisible(false);
|
||||
} else {
|
||||
menuOngoingCall.setVisible(false);
|
||||
final RtpCapability.Capability rtpCapability = RtpCapability.check(conversation.getContact());
|
||||
final boolean cameraAvailable = activity != null && activity.isCameraFeatureAvailable();
|
||||
menuCall.setVisible(rtpCapability != RtpCapability.Capability.NONE);
|
||||
menuVideoCall.setVisible(rtpCapability == RtpCapability.Capability.VIDEO && cameraAvailable);
|
||||
menuDisableCall.setVisible(rtpCapability != RtpCapability.Capability.NONE);
|
||||
menuEnableCall.setVisible(rtpCapability == RtpCapability.Capability.NONE);
|
||||
if (menuDisableCall.isChecked()) {
|
||||
final JingleConnectionManager mJingleConnectionManager = new JingleConnectionManager(activity.xmppConnectionService);
|
||||
mJingleConnectionManager.isBusy();
|
||||
menuDisableCall.setVisible(false);
|
||||
menuEnableCall.setVisible(true);
|
||||
menuCall.setVisible(false);
|
||||
menuVideoCall.setVisible(false);
|
||||
} else {
|
||||
menuCall.setVisible(rtpCapability != RtpCapability.Capability.NONE);
|
||||
menuVideoCall.setVisible(rtpCapability == RtpCapability.Capability.VIDEO && cameraAvailable);
|
||||
menuDisableCall.setVisible(rtpCapability != RtpCapability.Capability.NONE);
|
||||
menuEnableCall.setVisible(false);
|
||||
}
|
||||
}
|
||||
menuParticipants.setVisible(false);
|
||||
menuInviteContact.setVisible(false);
|
||||
|
@ -2585,6 +2593,11 @@ public class ConversationFragment extends XmppFragment
|
|||
case R.id.action_refresh_feature_discovery:
|
||||
refreshFeatureDiscovery();
|
||||
break;
|
||||
case R.id.action_disable_calls:
|
||||
final JingleConnectionManager mJingleConnectionManager = new JingleConnectionManager(activity.xmppConnectionService);
|
||||
mJingleConnectionManager.isBusy();
|
||||
item.setChecked(true);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue