Moved Block* from include/Swiften to transport/
This commit is contained in:
parent
7b692e8837
commit
b3725b47c4
10 changed files with 28 additions and 28 deletions
|
@ -6,17 +6,17 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <Swiften/Elements/BlockPayload.h>
|
||||
#include <transport/BlockPayload.h>
|
||||
#include <Swiften/Parser/GenericPayloadParser.h>
|
||||
|
||||
// This payload is NOT part of ANY XEP and it is only
|
||||
// libtransport related extension.
|
||||
namespace Swift {
|
||||
class BlockParser : public GenericPayloadParser<BlockPayload> {
|
||||
namespace Transport {
|
||||
class BlockParser : public Swift::GenericPayloadParser<BlockPayload> {
|
||||
public:
|
||||
BlockParser();
|
||||
|
||||
virtual void handleStartElement(const std::string& element, const std::string&, const AttributeMap& attributes);
|
||||
virtual void handleStartElement(const std::string& element, const std::string&, const Swift::AttributeMap& attributes);
|
||||
virtual void handleEndElement(const std::string& element, const std::string&);
|
||||
virtual void handleCharacterData(const std::string& data);
|
||||
|
|
@ -14,8 +14,8 @@
|
|||
|
||||
// This payload is NOT part of ANY XEP and it is only
|
||||
// libtransport related extension.
|
||||
namespace Swift {
|
||||
class BlockPayload : public Payload {
|
||||
namespace Transport {
|
||||
class BlockPayload : public Swift::Payload {
|
||||
public:
|
||||
typedef boost::shared_ptr<BlockPayload> ref;
|
||||
|
|
@ -7,12 +7,12 @@
|
|||
#pragma once
|
||||
|
||||
#include <Swiften/Serializer/GenericPayloadSerializer.h>
|
||||
#include <Swiften/Elements/BlockPayload.h>
|
||||
#include <transport/BlockPayload.h>
|
||||
|
||||
// This payload is NOT part of ANY XEP and it is only
|
||||
// libtransport related extension.
|
||||
namespace Swift {
|
||||
class BlockSerializer : public GenericPayloadSerializer<BlockPayload> {
|
||||
namespace Transport {
|
||||
class BlockSerializer : public Swift::GenericPayloadSerializer<BlockPayload> {
|
||||
public:
|
||||
BlockSerializer();
|
||||
|
|
@ -4,16 +4,16 @@
|
|||
* See Documentation/Licenses/BSD-simplified.txt for more information.
|
||||
*/
|
||||
|
||||
#include <Swiften/Parser/PayloadParsers/BlockParser.h>
|
||||
#include <transport/BlockParser.h>
|
||||
|
||||
namespace Swift {
|
||||
namespace Transport {
|
||||
|
||||
// This payload is NOT part of ANY XEP and it is only
|
||||
// libtransport related extension.
|
||||
BlockParser::BlockParser() /*: level_(0)*/ {
|
||||
}
|
||||
|
||||
void BlockParser::handleStartElement(const std::string& /*element*/, const std::string& /*ns*/, const AttributeMap& /*attributes*/) {
|
||||
void BlockParser::handleStartElement(const std::string& /*element*/, const std::string& /*ns*/, const Swift::AttributeMap& /*attributes*/) {
|
||||
}
|
||||
|
||||
void BlockParser::handleEndElement(const std::string&, const std::string&) {
|
|
@ -4,9 +4,9 @@
|
|||
* See Documentation/Licenses/BSD-simplified.txt for more information.
|
||||
*/
|
||||
|
||||
#include <Swiften/Elements/BlockPayload.h>
|
||||
#include <transport/BlockPayload.h>
|
||||
|
||||
namespace Swift {
|
||||
namespace Transport {
|
||||
|
||||
// This payload is NOT part of ANY XEP and it is only
|
||||
// libtransport related extension.
|
|
@ -4,7 +4,7 @@
|
|||
* See Documentation/Licenses/BSD-simplified.txt for more information.
|
||||
*/
|
||||
|
||||
#include <Swiften/Serializer/PayloadSerializers/BlockSerializer.h>
|
||||
#include <transport/BlockSerializer.h>
|
||||
|
||||
#include <boost/shared_ptr.hpp>
|
||||
|
||||
|
@ -12,7 +12,7 @@
|
|||
#include <Swiften/Serializer/XML/XMLRawTextNode.h>
|
||||
#include <Swiften/Serializer/XML/XMLElement.h>
|
||||
|
||||
namespace Swift {
|
||||
namespace Transport {
|
||||
|
||||
// This payload is NOT part of ANY XEP and it is only
|
||||
// libtransport related extension.
|
||||
|
@ -20,7 +20,7 @@ BlockSerializer::BlockSerializer() : GenericPayloadSerializer<BlockPayload>() {
|
|||
}
|
||||
|
||||
std::string BlockSerializer::serializePayload(boost::shared_ptr<BlockPayload> attention) const {
|
||||
XMLElement attentionElement("block", "urn:xmpp:block:0");
|
||||
Swift::XMLElement attentionElement("block", "urn:xmpp:block:0");
|
||||
|
||||
return attentionElement.serialize();
|
||||
}
|
|
@ -23,7 +23,7 @@
|
|||
#include <iostream>
|
||||
#include <boost/bind.hpp>
|
||||
#include "Swiften/Queries/IQRouter.h"
|
||||
#include "Swiften/Elements/BlockPayload.h"
|
||||
#include "transport/BlockPayload.h"
|
||||
#include "Swiften/Swiften.h"
|
||||
#include "transport/usermanager.h"
|
||||
#include "transport/user.h"
|
||||
|
@ -48,7 +48,7 @@ BlockResponder::~BlockResponder() {
|
|||
|
||||
}
|
||||
|
||||
bool BlockResponder::handleSetRequest(const Swift::JID& from, const Swift::JID& to, const std::string& id, boost::shared_ptr<Swift::BlockPayload> info) {
|
||||
bool BlockResponder::handleSetRequest(const Swift::JID& from, const Swift::JID& to, const std::string& id, boost::shared_ptr<Transport::BlockPayload> info) {
|
||||
User *user = m_userManager->getUser(from.toBare().toString());
|
||||
if (!user) {
|
||||
LOG4CXX_WARN(logger, from.toBare().toString() << ": User is not logged in");
|
||||
|
|
|
@ -23,14 +23,14 @@
|
|||
#include <vector>
|
||||
#include "Swiften/Swiften.h"
|
||||
#include "Swiften/Queries/SetResponder.h"
|
||||
#include "Swiften/Elements/BlockPayload.h"
|
||||
#include "transport/BlockPayload.h"
|
||||
|
||||
namespace Transport {
|
||||
|
||||
class UserManager;
|
||||
class Buddy;
|
||||
|
||||
class BlockResponder : public Swift::SetResponder<Swift::BlockPayload> {
|
||||
class BlockResponder : public Swift::SetResponder<Transport::BlockPayload> {
|
||||
public:
|
||||
BlockResponder(Swift::IQRouter *router, UserManager *userManager);
|
||||
~BlockResponder();
|
||||
|
@ -38,7 +38,7 @@ class BlockResponder : public Swift::SetResponder<Swift::BlockPayload> {
|
|||
boost::signal<void (Buddy *)> onBlockToggled;
|
||||
|
||||
private:
|
||||
virtual bool handleSetRequest(const Swift::JID& from, const Swift::JID& to, const std::string& id, boost::shared_ptr<Swift::BlockPayload> payload);
|
||||
virtual bool handleSetRequest(const Swift::JID& from, const Swift::JID& to, const std::string& id, boost::shared_ptr<Transport::BlockPayload> payload);
|
||||
|
||||
UserManager *m_userManager;
|
||||
};
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
#include "transport/rostermanager.h"
|
||||
#include "transport/user.h"
|
||||
#include "transport/transport.h"
|
||||
#include "Swiften/Elements/BlockPayload.h"
|
||||
#include "transport/BlockPayload.h"
|
||||
|
||||
namespace Transport {
|
||||
|
||||
|
@ -106,7 +106,7 @@ Swift::Presence::ref Buddy::generatePresenceStanza(int features, bool only_new)
|
|||
presence->addPayload(boost::shared_ptr<Swift::Payload>(new Swift::VCardUpdate (getIconHash())));
|
||||
// }
|
||||
if (isBlocked()) {
|
||||
presence->addPayload(boost::shared_ptr<Swift::Payload>(new Swift::BlockPayload ()));
|
||||
presence->addPayload(boost::shared_ptr<Swift::Payload>(new Transport::BlockPayload ()));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -34,8 +34,8 @@
|
|||
#include "Swiften/Serializer/PayloadSerializers/AttentionSerializer.h"
|
||||
#include "Swiften/Parser/PayloadParsers/XHTMLIMParser.h"
|
||||
#include "Swiften/Serializer/PayloadSerializers/XHTMLIMSerializer.h"
|
||||
#include "Swiften/Parser/PayloadParsers/BlockParser.h"
|
||||
#include "Swiften/Serializer/PayloadSerializers/BlockSerializer.h"
|
||||
#include "transport/BlockParser.h"
|
||||
#include "transport/BlockSerializer.h"
|
||||
#include "Swiften/Parser/PayloadParsers/InvisibleParser.h"
|
||||
#include "Swiften/Serializer/PayloadSerializers/InvisibleSerializer.h"
|
||||
#include "log4cxx/logger.h"
|
||||
|
@ -88,12 +88,12 @@ Component::Component(Swift::EventLoop *loop, Swift::NetworkFactories *factories,
|
|||
m_server->addPayloadParserFactory(new GenericPayloadParserFactory<StorageParser>("private", "jabber:iq:private"));
|
||||
m_server->addPayloadParserFactory(new GenericPayloadParserFactory<Swift::AttentionParser>("attention", "urn:xmpp:attention:0"));
|
||||
m_server->addPayloadParserFactory(new GenericPayloadParserFactory<Swift::XHTMLIMParser>("html", "http://jabber.org/protocol/xhtml-im"));
|
||||
m_server->addPayloadParserFactory(new GenericPayloadParserFactory<Swift::BlockParser>("block", "urn:xmpp:block:0"));
|
||||
m_server->addPayloadParserFactory(new GenericPayloadParserFactory<Transport::BlockParser>("block", "urn:xmpp:block:0"));
|
||||
m_server->addPayloadParserFactory(new GenericPayloadParserFactory<Swift::InvisibleParser>("invisible", "urn:xmpp:invisible:0"));
|
||||
|
||||
m_server->addPayloadSerializer(new Swift::AttentionSerializer());
|
||||
m_server->addPayloadSerializer(new Swift::XHTMLIMSerializer());
|
||||
m_server->addPayloadSerializer(new Swift::BlockSerializer());
|
||||
m_server->addPayloadSerializer(new Transport::BlockSerializer());
|
||||
m_server->addPayloadSerializer(new Swift::InvisibleSerializer());
|
||||
|
||||
m_server->onDataRead.connect(boost::bind(&Component::handleDataRead, this, _1));
|
||||
|
|
Loading…
Add table
Reference in a new issue