xmpp: extend escape-hatch feature to the receiving part
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
This commit is contained in:
parent
fbdd5f7b54
commit
3e794d3f50
3 changed files with 7 additions and 1 deletions
|
|
@ -39,7 +39,8 @@ XXXX-YY-ZZ [ RELEASER <admin@localhost> ]
|
||||||
hibernating resources around.
|
hibernating resources around.
|
||||||
- New 'escape-hatch' feature: Allow sending tokio_xmpp::Stanza directly
|
- New 'escape-hatch' feature: Allow sending tokio_xmpp::Stanza directly
|
||||||
instead of having to go through xmpp-rs' API when it's lacking. This
|
instead of having to go through xmpp-rs' API when it's lacking. This
|
||||||
is meant to stay behind a feature.
|
is meant to stay behind a feature. Also allows directly receiving
|
||||||
|
TokioXmppEvent.
|
||||||
- Added documentation on `Event` enum.
|
- Added documentation on `Event` enum.
|
||||||
* Fixes:
|
* Fixes:
|
||||||
- Use tokio::sync::RwLock not std::sync::RwLock (!432)
|
- Use tokio::sync::RwLock not std::sync::RwLock (!432)
|
||||||
|
|
|
||||||
|
|
@ -112,4 +112,6 @@ pub enum Event {
|
||||||
ServiceMessage(Option<MessageId>, BareJid, String, StanzaTimeInfo),
|
ServiceMessage(Option<MessageId>, BareJid, String, StanzaTimeInfo),
|
||||||
/// A file has been uploaded over HTTP; contains the URL of the file.
|
/// A file has been uploaded over HTTP; contains the URL of the file.
|
||||||
HttpUploadedFile(String),
|
HttpUploadedFile(String),
|
||||||
|
#[cfg(feature = "escape-hatch")]
|
||||||
|
TokioXmppEvent(TokioXmppEvent),
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,9 @@ pub async fn wait_for_events(agent: &mut Agent) -> Vec<Event> {
|
||||||
if let Some(event) = agent.client.next().await {
|
if let Some(event) = agent.client.next().await {
|
||||||
let mut events = Vec::new();
|
let mut events = Vec::new();
|
||||||
|
|
||||||
|
#[cfg(feature = "escape-hatch")]
|
||||||
|
events.push(Event::TokioXmppEvent(event.clone()));
|
||||||
|
|
||||||
match event {
|
match event {
|
||||||
TokioXmppEvent::Online { resumed: false, .. } => {
|
TokioXmppEvent::Online { resumed: false, .. } => {
|
||||||
let presence =
|
let presence =
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue