From 36bbeb02497f5f79ddae56857893c2f71bf08ee9 Mon Sep 17 00:00:00 2001 From: Jeremy Lainé Date: Wed, 8 Feb 2012 11:53:52 +0000 Subject: move server code to "server" directory --- src/server/QXmppServerExtension.cpp | 155 ++++++++++++++++++++++++++++++++++++ 1 file changed, 155 insertions(+) create mode 100644 src/server/QXmppServerExtension.cpp (limited to 'src/server/QXmppServerExtension.cpp') diff --git a/src/server/QXmppServerExtension.cpp b/src/server/QXmppServerExtension.cpp new file mode 100644 index 00000000..7369a4f7 --- /dev/null +++ b/src/server/QXmppServerExtension.cpp @@ -0,0 +1,155 @@ +/* + * Copyright (C) 2008-2011 The QXmpp developers + * + * Author: + * 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 +#include +#include + +#include "QXmppLogger.h" +#include "QXmppServer.h" +#include "QXmppServerExtension.h" + +class QXmppServerExtensionPrivate +{ +public: + QXmppServer *server; +}; + +QXmppServerExtension::QXmppServerExtension() + : d(new QXmppServerExtensionPrivate) +{ + d->server = 0; +} + +QXmppServerExtension::~QXmppServerExtension() +{ + delete d; +} + +/// Returns the discovery features to add to the server. +/// + +QStringList QXmppServerExtension::discoveryFeatures() const +{ + return QStringList(); +} + +/// Returns the discovery items to add to the server. +/// + +QStringList QXmppServerExtension::discoveryItems() const +{ + return QStringList(); +} + +/// Returns the extension's name. +/// + +QString QXmppServerExtension::extensionName() const +{ + int index = metaObject()->indexOfClassInfo("ExtensionName"); + if (index < 0) + return QString(); + const char *name = metaObject()->classInfo(index).value(); + return QString::fromLatin1(name); +} + +/// Handles an incoming XMPP stanza. +/// +/// Return true if no further processing should occur, false otherwise. +/// +/// \param stanza The received stanza. + +bool QXmppServerExtension::handleStanza(const QDomElement &stanza) +{ + Q_UNUSED(stanza); + return false; +} + +/// Returns the list of subscribers for the given JID. +/// +/// \param jid + +QSet QXmppServerExtension::presenceSubscribers(const QString &jid) +{ + Q_UNUSED(jid); + return QSet(); +} + +/// Returns the list of subscriptions for the given JID. +/// +/// \param jid + +QSet QXmppServerExtension::presenceSubscriptions(const QString &jid) +{ + Q_UNUSED(jid); + return QSet(); +} + +/// Returns the extension's statistics. +/// + +QVariantMap QXmppServerExtension::statistics() const +{ + return QVariantMap(); +} + +/// Sets the extension's statistics. +/// + +void QXmppServerExtension::setStatistics(const QVariantMap &statistics) +{ + Q_UNUSED(statistics); +} + +/// Starts the extension. +/// +/// Return true if the extension was started, false otherwise. + +bool QXmppServerExtension::start() +{ + return true; +} + +/// Stops the extension. + +void QXmppServerExtension::stop() +{ +} + +/// Returns the server which loaded this extension. + +QXmppServer *QXmppServerExtension::server() +{ + return d->server; +} + +/// Sets the server which loaded this extension. +/// +/// \param server + +void QXmppServerExtension::setServer(QXmppServer *server) +{ + d->server = server; +} + -- cgit v1.2.3