Skip to content
This repository was archived by the owner on Mar 20, 2025. It is now read-only.

Commit 17a208e

Browse files
committed
RosterManager: Document handling of Moved old JIDs
The handling of moved old JIDs and interaction with the QXmppMovedManager was undocumented. This adds documentation, including the behaviour changes between 1.9.4/1.10.1 and 1.9.5/1.10.2.
1 parent 01d08e0 commit 17a208e

File tree

2 files changed

+33
-1
lines changed

2 files changed

+33
-1
lines changed

src/client/QXmppRosterManager.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,16 @@ static void serializeRosterData(const RosterData &d, QXmlStreamWriter &writer)
7474
/// The user can either accept the request by calling acceptSubscription() or refuse it
7575
/// by calling refuseSubscription().
7676
///
77+
/// Since *QXmpp 1.10.2* only verified \xep{0283, Moved} old JIDs are passed in \a presence. If
78+
/// verification fails or the given old JID is not valid, the attribute is cleared in the
79+
/// QXmppPresence. See \ref rostermanager_moved "above" for more details.
80+
///
7781
/// \note If QXmppConfiguration::autoAcceptSubscriptions() is set to true or the subscription
7882
/// request is automatically accepted by the QXmppMovedManager, this signal will not be emitted.
7983
///
8084
/// \param subscriberBareJid bare JID that wants to subscribe to the user's presence
81-
/// \param presence presence stanza containing the reason / message (presence.statusText())
85+
/// \param presence presence stanza, e.g. containing the message (presence.statusText()),
86+
/// \xep{0283, Moved} old JID or other information
8287
///
8388
/// \since QXmpp 1.5
8489
///

src/client/QXmppRosterManager.h

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,33 @@ class QXmppRosterManagerPrivate;
5151
/// The \c presenceChanged() signal is emitted whenever the presence for a
5252
/// roster item changes.
5353
///
54+
/// \anchor rostermanager_moved
55+
/// ## XEP-0283: Moved
56+
///
57+
/// \xep{0283, Moved} provides a way to inform other users that an account has moved. This allows a
58+
/// presence subscription request from a new account to be automatically linked to the old account.
59+
/// However, this requires verification via a corresponding PubSub node on the old account.
60+
///
61+
/// The roster manager automatically checks entries using the QXmppMovedManager. For this to work,
62+
/// the moved manager must be added to the QXmppClient. If the moved manager is not found or the
63+
/// specified old JID is incorrect, the entry in the presence subscription request will be removed.
64+
///
65+
/// The received and verified presence subscription request is emitted via
66+
/// subscriptionRequestReceived() and the old JID can be found in QXmppPresence::oldJid().
67+
/// It is safe to assume that this old JID is valid since QXmpp 1.10.2.
68+
///
69+
/// Accepting moved subscription requests automatically is discouraged in
70+
/// [section 4.3](https://xmpp.org/extensions/xep-0283.html#receive-notification-client) of the
71+
/// XEP.
72+
///
73+
/// ### Behaviour in previous versions
74+
///
75+
/// Support in the roster manager and in QXmppPresence was initially added in 1.9.0.
76+
///
77+
/// In QXmpp 1.9.0 until 1.9.4 and 1.10.0 until 1.10.1 subscription requests with a Moved element
78+
/// are verified and automatically accepted without emitting subscriptionRequestReceived(). If
79+
/// verification fails, the **invalid** old JID is passed in subscriptionRequestReceived()!
80+
///
5481
/// \ingroup Managers
5582
///
5683
class QXMPP_EXPORT QXmppRosterManager : public QXmppClientExtension

0 commit comments

Comments
 (0)