aboutsummaryrefslogtreecommitdiff
path: root/xmpp-vala
diff options
context:
space:
mode:
Diffstat (limited to 'xmpp-vala')
-rw-r--r--xmpp-vala/src/core/xmpp_stream.vala6
1 files changed, 6 insertions, 0 deletions
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;