# HG changeset patch # User Matthew Wild # Date 1284566061 -3600 # Node ID 3c3cc6d75814332c020066dd44ebd10f60b32a25 # Parent 1ec64b321834e7a7e0af9a6fa5541894cc91756f clix/sendfile.lua: Send a file to a JID using Jingle diff -r 1ec64b321834 -r 3c3cc6d75814 clix/sendfile.lua --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clix/sendfile.lua Wed Sep 15 16:54:21 2010 +0100 @@ -0,0 +1,16 @@ +return function (opts, arg) + if opts.short_help then + print("Send files"); + return; + end + if (#arg == 0 or opts.help) and not opts.interactive then + return 0; + end + local function on_connect(conn) + conn:hook("proxy65/discovered-proxies", function () + conn:debug("Sending %s to %s", arg[2], arg[1]); + conn:send_file(arg[1], arg[2]); + end); + end + clix_connect(opts, on_connect, { "disco", "proxy65", "jingle", "jingle_ft", "jingle_s5b" }); +end