From 4ef50db3e581016365087759d5af8649e37ab8a7 Mon Sep 17 00:00:00 2001 From: fiaxh Date: Wed, 2 Feb 2022 21:37:05 +0100 Subject: Various call UI/UX improvements --- .../ui/conversation_content_view/call_widget.vala | 25 ++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) (limited to 'main/src/ui/conversation_content_view') diff --git a/main/src/ui/conversation_content_view/call_widget.vala b/main/src/ui/conversation_content_view/call_widget.vala index a2c8c0c2..d9060872 100644 --- a/main/src/ui/conversation_content_view/call_widget.vala +++ b/main/src/ui/conversation_content_view/call_widget.vala @@ -111,17 +111,30 @@ namespace Dino.Ui { incoming_call_revealer.get_style_context().remove_class("incoming"); outer_additional_box.get_style_context().remove_class("incoming-call-box"); - switch (call.state) { + // It doesn't make sense to display MUC calls as missed or declined by the whole MUC. Just display as ended. + // TODO: maybe not let them be missed/declined in first place. + Call.State relevant_state = call.state; + if (conversation.type_ == Conversation.Type.GROUPCHAT && call.direction == Call.DIRECTION_OUTGOING && + (relevant_state == Call.State.MISSED || relevant_state == Call.State.DECLINED)) { + relevant_state = Call.State.ENDED; + } + + switch (relevant_state) { case Call.State.RINGING: image.set_from_icon_name("dino-phone-ring-symbolic", IconSize.LARGE_TOOLBAR); if (call.direction == Call.DIRECTION_INCOMING) { bool video = call_manager.should_we_send_video(); title_label.label = video ? _("Incoming video call") : _("Incoming call"); - subtitle_label.label = "Ring ring…!"; - incoming_call_box.visible = true; - incoming_call_revealer.reveal_child = true; - incoming_call_revealer.get_style_context().add_class("incoming"); - outer_additional_box.get_style_context().add_class("incoming-call-box"); + + if (stream_interactor.get_module(Calls.IDENTITY).can_we_do_calls(call.account)) { + subtitle_label.label = "Ring ring…!"; + incoming_call_box.visible = true; + incoming_call_revealer.reveal_child = true; + incoming_call_revealer.get_style_context().add_class("incoming"); + outer_additional_box.get_style_context().add_class("incoming-call-box"); + } else { + subtitle_label.label = "Dependencies for call support not met"; + } } else { title_label.label = _("Calling…"); subtitle_label.label = "Ring ring…?"; -- cgit v1.2.3-70-g09d2