clix/sendfile.lua

Mon, 16 Nov 2020 17:16:01 +0100

author
Kim Alvefur <zash@zash.se>
date
Mon, 16 Nov 2020 17:16:01 +0100
changeset 142
05ec7103c0f7
parent 47
d4650cc6bb3f
permissions
-rw-r--r--

clix.watch_pep: Include short names for some common PEP nodes

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