summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/MUC')
-rw-r--r--Swiften/MUC/MUC.cpp5
-rw-r--r--Swiften/MUC/MUC.h2
2 files changed, 4 insertions, 3 deletions
diff --git a/Swiften/MUC/MUC.cpp b/Swiften/MUC/MUC.cpp
index 60b81a0..b4265b5 100644
--- a/Swiften/MUC/MUC.cpp
+++ b/Swiften/MUC/MUC.cpp
@@ -88,16 +88,17 @@ void MUC::handleIncomingPresence(boost::shared_ptr<Presence> presence) {
}
else if (presence->getType() == Presence::Available) {
std::map<String, MUCOccupant>::iterator it = occupants.find(nick);
+ MUCOccupant occupant(nick, role, affiliation);
if (it != occupants.end()) {
MUCOccupant oldOccupant = it->second;
if (oldOccupant.getRole() != role) {
- onOccupantRoleChanged(nick, role, oldOccupant.getRole());
+ onOccupantRoleChanged(nick, occupant, oldOccupant.getRole());
}
if (oldOccupant.getAffiliation() != affiliation) {
onOccupantAffiliationChanged(nick, affiliation, oldOccupant.getAffiliation());
}
}
- std::pair<std::map<String, MUCOccupant>::iterator, bool> result = occupants.insert(std::make_pair(nick, MUCOccupant(nick, role, affiliation)));
+ std::pair<std::map<String, MUCOccupant>::iterator, bool> result = occupants.insert(std::make_pair(nick, occupant));
if (result.second) {
onOccupantJoined(result.first->second);
}
diff --git a/Swiften/MUC/MUC.h b/Swiften/MUC/MUC.h
index 4bf56c9..40fc2f6 100644
--- a/Swiften/MUC/MUC.h
+++ b/Swiften/MUC/MUC.h
@@ -41,7 +41,7 @@ namespace Swift {
boost::signal<void (const String& /*nick*/)> onJoinComplete;
boost::signal<void (boost::shared_ptr<ErrorPayload>)> onJoinFailed;
boost::signal<void (boost::shared_ptr<Presence>)> onOccupantPresenceChange;
- boost::signal<void (const String&, const MUCOccupant::Role& /*new*/, const MUCOccupant::Role& /*old*/)> onOccupantRoleChanged;
+ boost::signal<void (const String&, const MUCOccupant& /*now*/, const MUCOccupant::Role& /*old*/)> onOccupantRoleChanged;
boost::signal<void (const String&, const MUCOccupant::Affiliation& /*new*/, const MUCOccupant::Affiliation& /*old*/)> onOccupantAffiliationChanged;
boost::signal<void (const MUCOccupant&)> onOccupantJoined;
boost::signal<void (const MUCOccupant&, LeavingType, const String& /*reason*/)> onOccupantLeft;