presence: dont notify uselessly

parent dce0f4d4
......@@ -320,7 +320,7 @@ static void linphone_friend_list_parse_multipart_related_body(LinphoneFriendList
LinphoneAddress *addr = (LinphoneAddress *)bctbx_list_get_data(iterator);
char *uri = linphone_address_as_string_uri_only(addr);
const LinphonePresenceModel *presence = linphone_friend_get_presence_model_for_uri_or_tel(lf, uri);
linphone_core_notify_notify_presence_received_for_uri_or_tel(list->lc, lf, uri, presence);
if (presence) linphone_core_notify_notify_presence_received_for_uri_or_tel(list->lc, lf, uri, presence);
ms_free(uri);
iterator = bctbx_list_next(iterator);
}
......@@ -329,7 +329,7 @@ static void linphone_friend_list_parse_multipart_related_body(LinphoneFriendList
while (iterator) {
const char *number = (const char *)bctbx_list_get_data(iterator);
const LinphonePresenceModel *presence = linphone_friend_get_presence_model_for_uri_or_tel(lf, number);
linphone_core_notify_notify_presence_received_for_uri_or_tel(list->lc, lf, number, presence);
if (presence) linphone_core_notify_notify_presence_received_for_uri_or_tel(list->lc, lf, number, presence);
iterator = bctbx_list_next(iterator);
}
if (numbers) bctbx_list_free(numbers);
......
......@@ -69,13 +69,10 @@ static void cleanup_dead_vtable_refs(LinphoneCore *lc){
#define NOTIFY_IF_EXIST_INTERNAL(function_name, internal_val, ...) \
bctbx_list_t* iterator; \
VTableReference *ref; \
bool_t has_cb = FALSE; \
for (iterator=lc->vtable_refs; iterator!=NULL; iterator=iterator->next)\
if ((ref=(VTableReference*)iterator->data)->valid && (lc->current_vtable=ref->vtable)->function_name && (ref->internal == internal_val)) {\
lc->current_vtable->function_name(__VA_ARGS__);\
has_cb = TRUE;\
}\
if (has_cb) ms_message("Linphone core [%p] notifying [%s]",lc,#function_name)
void linphone_core_notify_global_state_changed(LinphoneCore *lc, LinphoneGlobalState gstate, const char *message) {
NOTIFY_IF_EXIST(global_state_changed,lc,gstate,message);
......
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