aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLinus Jahn <lnj@kaidan.im>2020-07-20 16:22:47 +0200
committerLinus Jahn <lnj@kaidan.im>2020-07-20 17:18:24 +0200
commit0710dee7e93ad0cfa0f0d12fdcefa7dc2d7c9865 (patch)
treeb389164e58d0ea44caccc3e6fae71d5cffebb652 /src
parente73120d4ab5b1a93c6ad051ff6807af02cd8a039 (diff)
downloadqxmpp-0710dee7e93ad0cfa0f0d12fdcefa7dc2d7c9865.tar.gz
Clean up QXmppCarbonManager
Diffstat (limited to 'src')
-rw-r--r--src/client/QXmppCarbonManager.cpp40
-rw-r--r--src/client/QXmppCarbonManager.h7
2 files changed, 29 insertions, 18 deletions
diff --git a/src/client/QXmppCarbonManager.cpp b/src/client/QXmppCarbonManager.cpp
index e936ddf2..45dd96da 100644
--- a/src/client/QXmppCarbonManager.cpp
+++ b/src/client/QXmppCarbonManager.cpp
@@ -40,21 +40,24 @@ QXmppCarbonManager::~QXmppCarbonManager()
{
}
+///
/// Returns whether message carbons are currently enabled
-
+///
bool QXmppCarbonManager::carbonsEnabled() const
{
return m_carbonsEnabled;
}
-/// Enable or disable message carbons.
+///
+/// Enables or disables message carbons for this connection.
+///
/// This function does not check whether the server supports
/// message carbons, but just sends the corresponding stanza
/// to the server, so one must check in advance by using the
/// discovery manager.
///
/// By default, carbon copies are disabled.
-
+///
void QXmppCarbonManager::setCarbonsEnabled(bool enabled)
{
if (m_carbonsEnabled == enabled)
@@ -73,6 +76,7 @@ void QXmppCarbonManager::setCarbonsEnabled(bool enabled)
}
}
+/// \cond
QStringList QXmppCarbonManager::discoveryFeatures() const
{
return QStringList() << ns_carbons;
@@ -91,7 +95,7 @@ bool QXmppCarbonManager::handleStanza(const QDomElement &element)
}
if (carbon.isNull() || carbon.namespaceURI() != ns_carbons)
- return false; // Neither sent nor received -> no carbon message
+ return false;
// carbon copies must always come from our bare JID
if (element.attribute("from") != client()->configuration().jidBare()) {
@@ -99,16 +103,13 @@ bool QXmppCarbonManager::handleStanza(const QDomElement &element)
return false;
}
- QDomElement forwarded = carbon.firstChildElement("forwarded");
- if (forwarded.isNull())
- return false;
-
- QDomElement messageelement = forwarded.firstChildElement("message");
- if (messageelement.isNull())
+ auto forwarded = carbon.firstChildElement("forwarded");
+ auto messageElement = forwarded.firstChildElement("message");
+ if (messageElement.isNull())
return false;
QXmppMessage message;
- message.parse(messageelement);
+ message.parse(messageElement);
if (sent)
emit messageSent(message);
@@ -117,3 +118,20 @@ bool QXmppCarbonManager::handleStanza(const QDomElement &element)
return true;
}
+/// \endcond
+
+///
+/// \fn QXmppCarbonManager::messageReceived()
+///
+/// Emitted when a message was received from someone else and directed to
+/// another resource.
+///
+/// If you connect this signal to the QXmppClient::messageReceived signal, they
+/// will appear as normal messages.
+///
+
+///
+/// \fn QXmppCarbonManager::messageSent()
+///
+/// Emitted when another resource sent a message to someone else.
+///
diff --git a/src/client/QXmppCarbonManager.h b/src/client/QXmppCarbonManager.h
index d1e113be..33a39627 100644
--- a/src/client/QXmppCarbonManager.h
+++ b/src/client/QXmppCarbonManager.h
@@ -56,14 +56,7 @@ public:
/// \endcond
Q_SIGNALS:
- /// \brief Emitted when a message was received from someone else
- /// and directed to another resource.
- /// If you connect this signal to the \s QXmppClient::messageReceived
- /// signal, they will appear as normal messages.
void messageReceived(const QXmppMessage &);
-
- /// \brief Emitted when another resource sent a message to
- /// someone else
void messageSent(const QXmppMessage &);
private: