Software /
code /
prosody
Comparison
plugins/mod_time.lua @ 424:3eb22492e8ab
Changed format for XEP-0090 to the legacy format
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Wed, 26 Nov 2008 09:02:58 +0500 |
parent | 423:c9c7f026a108 |
child | 438:193f9dd64f17 |
comparison
equal
deleted
inserted
replaced
423:c9c7f026a108 | 424:3eb22492e8ab |
---|---|
1 | 1 |
2 local st = require "util.stanza"; | 2 local st = require "util.stanza"; |
3 local datetime = require "util.datetime".datetime; | 3 local datetime = require "util.datetime".datetime; |
4 local legacy = require "util.datetime".legacy; | |
4 | 5 |
5 -- XEP-0202: Entity Time | 6 -- XEP-0202: Entity Time |
6 | 7 |
7 require "core.discomanager".set("time", "urn:xmpp:time"); | 8 require "core.discomanager".set("time", "urn:xmpp:time"); |
8 | 9 |
21 | 22 |
22 add_iq_handler({"c2s", "s2sin"}, "jabber:iq:time", | 23 add_iq_handler({"c2s", "s2sin"}, "jabber:iq:time", |
23 function(session, stanza) | 24 function(session, stanza) |
24 if stanza.attr.type == "get" then | 25 if stanza.attr.type == "get" then |
25 session.send(st.reply(stanza):tag("query", {xmlns="jabber:iq:time"}) | 26 session.send(st.reply(stanza):tag("query", {xmlns="jabber:iq:time"}) |
26 :tag("utc"):text(datetime())); | 27 :tag("utc"):text(legacy())); |
27 end | 28 end |
28 end); | 29 end); |