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
1 changed files with 10 additions and 0 deletions
|
@ -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.
|
/// Creates an `<iq/>` stanza containing a result.
|
||||||
pub fn from_result<S: Into<String>>(id: S, payload: Option<impl IqResultPayload>) -> Iq {
|
pub fn from_result<S: Into<String>>(id: S, payload: Option<impl IqResultPayload>) -> Iq {
|
||||||
Iq {
|
Iq {
|
||||||
|
|
Loading…
Reference in a new issue