mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-25 07:08:11 +00:00
presence: dont notify uselessly
This commit is contained in:
parent
dce0f4d495
commit
9313618cbd
2 changed files with 2 additions and 5 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue