only accept subscription if there is something to send

This commit is contained in:
Benjamin Reis 2018-03-20 12:18:30 +01:00
parent 55d7e53da0
commit 561c5dd757

View file

@ -61,7 +61,6 @@ void LocalConferenceListEventHandler::subscribeReceived (LinphoneEvent *lev, con
linphone_event_deny_subscription(lev, LinphoneReasonDeclined);
return;
}
linphone_event_accept_subscription(lev);
const LinphoneAddress *lAddr = linphone_event_get_from(lev);
char *addrStr = linphone_address_as_string(lAddr);
@ -81,6 +80,7 @@ void LocalConferenceListEventHandler::subscribeReceived (LinphoneEvent *lev, con
Xsd::Rlmi::List::ResourceSequence resources;
// Parse resource list
bool noContent = true;
istringstream data(xmlBody);
unique_ptr<Xsd::ResourceLists::ResourceLists> rl(Xsd::ResourceLists::parseResourceLists(
data,
@ -119,6 +119,7 @@ void LocalConferenceListEventHandler::subscribeReceived (LinphoneEvent *lev, con
}
device->setConferenceSubscribeEvent((subscriptionState == LinphoneSubscriptionIncomingReceived) ? lev : nullptr);
noContent = false;
Content content;
if (notifyId > 0) {
ContentType contentType(ContentType::Multipart);
@ -147,6 +148,12 @@ void LocalConferenceListEventHandler::subscribeReceived (LinphoneEvent *lev, con
}
}
if (noContent) {
linphone_event_deny_subscription(lev, LinphoneReasonDeclined);
return;
}
linphone_event_accept_subscription(lev);
Xsd::Rlmi::List list("", 0, TRUE);
list.setResource(resources);
Xsd::XmlSchema::NamespaceInfomap map;