Commit Graph

288 Commits (master)
 

Author SHA1 Message Date
Michael Santos 7793b0ac07 Fix pasto in -k/--keepalive 5 years ago
Michael Santos 8e2fd1c363 xmppipe_conn_fd: check fd is a socket 5 years ago
Michael Santos b3991577aa reorg: event_loop: move to separate file 5 years ago
Michael Santos a8cc5b730a Remove unused function declaration 5 years ago
Michael Santos 4081ab67cb reorg: muc_unlock 5 years ago
Michael Santos 5165f8a1a4 reorg: muc_subject 5 years ago
Michael Santos 9d6b58ba26 reorg: muc: join 5 years ago
Michael Santos 6731de9a13 reorg: ping 5 years ago
Michael Santos 17e40ad118 reorg: move stream_close with other stream ops 5 years ago
Michael Santos 0ba9e92eda reorg: stream management: ack 5 years ago
Michael Santos ee0f59516b reorg: stream_close: move to util for now 5 years ago
Michael Santos 862ab6d313 reorg: stream management: request 5 years ago
Michael Santos 5cb7647e75 reorg: stream management: check if enabled 5 years ago
Michael Santos c5f0f7b662 reorg: presence error handler 5 years ago
Michael Santos 0b22ad4302 reorg: presence handler 5 years ago
Michael Santos 8b1374a25a reorg: move next_state to util 5 years ago
Michael Santos d150e63735 reorg: null handler 5 years ago
Michael Santos b3468de16f reorg: ping handler 5 years ago
Michael Santos 9a98b8b9bf reorg: version handler 5 years ago
Michael Santos 895ad40ee2 reorg: xmppipe_send* 5 years ago
Michael Santos d6dcc88bc6 tests: allow time for xmppipe login 5 years ago
Michael Santos a365e18b59 reorg: message: organize by handler 5 years ago
Michael Santos 561fc9cbc3 xmppipe_roomname: clean up 5 years ago
Michael Santos 990874ef2e Add support for printing groupchat subject 5 years ago
Michael Santos f5291fe321 makefile: fix static builds 5 years ago
Michael Santos 4e660c641a --keepalive-failures: check minimum using strtonum() 5 years ago
Michael Santos b38d4b9e0c handle_message: use xmpp_free() 5 years ago
Michael Santos 026890d377 Add experimental support for chat markers
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.
5 years ago
Michael Santos 501ada87ff chat: set default user to self 5 years ago
Michael Santos 1e59f50dc6 Enable PIE 5 years ago
Michael Santos a10b4bd84c chat: fix segfault when checking origin
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".
5 years ago
Michael Santos dbbf6e5f5e seccomp: update for Ubuntu 18.04
Add new syscalls (getrandom).

The resolver now uses openat(2) and sendmsg(2).
5 years ago
Michael Santos 0a776e3441 Fix warning
src/xmppipe.c:69:19: warning: duplicate ‘const’ declaration specifier
[-Wduplicate-decl-specifier]
 static const char const *xmppipe_states[] = {
                   ^~~~~
6 years ago
Michael Santos a2d16c90c1 format: rename options
stdin -> text, colon -> csv
6 years ago
Michael Santos df6a7ee596 format: use separate function 6 years ago
Michael Santos ab6d1b3f79 format: clean up input parsing 6 years ago
Michael Santos 4d1423eb5e <Remove unused verbose log
Statement will never be called since verbose mode is set afterwards.
6 years ago
Michael Santos 06f50d4b11 Fix "-x/--base64" option 6 years ago
Michael Santos ff3249c391 Revert "capsicum: allow terminal events"
This reverts commit 7090ef09fb.

fstat/ioctl are checking whether the program is attached to tty for
setting buffering. Since xmppipe explicitly enables line buffering, the
capsicum sandbox can ignore these tests.
6 years ago
Michael Santos 7090ef09fb capsicum: allow terminal events 6 years ago
Michael Santos 91173ecc00 xmppipe_fmt -> xmppipe_fmt_encode 6 years ago
Michael Santos 9598e01579 format: use empty element to set default values
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
~~~
6 years ago
Michael Santos 231bee7c74 -f/--format: support percent decoding
Convert percent hexcodes when format mode is enabled:

    m:chat:to@example.com:from@example.com:01234=%30%31%32%33%34
6 years ago
Michael Santos 5127b271ba -f/--format: fix arguments 6 years ago
Michael Santos 22afb52f83 --format/-f: formatted input
Rough implementation to allow input to be formatted as colon separated
values in the same way as output:

* percent decoding of the input is not supported yet
* only message stanzas supported

Using formatted input lets the script respond to other users aside from
the default channel assigned to stdout:

~~~
m:chat:to@example.com:from@example.com:message-body
~~~

TODO:
* does the default stdout channel always need to be formatted?

~~~
m:chat:to@example.com:from@example.com:message-body
m:groupchat:default@conference.example.com:from@example.com:message-body
~~~

  Otherwise it could be ambiguous.

* support presence and iq stanzas

  For example, a bot could respond to groupchat invitations.

* percent decoding: require the input to be percent encoded

  Support binary and multiline data.

* format naming: choose better names for the format types
6 years ago
Michael Santos 4fac27e382 README: update message types 6 years ago
Michael Santos dff8b8f72e sandbox/seccomp: return value from prctl(2) 6 years ago
Michael Santos ba2d49e4bd Use argument as output JID
Instead of supplying the output JID as an optional argument:

    xmppipe --output foo@conference.example.com

Use the first argument:

    xmppipe foo@conference.example.com

The -o/--output switches are still accepted.
6 years ago
Michael Santos 846f87c6bd scripts: rename variables 6 years ago
Michael Santos c7eb9a1d71 Check for NULL before calling libstrophe 6 years ago