Comparison

plugins/mod_presence.lua @ 5297:7453245f16e7

mod_presence: Put a timestamp on presence we store for probes
author Kim Alvefur <zash@zash.se>
date Fri, 11 Jan 2013 19:38:29 +0100
parent 5171:b4b302fe415c
child 5370:7838acadb0fa
comparison
equal deleted inserted replaced
5296:78b7a4ad2f32 5297:7453245f16e7
16 16
17 local core_post_stanza = prosody.core_post_stanza; 17 local core_post_stanza = prosody.core_post_stanza;
18 local st = require "util.stanza"; 18 local st = require "util.stanza";
19 local jid_split = require "util.jid".split; 19 local jid_split = require "util.jid".split;
20 local jid_bare = require "util.jid".bare; 20 local jid_bare = require "util.jid".bare;
21 local datetime = require "util.datetime";
21 local hosts = hosts; 22 local hosts = hosts;
22 local NULL = {}; 23 local NULL = {};
23 24
24 local rostermanager = require "core.rostermanager"; 25 local rostermanager = require "core.rostermanager";
25 local sessionmanager = require "core.sessionmanager"; 26 local sessionmanager = require "core.sessionmanager";
133 end 134 end
134 origin.directed = nil; 135 origin.directed = nil;
135 end 136 end
136 else 137 else
137 origin.presence = stanza; 138 origin.presence = stanza;
139 stanza:tag("delay", { xmlns = "urn:xmpp:delay", from = host, stamp = datetime.datetime() }):up();
138 if origin.priority ~= priority then 140 if origin.priority ~= priority then
139 origin.priority = priority; 141 origin.priority = priority;
140 recalc_resource_map(user); 142 recalc_resource_map(user);
141 end 143 end
142 end 144 end