From 5b2683dfa5241777d621866e4e0a0790766433c2 Mon Sep 17 00:00:00 2001 From: fiaxh Date: Mon, 6 Apr 2020 15:33:43 +0200 Subject: Last message correction fixes --- libdino/src/service/message_correction.vala | 3 +++ main/src/ui/conversation_view_controller.vala | 4 ++++ plugins/omemo/src/logic/trust_manager.vala | 3 +++ 3 files changed, 10 insertions(+) diff --git a/libdino/src/service/message_correction.vala b/libdino/src/service/message_correction.vala index 90d0580f..e38fd251 100644 --- a/libdino/src/service/message_correction.vala +++ b/libdino/src/service/message_correction.vala @@ -47,6 +47,9 @@ public class MessageCorrection : StreamInteractionModule, MessageListener { outstanding_correction_nodes[out_message.stanza_id] = stanza_id; stream_interactor.get_module(MessageStorage.IDENTITY).add_message(out_message, conversation); stream_interactor.get_module(MessageProcessor.IDENTITY).send_xmpp_message(out_message, conversation); + if (conversation.read_up_to != null && conversation.read_up_to.equals(old_message)) { // TODO nicer + conversation.read_up_to = out_message; + } db.message_correction.insert() .value(db.message_correction.message_id, out_message.id) diff --git a/main/src/ui/conversation_view_controller.vala b/main/src/ui/conversation_view_controller.vala index 31c7e612..dce9920e 100644 --- a/main/src/ui/conversation_view_controller.vala +++ b/main/src/ui/conversation_view_controller.vala @@ -151,6 +151,10 @@ public class ConversationViewController : Object { } private bool forward_key_press_to_chat_input(EventKey event) { + if (((Gtk.Window)view.get_toplevel()).get_focus() is TextView) { + return false; + } + // Don't forward / change focus on Control / Alt if (event.keyval == Gdk.Key.Control_L || event.keyval == Gdk.Key.Control_R || event.keyval == Gdk.Key.Alt_L || event.keyval == Gdk.Key.Alt_R) { diff --git a/plugins/omemo/src/logic/trust_manager.vala b/plugins/omemo/src/logic/trust_manager.vala index 1e77fcdd..50c9bbcb 100644 --- a/plugins/omemo/src/logic/trust_manager.vala +++ b/plugins/omemo/src/logic/trust_manager.vala @@ -283,6 +283,9 @@ public class TrustManager { StanzaNode? _encrypted = stanza.stanza.get_subnode("encrypted", NS_URI); if (_encrypted == null || MessageFlag.get_flag(stanza) != null || stanza.from == null) return false; StanzaNode encrypted = (!)_encrypted; + if (message.body == null && Xep.ExplicitEncryption.get_encryption_tag(stanza) == NS_URI) { + message.body = "[This message is OMEMO encrypted]"; // TODO temporary + }; if (!Plugin.ensure_context()) return false; int identity_id = db.identity.get_id(conversation.account.id); MessageFlag flag = new MessageFlag(); -- cgit v1.2.3-70-g09d2