xmpp_parsers/private.rs
1// Copyright (c) 2023 xmppftw <xmppftw@kl.netlib.re>
2//
3// This Source Code Form is subject to the terms of the Mozilla Public
4// License, v. 2.0. If a copy of the MPL was not distributed with this
5// file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
7//!
8//! This module implements [Private XML Storage](https://xmpp.org/extensions/xep-0049.html) from
9//! XEP-0049.
10//!
11//! However, only legacy bookmarks storage from [XEP-0048
12//! v1.0](https://xmpp.org/extensions/attic/xep-0048-1.0.html) is supported at the moment.
13//! This should only be used when `urn:xmpp:bookmarks:1#compat` is not advertised on the user's
14//! BareJID in a disco info request.
15//!
16//! See [ModernXMPP docs](https://docs.modernxmpp.org/client/groupchat/#bookmarks) on how to handle
17//! all historic and newer specifications for your clients handling of chatroom bookmarks.
18//!
19//! This module uses the legacy bookmarks [`bookmarks::Conference`][crate::bookmarks::Conference]
20//! struct as stored in a legacy [`bookmarks::Storage`][crate::bookmarks::Storage] struct.
21
22use crate::{
23 bookmarks::Storage,
24 iq::{IqGetPayload, IqResultPayload, IqSetPayload},
25};
26
27generate_element!(
28 /// A Private XML Storage query. Only supports XEP-0048 bookmarks.
29 Query, "query", PRIVATE,
30 attributes: [],
31 children: [
32 /// XEP-0048 bookmarks in a [`Storage`] element
33 storage: Required<Storage> = ("storage", BOOKMARKS) => Storage,
34 ]
35);
36
37impl IqSetPayload for Query {}
38impl IqGetPayload for Query {}
39impl IqResultPayload for Query {}