clix/sendfile.lua

Wed, 04 Jul 2012 07:51:35 +0200

author
Kim Alvefur <zash@zash.se>
date
Wed, 04 Jul 2012 07:51:35 +0200
changeset 90
3115bd81b9de
parent 47
d4650cc6bb3f
permissions
-rw-r--r--

clix.archive: Be interactive when --interactive is set. --everything makes it page by itself.

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
47
d4650cc6bb3f sendfile: Small fix for command description
Matthew Wild <mwild1@gmail.com>
parents: 44
diff changeset
3 print("Send a file");
44
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