diff options
author | Kevin Smith <git@kismith.co.uk> | 2010-03-26 13:42:19 (GMT) |
---|---|---|
committer | Kevin Smith <git@kismith.co.uk> | 2010-03-26 13:42:19 (GMT) |
commit | 42cf17e614f0c490ea214e36ac4e7ded2d0495b7 (patch) | |
tree | d29dd06d1942c89a9e7cfb2243359b4460df01af /Swiften | |
parent | fd6e929a54514d5c3f77956429d5ab5fb4271ff2 (diff) | |
download | swift-42cf17e614f0c490ea214e36ac4e7ded2d0495b7.zip swift-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.cpp | 2 | ||||
-rw-r--r-- | Swiften/MUC/MUC.h | 4 |
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_; }; } |