summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften')
-rw-r--r--Swiften/Client/DummyStanzaChannel.h10
-rw-r--r--Swiften/Elements/MUCItem.h5
2 files changed, 14 insertions, 1 deletions
diff --git a/Swiften/Client/DummyStanzaChannel.h b/Swiften/Client/DummyStanzaChannel.h
index 48b611c..fc2f05b 100644
--- a/Swiften/Client/DummyStanzaChannel.h
+++ b/Swiften/Client/DummyStanzaChannel.h
@@ -79,6 +79,16 @@ namespace Swift {
return std::dynamic_pointer_cast<T>(sentStanzas[index]);
}
+ template<typename T> size_t countSentStanzaOfType() {
+ size_t count = 0;
+ for (auto& stanza : sentStanzas) {
+ if (std::dynamic_pointer_cast<T>(stanza)) {
+ count++;
+ }
+ }
+ return count;
+ }
+
std::vector<Certificate::ref> getPeerCertificateChain() const {
return std::vector<Certificate::ref>();
}
diff --git a/Swiften/Elements/MUCItem.h b/Swiften/Elements/MUCItem.h
index 9ea6d77..3c89e68 100644
--- a/Swiften/Elements/MUCItem.h
+++ b/Swiften/Elements/MUCItem.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011 Isode Limited.
+ * Copyright (c) 2011-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -8,9 +8,12 @@
#include <Swiften/Elements/MUCOccupant.h>
#include <Swiften/JID/JID.h>
+
namespace Swift {
struct MUCItem {
MUCItem() {}
+ MUCItem(MUCOccupant::Affiliation affiliation, const JID& jid, MUCOccupant::Role role) : realJID(jid), affiliation(affiliation), role(role) {}
+ MUCItem(MUCOccupant::Affiliation affiliation, MUCOccupant::Role role) : affiliation(affiliation), role(role) {}
boost::optional<JID> realJID;
boost::optional<std::string> nick;
boost::optional<MUCOccupant::Affiliation> affiliation;