diff options
author | defanor <defanor@uberspace.net> | 2021-10-01 17:01:28 +0300 |
---|---|---|
committer | defanor <defanor@uberspace.net> | 2021-10-01 17:03:18 +0300 |
commit | 5a1db57c9a4e3a597400f4d49432fa63cbfaefd7 (patch) | |
tree | 1c1d7068ea4fb8c803c45cc08c5af5216e7c7425 /src/rexmpp_console.c | |
parent | c094b0163ab18f9bd40d4b0e76ab3ca26372d9e4 (diff) |
Add Jingle file transfer over IBB
Diffstat (limited to 'src/rexmpp_console.c')
-rw-r--r-- | src/rexmpp_console.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/rexmpp_console.c b/src/rexmpp_console.c index 1b1c603..397e603 100644 --- a/src/rexmpp_console.c +++ b/src/rexmpp_console.c @@ -15,6 +15,7 @@ #include "rexmpp.h" #include "rexmpp_openpgp.h" #include "rexmpp_http_upload.h" +#include "rexmpp_jingle.h" #include "rexmpp_console.h" @@ -300,6 +301,8 @@ void rexmpp_console_feed (rexmpp_t *s, char *str, ssize_t str_len) { "subscription approve <jid>\n" "subscription deny <jid>\n" "http-upload <file path>\n" + "jingle accept-file <sid> <file path>\n" + "jingle send-file <jid> <file path>\n" ; if (! strcmp(word, "help")) { @@ -557,4 +560,20 @@ void rexmpp_console_feed (rexmpp_t *s, char *str, ssize_t str_len) { rexmpp_http_upload_path(s, NULL, fpath, NULL, rexmpp_console_on_upload, strdup(fpath)); } + + if (! strcmp(word, "jingle")) { + word = strtok_r(NULL, " ", &words_save_ptr); + if (word == NULL) { + return; + } + if (! strcmp(word, "accept-file")) { + char *sid = strtok_r(NULL, " ", &words_save_ptr); + char *fpath = strtok_r(NULL, " ", &words_save_ptr); + rexmpp_jingle_accept_file_by_id(s, sid, fpath); + } else if (! strcmp(word, "send-file")) { + char *jid = strtok_r(NULL, " ", &words_save_ptr); + char *fpath = strtok_r(NULL, " ", &words_save_ptr); + rexmpp_jingle_send_file(s, jid, fpath); + } + } } |