Sat, 14 Nov 2020 15:33:35 +0100
clix.raw: Use indentation when prettyprinting if available in util.stanza
Properly indented XML is a lot more readable than squished together on a
single line.
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 |