# HG changeset patch # User Matthew Wild # Date 1262831478 0 # Node ID 1793fca3d70721fd40d19fe1184b5408ad51176a # Parent a502c905527c44fc1217c53f47c3f23a6540a311 clix.receive: New command to print text of received messages diff -r a502c905527c -r 1793fca3d707 clix/receive.lua --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clix/receive.lua Thu Jan 07 02:31:18 2010 +0000 @@ -0,0 +1,13 @@ +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