aboutsummaryrefslogtreecommitdiff
path: root/xmpp-vala/src/module/xep/0203_delayed_delivery.vala
diff options
context:
space:
mode:
authorfiaxh <git@mx.ax.lt>2017-11-21 23:27:27 +0100
committerfiaxh <git@mx.ax.lt>2017-11-22 00:40:41 +0100
commitde133218dab0ac1729dbfc32177979133c15f53b (patch)
tree1cecc41b9f54841dd44cc348a564d9fd7f999f9e /xmpp-vala/src/module/xep/0203_delayed_delivery.vala
parentf3063f56b7e2ccfef255256d5bf527988fcf2957 (diff)
downloaddino-de133218dab0ac1729dbfc32177979133c15f53b.tar.gz
dino-de133218dab0ac1729dbfc32177979133c15f53b.zip
Disconnect stanza listeners from pipeline
Diffstat (limited to 'xmpp-vala/src/module/xep/0203_delayed_delivery.vala')
-rw-r--r--xmpp-vala/src/module/xep/0203_delayed_delivery.vala8
1 files changed, 6 insertions, 2 deletions
diff --git a/xmpp-vala/src/module/xep/0203_delayed_delivery.vala b/xmpp-vala/src/module/xep/0203_delayed_delivery.vala
index 89c761f2..b36932b0 100644
--- a/xmpp-vala/src/module/xep/0203_delayed_delivery.vala
+++ b/xmpp-vala/src/module/xep/0203_delayed_delivery.vala
@@ -6,6 +6,8 @@ namespace Xmpp.Xep.DelayedDelivery {
public class Module : XmppStreamModule {
public static ModuleIdentity<Module> IDENTITY = new ModuleIdentity<Module>(NS_URI, "0203_delayed_delivery");
+ private ReceivedPipelineListener received_pipeline_listener = new ReceivedPipelineListener();
+
public static void set_message_delay(Message.Stanza message, DateTime datetime) {
StanzaNode delay_node = (new StanzaNode.build("delay", NS_URI)).add_self_xmlns();
delay_node.put_attribute("stamp", DateTimeProfiles.to_datetime(datetime));
@@ -27,10 +29,12 @@ namespace Xmpp.Xep.DelayedDelivery {
}
public override void attach(XmppStream stream) {
- stream.get_module(Message.Module.IDENTITY).received_pipeline.connect(new ReceivedPipelineListener());
+ stream.get_module(Message.Module.IDENTITY).received_pipeline.connect(received_pipeline_listener);
}
- public override void detach(XmppStream stream) { }
+ public override void detach(XmppStream stream) {
+ stream.get_module(Message.Module.IDENTITY).received_pipeline.disconnect(received_pipeline_listener);
+ }
public override string get_ns() { return NS_URI; }
public override string get_id() { return IDENTITY.id; }