summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/MUC')
-rw-r--r--Swiften/MUC/MUCRegistry.cpp15
-rw-r--r--Swiften/MUC/MUCRegistry.h13
2 files changed, 26 insertions, 2 deletions
diff --git a/Swiften/MUC/MUCRegistry.cpp b/Swiften/MUC/MUCRegistry.cpp
index 910d740..e433165 100644
--- a/Swiften/MUC/MUCRegistry.cpp
+++ b/Swiften/MUC/MUCRegistry.cpp
@@ -6,9 +6,24 @@
#include "Swiften/MUC/MUCRegistry.h"
+#include <algorithm>
+
namespace Swift {
MUCRegistry::~MUCRegistry() {
}
+bool MUCRegistry::isMUC(const JID& j) const {
+ return std::find(mucs.begin(), mucs.end(), j) != mucs.end();
+}
+
+void MUCRegistry::addMUC(const JID& j) {
+ mucs.push_back(j);
+}
+
+void MUCRegistry::removeMUC(const JID& j) {
+ mucs.erase(std::remove(mucs.begin(), mucs.end(), j), mucs.end());
+}
+
+
}
diff --git a/Swiften/MUC/MUCRegistry.h b/Swiften/MUC/MUCRegistry.h
index e6f2ab6..6356931 100644
--- a/Swiften/MUC/MUCRegistry.h
+++ b/Swiften/MUC/MUCRegistry.h
@@ -6,13 +6,22 @@
#pragma once
+#include <vector>
+
+#include "Swiften/JID/JID.h"
+
namespace Swift {
class JID;
class MUCRegistry {
public:
- virtual ~MUCRegistry();
+ ~MUCRegistry();
+
+ bool isMUC(const JID& j) const;
+ void addMUC(const JID& j);
+ void removeMUC(const JID& j);
- virtual bool isMUC(const JID&) const = 0;
+ private:
+ std::vector<JID> mucs;
};
}