Comparison

doc/example_carbons.lua @ 287:762511350532

doc/example_carbons.lua: Update to reflect timestamp change in carbons plugin.
author Kim Alvefur <zash@zash.se>
date Sat, 17 Mar 2012 16:00:16 +0100
parent 260:7f6df45a3d1f
comparison
equal deleted inserted replaced
286:04b6c060ff01 287:762511350532
1 local xmlns_carbons = "urn:xmpp:carbons:1"; 1 local xmlns_carbons = "urn:xmpp:carbons:1";
2 local xmlns_forward = "urn:xmpp:forward:0"; 2 local xmlns_forward = "urn:xmpp:forward:0";
3
4 local function datetime(t) return os_date("!%Y-%m-%dT%H:%M:%SZ", t); end
3 5
4 -- This line squishes verse each time you run, 6 -- This line squishes verse each time you run,
5 -- handy if you're hacking on Verse itself 7 -- handy if you're hacking on Verse itself
6 --os.execute("squish --minify-level=none verse"); 8 --os.execute("squish --minify-level=none verse");
7 9
22 c:close(); 24 c:close();
23 end); 25 end);
24 26
25 c:hook("carbon", function(carbon) 27 c:hook("carbon", function(carbon)
26 local dir, ts, st = carbon.dir, carbon.timestamp, carbon.stanza; 28 local dir, ts, st = carbon.dir, carbon.timestamp, carbon.stanza;
27 print("", ts, dir:upper()); 29 print("", datetime(ts), dir:upper());
28 print(st); 30 print(st);
29 end); 31 end);
30 32
31 -- Catch the "ready" event to know when the stream is ready to use 33 -- Catch the "ready" event to know when the stream is ready to use
32 c:hook("ready", function () 34 c:hook("ready", function ()