Calls: Only show invite button when it's supported

This commit is contained in:
Marvin W 2022-02-12 15:14:15 +01:00
parent 369d0c79d7
commit 6f9375e6ea
No known key found for this signature in database
GPG key ID: 072E9235DB996F2A

View file

@ -139,14 +139,14 @@ public class Dino.Ui.CallWindowController : Object {
peer_states[peer_id] = peer_state; peer_states[peer_id] = peer_state;
peer_state.connection_ready.connect(() => { peer_state.connection_ready.connect(() => {
call_window.set_status(peer_state.internal_id, ""); call_window.set_status(peer_id, "");
if (participant_widgets.size == 1) { if (participant_widgets.size == 1) {
// This is the first peer. // This is the first peer.
// If it can do MUJI, show invite button. // If it can do MUJI, show invite button.
call_state.can_convert_into_groupcall.begin((_, res) => { call_state.can_convert_into_groupcall.begin((_, res) => {
bool can_convert = call_state.can_convert_into_groupcall.end(res); bool can_convert = call_state.can_convert_into_groupcall.end(res);
participant_widgets.values.@foreach((widget) => widget.may_show_invite_button = true); participant_widgets[peer_id].may_show_invite_button = can_convert;
}); });
call_plugin.devices_changed.connect((media, incoming) => { call_plugin.devices_changed.connect((media, incoming) => {
@ -174,7 +174,7 @@ public class Dino.Ui.CallWindowController : Object {
}); });
peer_state.info_received.connect((session_info) => { peer_state.info_received.connect((session_info) => {
if (session_info == Xmpp.Xep.JingleRtp.CallSessionInfo.RINGING) { if (session_info == Xmpp.Xep.JingleRtp.CallSessionInfo.RINGING) {
call_window.set_status(peer_state.internal_id, "ringing"); call_window.set_status(peer_id, "ringing");
} }
}); });
peer_state.encryption_updated.connect((audio_encryption, video_encryption, same) => { peer_state.encryption_updated.connect((audio_encryption, video_encryption, same) => {