aboutsummaryrefslogtreecommitdiff
path: root/plugins/omemo/src/stream_module.vala
diff options
context:
space:
mode:
authorfiaxh <git@mx.ax.lt>2017-11-21 23:27:27 +0100
committerfiaxh <git@mx.ax.lt>2017-11-22 00:40:41 +0100
commitde133218dab0ac1729dbfc32177979133c15f53b (patch)
tree1cecc41b9f54841dd44cc348a564d9fd7f999f9e /plugins/omemo/src/stream_module.vala
parentf3063f56b7e2ccfef255256d5bf527988fcf2957 (diff)
downloaddino-de133218dab0ac1729dbfc32177979133c15f53b.tar.gz
dino-de133218dab0ac1729dbfc32177979133c15f53b.zip
Disconnect stanza listeners from pipeline
Diffstat (limited to 'plugins/omemo/src/stream_module.vala')
-rw-r--r--plugins/omemo/src/stream_module.vala12
1 files changed, 7 insertions, 5 deletions
diff --git a/plugins/omemo/src/stream_module.vala b/plugins/omemo/src/stream_module.vala
index 75a919f7..1aa92801 100644
--- a/plugins/omemo/src/stream_module.vala
+++ b/plugins/omemo/src/stream_module.vala
@@ -21,6 +21,7 @@ public class StreamModule : XmppStreamModule {
private ConcurrentSet<string> active_devicelist_requests = new ConcurrentSet<string>();
private Map<string, ArrayList<int32>> device_lists = new HashMap<string, ArrayList<int32>>();
private Map<string, ArrayList<int32>> ignored_devices = new HashMap<string, ArrayList<int32>>();
+ private ReceivedPipelineListener received_pipeline_listener;
public signal void store_created(Store store);
public signal void device_list_loaded(string jid);
@@ -117,10 +118,15 @@ public class StreamModule : XmppStreamModule {
this.store = Plugin.get_context().create_store();
store_created(store);
- stream.get_module(Message.Module.IDENTITY).received_pipeline.connect(new ReceivedPipelineListener(store));
+ received_pipeline_listener = new ReceivedPipelineListener(store);
+ stream.get_module(Message.Module.IDENTITY).received_pipeline.connect(received_pipeline_listener);
stream.get_module(Pubsub.Module.IDENTITY).add_filtered_notification(stream, NODE_DEVICELIST, (stream, jid, id, node) => on_devicelist(stream, jid, id, node));
}
+ public override void detach(XmppStream stream) {
+ stream.get_module(Message.Module.IDENTITY).received_pipeline.disconnect(received_pipeline_listener);
+ }
+
public void request_user_devicelist(XmppStream stream, string jid) {
if (active_devicelist_requests.add(jid)) {
if (Plugin.DEBUG) print(@"OMEMO: requesting device list for $jid\n");
@@ -369,10 +375,6 @@ public class StreamModule : XmppStreamModule {
stream.get_module(Pubsub.Module.IDENTITY).publish(stream, null, @"$NODE_BUNDLES:$device_id", @"$NODE_BUNDLES:$device_id", "1", bundle);
}
- public override void detach(XmppStream stream) {
-
- }
-
public override string get_ns() {
return NS_URI;
}