mirror of
https://gitlab.com/xmpp-rs/xmpp-rs.git
synced 2024-07-12 22:21:53 +00:00
muc::History::disabled() and muc::Muc::without_history() disable legacy history on MUC join (#77)
This commit is contained in:
parent
c8dcf5e7a7
commit
8c9448b46d
2 changed files with 13 additions and 0 deletions
|
@ -9,6 +9,8 @@ xxx
|
||||||
- Presence::with_payload builds a payload into the presence (#79)
|
- Presence::with_payload builds a payload into the presence (#79)
|
||||||
- Message now has constructors for each type ; Message::new still builds a Chat type (#78)
|
- Message now has constructors for each type ; Message::new still builds a Chat type (#78)
|
||||||
- Message::with_body builder method appends a body in a given language to the message (#78)
|
- Message::with_body builder method appends a body in a given language to the message (#78)
|
||||||
|
- muc::History::disabled method requests 0 maxchars history from MUC (#77)
|
||||||
|
- muc::Muc::without_history builder method requests 0 maxchars history from MUC (#77)
|
||||||
* Breaking changes:
|
* Breaking changes:
|
||||||
- Removed the 'serde' feature. Add it directly by using 'jid'.
|
- Removed the 'serde' feature. Add it directly by using 'jid'.
|
||||||
`jid = { version = "*", features = ["serde"] }`.
|
`jid = { version = "*", features = ["serde"] }`.
|
||||||
|
|
|
@ -33,6 +33,11 @@ impl History {
|
||||||
History::default()
|
History::default()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Don't request history from MUC
|
||||||
|
pub fn disabled() -> Self {
|
||||||
|
Self::new().with_maxchars(0)
|
||||||
|
}
|
||||||
|
|
||||||
/// Set how many characters of history to send.
|
/// Set how many characters of history to send.
|
||||||
pub fn with_maxchars(mut self, maxchars: u32) -> Self {
|
pub fn with_maxchars(mut self, maxchars: u32) -> Self {
|
||||||
self.maxchars = Some(maxchars);
|
self.maxchars = Some(maxchars);
|
||||||
|
@ -89,6 +94,12 @@ impl Muc {
|
||||||
self.history = Some(history);
|
self.history = Some(history);
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Join a room without history.
|
||||||
|
pub fn without_history(mut self) -> Self {
|
||||||
|
self.history = Some(History::disabled());
|
||||||
|
self
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
|
|
Loading…
Reference in a new issue