summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2010-12-20 09:51:03 (GMT)
committerKevin Smith <git@kismith.co.uk>2010-12-20 11:09:05 (GMT)
commit241bbe1c1a5755972f3ec0532befa9329631934e (patch)
tree740b4d6d4e8f010260b3cf05857379072d605341 /Swiften/MUC
parentee8e00ba6abb5a61ba51c0c75806b67242364dc6 (diff)
downloadswift-241bbe1c1a5755972f3ec0532befa9329631934e.zip
swift-241bbe1c1a5755972f3ec0532befa9329631934e.tar.bz2
Don't immediately send presence unneccesarily when registering directed presence senders.
Hopefully Resolves: #691 Release-Notes: We hope to have fixed the bug where a MUC room would go into loop of parting and joining continually.
Diffstat (limited to 'Swiften/MUC')
-rw-r--r--Swiften/MUC/MUC.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/Swiften/MUC/MUC.cpp b/Swiften/MUC/MUC.cpp
index dd57698..309107c 100644
--- a/Swiften/MUC/MUC.cpp
+++ b/Swiften/MUC/MUC.cpp
@@ -63,7 +63,7 @@ void MUC::joinWithContextSince(const String &nick, const boost::posix_time::ptim
}
void MUC::part() {
- presenceSender->removeDirectedPresenceReceiver(ownMUCJID);
+ presenceSender->removeDirectedPresenceReceiver(ownMUCJID, DirectedPresenceSender::AndSendPresence);
mucRegistry->removeMUC(getJID());
}
@@ -76,7 +76,7 @@ void MUC::handleUserLeft(LeavingType type) {
}
occupants.clear();
joinComplete_ = false;
- presenceSender->removeDirectedPresenceReceiver(ownMUCJID);
+ presenceSender->removeDirectedPresenceReceiver(ownMUCJID, DirectedPresenceSender::DontSendPresence);
}
void MUC::handleIncomingPresence(boost::shared_ptr<Presence> presence) {
@@ -158,7 +158,7 @@ void MUC::handleIncomingPresence(boost::shared_ptr<Presence> presence) {
joinComplete_ = true;
ownMUCJID = presence->getFrom();
onJoinComplete(getOwnNick());
- presenceSender->addDirectedPresenceReceiver(ownMUCJID);
+ presenceSender->addDirectedPresenceReceiver(ownMUCJID, DirectedPresenceSender::DontSendPresence);
}
if (status.code == 201) {
/* Room is created and locked */
@@ -179,8 +179,8 @@ void MUC::handleCreationConfigResponse(boost::shared_ptr<MUCOwnerPayload> /*unus
if (error) {
onJoinFailed(error);
} else {
- /* onJoinComplete(getOwnNick()); isn't needed here, the presence will cause an emit elsewhere. */
- presenceSender->addDirectedPresenceReceiver(ownMUCJID);
+ onJoinComplete(getOwnNick()); /* Previously, this wasn't needed here, as the presence duplication bug caused an emit elsewhere. */
+ presenceSender->addDirectedPresenceReceiver(ownMUCJID, DirectedPresenceSender::DontSendPresence);
}
}