From 826ece0480385c47c72f216e35e004b276d82498 Mon Sep 17 00:00:00 2001 From: Melvin Keskin Date: Sat, 8 May 2021 19:35:40 +0200 Subject: RosterManager: Add subscription request signal with full presence (#346) This makes it possible to get the statusText of subscription requests. --- src/client/QXmppRosterManager.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/client/QXmppRosterManager.cpp') diff --git a/src/client/QXmppRosterManager.cpp b/src/client/QXmppRosterManager.cpp index 0f677929..10f98a15 100644 --- a/src/client/QXmppRosterManager.cpp +++ b/src/client/QXmppRosterManager.cpp @@ -4,6 +4,7 @@ * Authors: * Manjeet Dahiya * Jeremy Lainé + * Melvin Keskin * * Source: * https://github.com/qxmpp-project/qxmpp @@ -31,6 +32,23 @@ #include +/// +/// \fn QXmppRosterManager::subscriptionRequestReceived +/// +/// This signal is emitted when a JID asks to subscribe to the user's presence. +/// +/// The user can either accept the request by calling acceptSubscription() or refuse it +/// by calling refuseSubscription(). +/// +/// \note If QXmppConfiguration::autoAcceptSubscriptions() is set to true, this +/// signal will not be emitted. +/// +/// \param subscriberBareJid bare JID that wants to subscribe to the user's presence +/// \param presence presence stanza containing the reason / message (presence.statusText()) +/// +/// \since QXmpp 1.5 +/// + class QXmppRosterManagerPrivate { public: @@ -234,6 +252,7 @@ void QXmppRosterManager::_q_presenceReceived(const QXmppPresence &presence) subscribe(bareJid); } else { emit subscriptionReceived(bareJid); + emit subscriptionRequestReceived(bareJid, presence); } break; default: -- cgit v1.2.3