diff options
Diffstat (limited to 'Swiften')
-rw-r--r-- | Swiften/MUC/MUC.cpp | 8 | ||||
-rw-r--r-- | Swiften/MUC/MUC.h | 4 |
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; |