aboutsummaryrefslogtreecommitdiff
path: root/src/client/QXmppCarbonsManager.h
diff options
context:
space:
mode:
authorfbeutel <fbeutel@users.noreply.github.com>2016-09-04 22:56:15 +0200
committerJeremy Lainé <jeremy.laine@m4x.org>2016-09-04 22:56:15 +0200
commit78a3b26a36a720bf5bbeb86622a17588a1d881b5 (patch)
tree8795a95058740b95dbb8f324183bed441748325f /src/client/QXmppCarbonsManager.h
parent8606658a9c9eef83e89e6f62fffd913bffb99b0f (diff)
downloadqxmpp-78a3b26a36a720bf5bbeb86622a17588a1d881b5.tar.gz
Merge pull request #88 from fbeutel/carbons
* Implemented XEP-0280: Message Carbons
Diffstat (limited to 'src/client/QXmppCarbonsManager.h')
-rw-r--r--src/client/QXmppCarbonsManager.h71
1 files changed, 71 insertions, 0 deletions
diff --git a/src/client/QXmppCarbonsManager.h b/src/client/QXmppCarbonsManager.h
new file mode 100644
index 00000000..c3852e66
--- /dev/null
+++ b/src/client/QXmppCarbonsManager.h
@@ -0,0 +1,71 @@
+/*
+ * Copyright (C) 2008-2014 The QXmpp developers
+ *
+ * Author:
+ * Manjeet Dahiya
+ *
+ * Source:
+ * https://github.com/qxmpp-project/qxmpp
+ *
+ * This file is a part of QXmpp library.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ */
+
+
+#ifndef QXMPPCARBONSMANAGER_H
+#define QXMPPCARBONSMANAGER_H
+
+#include "QXmppClientExtension.h"
+
+class QXmppMessage;
+
+/// \brief The QXmppCarbonsManager class handles message carbons
+/// as described in xep-0280.
+///
+/// This class emits signals whenever another resource of the
+/// currently connected client account sent or received a message.
+///
+/// \ingroup Managers
+
+class QXMPP_EXPORT QXmppCarbonsManager : public QXmppClientExtension
+{
+ Q_OBJECT
+
+public:
+ QXmppCarbonsManager();
+ ~QXmppCarbonsManager();
+
+ bool carbonsEnabled() const;
+ void setCarbonsEnabled(bool enabled);
+
+ /// \cond
+ QStringList discoveryFeatures() const;
+ bool handleStanza(const QDomElement &element);
+ /// \endcond
+
+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:
+ bool m_carbonsEnabled;
+};
+
+#endif // QXMPPCARBONSMANAGER_H