Commit 09000984 authored by Benjamin REIS's avatar Benjamin REIS

only notify friend list concerned by the event

parent 80556d0a
......@@ -1016,33 +1016,34 @@ void linphone_friend_list_notify_presence(LinphoneFriendList *list, LinphonePres
}
void linphone_friend_list_notify_presence_received(LinphoneFriendList *list, LinphoneEvent *lev, const LinphoneContent *body) {
if (linphone_content_is_multipart(body)) {
LinphoneContent *first_part;
const char *type = linphone_content_get_type(body);
const char *subtype = linphone_content_get_subtype(body);
if ((strcmp(type, "multipart") != 0) || (strcmp(subtype, "related") != 0)) {
ms_warning("multipart presence notified but it is not 'multipart/related', instead is '%s/%s'", type, subtype);
return;
}
if (!linphone_content_is_multipart(body))
return;
first_part = linphone_content_get_part(body, 0);
if (first_part == NULL) {
ms_warning("'multipart/related' presence notified but it doesn't contain any part");
return;
}
LinphoneContent *first_part;
const char *type = linphone_content_get_type(body);
const char *subtype = linphone_content_get_subtype(body);
type = linphone_content_get_type(first_part);
subtype = linphone_content_get_subtype(first_part);
if ((strcmp(type, "application") != 0) || (strcmp(subtype, "rlmi+xml") != 0)) {
ms_warning("multipart presence notified but first part is not 'application/rlmi+xml'");
linphone_content_unref(first_part);
return;
}
if ((strcmp(type, "multipart") != 0) || (strcmp(subtype, "related") != 0)) {
ms_warning("multipart presence notified but it is not 'multipart/related', instead is '%s/%s'", type, subtype);
return;
}
linphone_friend_list_parse_multipart_related_body(list, body, linphone_content_get_string_buffer(first_part));
first_part = linphone_content_get_part(body, 0);
if (first_part == NULL) {
ms_warning("'multipart/related' presence notified but it doesn't contain any part");
return;
}
type = linphone_content_get_type(first_part);
subtype = linphone_content_get_subtype(first_part);
if ((strcmp(type, "application") != 0) || (strcmp(subtype, "rlmi+xml") != 0)) {
ms_warning("multipart presence notified but first part is not 'application/rlmi+xml'");
linphone_content_unref(first_part);
return;
}
linphone_friend_list_parse_multipart_related_body(list, body, linphone_content_get_string_buffer(first_part));
linphone_content_unref(first_part);
}
const char * linphone_friend_list_get_uri(const LinphoneFriendList *list) {
......
......@@ -2173,7 +2173,8 @@ static void linphone_core_internal_notify_received(LinphoneCore *lc, LinphoneEve
for (const bctbx_list_t *it = linphone_core_get_friends_lists(lc); it; it = bctbx_list_next(it)) {
LinphoneFriendList *list = reinterpret_cast<LinphoneFriendList *>(bctbx_list_get_data(it));
ms_message("Notify presence for list %p", list);
linphone_friend_list_notify_presence_received(list, lev, body);
if (list->event == lev)
linphone_friend_list_notify_presence_received(list, lev, body);
}
} else if (strcmp(notified_event, "conference") == 0) {
const LinphoneAddress *resource = linphone_event_get_resource(lev);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment