aboutsummaryrefslogtreecommitdiff
path: root/main/src/ui
diff options
context:
space:
mode:
Diffstat (limited to 'main/src/ui')
-rw-r--r--main/src/ui/call_window/call_bottom_bar.vala54
-rw-r--r--main/src/ui/call_window/call_window_controller.vala4
2 files changed, 35 insertions, 23 deletions
diff --git a/main/src/ui/call_window/call_bottom_bar.vala b/main/src/ui/call_window/call_bottom_bar.vala
index a3e4b93b..64b157dd 100644
--- a/main/src/ui/call_window/call_bottom_bar.vala
+++ b/main/src/ui/call_window/call_bottom_bar.vala
@@ -89,42 +89,54 @@ public class Dino.Ui.CallBottomBar : Gtk.Box {
this.get_style_context().add_class("call-bottom-bar");
}
- public void set_encryption(Xmpp.Xep.Jingle.ContentEncryption? encryption) {
+ public void set_encryption(Xmpp.Xep.Jingle.ContentEncryption? audio_encryption, Xmpp.Xep.Jingle.ContentEncryption? video_encryption, bool same) {
encryption_button.visible = true;
Popover popover = new Popover(encryption_button);
-
- if (encryption == null) {
+ if (audio_encryption == null) {
encryption_image.set_from_icon_name("changes-allow-symbolic", IconSize.BUTTON);
encryption_button.get_style_context().add_class("unencrypted");
popover.add(new Label("This call isn't encrypted.") { margin=10, visible=true } );
- } else if (encryption.encryption_name == "OMEMO") {
- encryption_image.set_from_icon_name("changes-prevent-symbolic", IconSize.BUTTON);
- encryption_button.get_style_context().remove_class("unencrypted");
+ return;
+ }
+
+ encryption_image.set_from_icon_name("changes-prevent-symbolic", IconSize.BUTTON);
+ encryption_button.get_style_context().remove_class("unencrypted");
- popover.add(new Label("This call is encrypted with OMEMO.") { margin=10, visible=true } );
+ Box box = new Box(Orientation.VERTICAL, 5) { margin=10, visible=true };
+ if (audio_encryption.encryption_name == "OMEMO") {
+ box.add(new Label("<b>This call is encrypted with OMEMO.</b>") { use_markup=true, xalign=0, visible=true } );
} else {
- encryption_image.set_from_icon_name("changes-prevent-symbolic", IconSize.BUTTON);
- encryption_button.get_style_context().remove_class("unencrypted");
-
- Grid encryption_info_grid = new Grid() { margin=10, row_spacing=3, column_spacing=5, visible=true };
- encryption_info_grid.attach(new Label("<b>This call is end-to-end encrypted.</b>") { use_markup=true, xalign=0, visible=true }, 1, 1, 2, 1);
- if (encryption.peer_key.length > 0) {
- encryption_info_grid.attach(new Label("Peer key") { xalign=0, visible=true }, 1, 2, 1, 1);
- encryption_info_grid.attach(new Label("<span font_family='monospace'>" + format_fingerprint(encryption.peer_key) + "</span>") { use_markup=true, max_width_chars=25, ellipsize=EllipsizeMode.MIDDLE, xalign=0, hexpand=true, visible=true }, 2, 2, 1, 1);
- }
- if (encryption.our_key.length > 0) {
- encryption_info_grid.attach(new Label("Your key") { xalign=0, visible=true }, 1, 3, 1, 1);
- encryption_info_grid.attach(new Label("<span font_family='monospace'>" + format_fingerprint(encryption.our_key) + "</span>") { use_markup=true, max_width_chars=25, ellipsize=EllipsizeMode.MIDDLE, xalign=0, hexpand=true, visible=true }, 2, 3, 1, 1);
- }
+ box.add(new Label("<b>This call is end-to-end encrypted.</b>") { use_markup=true, xalign=0, visible=true });
+ }
- popover.add(encryption_info_grid);
+ if (same) {
+ box.add(create_media_encryption_grid(audio_encryption));
+ } else {
+ box.add(new Label("<b>Audio</b>") { use_markup=true, xalign=0, visible=true });
+ box.add(create_media_encryption_grid(audio_encryption));
+ box.add(new Label("<b>Video</b>") { use_markup=true, xalign=0, visible=true });
+ box.add(create_media_encryption_grid(video_encryption));
}
+ popover.add(box);
encryption_button.set_popover(popover);
}
+ private Grid create_media_encryption_grid(Xmpp.Xep.Jingle.ContentEncryption? encryption) {
+ Grid ret = new Grid() { row_spacing=3, column_spacing=5, visible=true };
+ if (encryption.peer_key.length > 0) {
+ ret.attach(new Label("Peer call key") { xalign=0, visible=true }, 1, 2, 1, 1);
+ ret.attach(new Label("<span font_family='monospace'>" + format_fingerprint(encryption.peer_key) + "</span>") { use_markup=true, max_width_chars=25, ellipsize=EllipsizeMode.MIDDLE, xalign=0, hexpand=true, visible=true }, 2, 2, 1, 1);
+ }
+ if (encryption.our_key.length > 0) {
+ ret.attach(new Label("Your call key") { xalign=0, visible=true }, 1, 3, 1, 1);
+ ret.attach(new Label("<span font_family='monospace'>" + format_fingerprint(encryption.our_key) + "</span>") { use_markup=true, max_width_chars=25, ellipsize=EllipsizeMode.MIDDLE, xalign=0, hexpand=true, visible=true }, 2, 3, 1, 1);
+ }
+ return ret;
+ }
+
public AudioSettingsPopover? show_audio_device_choices(bool show) {
audio_settings_button.visible = show;
if (audio_settings_popover != null) audio_settings_popover.visible = false;
diff --git a/main/src/ui/call_window/call_window_controller.vala b/main/src/ui/call_window/call_window_controller.vala
index 0a223d72..7e5920ce 100644
--- a/main/src/ui/call_window/call_window_controller.vala
+++ b/main/src/ui/call_window/call_window_controller.vala
@@ -76,9 +76,9 @@ public class Dino.Ui.CallWindowController : Object {
call_window.set_status("ringing");
}
});
- calls.encryption_updated.connect((call, encryption) => {
+ calls.encryption_updated.connect((call, audio_encryption, video_encryption, same) => {
if (!this.call.equals(call)) return;
- call_window.bottom_bar.set_encryption(encryption);
+ call_window.bottom_bar.set_encryption(audio_encryption, video_encryption, same);
});
own_video.resolution_changed.connect((width, height) => {