summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/Parser/PayloadParsers/MUCUserPayloadParserFactory.h')
-rw-r--r--Swiften/Parser/PayloadParsers/MUCUserPayloadParserFactory.h20
1 files changed, 16 insertions, 4 deletions
diff --git a/Swiften/Parser/PayloadParsers/MUCUserPayloadParserFactory.h b/Swiften/Parser/PayloadParsers/MUCUserPayloadParserFactory.h
index 3946ece..2c1c915 100644
--- a/Swiften/Parser/PayloadParsers/MUCUserPayloadParserFactory.h
+++ b/Swiften/Parser/PayloadParsers/MUCUserPayloadParserFactory.h
@@ -6,12 +6,24 @@
#pragma once
-#include "Swiften/Parser/GenericPayloadParserFactory.h"
-#include "Swiften/Parser/PayloadParsers/MUCUserPayloadParser.h"
+#include <Swiften/Parser/GenericPayloadParserFactory.h>
+#include <Swiften/Parser/PayloadParsers/MUCUserPayloadParser.h>
namespace Swift {
- class MUCUserPayloadParserFactory : public GenericPayloadParserFactory<MUCUserPayloadParser> {
+ class MUCUserPayloadParserFactory : public PayloadParserFactory {
public:
- MUCUserPayloadParserFactory() : GenericPayloadParserFactory<MUCUserPayloadParser>("x", "http://jabber.org/protocol/muc#user") {}
+ MUCUserPayloadParserFactory(PayloadParserFactoryCollection* factories) : factories(factories) {
+ }
+
+ virtual bool canParse(const std::string& element, const std::string& ns, const AttributeMap&) const {
+ return element == "x" && ns == "http://jabber.org/protocol/muc#user";
+ }
+
+ virtual PayloadParser* createPayloadParser() {
+ return new MUCUserPayloadParser(factories);
+ }
+
+ private:
+ PayloadParserFactoryCollection* factories;
};
}