summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2010-03-26 13:42:19 (GMT)
committerKevin Smith <git@kismith.co.uk>2010-03-26 13:42:19 (GMT)
commit42cf17e614f0c490ea214e36ac4e7ded2d0495b7 (patch)
treed29dd06d1942c89a9e7cfb2243359b4460df01af /Swiften
parentfd6e929a54514d5c3f77956429d5ab5fb4271ff2 (diff)
downloadswift-contrib-42cf17e614f0c490ea214e36ac4e7ded2d0495b7.zip
swift-contrib-42cf17e614f0c490ea214e36ac4e7ded2d0495b7.tar.bz2
Remove MUCs from the ChatsManager's list once you leave them.
Resolves: #292
Diffstat (limited to 'Swiften')
-rw-r--r--Swiften/MUC/MUC.cpp2
-rw-r--r--Swiften/MUC/MUC.h4
2 files changed, 4 insertions, 2 deletions
diff --git a/Swiften/MUC/MUC.cpp b/Swiften/MUC/MUC.cpp
index a6fbcbd..3c06c7a 100644
--- a/Swiften/MUC/MUC.cpp
+++ b/Swiften/MUC/MUC.cpp
@@ -13,7 +13,7 @@ namespace Swift {
typedef std::pair<String, MUCOccupant> StringMUCOccupantPair;
MUC::MUC(StanzaChannel* stanzaChannel, PresenceSender* presenceSender, const JID &muc) : ownMUCJID(muc), stanzaChannel(stanzaChannel), presenceSender(presenceSender) {
- stanzaChannel->onPresenceReceived.connect(boost::bind(&MUC::handleIncomingPresence, this, _1));
+ scopedConnection_ = stanzaChannel->onPresenceReceived.connect(boost::bind(&MUC::handleIncomingPresence, this, _1));
}
void MUC::joinAs(const String &nick) {
diff --git a/Swiften/MUC/MUC.h b/Swiften/MUC/MUC.h
index c31f9ac..1ef974f 100644
--- a/Swiften/MUC/MUC.h
+++ b/Swiften/MUC/MUC.h
@@ -6,8 +6,9 @@
#include "Swiften/Elements/Presence.h"
#include "Swiften/MUC/MUCOccupant.h"
-#include <boost/signals.hpp>
#include <boost/shared_ptr.hpp>
+#include <boost/signals.hpp>
+#include <boost/signals/connection.hpp>
#include <map>
@@ -53,5 +54,6 @@ namespace Swift {
PresenceSender* presenceSender;
std::map<String, MUCOccupant> occupants;
bool firstPresenceSeen;
+ boost::bsignals::scoped_connection scopedConnection_;
};
}