From bd1f116b3a57b803e2be4dc92474937f1f824fe4 Mon Sep 17 00:00:00 2001 From: Marvin W Date: Sun, 12 Mar 2017 21:20:56 +0100 Subject: Fix delegate copying issue --- plugins/omemo/src/stream_module.vala | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'plugins/omemo/src') diff --git a/plugins/omemo/src/stream_module.vala b/plugins/omemo/src/stream_module.vala index 546da102..86a9225d 100644 --- a/plugins/omemo/src/stream_module.vala +++ b/plugins/omemo/src/stream_module.vala @@ -109,18 +109,19 @@ public class StreamModule : XmppStreamModule { } public override void attach(XmppStream stream) { - if (Plugin.context == null) return; Message.Module.require(stream); Pubsub.Module.require(stream); - stream.get_module(Message.Module.IDENTITY).pre_received_message.connect(on_pre_received_message); - stream.get_module(Pubsub.Module.IDENTITY).add_filtered_notification(stream, NODE_DEVICELIST, on_devicelist, this); + if (Plugin.context == null) return; + this.store = Plugin.context.create_store(); store_created(store); + stream.get_module(Message.Module.IDENTITY).pre_received_message.connect(on_pre_received_message); + stream.get_module(Pubsub.Module.IDENTITY).add_filtered_notification(stream, NODE_DEVICELIST, (stream, jid, id, node, obj) => (obj as StreamModule).on_devicelist(stream, jid, id, node), this); } private void on_pre_received_message(XmppStream stream, Message.Stanza message) { StanzaNode? encrypted = message.stanza.get_subnode("encrypted", NS_URI); - if (encrypted == null) return; + if (encrypted == null || MessageFlag.get_flag(message) != null) return; MessageFlag flag = new MessageFlag(); message.add_flag(flag); StanzaNode? header = encrypted.get_subnode("header"); -- cgit v1.2.3-70-g09d2