clix/receive.lua@1793fca3d707
clix/receive.lua
Thu, 07 Jan 2010 02:31:18 +0000
- author
- Matthew Wild <mwild1@gmail.com>
- date
- Thu, 07 Jan 2010 02:31:18 +0000
- changeset 12
- 1793fca3d707
- child 17
-
fa9efbef8a0c
- permissions
- -rw-r--r--
clix.receive: New command to print text of received messages
return function (opts, args)
local function on_message(message)
local body = message:get_child("body");
if body then
print(body:get_text());
end
end
local function on_connect(conn)
conn:hook("message", on_message);
conn:send(verse.presence());
end
clix_connect(opts, on_connect);
end