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 rsm::Set;
|
||||
use forwarding::Forwarded;
|
||||
use pubsub::NodeName;
|
||||
|
||||
use ns;
|
||||
|
||||
generate_id!(
|
||||
/// An identifier matching a result message to the query requesting it.
|
||||
QueryId
|
||||
);
|
||||
|
||||
generate_element!(
|
||||
Query, "query", MAM,
|
||||
attributes: [
|
||||
queryid: Option<String> = "queryid" => optional,
|
||||
node: Option<String> = "node" => optional
|
||||
queryid: Option<QueryId> = "queryid" => optional,
|
||||
node: Option<NodeName> = "node" => optional
|
||||
],
|
||||
children: [
|
||||
form: Option<DataForm> = ("x", DATA_FORMS) => DataForm,
|
||||
|
@ -38,7 +44,7 @@ generate_element!(
|
|||
Result_, "result", MAM,
|
||||
attributes: [
|
||||
id: String = "id" => required,
|
||||
queryid: String = "queryid" => required,
|
||||
queryid: Option<QueryId> = "queryid" => optional,
|
||||
],
|
||||
children: [
|
||||
forwarded: Required<Forwarded> = ("forwarded", FORWARD) => Forwarded
|
||||
|
|
Loading…
Reference in a new issue