aboutsummaryrefslogtreecommitdiff
path: root/xmpp-vala
diff options
context:
space:
mode:
authorfiaxh <git@mx.ax.lt>2017-09-26 17:01:06 +0200
committerfiaxh <git@mx.ax.lt>2017-09-26 17:01:06 +0200
commit9d8e1e88ec61403659a8cc410d5c4414e3bd3a96 (patch)
tree40f1014b7511fd5951035cb706f06d4daa2a42f0 /xmpp-vala
parent54a25fd926070a977138cec94908c55806e22f4a (diff)
downloaddino-9d8e1e88ec61403659a8cc410d5c4414e3bd3a96.tar.gz
dino-9d8e1e88ec61403659a8cc410d5c4414e3bd3a96.zip
http-files: max-file-size handling
Diffstat (limited to 'xmpp-vala')
-rw-r--r--xmpp-vala/src/core/xmpp_stream.vala2
-rw-r--r--xmpp-vala/src/module/iq/module.vala5
-rw-r--r--xmpp-vala/src/module/xep/0030_service_discovery/module.vala6
3 files changed, 10 insertions, 3 deletions
diff --git a/xmpp-vala/src/core/xmpp_stream.vala b/xmpp-vala/src/core/xmpp_stream.vala
index 6bb66445..9d700b4d 100644
--- a/xmpp-vala/src/core/xmpp_stream.vala
+++ b/xmpp-vala/src/core/xmpp_stream.vala
@@ -149,7 +149,7 @@ public class XmppStream {
return this;
}
- public void remove_modules() {
+ public void detach_modules() {
foreach (XmppStreamModule module in modules) module.detach(this);
}
diff --git a/xmpp-vala/src/module/iq/module.vala b/xmpp-vala/src/module/iq/module.vala
index 088519ff..c19cc2e5 100644
--- a/xmpp-vala/src/module/iq/module.vala
+++ b/xmpp-vala/src/module/iq/module.vala
@@ -30,6 +30,11 @@ namespace Xmpp.Iq {
namespaceRegistrants[namespace].add(module);
}
+ public void unregister_from_namespace(string namespace, Handler module) {
+ ArrayList<Handler>? handlers = namespaceRegistrants[namespace];
+ if (handlers != null) handlers.remove(module);
+ }
+
public override void attach(XmppStream stream) {
stream.received_iq_stanza.connect(on_received_iq_stanza);
}
diff --git a/xmpp-vala/src/module/xep/0030_service_discovery/module.vala b/xmpp-vala/src/module/xep/0030_service_discovery/module.vala
index 4d7a3245..011a1f36 100644
--- a/xmpp-vala/src/module/xep/0030_service_discovery/module.vala
+++ b/xmpp-vala/src/module/xep/0030_service_discovery/module.vala
@@ -71,12 +71,14 @@ public class Module : XmppStreamModule, Iq.Handler {
public void on_iq_set(XmppStream stream, Iq.Stanza iq) { }
public override void attach(XmppStream stream) {
- stream.get_module(Iq.Module.IDENTITY).register_for_namespace(NS_URI_INFO, this);
stream.add_flag(new Flag());
+ stream.get_module(Iq.Module.IDENTITY).register_for_namespace(NS_URI_INFO, this);
add_feature(stream, NS_URI_INFO);
}
- public override void detach(XmppStream stream) { }
+ public override void detach(XmppStream stream) {
+ stream.get_module(Iq.Module.IDENTITY).unregister_from_namespace(NS_URI_INFO, this);
+ }
public static void require(XmppStream stream) {
if (stream.get_module(IDENTITY) == null) stream.add_module(new ServiceDiscovery.Module());