diff options
author | Kevin Smith <git@kismith.co.uk> | 2010-08-20 14:08:59 (GMT) |
---|---|---|
committer | Kevin Smith <git@kismith.co.uk> | 2010-08-20 14:08:59 (GMT) |
commit | b3de442223a5b3281c159b34f047d715da8ca3c9 (patch) | |
tree | 85aa240b768ab89fa62957cffa573ef4cd30c7ce | |
parent | c5b8d80800af29bcab6ba2263033fa0d7dc797ef (diff) | |
download | swift-b3de442223a5b3281c159b34f047d715da8ca3c9.zip swift-b3de442223a5b3281c159b34f047d715da8ca3c9.tar.bz2 |
Include Real JIDs in MUC rosters where available
-rw-r--r-- | Swiften/MUC/MUC.cpp | 5 |
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) { |