Remove an unnecessary call to put stdin into non-blocking mode. On
termux/android, xmppipe is aborted when the fd capability set is
changed:
```
FORTIFY: fcntl(F_SETFD) passed non-FD_CLOEXEC flag: 0x800
libc: FORTIFY: fcntl(F_SETFD) passed non-FD_CLOEXEC flag: 0x800
libc: Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 32292
(xmppipe), pid 32292 (<unknown>)
libc: failed to spawn debuggerd dispatch thread: Try again
```
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
```
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.
An empty string in the type, to and from uses a default value. For
example to send a message to the groupchat specified on the command
line:
~~~
m::::this is a test message
~~~
Use the UID of the xmppipe process instead of the PID in the default
name. This allows many processes running under the same user on a host
to share the same output channel and makes it easier to pre-create the
MUC if the xmppipe XMPP user does not have MUC creation privs.
Whether gethostname(2) returns an error depends on the implementation.
Some implementations:
* truncate the hostname if length is less than the hostname, with or
without a trailing NULL
* return -1 if length is less than hostname
* return -1 if length is 0
Set a default name if gethostanme() returns error.
Check for errors on libstrophe functions that return non-void. Some of
the funs have undocumented failure conditions (e.g.,
xmpp_stanza_copy()). Others return less than zero or enum values. To
account for future discoveries, use a wrapper instead of a macro.