summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2011-04-08 21:58:03 (GMT)
committerRemko Tronçon <git@el-tramo.be>2011-04-18 19:11:40 (GMT)
commit01385d84f07466550fff702079555c65963463a8 (patch)
treed995334b205737b2402a8f5778642342b9b3ab02 /Swiften/Elements
parent1a92834490cda1352a46eaef02a4e7ff76ab94e3 (diff)
downloadswift-contrib-01385d84f07466550fff702079555c65963463a8.zip
swift-contrib-01385d84f07466550fff702079555c65963463a8.tar.bz2
Added XEP-0237 Roster Versioning support.
Resolves: #803 Release-Notes: Added support for XEP-0237 Roster Versioning
Diffstat (limited to 'Swiften/Elements')
-rw-r--r--Swiften/Elements/RosterItemPayload.h14
-rw-r--r--Swiften/Elements/RosterPayload.h9
-rw-r--r--Swiften/Elements/StreamFeatures.h11
3 files changed, 24 insertions, 10 deletions
diff --git a/Swiften/Elements/RosterItemPayload.h b/Swiften/Elements/RosterItemPayload.h
index b8a1b10..915ae31 100644
--- a/Swiften/Elements/RosterItemPayload.h
+++ b/Swiften/Elements/RosterItemPayload.h
@@ -4,22 +4,20 @@
* See Documentation/Licenses/GPLv3.txt for more information.
*/
-#ifndef SWIFTEN_RosterItemPayloadPayload_H
-#define SWIFTEN_RosterItemPayloadPayload_H
+#pragma once
#include <vector>
-
-#include "Swiften/JID/JID.h"
#include <string>
+#include <Swiften/JID/JID.h>
+
namespace Swift {
- class RosterItemPayload
- {
+ class RosterItemPayload {
public:
enum Subscription { None, To, From, Both, Remove };
RosterItemPayload() : subscription_(None), ask_(false) {}
- RosterItemPayload(const JID& jid, const std::string& name, Subscription subscription) : jid_(jid), name_(name), subscription_(subscription), ask_(false) { }
+ RosterItemPayload(const JID& jid, const std::string& name, Subscription subscription, const std::vector<std::string>& groups = std::vector<std::string>()) : jid_(jid), name_(name), subscription_(subscription), groups_(groups), ask_(false) { }
void setJID(const JID& jid) { jid_ = jid; }
const JID& getJID() const { return jid_; }
@@ -51,5 +49,3 @@ namespace Swift {
std::string unknownContent_;
};
}
-
-#endif
diff --git a/Swiften/Elements/RosterPayload.h b/Swiften/Elements/RosterPayload.h
index b46b384..3102f0e 100644
--- a/Swiften/Elements/RosterPayload.h
+++ b/Swiften/Elements/RosterPayload.h
@@ -33,7 +33,16 @@ namespace Swift {
return items_;
}
+ const boost::optional<std::string>& getVersion() const {
+ return version_;
+ }
+
+ void setVersion(const std::string& version) {
+ version_ = version;
+ }
+
private:
RosterItemPayloads items_;
+ boost::optional<std::string> version_;
};
}
diff --git a/Swiften/Elements/StreamFeatures.h b/Swiften/Elements/StreamFeatures.h
index 4bb21f0..5dc5a26 100644
--- a/Swiften/Elements/StreamFeatures.h
+++ b/Swiften/Elements/StreamFeatures.h
@@ -17,7 +17,7 @@ namespace Swift {
public:
typedef boost::shared_ptr<StreamFeatures> ref;
- StreamFeatures() : hasStartTLS_(false), hasResourceBind_(false), hasSession_(false), hasStreamManagement_(false) {}
+ StreamFeatures() : hasStartTLS_(false), hasResourceBind_(false), hasSession_(false), hasStreamManagement_(false), hasRosterVersioning_(false) {}
void setHasStartTLS() {
hasStartTLS_ = true;
@@ -75,6 +75,14 @@ namespace Swift {
hasStreamManagement_ = true;
}
+ bool hasRosterVersioning() const {
+ return hasRosterVersioning_;
+ }
+
+ void setHasRosterVersioning() {
+ hasRosterVersioning_ = true;
+ }
+
private:
bool hasStartTLS_;
std::vector<std::string> compressionMethods_;
@@ -82,5 +90,6 @@ namespace Swift {
bool hasResourceBind_;
bool hasSession_;
bool hasStreamManagement_;
+ bool hasRosterVersioning_;
};
}