summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/Parser/PresenceParser.cpp')
-rw-r--r--Swiften/Parser/PresenceParser.cpp66
1 files changed, 33 insertions, 33 deletions
diff --git a/Swiften/Parser/PresenceParser.cpp b/Swiften/Parser/PresenceParser.cpp
index 6d6424e..4a27a24 100644
--- a/Swiften/Parser/PresenceParser.cpp
+++ b/Swiften/Parser/PresenceParser.cpp
@@ -12,42 +12,42 @@
namespace Swift {
-PresenceParser::PresenceParser(PayloadParserFactoryCollection* factories) :
- GenericStanzaParser<Presence>(factories) {
+PresenceParser::PresenceParser(PayloadParserFactoryCollection* factories) :
+ GenericStanzaParser<Presence>(factories) {
}
void PresenceParser::handleStanzaAttributes(const AttributeMap& attributes) {
- boost::optional<std::string> type = attributes.getAttributeValue("type");
- if (type) {
- if (*type == "unavailable") {
- getStanzaGeneric()->setType(Presence::Unavailable);
- }
- else if (*type == "probe") {
- getStanzaGeneric()->setType(Presence::Probe);
- }
- else if (*type == "subscribe") {
- getStanzaGeneric()->setType(Presence::Subscribe);
- }
- else if (*type == "subscribed") {
- getStanzaGeneric()->setType(Presence::Subscribed);
- }
- else if (*type == "unsubscribe") {
- getStanzaGeneric()->setType(Presence::Unsubscribe);
- }
- else if (*type == "unsubscribed") {
- getStanzaGeneric()->setType(Presence::Unsubscribed);
- }
- else if (*type == "error") {
- getStanzaGeneric()->setType(Presence::Error);
- }
- else {
- std::cerr << "Unknown Presence type: " << *type << std::endl;
- getStanzaGeneric()->setType(Presence::Available);
- }
- }
- else {
- getStanzaGeneric()->setType(Presence::Available);
- }
+ boost::optional<std::string> type = attributes.getAttributeValue("type");
+ if (type) {
+ if (*type == "unavailable") {
+ getStanzaGeneric()->setType(Presence::Unavailable);
+ }
+ else if (*type == "probe") {
+ getStanzaGeneric()->setType(Presence::Probe);
+ }
+ else if (*type == "subscribe") {
+ getStanzaGeneric()->setType(Presence::Subscribe);
+ }
+ else if (*type == "subscribed") {
+ getStanzaGeneric()->setType(Presence::Subscribed);
+ }
+ else if (*type == "unsubscribe") {
+ getStanzaGeneric()->setType(Presence::Unsubscribe);
+ }
+ else if (*type == "unsubscribed") {
+ getStanzaGeneric()->setType(Presence::Unsubscribed);
+ }
+ else if (*type == "error") {
+ getStanzaGeneric()->setType(Presence::Error);
+ }
+ else {
+ std::cerr << "Unknown Presence type: " << *type << std::endl;
+ getStanzaGeneric()->setType(Presence::Available);
+ }
+ }
+ else {
+ getStanzaGeneric()->setType(Presence::Available);
+ }
}
}