summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2011-04-12 18:35:30 (GMT)
committerRemko Tronçon <git@el-tramo.be>2011-04-18 19:11:42 (GMT)
commit509973e7e5978c2225fb89a10a1e2343fce21e7b (patch)
treed8ea2cdc00d42f709103a1a1c0b7777c192e71a7 /Swiften/Parser/PayloadParsers/RosterItemExchangeParser.cpp
parente0578b8fc582d431cce61ecac833ecf7031f6e75 (diff)
downloadswift-509973e7e5978c2225fb89a10a1e2343fce21e7b.zip
swift-509973e7e5978c2225fb89a10a1e2343fce21e7b.tar.bz2
Small tweaks to the roster item exchange payload.
Diffstat (limited to 'Swiften/Parser/PayloadParsers/RosterItemExchangeParser.cpp')
-rw-r--r--Swiften/Parser/PayloadParsers/RosterItemExchangeParser.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/Swiften/Parser/PayloadParsers/RosterItemExchangeParser.cpp b/Swiften/Parser/PayloadParsers/RosterItemExchangeParser.cpp
index 7d59cc3..ff2a73b 100644
--- a/Swiften/Parser/PayloadParsers/RosterItemExchangeParser.cpp
+++ b/Swiften/Parser/PayloadParsers/RosterItemExchangeParser.cpp
@@ -19,22 +19,22 @@ void RosterItemExchangeParser::handleStartElement(const std::string& element, co
currentItem_ = RosterItemExchangePayload::Item();
- currentItem_.jid = JID(attributes.getAttribute("jid"));
- currentItem_.name = attributes.getAttribute("name");
+ currentItem_.setJID(JID(attributes.getAttribute("jid")));
+ currentItem_.setName(attributes.getAttribute("name"));
std::string action = attributes.getAttribute("action");
if (action == "add") {
- currentItem_.action = RosterItemExchangePayload::Add;
+ currentItem_.setAction(RosterItemExchangePayload::Item::Add);
}
else if (action == "modify") {
- currentItem_.action = RosterItemExchangePayload::Modify;
+ currentItem_.setAction(RosterItemExchangePayload::Item::Modify);
}
else if (action == "delete") {
- currentItem_.action = RosterItemExchangePayload::Delete;
+ currentItem_.setAction(RosterItemExchangePayload::Item::Delete);
}
else {
// Add is default action according to XEP
- currentItem_.action = RosterItemExchangePayload::Add;
+ currentItem_.setAction(RosterItemExchangePayload::Item::Add);
}
}
}
@@ -56,7 +56,7 @@ void RosterItemExchangeParser::handleEndElement(const std::string& element, cons
}
else if (level_ == ItemLevel) {
if (element == "group") {
- currentItem_.groups.push_back(currentText_);
+ currentItem_.addGroup(currentText_);
}
}
}