fix pidfonline checking

This commit is contained in:
Jehan Monnier 2017-06-02 15:52:17 +02:00
parent 32b7ce6db0
commit 9296483873

View file

@ -1229,6 +1229,7 @@ static int process_pidf_xml_presence_service_notes(xmlparsing_context_t *xml_ctx
static int process_pidf_xml_presence_services(xmlparsing_context_t *xml_ctx, LinphonePresenceModel *model) {
char xpath_str[MAX_XPATH_LENGTH];
xmlXPathObjectPtr service_object;
xmlXPathObjectPtr pidfonline_object;
LinphonePresenceService *service;
const char *basic_status_str;
const char *service_id_str;
@ -1256,7 +1257,9 @@ static int process_pidf_xml_presence_services(xmlparsing_context_t *xml_ctx, Lin
}
snprintf(xpath_str, sizeof(xpath_str), "%s[%i]/pidf:status/pidfonline:online", service_prefix, i);
if (linphone_get_xml_xpath_object_for_node_list(xml_ctx, xpath_str) != NULL) {
if ((pidfonline_object = linphone_get_xml_xpath_object_for_node_list(xml_ctx, xpath_str)) != NULL
&& pidfonline_object->nodesetval
&& pidfonline_object->nodesetval->nodeNr >0) {
model->is_online = TRUE;
}