send subscribe presence as response to error presence only when error type is SubscriptionRequested
This commit is contained in:
parent
db3096599f
commit
8c7caaf94a
1 changed files with 9 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue