From 0bddf9f3dacc0945429979787348f41571f27518 Mon Sep 17 00:00:00 2001 From: fiaxh Date: Mon, 1 May 2023 19:15:36 +0200 Subject: [PATCH 01/15] Fix character counting for fallbacks fixes #1420 --- libdino/src/service/message_processor.vala | 3 +-- libdino/src/service/replies.vala | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libdino/src/service/message_processor.vala b/libdino/src/service/message_processor.vala index 04c7d1a5..01687083 100644 --- a/libdino/src/service/message_processor.vala +++ b/libdino/src/service/message_processor.vala @@ -472,8 +472,7 @@ public class MessageProcessor : StreamInteractionModule, Object { string fallback = FallbackBody.get_quoted_fallback_body(content_item); - long fallback_length = fallback.length; - var fallback_location = new Xep.FallbackIndication.FallbackLocation(0, (int)fallback_length); + var fallback_location = new Xep.FallbackIndication.FallbackLocation(0, (int)fallback.char_count()); Xep.FallbackIndication.set_fallback(new_stanza, new Xep.FallbackIndication.Fallback(Xep.Replies.NS_URI, new Xep.FallbackIndication.FallbackLocation[] { fallback_location })); return fallback; diff --git a/libdino/src/service/replies.vala b/libdino/src/service/replies.vala index 2bb10e0b..58d44b37 100644 --- a/libdino/src/service/replies.vala +++ b/libdino/src/service/replies.vala @@ -105,7 +105,8 @@ namespace Dino { string body = message.body; foreach (var fallback in message.get_fallbacks()) { if (fallback.ns_uri == Xep.Replies.NS_URI && message.quoted_item_id > 0) { - body = body[0:fallback.locations[0].from_char] + body[fallback.locations[0].to_char:body.length]; + body = body[0:body.index_of_nth_char(fallback.locations[0].from_char)] + + body[body.index_of_nth_char(fallback.locations[0].to_char):body.length]; } } return body; From 4dfe853fbf3ada385cdfa0d9208ceb83378f17d7 Mon Sep 17 00:00:00 2001 From: fiaxh Date: Sat, 13 May 2023 14:45:07 +0200 Subject: [PATCH 02/15] Fix xml output intendation --- xmpp-vala/src/core/stanza_node.vala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xmpp-vala/src/core/stanza_node.vala b/xmpp-vala/src/core/stanza_node.vala index 502717c8..44a70d8d 100644 --- a/xmpp-vala/src/core/stanza_node.vala +++ b/xmpp-vala/src/core/stanza_node.vala @@ -336,7 +336,7 @@ public class StanzaNode : StanzaEntry { if (((!)val).length > 1000) { return indent + "[... retracted for brevity ...]\n"; } - return indent + ((!)val).replace("\n", indent + "\n") + "\n"; + return indent + ((!)val).replace("\n", "\n" + indent) + "\n"; } var sb = new StringBuilder(); if (no_ns) { From 287d5bee6e335396a362f1563062aef8509c5659 Mon Sep 17 00:00:00 2001 From: fiaxh Date: Sat, 13 May 2023 14:44:29 +0200 Subject: [PATCH 03/15] Fix chat input status having a fixed width requirement fixes #1439 --- main/data/chat_input.ui | 1 + 1 file changed, 1 insertion(+) diff --git a/main/data/chat_input.ui b/main/data/chat_input.ui index 5e84c360..ccc47e8e 100644 --- a/main/data/chat_input.ui +++ b/main/data/chat_input.ui @@ -85,6 +85,7 @@ 3 14 14 + True From 9e4def221fe54bc38ebe9ae10672325d3c9a7f1d Mon Sep 17 00:00:00 2001 From: fiaxh Date: Sun, 14 May 2023 14:10:51 +0200 Subject: [PATCH 04/15] Fix chat input for IME fixes #1419 Co-authored-by: Marvin W --- main/src/ui/chat_input/chat_text_view.vala | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/main/src/ui/chat_input/chat_text_view.vala b/main/src/ui/chat_input/chat_text_view.vala index 3752a1cf..72ebc845 100644 --- a/main/src/ui/chat_input/chat_text_view.vala +++ b/main/src/ui/chat_input/chat_text_view.vala @@ -94,8 +94,13 @@ public class ChatTextView : Box { } } - private bool on_text_input_key_press(uint keyval, uint keycode, Gdk.ModifierType state) { + private bool on_text_input_key_press(EventControllerKey controller, uint keyval, uint keycode, Gdk.ModifierType state) { if (keyval in new uint[]{ Key.Return, Key.KP_Enter }) { + // Allow the text view to process the event. Needed for IME. + if (text_view.im_context_filter_keypress(controller.get_current_event())) { + return true; + } + if ((state & ModifierType.SHIFT_MASK) > 0) { text_view.buffer.insert_at_cursor("\n", 1); } else if (text_view.buffer.text.strip() != "") { From 9a04573fdc415a3a9293e5164bfc0316884285a3 Mon Sep 17 00:00:00 2001 From: Marvin W Date: Sun, 14 May 2023 16:44:33 +0200 Subject: [PATCH 05/15] Fix reactions being made to the wrong message fixes #1426 --- main/src/ui/conversation_content_view/conversation_view.vala | 1 - 1 file changed, 1 deletion(-) diff --git a/main/src/ui/conversation_content_view/conversation_view.vala b/main/src/ui/conversation_content_view/conversation_view.vala index badc6c65..cc63037f 100644 --- a/main/src/ui/conversation_content_view/conversation_view.vala +++ b/main/src/ui/conversation_content_view/conversation_view.vala @@ -95,7 +95,6 @@ public class ConversationView : Widget, Plugins.ConversationItemCollection, Plug EventControllerMotion main_wrap_motion_events = new EventControllerMotion(); main_wrap_box.add_controller(main_wrap_motion_events); main_wrap_motion_events.leave.connect(on_leave_notify_event); - main_wrap_motion_events.enter.connect(update_highlight); // The buttons of the overlaying message_menu_box may partially overlap the adjacent // conversation items. We connect to the main_event_box directly to avoid emitting // the pointer motion events as long as the pointer is above the message menu. From 4bb0c465fc8f1737a1f2668519a6e0cfbc7bfa0d Mon Sep 17 00:00:00 2001 From: Tobias Bernard Date: Mon, 29 May 2023 22:01:33 +0200 Subject: [PATCH 06/15] icons: Refresh some symbolic icons (#1444) --- main/CMakeLists.txt | 4 -- main/data/chat_input.ui | 2 +- main/data/file_default_widget.ui | 4 +- main/data/gresource.xml | 5 +-- .../actions/dino-account-plus-symbolic.svg | 1 - .../actions/dino-emoticon-add-symbolic.svg | 9 +++-- .../actions/dino-emoticon-symbolic.svg | 4 -- .../devices/dino-phone-hangup-symbolic.svg | 39 ++++++++++++++++++- .../devices/dino-phone-in-talk-symbolic.svg | 7 +++- .../devices/dino-phone-missed-symbolic.svg | 6 ++- .../devices/dino-phone-ring-symbolic.svg | 5 ++- .../scalable/devices/dino-phone-symbolic.svg | 9 ++++- .../status/dino-microphone-off-symbolic.svg | 1 - .../status/dino-microphone-symbolic.svg | 1 - .../status/dino-video-off-symbolic.svg | 6 ++- .../scalable/status/dino-video-symbolic.svg | 6 ++- main/data/message_item_widget_edit_mode.ui | 2 +- main/src/ui/call_window/call_bottom_bar.vala | 6 +-- .../ui/call_window/participant_widget.vala | 6 +-- .../file_image_widget.vala | 2 +- .../ui/conversation_titlebar/menu_entry.vala | 2 +- 21 files changed, 90 insertions(+), 37 deletions(-) delete mode 100644 main/data/icons/scalable/actions/dino-account-plus-symbolic.svg delete mode 100644 main/data/icons/scalable/actions/dino-emoticon-symbolic.svg delete mode 100644 main/data/icons/scalable/status/dino-microphone-off-symbolic.svg delete mode 100644 main/data/icons/scalable/status/dino-microphone-symbolic.svg diff --git a/main/CMakeLists.txt b/main/CMakeLists.txt index 1a66597c..f78a1191 100644 --- a/main/CMakeLists.txt +++ b/main/CMakeLists.txt @@ -17,9 +17,7 @@ find_packages(MAIN_PACKAGES REQUIRED set(RESOURCE_LIST dino-conversation-list-placeholder-arrow.svg - icons/scalable/actions/dino-account-plus-symbolic.svg icons/scalable/actions/dino-emoticon-add-symbolic.svg - icons/scalable/actions/dino-emoticon-symbolic.svg icons/scalable/actions/dino-qr-code-symbolic.svg icons/scalable/apps/im.dino.Dino.svg @@ -42,8 +40,6 @@ set(RESOURCE_LIST icons/scalable/mimetypes/dino-file-video-symbolic.svg icons/scalable/status/dino-double-tick-symbolic.svg - icons/scalable/status/dino-microphone-off-symbolic.svg - icons/scalable/status/dino-microphone-symbolic.svg icons/scalable/status/dino-party-popper-symbolic.svg icons/scalable/status/dino-security-high-symbolic.svg icons/scalable/status/dino-status-away.svg diff --git a/main/data/chat_input.ui b/main/data/chat_input.ui index ccc47e8e..cde00b22 100644 --- a/main/data/chat_input.ui +++ b/main/data/chat_input.ui @@ -51,7 +51,7 @@ - dino-emoticon-symbolic + emoji-people-symbolic False 2 start diff --git a/main/data/file_default_widget.ui b/main/data/file_default_widget.ui index 77ddebd1..bc89df1b 100644 --- a/main/data/file_default_widget.ui +++ b/main/data/file_default_widget.ui @@ -80,7 +80,7 @@ - open-menu-symbolic + view-more-symbolic 0 False @@ -90,4 +90,4 @@ - \ No newline at end of file + diff --git a/main/data/gresource.xml b/main/data/gresource.xml index 6d9febab..603d7fd0 100644 --- a/main/data/gresource.xml +++ b/main/data/gresource.xml @@ -20,9 +20,7 @@ file_default_widget.ui file_send_overlay.ui global_search.ui - icons/scalable/actions/dino-account-plus-symbolic.svg icons/scalable/actions/dino-emoticon-add-symbolic.svg - icons/scalable/actions/dino-emoticon-symbolic.svg icons/scalable/actions/dino-qr-code-symbolic.svg icons/scalable/apps/im.dino.Dino-symbolic.svg icons/scalable/apps/im.dino.Dino.svg @@ -41,8 +39,6 @@ icons/scalable/mimetypes/dino-file-table-symbolic.svg icons/scalable/mimetypes/dino-file-video-symbolic.svg icons/scalable/status/dino-double-tick-symbolic.svg - icons/scalable/status/dino-microphone-off-symbolic.svg - icons/scalable/status/dino-microphone-symbolic.svg icons/scalable/status/dino-party-popper-symbolic.svg icons/scalable/status/dino-security-high-symbolic.svg icons/scalable/status/dino-status-away.svg @@ -72,3 +68,4 @@ unified_window_placeholder.ui + diff --git a/main/data/icons/scalable/actions/dino-account-plus-symbolic.svg b/main/data/icons/scalable/actions/dino-account-plus-symbolic.svg deleted file mode 100644 index cf743afa..00000000 --- a/main/data/icons/scalable/actions/dino-account-plus-symbolic.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/main/data/icons/scalable/actions/dino-emoticon-add-symbolic.svg b/main/data/icons/scalable/actions/dino-emoticon-add-symbolic.svg index 51cc75c6..649bd9de 100644 --- a/main/data/icons/scalable/actions/dino-emoticon-add-symbolic.svg +++ b/main/data/icons/scalable/actions/dino-emoticon-add-symbolic.svg @@ -1,5 +1,8 @@ - - - + + + + + + diff --git a/main/data/icons/scalable/actions/dino-emoticon-symbolic.svg b/main/data/icons/scalable/actions/dino-emoticon-symbolic.svg deleted file mode 100644 index 5656303d..00000000 --- a/main/data/icons/scalable/actions/dino-emoticon-symbolic.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/main/data/icons/scalable/devices/dino-phone-hangup-symbolic.svg b/main/data/icons/scalable/devices/dino-phone-hangup-symbolic.svg index ecd230ac..542533ba 100644 --- a/main/data/icons/scalable/devices/dino-phone-hangup-symbolic.svg +++ b/main/data/icons/scalable/devices/dino-phone-hangup-symbolic.svg @@ -1 +1,38 @@ - \ No newline at end of file + + + + + + + + diff --git a/main/data/icons/scalable/devices/dino-phone-in-talk-symbolic.svg b/main/data/icons/scalable/devices/dino-phone-in-talk-symbolic.svg index 351035da..905eb1ac 100644 --- a/main/data/icons/scalable/devices/dino-phone-in-talk-symbolic.svg +++ b/main/data/icons/scalable/devices/dino-phone-in-talk-symbolic.svg @@ -1 +1,6 @@ - \ No newline at end of file + + + + + + diff --git a/main/data/icons/scalable/devices/dino-phone-missed-symbolic.svg b/main/data/icons/scalable/devices/dino-phone-missed-symbolic.svg index 228f073e..ca8e6978 100644 --- a/main/data/icons/scalable/devices/dino-phone-missed-symbolic.svg +++ b/main/data/icons/scalable/devices/dino-phone-missed-symbolic.svg @@ -1 +1,5 @@ - \ No newline at end of file + + + + + diff --git a/main/data/icons/scalable/devices/dino-phone-ring-symbolic.svg b/main/data/icons/scalable/devices/dino-phone-ring-symbolic.svg index 06b8dcbf..13b32842 100644 --- a/main/data/icons/scalable/devices/dino-phone-ring-symbolic.svg +++ b/main/data/icons/scalable/devices/dino-phone-ring-symbolic.svg @@ -1 +1,4 @@ - \ No newline at end of file + + + + diff --git a/main/data/icons/scalable/devices/dino-phone-symbolic.svg b/main/data/icons/scalable/devices/dino-phone-symbolic.svg index 0020dddc..14c2225b 100644 --- a/main/data/icons/scalable/devices/dino-phone-symbolic.svg +++ b/main/data/icons/scalable/devices/dino-phone-symbolic.svg @@ -1 +1,8 @@ - \ No newline at end of file + + + + + + + + diff --git a/main/data/icons/scalable/status/dino-microphone-off-symbolic.svg b/main/data/icons/scalable/status/dino-microphone-off-symbolic.svg deleted file mode 100644 index 7e5b853d..00000000 --- a/main/data/icons/scalable/status/dino-microphone-off-symbolic.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/main/data/icons/scalable/status/dino-microphone-symbolic.svg b/main/data/icons/scalable/status/dino-microphone-symbolic.svg deleted file mode 100644 index fbf0784a..00000000 --- a/main/data/icons/scalable/status/dino-microphone-symbolic.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/main/data/icons/scalable/status/dino-video-off-symbolic.svg b/main/data/icons/scalable/status/dino-video-off-symbolic.svg index d438e065..6bfa690a 100644 --- a/main/data/icons/scalable/status/dino-video-off-symbolic.svg +++ b/main/data/icons/scalable/status/dino-video-off-symbolic.svg @@ -1 +1,5 @@ - \ No newline at end of file + + + + + diff --git a/main/data/icons/scalable/status/dino-video-symbolic.svg b/main/data/icons/scalable/status/dino-video-symbolic.svg index 60a1c742..2896c22d 100644 --- a/main/data/icons/scalable/status/dino-video-symbolic.svg +++ b/main/data/icons/scalable/status/dino-video-symbolic.svg @@ -1 +1,5 @@ - \ No newline at end of file + + + + + diff --git a/main/data/message_item_widget_edit_mode.ui b/main/data/message_item_widget_edit_mode.ui index 907dbbf0..e1ca4bc4 100644 --- a/main/data/message_item_widget_edit_mode.ui +++ b/main/data/message_item_widget_edit_mode.ui @@ -27,7 +27,7 @@ - dino-emoticon-symbolic + emoji-people-symbolic 1 diff --git a/main/src/ui/call_window/call_bottom_bar.vala b/main/src/ui/call_window/call_bottom_bar.vala index dfa2e4c6..641a4def 100644 --- a/main/src/ui/call_window/call_bottom_bar.vala +++ b/main/src/ui/call_window/call_bottom_bar.vala @@ -113,11 +113,11 @@ public class Dino.Ui.CallBottomBar : Gtk.Box { public void on_audio_enabled_changed() { if (audio_enabled) { - audio_image.icon_name = "dino-microphone-symbolic"; + audio_image.icon_name = "audio-input-microphone-symbolic"; audio_button.add_css_class("white-button"); audio_button.remove_css_class("transparent-white-button"); } else { - audio_image.icon_name = "dino-microphone-off-symbolic"; + audio_image.icon_name = "microphone-disabled-symbolic"; audio_button.remove_css_class("white-button"); audio_button.add_css_class("transparent-white-button"); } @@ -145,4 +145,4 @@ public class Dino.Ui.CallBottomBar : Gtk.Box { return (video_settings_button.popover != null && video_settings_button.popover.visible) || (audio_settings_button.popover != null && audio_settings_button.popover.visible); } -} \ No newline at end of file +} diff --git a/main/src/ui/call_window/participant_widget.vala b/main/src/ui/call_window/participant_widget.vala index bed64c30..0940bc9e 100644 --- a/main/src/ui/call_window/participant_widget.vala +++ b/main/src/ui/call_window/participant_widget.vala @@ -17,8 +17,8 @@ namespace Dino.Ui { public Box title_box = new Box(Orientation.VERTICAL, 0) { valign=Align.CENTER, hexpand=true }; public MenuButton encryption_button = new MenuButton() { opacity=0, has_frame=false, height_request=30, width_request=30, margin_end=5 }; public CallEncryptionButtonController encryption_button_controller; - public MenuButton menu_button = new MenuButton() { icon_name="open-menu-symbolic", has_frame=false }; - public Button invite_button = new Button.from_icon_name("dino-account-plus") { has_frame=false }; + public MenuButton menu_button = new MenuButton() { icon_name="view-more-symbolic", has_frame=false }; + public Button invite_button = new Button.from_icon_name("contact-new-symbolic") { has_frame=false }; public bool shows_video = false; public string? participant_name; @@ -140,4 +140,4 @@ namespace Dino.Ui { invite_button.visible = may_show_invite_button && is_highest_row && is_start_row; } } -} \ No newline at end of file +} diff --git a/main/src/ui/conversation_content_view/file_image_widget.vala b/main/src/ui/conversation_content_view/file_image_widget.vala index 505c46a0..43c3b74d 100644 --- a/main/src/ui/conversation_content_view/file_image_widget.vala +++ b/main/src/ui/conversation_content_view/file_image_widget.vala @@ -48,7 +48,7 @@ public class FileImageWidget : Box { string? mime_type = file_info.get_content_type(); MenuButton button = new MenuButton(); - button.icon_name = "open-menu"; + button.icon_name = "view-more"; Menu menu_model = new Menu(); menu_model.append(_("Open"), "file.open"); menu_model.append(_("Save as…"), "file.save_as"); diff --git a/main/src/ui/conversation_titlebar/menu_entry.vala b/main/src/ui/conversation_titlebar/menu_entry.vala index 7b484219..d0b9fbcd 100644 --- a/main/src/ui/conversation_titlebar/menu_entry.vala +++ b/main/src/ui/conversation_titlebar/menu_entry.vala @@ -11,7 +11,7 @@ class MenuEntry : Plugins.ConversationTitlebarEntry, Object { StreamInteractor stream_interactor; private Conversation? conversation; - Button button = new Button() { icon_name="open-menu-symbolic" }; + Button button = new Button() { icon_name="view-more-symbolic" }; public MenuEntry(StreamInteractor stream_interactor) { this.stream_interactor = stream_interactor; From da7be50f059e5a1536b58087d5cdb305bf86ef63 Mon Sep 17 00:00:00 2001 From: eerielili Date: Sun, 25 Jun 2023 11:39:07 +0000 Subject: [PATCH 07/15] Add a keyboard shortcut to show keyboard shortcuts (#1432) Add a keyboard shortcut to show keyboard shortcuts - It's Ctrl+? --- main/data/shortcuts.ui | 6 ++++++ main/src/ui/application.vala | 2 ++ 2 files changed, 8 insertions(+) diff --git a/main/data/shortcuts.ui b/main/data/shortcuts.ui index 30b5ab83..6cc5851a 100644 --- a/main/data/shortcuts.ui +++ b/main/data/shortcuts.ui @@ -20,6 +20,12 @@ Join Channel + + + <ctrl>question + Keyboard shortcuts + + diff --git a/main/src/ui/application.vala b/main/src/ui/application.vala index 36f08f60..9ee3361a 100644 --- a/main/src/ui/application.vala +++ b/main/src/ui/application.vala @@ -10,6 +10,7 @@ public class Dino.Ui.Application : Adw.Application, Dino.Application { private const string[] KEY_COMBINATION_ADD_CONFERENCE = {"G", null}; private const string[] KEY_COMBINATION_LOOP_CONVERSATIONS = {"Tab", null}; private const string[] KEY_COMBINATION_LOOP_CONVERSATIONS_REV = {"Tab", null}; + private const string[] KEY_COMBINATION_SHOW_KEYBOARD_SHORTCUTS = {"question", null}; private MainWindow window; public MainWindowController controller; @@ -206,6 +207,7 @@ public class Dino.Ui.Application : Adw.Application, Dino.Application { dialog.present(); }); add_action(open_shortcuts_action); + set_accels_for_action("app.open_shortcuts", KEY_COMBINATION_SHOW_KEYBOARD_SHORTCUTS); SimpleAction accept_call_action = new SimpleAction("accept-call", new VariantType.tuple(new VariantType[]{VariantType.INT32, VariantType.INT32})); accept_call_action.activate.connect((variant) => { From a36a63d7e42f5a21ecc3755db2570ce2b379f5ff Mon Sep 17 00:00:00 2001 From: Christopher Davis Date: Mon, 3 Jul 2023 21:54:23 -0400 Subject: [PATCH 08/15] main_window: Use AdwApplicationWindow The main window of an app should be an ApplicationWindow. These windows provide nicer APIs for actions and more. --- main/src/ui/main_window.vala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/src/ui/main_window.vala b/main/src/ui/main_window.vala index 9121b91e..dd54052e 100644 --- a/main/src/ui/main_window.vala +++ b/main/src/ui/main_window.vala @@ -6,7 +6,7 @@ using Dino.Entities; namespace Dino.Ui { -public class MainWindow : Adw.Window { +public class MainWindow : Adw.ApplicationWindow { public signal void conversation_selected(Conversation conversation); From 3d5dad25d8d400003bea74b4c891f041c01351b5 Mon Sep 17 00:00:00 2001 From: Christopher Davis Date: Mon, 3 Jul 2023 21:55:11 -0400 Subject: [PATCH 09/15] application: Load help overlay automatically GTK automatically loads and sets up the action and keyboard shortcut for the Keyboard Shortcuts dialog. We don't need to manually do it as long as we put everything in the right place. See https://docs.gtk.org/gtk4/class.Application.html#automatic-resources --- main/CMakeLists.txt | 2 +- main/data/gresource.xml | 3 +-- main/data/{shortcuts.ui => gtk/help-overlay.ui} | 2 +- main/data/menu_app.ui | 2 +- main/src/ui/application.vala | 14 -------------- 5 files changed, 4 insertions(+), 19 deletions(-) rename main/data/{shortcuts.ui => gtk/help-overlay.ui} (98%) diff --git a/main/CMakeLists.txt b/main/CMakeLists.txt index f78a1191..9202c1c7 100644 --- a/main/CMakeLists.txt +++ b/main/CMakeLists.txt @@ -82,7 +82,7 @@ set(RESOURCE_LIST quote.ui search_autocomplete.ui settings_dialog.ui - shortcuts.ui + gtk/help-overlay.ui unified_main_content.ui unified_window_placeholder.ui diff --git a/main/data/gresource.xml b/main/data/gresource.xml index 603d7fd0..84c6f2b4 100644 --- a/main/data/gresource.xml +++ b/main/data/gresource.xml @@ -61,11 +61,10 @@ quote.ui search_autocomplete.ui settings_dialog.ui - shortcuts.ui + gtk/help-overlay.ui style-dark.css style.css unified_main_content.ui unified_window_placeholder.ui - diff --git a/main/data/shortcuts.ui b/main/data/gtk/help-overlay.ui similarity index 98% rename from main/data/shortcuts.ui rename to main/data/gtk/help-overlay.ui index 6cc5851a..17b0555c 100644 --- a/main/data/shortcuts.ui +++ b/main/data/gtk/help-overlay.ui @@ -1,6 +1,6 @@ - + True diff --git a/main/data/menu_app.ui b/main/data/menu_app.ui index f269e219..bb33ff65 100644 --- a/main/data/menu_app.ui +++ b/main/data/menu_app.ui @@ -13,7 +13,7 @@ Preferences - app.open_shortcuts + win.show-help-overlay Keyboard Shortcuts diff --git a/main/src/ui/application.vala b/main/src/ui/application.vala index 9ee3361a..45d958cb 100644 --- a/main/src/ui/application.vala +++ b/main/src/ui/application.vala @@ -195,20 +195,6 @@ public class Dino.Ui.Application : Adw.Application, Dino.Application { add_action(loop_conversations_bw_action); set_accels_for_action("app.loop_conversations_bw", KEY_COMBINATION_LOOP_CONVERSATIONS_REV); - SimpleAction open_shortcuts_action = new SimpleAction("open_shortcuts", null); - open_shortcuts_action.activate.connect((variant) => { - Builder builder = new Builder.from_resource("/im/dino/Dino/shortcuts.ui"); - ShortcutsWindow dialog = (ShortcutsWindow) builder.get_object("shortcuts-window"); - if (!use_csd()) { - dialog.set_titlebar(null); - } - dialog.title = _("Keyboard Shortcuts"); - dialog.set_transient_for(get_active_window()); - dialog.present(); - }); - add_action(open_shortcuts_action); - set_accels_for_action("app.open_shortcuts", KEY_COMBINATION_SHOW_KEYBOARD_SHORTCUTS); - SimpleAction accept_call_action = new SimpleAction("accept-call", new VariantType.tuple(new VariantType[]{VariantType.INT32, VariantType.INT32})); accept_call_action.activate.connect((variant) => { int conversation_id = variant.get_child_value(0).get_int32(); From b830b796a5dd6379470ff72ff989f63c4a480954 Mon Sep 17 00:00:00 2001 From: fiaxh Date: Sat, 8 Jul 2023 11:05:51 +0200 Subject: [PATCH 10/15] Cleanup automatically loaded help overlay --- main/CMakeLists.txt | 2 +- main/data/gresource.xml | 2 +- main/src/ui/application.vala | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/main/CMakeLists.txt b/main/CMakeLists.txt index 9202c1c7..7f85f7ae 100644 --- a/main/CMakeLists.txt +++ b/main/CMakeLists.txt @@ -67,6 +67,7 @@ set(RESOURCE_LIST file_default_widget.ui file_send_overlay.ui global_search.ui + gtk/help-overlay.ui conversation_content_view/item_metadata_header.ui conversation_content_view/view.ui manage_accounts/account_row.ui @@ -82,7 +83,6 @@ set(RESOURCE_LIST quote.ui search_autocomplete.ui settings_dialog.ui - gtk/help-overlay.ui unified_main_content.ui unified_window_placeholder.ui diff --git a/main/data/gresource.xml b/main/data/gresource.xml index 84c6f2b4..656defc4 100644 --- a/main/data/gresource.xml +++ b/main/data/gresource.xml @@ -20,6 +20,7 @@ file_default_widget.ui file_send_overlay.ui global_search.ui + gtk/help-overlay.ui icons/scalable/actions/dino-emoticon-add-symbolic.svg icons/scalable/actions/dino-qr-code-symbolic.svg icons/scalable/apps/im.dino.Dino-symbolic.svg @@ -61,7 +62,6 @@ quote.ui search_autocomplete.ui settings_dialog.ui - gtk/help-overlay.ui style-dark.css style.css unified_main_content.ui diff --git a/main/src/ui/application.vala b/main/src/ui/application.vala index 45d958cb..2e785224 100644 --- a/main/src/ui/application.vala +++ b/main/src/ui/application.vala @@ -10,7 +10,6 @@ public class Dino.Ui.Application : Adw.Application, Dino.Application { private const string[] KEY_COMBINATION_ADD_CONFERENCE = {"G", null}; private const string[] KEY_COMBINATION_LOOP_CONVERSATIONS = {"Tab", null}; private const string[] KEY_COMBINATION_LOOP_CONVERSATIONS_REV = {"Tab", null}; - private const string[] KEY_COMBINATION_SHOW_KEYBOARD_SHORTCUTS = {"question", null}; private MainWindow window; public MainWindowController controller; From 35163f08f9c0818100c9a574cd7029ec6aeb1498 Mon Sep 17 00:00:00 2001 From: Robert Mader Date: Thu, 8 Jun 2023 19:05:31 +0200 Subject: [PATCH 11/15] data: Set X-Purism-FormFactor in .desktop file So the app is detected as mobile-friendly on Phosh. --- main/data/im.dino.Dino.desktop | 1 + 1 file changed, 1 insertion(+) diff --git a/main/data/im.dino.Dino.desktop b/main/data/im.dino.Dino.desktop index 8c04dc34..647783b2 100644 --- a/main/data/im.dino.Dino.desktop +++ b/main/data/im.dino.Dino.desktop @@ -11,3 +11,4 @@ Type=Application Categories=GTK;Network;Chat;InstantMessaging; X-GNOME-UsesNotifications=true MimeType=x-scheme-handler/xmpp; +X-Purism-FormFactor=Workstation;Mobile; From f82f788f43e385391db2827cde151830fc91bc14 Mon Sep 17 00:00:00 2001 From: Stephen Paul Weber Date: Tue, 4 Jul 2023 21:59:24 -0500 Subject: [PATCH 12/15] Ignore non-DTLS data before handshake is complete https://datatracker.ietf.org/doc/html/rfc9147#name-demul https://datatracker.ietf.org/doc/html/rfc5764#section-5.1.2 If data is received before handshake is complete, discard it rather than forwarding it blindly to GnuTLS which can get confused. --- plugins/ice/src/dtls_srtp.vala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/ice/src/dtls_srtp.vala b/plugins/ice/src/dtls_srtp.vala index 298c0061..6987a0d2 100644 --- a/plugins/ice/src/dtls_srtp.vala +++ b/plugins/ice/src/dtls_srtp.vala @@ -46,7 +46,7 @@ public class Handler { return srtp_session.decrypt_rtp(data); } if (component_id == 2) return srtp_session.decrypt_rtcp(data); - } else if (component_id == 1) { + } else if (component_id == 1 && (data[0] >= 20 && data[0] <= 63)) { on_data_rec(data); } return null; From 1bf57a42fa5c36977132d21f59ca6637fcd0c3d3 Mon Sep 17 00:00:00 2001 From: Marvin W Date: Sun, 9 Jul 2023 14:14:43 +0200 Subject: [PATCH 13/15] Do not send DTLS datagrams to RTP even after handshake Also post debug message in case we drop datagrams --- plugins/ice/src/dtls_srtp.vala | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/plugins/ice/src/dtls_srtp.vala b/plugins/ice/src/dtls_srtp.vala index 6987a0d2..e2817ef3 100644 --- a/plugins/ice/src/dtls_srtp.vala +++ b/plugins/ice/src/dtls_srtp.vala @@ -38,7 +38,11 @@ public class Handler { } public uint8[]? process_incoming_data(uint component_id, uint8[] data) throws Crypto.Error { - if (srtp_session.has_decrypt) { + if (data[0] >= 128) { + if (!srtp_session.has_decrypt) { + debug("Received data before SRTP session is ready, dropping."); + return null; + } if (component_id == 1) { if (data.length >= 2 && data[1] >= 192 && data[1] < 224) { return srtp_session.decrypt_rtcp(data); @@ -46,9 +50,12 @@ public class Handler { return srtp_session.decrypt_rtp(data); } if (component_id == 2) return srtp_session.decrypt_rtcp(data); - } else if (component_id == 1 && (data[0] >= 20 && data[0] <= 63)) { - on_data_rec(data); } + if (component_id == 1 && data.length >= 1 && (data[0] >= 20 && data[0] < 64)) { + on_data_rec(data); + return null; + } + debug("Dropping unknown data from component %u", component_id); return null; } From 7357b7ecfbaa6bd0b9aeacb6d1551fd02b3f0f20 Mon Sep 17 00:00:00 2001 From: Marvin W Date: Sun, 9 Jul 2023 14:15:40 +0200 Subject: [PATCH 14/15] Fix certificate start time I doubt anyone ever looked at it, but it shouldn't be 1 day in the future ;) --- plugins/ice/src/dtls_srtp.vala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/ice/src/dtls_srtp.vala b/plugins/ice/src/dtls_srtp.vala index e2817ef3..c9813b7e 100644 --- a/plugins/ice/src/dtls_srtp.vala +++ b/plugins/ice/src/dtls_srtp.vala @@ -86,7 +86,7 @@ public class Handler { err = private_key.generate(PKAlgorithm.ECDSA, 256); throw_if_error(err); - var start_time = new DateTime.now_local().add_days(1); + var start_time = new DateTime.now_local().add_days(-1); var end_time = start_time.add_days(2); X509.Certificate cert = X509.Certificate.create(); From 8c8c2dc4b0e08a2e6d73b45fba795d462595418f Mon Sep 17 00:00:00 2001 From: Marvin W Date: Sun, 9 Jul 2023 15:32:53 +0200 Subject: [PATCH 15/15] Fix potential crash in video calls --- plugins/rtp/src/video_widget.vala | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/rtp/src/video_widget.vala b/plugins/rtp/src/video_widget.vala index 20123c68..f69a2ba7 100644 --- a/plugins/rtp/src/video_widget.vala +++ b/plugins/rtp/src/video_widget.vala @@ -197,7 +197,11 @@ public class Dino.Plugins.Rtp.VideoWidget : Gtk.Widget, Dino.Plugins.VideoCallWi caps.get_structure(0).get_int("width", out width); caps.get_structure(0).get_int("height", out height); debug("Input resolution changed: %ix%i", width, height); - resolution_changed(width, height); + // Invoke signal on GTK main loop as recipients are likely to use it for doing GTK operations + Idle.add(() => { + resolution_changed(width, height); + return Source.REMOVE; + }); last_input_caps = caps; }