summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2011-02-27 22:45:32 (GMT)
committerKevin Smith <git@kismith.co.uk>2011-03-06 20:25:01 (GMT)
commit27d21b371f24272466a2d6a5bf2e2b717ee2d9fc (patch)
tree5f53281711d4f467933e4b3315241e4eee58a64c /Swiften/MUC
parentd9c9df3b4ae5432552417fc4db74d62ab34f066d (diff)
downloadswift-contrib-27d21b371f24272466a2d6a5bf2e2b717ee2d9fc.zip
swift-contrib-27d21b371f24272466a2d6a5bf2e2b717ee2d9fc.tar.bz2
A start on Swiftob, a Swiften-based chatbot.
Diffstat (limited to 'Swiften/MUC')
-rw-r--r--Swiften/MUC/MUC.cpp8
-rw-r--r--Swiften/MUC/MUC.h4
2 files changed, 11 insertions, 1 deletions
diff --git a/Swiften/MUC/MUC.cpp b/Swiften/MUC/MUC.cpp
index b8c23cd..68a5a86 100644
--- a/Swiften/MUC/MUC.cpp
+++ b/Swiften/MUC/MUC.cpp
@@ -208,6 +208,14 @@ void MUC::handleCreationConfigResponse(MUCOwnerPayload::ref /*unused*/, ErrorPay
}
}
+bool MUC::hasOccupant(const std::string& nick) {
+ return occupants.find(nick) != occupants.end();
+}
+
+MUCOccupant MUC::getOccupant(const std::string& nick) {
+ return occupants.find(nick)->second;
+}
+
//FIXME: Recognise Topic changes
//TODO: Invites(direct/mediated)
diff --git a/Swiften/MUC/MUC.h b/Swiften/MUC/MUC.h
index ef76a6a..278ef95 100644
--- a/Swiften/MUC/MUC.h
+++ b/Swiften/MUC/MUC.h
@@ -51,7 +51,9 @@ namespace Swift {
void handleIncomingMessage(Message::ref message);
/** Expose public so it can be called when e.g. user goes offline */
void handleUserLeft(LeavingType);
-
+ /** Get occupant information*/
+ MUCOccupant getOccupant(const std::string& nick);
+ bool hasOccupant(const std::string& nick);
public:
boost::signal<void (const std::string& /*nick*/)> onJoinComplete;
boost::signal<void (ErrorPayload::ref)> onJoinFailed;