display video call based on availability

This commit is contained in:
Daniel Gultsch 2020-04-15 16:54:54 +02:00
parent b4df19177f
commit d4788fc1f4

View file

@ -955,6 +955,7 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke
final MenuItem menuMute = menu.findItem(R.id.action_mute);
final MenuItem menuUnmute = menu.findItem(R.id.action_unmute);
final MenuItem menuCall = menu.findItem(R.id.action_call);
final MenuItem menuVideoCall = menu.findItem(R.id.action_video_call);
if (conversation != null) {
@ -964,7 +965,9 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke
menuMucDetails.setTitle(conversation.getMucOptions().isPrivateAndNonAnonymous() ? R.string.action_muc_details : R.string.channel_details);
menuCall.setVisible(false);
} else {
menuCall.setVisible(RtpCapability.check(conversation.getContact()) != RtpCapability.Capability.NONE);
final RtpCapability.Capability rtpCapability = RtpCapability.check(conversation.getContact());
menuCall.setVisible(rtpCapability != RtpCapability.Capability.NONE);
menuVideoCall.setVisible(rtpCapability == RtpCapability.Capability.VIDEO);
menuContactDetails.setVisible(!this.conversation.withSelf());
menuMucDetails.setVisible(false);
final XmppConnectionService service = activity.xmppConnectionService;