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/Elements
parente0578b8fc582d431cce61ecac833ecf7031f6e75 (diff)
downloadswift-509973e7e5978c2225fb89a10a1e2343fce21e7b.zip
swift-509973e7e5978c2225fb89a10a1e2343fce21e7b.tar.bz2
Small tweaks to the roster item exchange payload.
Diffstat (limited to 'Swiften/Elements')
-rw-r--r--Swiften/Elements/RosterItemExchangePayload.cpp3
-rw-r--r--Swiften/Elements/RosterItemExchangePayload.h49
2 files changed, 45 insertions, 7 deletions
diff --git a/Swiften/Elements/RosterItemExchangePayload.cpp b/Swiften/Elements/RosterItemExchangePayload.cpp
index 846e184..f4f3a57 100644
--- a/Swiften/Elements/RosterItemExchangePayload.cpp
+++ b/Swiften/Elements/RosterItemExchangePayload.cpp
@@ -9,6 +9,9 @@
namespace Swift {
+RosterItemExchangePayload::Item::Item() {
+}
+
RosterItemExchangePayload::RosterItemExchangePayload() {
}
diff --git a/Swiften/Elements/RosterItemExchangePayload.h b/Swiften/Elements/RosterItemExchangePayload.h
index f573039..d9e2912 100644
--- a/Swiften/Elements/RosterItemExchangePayload.h
+++ b/Swiften/Elements/RosterItemExchangePayload.h
@@ -8,7 +8,6 @@
#include <vector>
#include <string>
-#include <boost/optional.hpp>
#include <boost/shared_ptr.hpp>
#include "Swiften/Elements/Payload.h"
@@ -20,13 +19,49 @@ namespace Swift {
public:
typedef boost::shared_ptr<RosterItemExchangePayload> ref;
- enum Action { Add, Modify, Delete };
+ class Item {
+ public:
+ enum Action { Add, Modify, Delete };
- struct Item {
- Action action;
- JID jid;
- std::string name;
- std::vector<std::string> groups;
+ Item();
+
+ Action getAction() const {
+ return action;
+ }
+
+ void setAction(Action action) {
+ this->action = action;
+ }
+
+ const JID& getJID() const {
+ return jid;
+ }
+
+ void setJID(const JID& jid) {
+ this->jid = jid;
+ }
+
+ const std::string& getName() const {
+ return name;
+ }
+
+ void setName(const std::string& name) {
+ this->name = name;
+ }
+
+ const std::vector<std::string>& getGroups() const {
+ return groups;
+ }
+
+ void addGroup(const std::string& group) {
+ groups.push_back(group);
+ }
+
+ private:
+ Action action;
+ JID jid;
+ std::string name;
+ std::vector<std::string> groups;
};
typedef std::vector<RosterItemExchangePayload::Item> RosterItemExchangePayloadItems;