libstrophe 0.12 supports (and enables by default) stream management. The
xmppipe session disconnects when strophe and xmppipe both try to handle
the stream acknowledgement.
* disable strophe stream management
* TODO: if strophe SM is available, disable xmppipe SM
The default resource is "xmppipe". A subsequent xmppipe using the default
resource connects to the groupchat will be disconnected.
* reduce the amount of configuration needed for scripts
* make the resource unique on the same host by appending the PID
One to one chats with a username without a domain would echo back
messages. Use the domain from the user's JID:
```
xmppipe -u user1@example.com --chat user2
```
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>"?
Correct the type for the flag argument from int to long. Note the
compiler will still complain because, although xmpp_conn_set_flags() is
declared to take a signed long, the constants are declared as unsigned
longs:
src/xmppipe.c: In function ‘main’:
src/xmppipe.c:205:13: warning: conversion to ‘long unsigned int’ from
‘long int’ may change the sign of the result [-Wsign-conversion]
flags |= XMPP_CONN_FLAG_TRUST_TLS;
^
src/xmppipe.c:205:16: warning: conversion to ‘long int’ from ‘long
unsigned int’ may change the sign of the result [-Wsign-conversion]
flags |= XMPP_CONN_FLAG_TRUST_TLS;
Support chat marker (XEP-0333) stanzas when the "--chat-marker" switch
is provided on the command line. A chat marker is prefixed by 'M':
~~~
M:groupchat:test@conference.example.com/msantos:me@example.com/162315501161646113068402:
~~~
The idea is to allow scripts to react based on whether a message has
been read, for example, escalating via other channels.
strcmp(3) segfaulted when comparing the from address to NULL.
Checking messages originated from the output account only makes sense
with groupchat. Remove the check for type of "chat".