aboutsummaryrefslogtreecommitdiff
path: root/xmpp-vala/src/module/xep/0203_delayed_delivery.vala
diff options
context:
space:
mode:
Diffstat (limited to 'xmpp-vala/src/module/xep/0203_delayed_delivery.vala')
-rw-r--r--xmpp-vala/src/module/xep/0203_delayed_delivery.vala18
1 files changed, 13 insertions, 5 deletions
diff --git a/xmpp-vala/src/module/xep/0203_delayed_delivery.vala b/xmpp-vala/src/module/xep/0203_delayed_delivery.vala
index 8ca300c9..89c761f2 100644
--- a/xmpp-vala/src/module/xep/0203_delayed_delivery.vala
+++ b/xmpp-vala/src/module/xep/0203_delayed_delivery.vala
@@ -27,19 +27,27 @@ namespace Xmpp.Xep.DelayedDelivery {
}
public override void attach(XmppStream stream) {
- stream.get_module(Message.Module.IDENTITY).pre_received_message.connect(on_pre_received_message);
+ stream.get_module(Message.Module.IDENTITY).received_pipeline.connect(new ReceivedPipelineListener());
}
public override void detach(XmppStream stream) { }
public override string get_ns() { return NS_URI; }
public override string get_id() { return IDENTITY.id; }
+ }
- private void on_pre_received_message(XmppStream stream, Message.Stanza message) {
- DateTime? datetime = get_time_for_message(message);
- if (datetime != null) message.add_flag(new MessageFlag(datetime));
- }
+public class ReceivedPipelineListener : StanzaListener<Message.Stanza> {
+
+ private const string[] after_actions_const = {};
+
+ public override string action_group { get { return "ADD_NODE"; } }
+ public override string[] after_actions { get { return after_actions_const; } }
+
+ public override async void run(Core.XmppStream stream, Message.Stanza message) {
+ DateTime? datetime = Module.get_time_for_message(message);
+ if (datetime != null) message.add_flag(new MessageFlag(datetime));
}
+}
public class MessageFlag : Message.MessageFlag {
public const string ID = "delayed_delivery";