mirror of
https://gitlab.com/xmpp-rs/xmpp-rs.git
synced 2024-07-02 19:30:36 +02:00
xmpp-parsers/iq: Add a helper to create an empty result iq.
This can be useful to reply to a get/set iq.
This commit is contained in:
parent
eaa63fbe46
commit
24eeb0b3c9
|
@ -90,6 +90,16 @@ impl Iq {
|
|||
}
|
||||
}
|
||||
|
||||
/// Creates an empty `<iq type="result"/>` stanza.
|
||||
pub fn empty_result<S: Into<String>>(to: Jid, id: S) -> Iq {
|
||||
Iq {
|
||||
from: None,
|
||||
to: Some(to),
|
||||
id: id.into(),
|
||||
payload: IqType::Result(None),
|
||||
}
|
||||
}
|
||||
|
||||
/// Creates an `<iq/>` stanza containing a result.
|
||||
pub fn from_result<S: Into<String>>(id: S, payload: Option<impl IqResultPayload>) -> Iq {
|
||||
Iq {
|
||||
|
|
Loading…
Reference in New Issue
Block a user