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 --- xmpp-vala/src/module/xep/0045_muc/module.vala | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'xmpp-vala/src/module/xep/0045_muc') diff --git a/xmpp-vala/src/module/xep/0045_muc/module.vala b/xmpp-vala/src/module/xep/0045_muc/module.vala index 263fa3d7..1b16f8a1 100644 --- a/xmpp-vala/src/module/xep/0045_muc/module.vala +++ b/xmpp-vala/src/module/xep/0045_muc/module.vala @@ -221,9 +221,7 @@ public class Module : XmppStreamModule { stream.get_module(Presence.Module.IDENTITY).received_presence.connect(check_for_enter_error); stream.get_module(Presence.Module.IDENTITY).received_available.connect(on_received_available); stream.get_module(Presence.Module.IDENTITY).received_unavailable.connect(on_received_unavailable); - if (stream.get_module(ServiceDiscovery.Module.IDENTITY) != null) { - stream.get_module(ServiceDiscovery.Module.IDENTITY).add_feature(stream, NS_URI); - } + stream.get_module(ServiceDiscovery.Module.IDENTITY).add_feature(stream, NS_URI); } public override void detach(XmppStream stream) { @@ -232,6 +230,7 @@ public class Module : XmppStreamModule { stream.get_module(Presence.Module.IDENTITY).received_presence.disconnect(check_for_enter_error); stream.get_module(Presence.Module.IDENTITY).received_available.disconnect(on_received_available); stream.get_module(Presence.Module.IDENTITY).received_unavailable.disconnect(on_received_unavailable); + stream.get_module(ServiceDiscovery.Module.IDENTITY).remove_feature(stream, NS_URI); } public override string get_ns() { return NS_URI; } -- cgit v1.2.3-70-g09d2