diff options
Diffstat (limited to 'Swiften/Parser/PresenceParser.cpp')
m--------- | Swiften | 0 | ||||
-rw-r--r-- | Swiften/Parser/PresenceParser.cpp | 45 |
2 files changed, 0 insertions, 45 deletions
diff --git a/Swiften b/Swiften new file mode 160000 +Subproject 8213ba16d0043d2461f4b031c881d61dda5a38c diff --git a/Swiften/Parser/PresenceParser.cpp b/Swiften/Parser/PresenceParser.cpp deleted file mode 100644 index 72cdd4c..0000000 --- a/Swiften/Parser/PresenceParser.cpp +++ /dev/null @@ -1,45 +0,0 @@ -#include <iostream> - -#include "Swiften/Parser/PresenceParser.h" - -namespace Swift { - -PresenceParser::PresenceParser(PayloadParserFactoryCollection* factories) : - GenericStanzaParser<Presence>(factories) { -} - -void PresenceParser::handleStanzaAttributes(const AttributeMap& attributes) { - AttributeMap::const_iterator type = attributes.find("type"); - if (type != attributes.end()) { - if (type->second == "unavailable") { - getStanzaGeneric()->setType(Presence::Unavailable); - } - else if (type->second == "probe") { - getStanzaGeneric()->setType(Presence::Probe); - } - else if (type->second == "subscribe") { - getStanzaGeneric()->setType(Presence::Subscribe); - } - else if (type->second == "subscribed") { - getStanzaGeneric()->setType(Presence::Subscribed); - } - else if (type->second == "unsubscribe") { - getStanzaGeneric()->setType(Presence::Unsubscribe); - } - else if (type->second == "unsubscribed") { - getStanzaGeneric()->setType(Presence::Unsubscribed); - } - else if (type->second == "error") { - getStanzaGeneric()->setType(Presence::Error); - } - else { - std::cerr << "Unknown Presence type: " << type->second << std::endl; - getStanzaGeneric()->setType(Presence::Available); - } - } - else { - getStanzaGeneric()->setType(Presence::Available); - } -} - -} |