From b3de442223a5b3281c159b34f047d715da8ca3c9 Mon Sep 17 00:00:00 2001
From: Kevin Smith <git@kismith.co.uk>
Date: Fri, 20 Aug 2010 15:08:59 +0100
Subject: Include Real JIDs in MUC rosters where available


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) {
-- 
cgit v0.10.2-6-g49f6