From 4ccdc1d0920a93b313d81b4014b6f45efb49b1fe Mon Sep 17 00:00:00 2001 From: fiaxh Date: Sat, 10 Mar 2018 19:46:08 +0100 Subject: Small connection fixes --- xmpp-vala/src/core/xmpp_stream.vala | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'xmpp-vala/src') diff --git a/xmpp-vala/src/core/xmpp_stream.vala b/xmpp-vala/src/core/xmpp_stream.vala index 09e973bd..98c89716 100644 --- a/xmpp-vala/src/core/xmpp_stream.vala +++ b/xmpp-vala/src/core/xmpp_stream.vala @@ -151,6 +151,12 @@ public class XmppStream { } public XmppStream add_module(XmppStreamModule module) { + foreach (XmppStreamModule m in modules) { + if (m.get_ns() == module.get_ns() && m.get_id() == module.get_id()) { + print("[%p] Adding already added module: %s\n".printf(this, module.get_id())); + return this; + } + } modules.add(module); if (negotiation_complete) module.attach(this); return this; -- cgit v1.2.3-70-g09d2