diff options
Diffstat (limited to 'Swiften/Elements')
-rw-r--r-- | Swiften/Elements/MUCPayload.h | 10 | ||||
-rw-r--r-- | Swiften/Elements/MUCUserPayload.h | 59 |
2 files changed, 65 insertions, 4 deletions
diff --git a/Swiften/Elements/MUCPayload.h b/Swiften/Elements/MUCPayload.h index 5ce682e..4b48b45 100644 --- a/Swiften/Elements/MUCPayload.h +++ b/Swiften/Elements/MUCPayload.h @@ -1,17 +1,19 @@ /* - * Copyright (c) 2010 Remko Tronçon + * Copyright (c) 2010 Kevin Smith * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ #pragma once +#include <boost/optional.hpp> + +#include "Swiften/JID/JID.h" +#include "Swiften/Base/String.h" #include "Swiften/Elements/Payload.h" namespace Swift { class MUCPayload : public Payload { - public: - MUCPayload() { - } + }; } diff --git a/Swiften/Elements/MUCUserPayload.h b/Swiften/Elements/MUCUserPayload.h new file mode 100644 index 0000000..3032b9f --- /dev/null +++ b/Swiften/Elements/MUCUserPayload.h @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2010 Kevin Smith + * Licensed under the GNU General Public License v3. + * See Documentation/Licenses/GPLv3.txt for more information. + */ + +#pragma once + +#include <boost/optional.hpp> + +#include "Swiften/JID/JID.h" +#include "Swiften/Base/String.h" +#include "Swiften/Elements/Payload.h" +#include "Swiften/MUC/MUCOccupant.h" + +namespace Swift { + class MUCUserPayload : public Payload { + public: + struct Item { + Item() : affiliation(MUCOccupant::NoAffiliation), role(MUCOccupant::NoRole) {} + boost::optional<JID> realJID; + boost::optional<String> nick; + MUCOccupant::Affiliation affiliation; + MUCOccupant::Role role; + }; + + struct StatusCode { + StatusCode() {} + int code; + }; + + // struct Password { + + // } + + // struct History { + + // } + + // struct Invite { + + // } + + MUCUserPayload() { + } + + void addItem(Item item) {items_.push_back(item);} + + void addStatusCode(StatusCode code) {statusCodes_.push_back(code);} + + const std::vector<Item> getItems() const {return items_;} + + const std::vector<StatusCode> getStatusCodes() const {return statusCodes_;} + + private: + std::vector<Item> items_; + std::vector<StatusCode> statusCodes_; + }; +} |