Mercurial > prosody-modules
comparison mod_uptime_presence/mod_uptime_presence.lua @ 927:a9dfa7232d88
Merge
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Tue, 12 Mar 2013 12:10:25 +0000 |
parents | d3497b81a3b5 |
children |
comparison
equal
deleted
inserted
replaced
926:f88381a39c56 | 927:a9dfa7232d88 |
---|---|
1 local st = require"util.stanza"; | |
2 local datetime = require"util.datetime"; | |
3 | |
4 local presence = st.presence({ from = module.host }) | |
5 :tag("delay", { xmlns = "urn:xmpp:delay", | |
6 stamp = datetime.datetime(prosody.start_time) }); | |
7 | |
8 module:hook("presence/host", function(event) | |
9 local stanza = event.stanza; | |
10 if stanza.attr.type == "probe" then | |
11 presence.attr.id = stanza.attr.id; | |
12 presence.attr.to = stanza.attr.from; | |
13 module:send(presence); | |
14 return true; | |
15 end | |
16 end, 10); | |
17 |