summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2011-03-04 10:56:07 (GMT)
committerKevin Smith <git@kismith.co.uk>2011-03-04 10:58:16 (GMT)
commit37bfeaf6f2e0145731c32f79291ff3d48ae0e1b1 (patch)
treee6455b4f21b3a5ba716526916a67cfd4b7e55051 /Swiften/Elements/SecurityLabelsCatalog.h
parent12024229138787d7df91cb8101d0986996880e3d (diff)
downloadswift-contrib-37bfeaf6f2e0145731c32f79291ff3d48ae0e1b1.zip
swift-contrib-37bfeaf6f2e0145731c32f79291ff3d48ae0e1b1.tar.bz2
Upgrade XEP-0258 support to match 0.6.
Resolves: #183 Release-Notes: Security labels (XEP-0258) support has been updated to match the latest version of the specification.
Diffstat (limited to 'Swiften/Elements/SecurityLabelsCatalog.h')
-rw-r--r--Swiften/Elements/SecurityLabelsCatalog.h37
1 files changed, 32 insertions, 5 deletions
diff --git a/Swiften/Elements/SecurityLabelsCatalog.h b/Swiften/Elements/SecurityLabelsCatalog.h
index 1c13fdf..10ef459 100644
--- a/Swiften/Elements/SecurityLabelsCatalog.h
+++ b/Swiften/Elements/SecurityLabelsCatalog.h
@@ -17,14 +17,41 @@
namespace Swift {
class SecurityLabelsCatalog : public Payload {
public:
+ class Item {
+ public:
+ Item() : default_(false) {}
+ const boost::shared_ptr<SecurityLabel> getLabel() const {
+ return label_;
+ }
+
+ void setLabel(boost::shared_ptr<SecurityLabel> label) {
+ label_ = label;
+ }
+
+ const std::string& getSelector() const { return selector_; }
+
+ void setSelector(const std::string& selector) {
+ selector_ = selector;
+ }
+
+ bool getIsDefault() const { return default_; }
+
+ void setIsDefault(bool isDefault) {
+ default_ = isDefault;
+ }
+ private:
+ boost::shared_ptr<SecurityLabel> label_;
+ std::string selector_;
+ bool default_;
+ };
SecurityLabelsCatalog(const JID& to = JID()) : to_(to) {}
- const std::vector<SecurityLabel>& getLabels() const {
- return labels_;
+ const std::vector<Item>& getItems() const {
+ return items_;
}
- void addLabel(const SecurityLabel& label) {
- labels_.push_back(label);
+ void addItem(const Item& item) {
+ items_.push_back(item);
}
const JID& getTo() const {
@@ -55,7 +82,7 @@ namespace Swift {
JID to_;
std::string name_;
std::string description_;
- std::vector<SecurityLabel> labels_;
+ std::vector<Item> items_;
};
}