2
0
mirror of https://github.com/msantos/xmppipe synced 2024-11-16 00:12:59 +00:00
Commit Graph

126 Commits

Author SHA1 Message Date
Michael Santos
1471e463a2 chat: send disco
Fix http upload for 1 to 1 chat sessions.
2023-11-02 07:14:52 -04:00
Michael Santos
449099958a chat: fix bare domain name
TIL XMPP JIDs can be bare domain names:

    xmppipe --chat example.com

xmppipe parses that as: example.com@yourdomain.com

As a hacky workaround, for chats only, check if the JID contains a
period. JIDs containing a period such as firstname.lastname need to use
the full JID:

    xmppipe --chat firstname.lastname@example.com
2023-10-31 07:34:18 -04:00
Michael Santos
f987fd95e7 cleanup: variable reinitializations 2023-10-12 07:18:19 -04:00
Michael Santos
56ef393916 cleanup: remove variable reinitialization 2023-10-11 07:48:27 -04:00
Michael Santos
2a22204ff2 cleanup: duplicate variable initialization 2023-10-10 06:49:30 -04:00
Michael Santos
21e7da86b4 cleanup: strtonum: error check 2023-10-09 08:28:03 -04:00
Michael Santos
4d79bddf56 ping: install a pong handler
Respond to server pings:

https://xmpp.org/extensions/xep-0199.html#s2c

```
xmpp DEBUG RECV: <iq id="rr-1694698253331-17375542133555098656-wf3J7kbG6j8Ft5Vx0cMY99txsW8=-55238004" type="get" to="msantos@example.com/110052433108464573191602" from="example.com"><ping xmlns="urn:xmpp:ping"/></iq>
conn DEBUG SENT: <iq id="rr-1694698253331-17375542133555098656-wf3J7kbG6j8Ft5Vx0cMY99txsW8=-55238004" to="example.com" type="result" from="msantos@example.com/110052433108464573191602"/>
```

Thanks @jessiehowell !

Fixes https://github.com/msantos/xmppipe/issues/9
2023-09-14 09:35:46 -04:00
Michael Santos
f6c1fd34ca 0.14.7: strophe 0.12: fix exit 1 on disconnect
With strophe 0.12, xmppipe printed an error "handle_connection:
disconnected" and exited with status 1 when the connection to the server
is closed.
2023-03-10 07:21:00 -05:00
Michael Santos
d8a6890873 0.14.6: disable strophe stream management
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
2023-03-09 07:19:44 -05:00
Michael Santos
8e25057316 Fix typo in comment 2023-02-10 07:48:58 -05:00
Michael Santos
11d854f9e7 0.14.5: fix usage 2022-09-19 08:50:07 -04:00
Michael Santos
840ef08251 0.14.4: standardize exit status
* 2: usage errors
* 0: usage (-h)
2022-09-09 08:25:02 -04:00
Michael Santos
2df5896df2 Set a unique default resource
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
2022-02-02 07:43:59 -05:00
Michael Santos
f9bdddd910 0.14.1: --chat: fix use of username without domain
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
```
2022-01-28 08:22:14 -05:00
Michael Santos
80135667d6 usage: cleanup 2020-07-31 07:41:26 -04:00
Michael Santos
f80ab9c65e Update README/usage 2020-07-04 07:21:01 -04:00
Michael Santos
91a43f2433 -V/--version: display version information 2020-07-04 07:19:16 -04:00
Michael Santos
45e96e6ea9 s/XMPPIPE_RESTRICT/RESTRICT/gi 2019-12-21 08:44:53 -05:00
Michael Santos
7dda5bafcd sandbox->restrict_process 2019-12-20 10:51:27 -05:00
Michael Santos
abfa336640 xmppipe_uuid_gen: xmpp_uuid_gen NULL check wrapper 2019-07-17 10:23:23 -04:00
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>"?
2019-07-15 10:15:01 -04:00
Michael Santos
5f2c3003ff v0.13.0
Update usage with --format option.
2019-07-04 10:10:40 -04:00
Michael Santos
a45b734211 options: remove --chat-marker 2019-07-03 07:54:19 -04:00
Michael Santos
2a75c3373a Always display chat markers
Remove the option to explicitly enable/disable chat markers.
2019-07-02 08:13:39 -04:00
Michael Santos
5e488e059a xmpp_conn_set_flags() argument is a long
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;
2019-06-29 11:07:59 -04:00
Michael Santos
8776afe0f5 Suppress conversion warnings 2019-06-28 10:04:53 -04:00
Michael Santos
42e0ce4a67 xmppipe: free child stanzas 2019-06-22 08:08:47 -04:00
Michael Santos
e00a7fddd2 Consistently format using clang-format 2019-05-19 07:15:11 -04:00
Michael Santos
4b85976242 --keepalives -> --keepalive 2019-05-07 08:13:47 -04:00
Michael Santos
7793b0ac07 Fix pasto in -k/--keepalive 2019-05-06 10:13:30 -04:00
Michael Santos
b3991577aa reorg: event_loop: move to separate file 2019-04-29 10:14:27 -04:00
Michael Santos
4081ab67cb reorg: muc_unlock 2019-04-05 09:47:57 -04:00
Michael Santos
5165f8a1a4 reorg: muc_subject 2019-04-04 10:26:23 -04:00
Michael Santos
9d6b58ba26 reorg: muc: join 2019-02-06 10:43:16 -05:00
Michael Santos
6731de9a13 reorg: ping 2019-02-05 12:23:28 -05:00
Michael Santos
0ba9e92eda reorg: stream management: ack 2019-02-03 09:21:15 -05:00
Michael Santos
ee0f59516b reorg: stream_close: move to util for now 2019-02-02 11:01:22 -05:00
Michael Santos
862ab6d313 reorg: stream management: request 2019-02-01 10:01:03 -05:00
Michael Santos
5cb7647e75 reorg: stream management: check if enabled 2019-01-31 10:35:54 -05:00
Michael Santos
c5f0f7b662 reorg: presence error handler 2019-01-30 09:56:25 -05:00
Michael Santos
0b22ad4302 reorg: presence handler 2019-01-29 09:56:45 -05:00
Michael Santos
8b1374a25a reorg: move next_state to util 2019-01-28 10:25:04 -05:00
Michael Santos
d150e63735 reorg: null handler 2019-01-27 08:38:21 -05:00
Michael Santos
b3468de16f reorg: ping handler 2019-01-26 08:47:55 -05:00
Michael Santos
9a98b8b9bf reorg: version handler 2019-01-25 10:28:00 -05:00
Michael Santos
895ad40ee2 reorg: xmppipe_send* 2019-01-23 10:37:20 -05:00
Michael Santos
a365e18b59 reorg: message: organize by handler 2019-01-21 11:45:29 -05:00
Michael Santos
990874ef2e Add support for printing groupchat subject 2019-01-10 11:26:21 -05:00
Michael Santos
4e660c641a --keepalive-failures: check minimum using strtonum() 2019-01-05 10:04:48 -05:00
Michael Santos
b38d4b9e0c handle_message: use xmpp_free() 2019-01-03 10:06:19 -05:00