mod_presence: Put a timestamp on presence we store for probes
authorKim Alvefur <zash@zash.se>
Fri, 11 Jan 2013 18:38:29 +0000 (19:38 +0100)
committerKim Alvefur <zash@zash.se>
Fri, 11 Jan 2013 18:38:29 +0000 (19:38 +0100)
plugins/mod_presence.lua

index 20d0adf0504182e32ac7b28dfd33c1bc033a0acd..23012750d46e00837bcbfb39637c450a1ea39d51 100644 (file)
@@ -18,6 +18,7 @@ local core_post_stanza = prosody.core_post_stanza;
 local st = require "util.stanza";
 local jid_split = require "util.jid".split;
 local jid_bare = require "util.jid".bare;
+local datetime = require "util.datetime";
 local hosts = hosts;
 local NULL = {};
 
@@ -135,6 +136,7 @@ function handle_normal_presence(origin, stanza)
                end
        else
                origin.presence = stanza;
+               stanza:tag("delay", { xmlns = "urn:xmpp:delay", from = host, stamp = datetime.datetime() }):up();
                if origin.priority ~= priority then
                        origin.priority = priority;
                        recalc_resource_map(user);