Show all resources of particular user when disconnecting to make debugging easier

This commit is contained in:
Jan Kaluza 2013-01-22 11:59:51 +01:00
parent 58f50c7544
commit 943990e764

View file

@ -320,6 +320,21 @@ void User::handlePresence(Swift::Presence::ref presence, bool forceJoin) {
if (presence->getType() == Swift::Presence::Unavailable) {
m_conversationManager->removeJID(presence->getFrom());
std::string presences;
std::vector<Swift::Presence::ref> ps = m_presenceOracle->getAllPresence(m_jid);
BOOST_FOREACH(Swift::Presence::ref p, ps) {
if (p != presence) {
presences += p->getFrom().toString() + " ";
}
};
if (!presences.empty()) {
LOG4CXX_INFO(logger, m_jid.toString() << ": User is still connected from following clients: " << presences);
}
else {
LOG4CXX_INFO(logger, m_jid.toString() << ": Last client disconnected");
}
}