Mercurial > prosody-hg
comparison plugins/mod_uptime.lua @ 10758:d0e6d5bc7ea2
Merge with upstream trunk
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Thu, 23 Apr 2020 13:53:18 +0100 |
| parents | abbdf72b0710 |
| children | 74b9e05af71e |
comparison
equal
deleted
inserted
replaced
| 10757:9dec7cddb40b | 10758:d0e6d5bc7ea2 |
|---|---|
| 14 -- XEP-0012: Last activity | 14 -- XEP-0012: Last activity |
| 15 module:add_feature("jabber:iq:last"); | 15 module:add_feature("jabber:iq:last"); |
| 16 | 16 |
| 17 module:hook("iq-get/host/jabber:iq:last:query", function(event) | 17 module:hook("iq-get/host/jabber:iq:last:query", function(event) |
| 18 local origin, stanza = event.origin, event.stanza; | 18 local origin, stanza = event.origin, event.stanza; |
| 19 origin.send(st.reply(stanza):tag("query", {xmlns = "jabber:iq:last", seconds = tostring(os.difftime(os.time(), start_time))})); | 19 origin.send(st.reply(stanza):tag("query", {xmlns = "jabber:iq:last", seconds = tostring(("%d"):format(os.difftime(os.time(), start_time)))})); |
| 20 return true; | 20 return true; |
| 21 end); | 21 end); |
| 22 | 22 |
| 23 -- Ad-hoc command | 23 -- Ad-hoc command |
| 24 module:depends "adhoc"; | 24 module:depends "adhoc"; |
