summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2010-05-22 20:45:53 (GMT)
committerKevin Smith <git@kismith.co.uk>2010-05-23 08:15:20 (GMT)
commita68530cbbfeb17e01fd684b1ef41b960bc173f66 (patch)
tree98b5cd195f04d781164cf1394cee9092bb7b2497 /Swiften/Elements
parentc9659b556b932e2f887cf1d8ab6c5a0bead835eb (diff)
downloadswift-a68530cbbfeb17e01fd684b1ef41b960bc173f66.zip
swift-a68530cbbfeb17e01fd684b1ef41b960bc173f66.tar.bz2
Implement XEP-0045 joining, and appropriate error handling.
Resolves: #211
Diffstat (limited to 'Swiften/Elements')
-rw-r--r--Swiften/Elements/MUCPayload.h10
-rw-r--r--Swiften/Elements/MUCUserPayload.h59
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_;
+ };
+}