clix/sendfile.lua

Wed, 15 Sep 2010 16:54:21 +0100

author
Matthew Wild <mwild1@gmail.com>
date
Wed, 15 Sep 2010 16:54:21 +0100
changeset 44
3c3cc6d75814
child 47
d4650cc6bb3f
permissions
-rw-r--r--

clix/sendfile.lua: Send a file to a JID using Jingle

44
3c3cc6d75814 clix/sendfile.lua: Send a file to a JID using Jingle
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
1 return function (opts, arg)
3c3cc6d75814 clix/sendfile.lua: Send a file to a JID using Jingle
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
2 if opts.short_help then
3c3cc6d75814 clix/sendfile.lua: Send a file to a JID using Jingle
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
3 print("Send files");
3c3cc6d75814 clix/sendfile.lua: Send a file to a JID using Jingle
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
4 return;
3c3cc6d75814 clix/sendfile.lua: Send a file to a JID using Jingle
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
5 end
3c3cc6d75814 clix/sendfile.lua: Send a file to a JID using Jingle
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
6 if (#arg == 0 or opts.help) and not opts.interactive then
3c3cc6d75814 clix/sendfile.lua: Send a file to a JID using Jingle
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
7 return 0;
3c3cc6d75814 clix/sendfile.lua: Send a file to a JID using Jingle
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
8 end
3c3cc6d75814 clix/sendfile.lua: Send a file to a JID using Jingle
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
9 local function on_connect(conn)
3c3cc6d75814 clix/sendfile.lua: Send a file to a JID using Jingle
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
10 conn:hook("proxy65/discovered-proxies", function ()
3c3cc6d75814 clix/sendfile.lua: Send a file to a JID using Jingle
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
11 conn:debug("Sending %s to %s", arg[2], arg[1]);
3c3cc6d75814 clix/sendfile.lua: Send a file to a JID using Jingle
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
12 conn:send_file(arg[1], arg[2]);
3c3cc6d75814 clix/sendfile.lua: Send a file to a JID using Jingle
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
13 end);
3c3cc6d75814 clix/sendfile.lua: Send a file to a JID using Jingle
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
14 end
3c3cc6d75814 clix/sendfile.lua: Send a file to a JID using Jingle
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
15 clix_connect(opts, on_connect, { "disco", "proxy65", "jingle", "jingle_ft", "jingle_s5b" });
3c3cc6d75814 clix/sendfile.lua: Send a file to a JID using Jingle
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
16 end

mercurial