diff options
| author | Jeremy Lainé <jeremy.laine@m4x.org> | 2012-02-08 12:33:41 +0000 |
|---|---|---|
| committer | Jeremy Lainé <jeremy.laine@m4x.org> | 2012-02-08 12:33:41 +0000 |
| commit | 21acd67e9b65bea87902032b12709675905aa922 (patch) | |
| tree | ed5ae9066b10400c4fe6e67dfaf2f4c37a09c32e /src/QXmppMessageReceiptManager.cpp | |
| parent | cea7ae1e702b82d2d0d0a851de1aae58270b14f6 (diff) | |
| download | qxmpp-21acd67e9b65bea87902032b12709675905aa922.tar.gz | |
start moving client-specific code
Diffstat (limited to 'src/QXmppMessageReceiptManager.cpp')
| -rw-r--r-- | src/QXmppMessageReceiptManager.cpp | 72 |
1 files changed, 0 insertions, 72 deletions
diff --git a/src/QXmppMessageReceiptManager.cpp b/src/QXmppMessageReceiptManager.cpp deleted file mode 100644 index b78c1a77..00000000 --- a/src/QXmppMessageReceiptManager.cpp +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (C) 2008-2011 The QXmpp developers - * - * Author: - * Georg Rudoy - * Jeremy Lainé - * - * Source: - * http://code.google.com/p/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. - * - */ - -#include "QXmppMessageReceiptManager.h" - -#include <QDomElement> - -#include "QXmppConstants.h" -#include "QXmppMessage.h" -#include "QXmppClient.h" - -/// Constructs a QXmppMessageReceiptManager to handle incoming and outgoing -/// message delivery receipts. - -QXmppMessageReceiptManager::QXmppMessageReceiptManager() - : QXmppClientExtension() -{ -} - -QStringList QXmppMessageReceiptManager::discoveryFeatures() const -{ - return QStringList(ns_message_receipts); -} - -bool QXmppMessageReceiptManager::handleStanza(const QDomElement &stanza) -{ - if (stanza.tagName() != "message") - return false; - - QXmppMessage message; - message.parse(stanza); - - // Handle receipts and cancel any further processing. - if (!message.receiptId().isEmpty()) { - emit messageDelivered(message.from(), message.receiptId()); - return true; - } - - // If requested, send a receipt. - if (message.isReceiptRequested() - && !message.from().isEmpty() - && !message.id().isEmpty()) { - QXmppMessage receipt; - receipt.setTo(message.from()); - receipt.setReceiptId(message.id()); - client()->sendPacket(receipt); - } - - // Continue processing. - return false; -} |
