Commit Graph

11 Commits (8a132c4565437eb9051465fb4e89a7272b57f319)

Author SHA1 Message Date
Michael Santos f763e31ffd muc,send: constify 8 months ago
Michael Santos 018662c2ef send: remove variable reinitializations 8 months ago
Michael Santos abfa336640 xmppipe_uuid_gen: xmpp_uuid_gen NULL check wrapper 5 years ago
Michael Santos ad1bf58c55 xmppipe_send: move internal functions 5 years ago
Michael Santos 31d6a03bfc XEP-0363: HTTP File Upload
Add initial support for XEP-0363. HTTP uploads can be used when colon
separated values for stdin is enabled:

~~~

u::::<filename>|<size (bytes)>[|<content-type>]

u::::example.png%7C16698

u::::tr.png%7C16698%7Cimage%2Fpng
~~~

The reponse:

~~~
U:upload.example.com:user@example.com/477937350262208314215778:https%3A%2F%2Fexample.com%2Fupload%2F1234%2Fabc%2Fexample.png%7Chttps%3A%2F%2Fexample.com%2Fupload%2F1234%2Fabc%2Fexample.png
~~~

TODO:

* support PUT header elements
* support/test error conditions

Questions:

* save the maximum file size returned by the server and disallow uploads
  larger than the value?

* xmppipe is "pinned" to the upload server returned in the IQ reply (the
  "to" field is ignored)

  * allow other upload servers?
  * error if different upload server is specified in "u:<from>:<to>"?
5 years ago
Michael Santos 11bc581608 oob inline image: u -> I 5 years ago
Michael Santos cb21c2860e Support inline images
When using the csv input format, add a new format ('u') that wraps the
message in an "x:oob" element. The image will be displayed inline by
Conversations.

~~~
u:groupchat:::https%3A%2F%2Fhttpstatusdogs.com%2Fimg%2F500.jpg
~~~
5 years ago
Michael Santos a21d4d5b29 xmppipe_send: remove shadowed variable 5 years ago
Michael Santos 1bb03b563e xmppipe_send_message: fix memory leak
Fix a memory leak caused by improper usage of
xmpp_stanza_new()/xmpp_stanza_release() by replacing usage with the
simpler xmpp_message_new()/xmpp_message_set_body() API available in
libstrophe 0.9.0, as advised by @pasis.

Fixes https://github.com/msantos/xmppipe/issues/3.
5 years ago
Michael Santos e00a7fddd2 Consistently format using clang-format 5 years ago
Michael Santos 895ad40ee2 reorg: xmppipe_send* 6 years ago