From 7c4260eed718961874fc0ea665263ea2ce59338b Mon Sep 17 00:00:00 2001 From: fiaxh Date: Tue, 21 Apr 2020 16:25:21 +0200 Subject: Remove features from service discovery module when detaching module from stream fixes #179 fixes #812 --- plugins/omemo/src/jingle/jet_omemo.vala | 1 + plugins/omemo/src/protocol/stream_module.vala | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'plugins/omemo/src') diff --git a/plugins/omemo/src/jingle/jet_omemo.vala b/plugins/omemo/src/jingle/jet_omemo.vala index 2ddf5d33..edca809c 100644 --- a/plugins/omemo/src/jingle/jet_omemo.vala +++ b/plugins/omemo/src/jingle/jet_omemo.vala @@ -26,6 +26,7 @@ public class Module : XmppStreamModule, Jet.EnvelopEncoding { } public override void detach(XmppStream stream) { + stream.get_module(ServiceDiscovery.Module.IDENTITY).remove_feature(stream, NS_URI); } public bool is_available(XmppStream stream, Jid full_jid) { diff --git a/plugins/omemo/src/protocol/stream_module.vala b/plugins/omemo/src/protocol/stream_module.vala index 83822ea2..ba6e409e 100644 --- a/plugins/omemo/src/protocol/stream_module.vala +++ b/plugins/omemo/src/protocol/stream_module.vala @@ -35,7 +35,9 @@ public class StreamModule : XmppStreamModule { stream.get_module(Pubsub.Module.IDENTITY).add_filtered_notification(stream, NODE_DEVICELIST, (stream, jid, id, node) => parse_device_list(stream, jid, id, node), null); } - public override void detach(XmppStream stream) {} + public override void detach(XmppStream stream) { + stream.get_module(Pubsub.Module.IDENTITY).remove_filtered_notification(stream, NODE_DEVICELIST); + } public async ArrayList request_user_devicelist(XmppStream stream, Jid jid) { var future = active_devicelist_requests[jid]; -- cgit v1.2.3-54-g00ecf