Commit graph xmpp-rs/xmpp/src
Author SHA1 Message Date
Maxime “pep” Buquet
477af3c895 xmpp: new 'escape-hatch' feature
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2025-04-20 13:41:56 +00:00
Jonas Schäfer
5172fb5e0f parsers: port Message to use the derive macros 2025-04-18 12:56:03 +02:00
Maxime “pep” Buquet
4780f89604 xmpp: new Agent::new method
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2025-04-07 18:26:27 +00:00
Link Mauve
5ae38545e4 xmpp: Shorten the default caps node to our main domain
We do own xmpp.rs, so let’s use that instead of gitlab.com.
2025-04-07 11:57:01 +02:00
Emmanuel Gil Peyrot
fa61f421bb xmpp-parsers: Use xso for pubsub events
Also split the PubSubEvent enum into Event and Payload.
2025-01-27 15:07:59 +01:00
Emmanuel Gil Peyrot
543d9eb590 xmpp-parsers: Convert http_upload::Header to xso
We can’t use generate_attribute!() for HeaderName because it has to be
case insensitive.
2025-01-27 14:45:17 +01:00
Emmanuel Gil Peyrot
f63b780089 xmpp-parsers: Simplify PubSub Item using xso
Now that we can have a single arbitrary payload, we can derive FromXml
and AsXml on the Item.
2025-01-26 16:40:05 +00:00
33098e6f2c Message and message_correct::Replace now has typed Id 2024-12-30 20:50:43 +00:00
bfac3e8893 xmpp: Receive message corrections, unchecked 2024-12-20 15:48:47 +00:00
Maxime “pep” Buquet
2e66f848f6
xmpp: Remove noisy info log
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2024-12-20 14:23:38 +01:00
668cc05445 xmpp: Replace std stuff with alloc/core stuff 2024-12-19 20:39:18 +01:00
c1a3c85556 xmpp: Implement Deref<Target=ResourcePart> for RoomNick 2024-12-18 21:55:03 +01:00
793b76d0d5 xmpp: More nicks are typed as RoomNick 2024-12-18 21:55:01 +01:00
48cb79b2d1 xmpp: Implement FromStr for RoomNick 2024-12-18 21:26:30 +01:00
b8f74e6bce xmpp: Common structure for imports 2024-12-18 19:26:40 +01:00
0ec9103b28 xmpp: Rewrite other messages with Agent::send_raw_message 2024-12-18 19:18:34 +01:00
b4d3252da4 xmpp: Add Agent::send_raw_message 2024-12-18 19:18:22 +01:00
e19a7988ed xmpp: Agent::send_message is only for normal messages 2024-12-18 19:17:55 +01:00
d98ed615a5 xmpp: Agent::send_room_private_message takes RoomPrivateMessageSettings 2024-12-18 19:17:39 +01:00
7991cef904 Add tests for crate exports ; add structure to imports/exports 2024-12-18 18:03:18 +00:00
3fd8285a29 xmpp: RoomNick is newtype wrapper for ResourcePart 2024-12-18 15:43:09 +00:00
5477cf1240 xmpp: Use ResourcePart for sender of room events 2024-12-18 15:43:09 +00:00
c16456f381 parsers/xmpp: MUC bookmarks have nickname typed as ResourcePart 2024-12-18 15:43:09 +00:00
Jonas Schäfer
35ce86243f client: use stanzastream! 2024-12-17 18:16:02 +01:00
8c3c8c7c97 hello_bot accepts a list of room JIDs to join to say hello 2024-12-17 00:27:50 +00:00
fdec34afde Add JoinRoomSettings, LeaveRoomSettings, and RoomMessageSettings 2024-12-17 00:27:50 +00:00
6d7a95b6ca Remove xmpp::Event::{JoinRoom,LeaveRoom,LeaveAllRooms} 2024-12-16 22:36:25 +01:00
Emmanuel Gil Peyrot
011585594f xmpp: Adapt to xmpp-parsers changes wrt autojoin
This attribute is now a simple bool instead of an enum.
2024-12-16 13:32:49 +00:00
Jonas Schäfer
4cfe4f8429 xmlstream: implement simple timeout logic
This allows to detect and handle dying streams without getting stuck
forever.

