From 1e3dc1ef4d6dae9111306541bc9c7eefb55da4de Mon Sep 17 00:00:00 2001 From: HanzZ Date: Wed, 19 Oct 2011 23:28:32 +0200 Subject: [PATCH] Add custom parsers/serializers also for component --- src/transport.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/transport.cpp b/src/transport.cpp index 0e63ac8a..cb2cdbb6 100644 --- a/src/transport.cpp +++ b/src/transport.cpp @@ -107,6 +107,18 @@ Component::Component(Swift::EventLoop *loop, Swift::NetworkFactories *factories, m_component->onError.connect(boost::bind(&Component::handleConnectionError, this, _1)); m_component->onDataRead.connect(boost::bind(&Component::handleDataRead, this, _1)); m_component->onDataWritten.connect(boost::bind(&Component::handleDataWritten, this, _1)); + + m_component->addPayloadParserFactory(new GenericPayloadParserFactory("private", "jabber:iq:private")); + m_component->addPayloadParserFactory(new GenericPayloadParserFactory("attention", "urn:xmpp:attention:0")); + m_component->addPayloadParserFactory(new GenericPayloadParserFactory("html", "http://jabber.org/protocol/xhtml-im")); + m_component->addPayloadParserFactory(new GenericPayloadParserFactory("block", "urn:xmpp:block:0")); + m_component->addPayloadParserFactory(new GenericPayloadParserFactory("invisible", "urn:xmpp:invisible:0")); + + m_component->addPayloadSerializer(new Swift::AttentionSerializer()); + m_component->addPayloadSerializer(new Swift::XHTMLIMSerializer()); + m_component->addPayloadSerializer(new Transport::BlockSerializer()); + m_component->addPayloadSerializer(new Swift::InvisibleSerializer()); + m_stanzaChannel = m_component->getStanzaChannel(); m_iqRouter = m_component->getIQRouter(); }