mirror of
https://gitlab.com/xmpp-rs/xmpp-rs.git
synced 2024-07-12 22:21:53 +00:00
mam: Replace Strings with proper wrappers, and make queryid optional as it should be.
This commit is contained in:
parent
a70ce99d91
commit
d038ddddab
1 changed files with 9 additions and 3 deletions
12
src/mam.rs
12
src/mam.rs
|
@ -15,14 +15,20 @@ use iq::{IqGetPayload, IqSetPayload, IqResultPayload};
|
||||||
use data_forms::DataForm;
|
use data_forms::DataForm;
|
||||||
use rsm::Set;
|
use rsm::Set;
|
||||||
use forwarding::Forwarded;
|
use forwarding::Forwarded;
|
||||||
|
use pubsub::NodeName;
|
||||||
|
|
||||||
use ns;
|
use ns;
|
||||||
|
|
||||||
|
generate_id!(
|
||||||
|
/// An identifier matching a result message to the query requesting it.
|
||||||
|
QueryId
|
||||||
|
);
|
||||||
|
|
||||||
generate_element!(
|
generate_element!(
|
||||||
Query, "query", MAM,
|
Query, "query", MAM,
|
||||||
attributes: [
|
attributes: [
|
||||||
queryid: Option<String> = "queryid" => optional,
|
queryid: Option<QueryId> = "queryid" => optional,
|
||||||
node: Option<String> = "node" => optional
|
node: Option<NodeName> = "node" => optional
|
||||||
],
|
],
|
||||||
children: [
|
children: [
|
||||||
form: Option<DataForm> = ("x", DATA_FORMS) => DataForm,
|
form: Option<DataForm> = ("x", DATA_FORMS) => DataForm,
|
||||||
|
@ -38,7 +44,7 @@ generate_element!(
|
||||||
Result_, "result", MAM,
|
Result_, "result", MAM,
|
||||||
attributes: [
|
attributes: [
|
||||||
id: String = "id" => required,
|
id: String = "id" => required,
|
||||||
queryid: String = "queryid" => required,
|
queryid: Option<QueryId> = "queryid" => optional,
|
||||||
],
|
],
|
||||||
children: [
|
children: [
|
||||||
forwarded: Required<Forwarded> = ("forwarded", FORWARD) => Forwarded
|
forwarded: Required<Forwarded> = ("forwarded", FORWARD) => Forwarded
|
||||||
|
|
Loading…
Reference in a new issue