Timeouts are always wrong, though, so we put the burden of choosing the
right values (mostly) on the creator of a stream.
2024-09-01 10:02:36 +02:00
Jonas Schäfer
ab10e30ac0 Port crates to use new XSO-based xmlstream 2024-08-29 16:47:13 +02:00
0b58561003 Rename AsyncClient to Client 2024-08-10 16:57:51 +02:00
311e7406f0 Make Client and Component more unified, and connectors too 2024-08-10 16:57:49 +02:00
ec3c7694a7 Moved starttls connector to tokio_xmpp::connect::starttls module 2024-08-10 16:49:26 +02:00
23e943825f xmpp::Agent::wait_for_events cannot error 2024-08-08 15:43:52 +02:00
ba6a7c4744 Use tokio::sync::RwLock instead of std 2024-08-06 16:04:04 +02:00
fa99c09585 Indicate which feature flag for each module/type 2024-08-05 11:14:41 +02:00
eb51b05c13 Reexport tokio_xmpp from xmpp crate 2024-07-31 16:58:30 +00:00
Emmanuel Gil Peyrot
5fc12c45b5 xmpp: Use tokio-xmpp’s reexports of jid and minidom 2024-07-25 14:36:09 +00:00
Jonas Schäfer
80efd2eb19 Ignore missing disco#info feature in disco#info responses
xmpp-rs normally has the stance to get buggy implementations fixed
rather than dropping checks. In this particular case I think this is not
a good use of resources:

- The disco#info feature var conveys no actual information:
  If an implementation replies properly to a disco#info query, it is
  already implied that it supports the protocol.

- There are broken server implementations out there.
  A lot of them (all recent (>= 0.10 && < 0.13 AFAICT) Prosody IM
  instances). At this point in time, xmpp-rs is unable to query
  disco#info from MUCs hosted on such prosody versions, except by
  workarounds (such as the one removed in this diff).

- XEP-0030 now features a note which reads:

  > Note: Some entities are known not to advertise the
  > `http://jabber.org/protocol/disco#info` feature within their
  > responses, contrary to this specification. Entities receiving
  > otherwise valid responses which do not include this feature SHOULD
  > infer the support.

The case would be different if there were no (deployed) implementations
which had this bug or if the bug actually had an effect on clients.
Especially the latter is not the case though, as pointed out above.

Hence, I conclude that this check is overly pedantic and the resources
(time, emotional energy of dealing with bugs, punching patches through
to stable distributions, etc. etc.) spent on getting this fixed would
be better invested elsewhere.

In addition, the workaround is extremely ugly and, even in the xmpp-rs
implementation, has no test coverage. Without test coverage of such an
implementation, it is bound to break in funny ways when xmpp-rs changes
the strings of its error messages (which is something one might do even
outside a breaking release).
2024-06-16 10:52:51 +02:00
Emmanuel Gil Peyrot
002c2803d4 Fix typos across the codebase (thanks codespell!) 2024-05-14 05:46:02 +00:00
Jonas Schäfer
2e9c9411a3 jid: rewrite public types
This moves InnerJid into Jid and reformulates BareJid and FullJid in
terms of Jid.

Doing this has the key advantage that FullJid and BareJid can deref to
and borrow as Jid. This, in turn, has the advantage that they can be
used much more flexibly in HashMaps. However, this is (as we say in
Germany) future music; this commit only does the internal reworking.

Oh and also, it saves 20% memory on Jid objects.

Fixes #122 more thoroughly, or rather the original intent behind it.
2024-04-15 18:21:24 +02:00
Jonas Schäfer
7fce1146e0 Offer {Resource,Node,Domain}Ref on Jid API
This provides a non-copying API, which is generally favourable. The
other accessors were removed, because the intent was to provide this
"most sensible" API via the "default" (i.e. shortest, most concisely
named) functions.
2024-03-10 10:51:01 +01:00
Maxime “pep” Buquet
99036735a3
xmpp: Rename ClientBuilder::new_with_server to new_with_connector
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2024-02-06 01:14:50 +01:00
9d5019ecdd Fix last cargo doc warnings
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2024-01-27 17:44:48 +00:00
1ce8145a7d Fix unused variable warnings when avatars disabled 2024-01-21 13:55:39 +01:00
Werner Kroneman
e36b8d4fb9 Exposed bound_jid on Agent. 2024-01-10 17:12:59 +01:00
moparisthebest
54de8d9951
Fix building xmpp with no-default-features 2024-01-03 20:01:05 -05:00
moparisthebest
38bfba4a18
xmpp crate now supports ServerConnector 2024-01-03 19:34:02 -05:00
moparisthebest
733d005f51
DNS/TLS deps are now optional, component now also uses ServerConnector 2024-01-01 02:09:41 -05:00
moparisthebest
3cab603a4c
Add AsyncServerConnector to AsyncClient to be able to support any stream
Unfortunately API breaking unless we do some export mangling
2024-01-01 02:08:13 -05:00