summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2011-10-05 07:34:05 (GMT)
committerKevin Smith <git@kismith.co.uk>2011-10-05 07:34:05 (GMT)
commit3e972565e51f5b2fa7e9768d5d84a7d4b6dfc09b (patch)
treeb5b464804d169396f0cdd7348f4ae600ee2efe33 /Swift/Controllers/Chat/MUCController.cpp
parent1f4be30a480818458fd841809585681597be831e (diff)
downloadswift-contrib-3e972565e51f5b2fa7e9768d5d84a7d4b6dfc09b.zip
swift-contrib-3e972565e51f5b2fa7e9768d5d84a7d4b6dfc09b.tar.bz2
Allow joining passworded MUCs.
Resolves: #991
Diffstat (limited to 'Swift/Controllers/Chat/MUCController.cpp')
-rw-r--r--Swift/Controllers/Chat/MUCController.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/Swift/Controllers/Chat/MUCController.cpp b/Swift/Controllers/Chat/MUCController.cpp
index d72c0f7..2b8a8b7 100644
--- a/Swift/Controllers/Chat/MUCController.cpp
+++ b/Swift/Controllers/Chat/MUCController.cpp
@@ -44,6 +44,7 @@ namespace Swift {
MUCController::MUCController (
const JID& self,
MUC::ref muc,
+ const boost::optional<std::string>& password,
const std::string &nick,
StanzaChannel* stanzaChannel,
IQRouter* iqRouter,
@@ -55,7 +56,7 @@ MUCController::MUCController (
TimerFactory* timerFactory,
EventController* eventController,
EntityCapsProvider* entityCapsProvider) :
- ChatControllerBase(self, stanzaChannel, iqRouter, chatWindowFactory, muc->getJID(), presenceOracle, avatarManager, useDelayForLatency, uiEventStream, eventController, timerFactory, entityCapsProvider), muc_(muc), nick_(nick), desiredNick_(nick) {
+ ChatControllerBase(self, stanzaChannel, iqRouter, chatWindowFactory, muc->getJID(), presenceOracle, avatarManager, useDelayForLatency, uiEventStream, eventController, timerFactory, entityCapsProvider), muc_(muc), nick_(nick), desiredNick_(nick), password_(password) {
parting_ = true;
joined_ = false;
lastWasPresence_ = false;
@@ -146,6 +147,9 @@ void MUCController::rejoin() {
if (parting_) {
joined_ = false;
parting_ = false;
+ if (password_) {
+ muc_->setPassword(*password_);
+ }
//FIXME: check for received activity
if (lastActivity_ == boost::posix_time::not_a_date_time) {
muc_->joinAs(nick_);