diff options
author | Kevin Smith <git@kismith.co.uk> | 2011-10-05 07:34:05 (GMT) |
---|---|---|
committer | Kevin Smith <git@kismith.co.uk> | 2011-10-05 07:34:05 (GMT) |
commit | 3e972565e51f5b2fa7e9768d5d84a7d4b6dfc09b (patch) | |
tree | b5b464804d169396f0cdd7348f4ae600ee2efe33 /Swiften/MUC/MUC.cpp | |
parent | 1f4be30a480818458fd841809585681597be831e (diff) | |
download | swift-contrib-3e972565e51f5b2fa7e9768d5d84a7d4b6dfc09b.zip swift-contrib-3e972565e51f5b2fa7e9768d5d84a7d4b6dfc09b.tar.bz2 |
Allow joining passworded MUCs.
Resolves: #991
Diffstat (limited to 'Swiften/MUC/MUC.cpp')
-rw-r--r-- | Swiften/MUC/MUC.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Swiften/MUC/MUC.cpp b/Swiften/MUC/MUC.cpp index 08391b4..15355ad 100644 --- a/Swiften/MUC/MUC.cpp +++ b/Swiften/MUC/MUC.cpp @@ -44,6 +44,13 @@ void MUC::joinAs(const std::string &nick) { } /** + * Set the password used for entering the room. + */ +void MUC::setPassword(const boost::optional<std::string>& newPassword) { + password = newPassword; +} + +/** * Join the MUC with context since date. */ void MUC::joinWithContextSince(const std::string &nick, const boost::posix_time::ptime& since) { @@ -68,6 +75,9 @@ void MUC::internalJoin(const std::string &nick) { if (joinSince_ != boost::posix_time::not_a_date_time) { mucPayload->setSince(joinSince_); } + if (password) { + mucPayload->setPassword(*password); + } joinPresence->addPayload(mucPayload); presenceSender->sendPresence(joinPresence); |