summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2010-08-20 14:08:59 (GMT)
committerKevin Smith <git@kismith.co.uk>2010-08-20 14:08:59 (GMT)
commitb3de442223a5b3281c159b34f047d715da8ca3c9 (patch)
tree85aa240b768ab89fa62957cffa573ef4cd30c7ce /Swiften/MUC
parentc5b8d80800af29bcab6ba2263033fa0d7dc797ef (diff)
downloadswift-contrib-b3de442223a5b3281c159b34f047d715da8ca3c9.zip
swift-contrib-b3de442223a5b3281c159b34f047d715da8ca3c9.tar.bz2
Include Real JIDs in MUC rosters where available
Diffstat (limited to 'Swiften/MUC')
-rw-r--r--Swiften/MUC/MUC.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/Swiften/MUC/MUC.cpp b/Swiften/MUC/MUC.cpp
index 91ba043..f4512a0 100644
--- a/Swiften/MUC/MUC.cpp
+++ b/Swiften/MUC/MUC.cpp
@@ -81,9 +81,11 @@ void MUC::handleIncomingPresence(boost::shared_ptr<Presence> presence) {
}
MUCOccupant::Role role(MUCOccupant::NoRole);
MUCOccupant::Affiliation affiliation(MUCOccupant::NoAffiliation);
+ boost::optional<JID> realJID;
if (mucPayload && mucPayload->getItems().size() > 0) {
role = mucPayload->getItems()[0].role;
affiliation = mucPayload->getItems()[0].affiliation;
+ realJID = mucPayload->getItems()[0].realJID;
}
//100 is non-anonymous
@@ -105,6 +107,9 @@ 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 (realJID) {
+ occupant.setRealJID(realJID.get());
+ }
if (it != occupants.end()) {
MUCOccupant oldOccupant = it->second;
if (oldOccupant.getRole() != role) {