doc/example_component.lua

changeset 151
75016d851648
parent 86
508f653e9d46
child 260
7f6df45a3d1f
equal deleted inserted replaced
150:728cc7f2f0c2 151:75016d851648
31 c:hook("ready", function () 31 c:hook("ready", function ()
32 print("Stream ready!"); 32 print("Stream ready!");
33 c.version:set{ name = "verse example component" }; 33 c.version:set{ name = "verse example component" };
34 end); 34 end);
35 35
36 -- Echo, echo, echo, echo...
37 c:hook("stanza", function (stanza)
38 stanza.attr.from, stanza.attr.to = stanza.attr.to, stanza.attr.from;
39 c:send(stanza);
40 end)
41
36 print("Starting loop...") 42 print("Starting loop...")
37 verse.loop() 43 verse.loop()

mercurial