send subscribe presence as response to error presence only when error type is SubscriptionRequested

This commit is contained in:
HanzZ 2012-11-13 17:52:51 +01:00
parent db3096599f
commit 8c7caaf94a

View file

@ -431,6 +431,15 @@ void UserManager::handleErrorPresence(Swift::Presence::ref presence) {
if (!presence->getTo().getNode().empty()) {
return;
}
if (!presence->getPayload<Swift::ErrorPayload>()) {
return;
}
if (presence->getPayload<Swift::ErrorPayload>()->getCondition() != Swift::ErrorPayload::SubscriptionRequired) {
return;
}
std::string userkey = presence->getFrom().toBare().toString();
UserInfo res;
bool registered = m_storageBackend ? m_storageBackend->getUser(userkey, res) : false;