From 41d60df07029f182588d5f2841983fb4ebc6083b Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Wed, 9 Oct 2013 14:13:11 +0200 Subject: [PATCH] Normalize event callbacks names. --- console/linphonec.c | 4 ++-- coreapi/event.h | 2 +- coreapi/help/buddy_status.c | 8 ++++---- coreapi/linphonecore.h | 8 ++++---- coreapi/linphonecore_jni.cc | 8 ++++---- coreapi/linphonefriend.h | 2 +- coreapi/presence.c | 8 ++++---- gtk/main.c | 4 ++-- tester/liblinphone_tester.c | 4 ++-- tester/liblinphone_tester.h | 2 +- tester/presence_tester.c | 2 +- 11 files changed, 26 insertions(+), 26 deletions(-) diff --git a/console/linphonec.c b/console/linphonec.c index f9e329b51..0b0c3a3f4 100644 --- a/console/linphonec.c +++ b/console/linphonec.c @@ -629,8 +629,8 @@ int main (int argc, char *argv[]) { #endif linphonec_vtable.call_state_changed=linphonec_call_state_changed; - linphonec_vtable.notify_presence_recv = linphonec_notify_presence_received; - linphonec_vtable.new_subscription_request = linphonec_new_unknown_subscriber; + linphonec_vtable.notify_presence_received = linphonec_notify_presence_received; + linphonec_vtable.new_subscription_requested = linphonec_new_unknown_subscriber; linphonec_vtable.auth_info_requested = linphonec_prompt_for_auth; linphonec_vtable.display_status = linphonec_display_status; linphonec_vtable.display_message=linphonec_display_something; diff --git a/coreapi/event.h b/coreapi/event.h index 8f9f8e6bd..9acb94b2d 100644 --- a/coreapi/event.h +++ b/coreapi/event.h @@ -89,7 +89,7 @@ LINPHONE_PUBLIC const char *linphone_publish_state_to_string(LinphonePublishStat /** * Callback prototype for notifying the application about notification received from the network. **/ -typedef void (*LinphoneCoreIncomingNotifyCb)(LinphoneCore *lc, LinphoneEvent *lev, const char *notified_event, const LinphoneContent *body); +typedef void (*LinphoneCoreNotifyReceivedCb)(LinphoneCore *lc, LinphoneEvent *lev, const char *notified_event, const LinphoneContent *body); /** * Callback prototype for notifying the application about changes of subscription states, including arrival of new subscriptions. diff --git a/coreapi/help/buddy_status.c b/coreapi/help/buddy_status.c index bcd71b99f..64f818683 100644 --- a/coreapi/help/buddy_status.c +++ b/coreapi/help/buddy_status.c @@ -59,7 +59,7 @@ static void notify_presence_recv_updated (LinphoneCore *lc, LinphoneFriend *fri ,activity_str ,linphone_address_as_string (friend_address)); } -static void new_subscription_request (LinphoneCore *lc, LinphoneFriend *friend, const char* url) { +static void new_subscription_requested (LinphoneCore *lc, LinphoneFriend *friend, const char* url) { const LinphoneAddress* friend_address = linphone_friend_get_address(friend); printf(" [%s] wants to see your status, accepting\n" ,linphone_address_as_string (friend_address)); @@ -106,11 +106,11 @@ int main(int argc, char *argv[]){ #endif /* Fill the LinphoneCoreVTable with application callbacks. - All are optional. Here we only use the both notify_presence_recv and new_subscription_request callbacks + All are optional. Here we only use the both notify_presence_received and new_subscription_requested callbacks in order to get notifications about friend status. */ - vtable.notify_presence_recv=notify_presence_recv_updated; - vtable.new_subscription_request=new_subscription_request; + vtable.notify_presence_received=notify_presence_recv_updated; + vtable.new_subscription_requested=new_subscription_requested; vtable.registration_state_changed=registration_state_changed; /*just in case sip proxy is used*/ /* diff --git a/coreapi/linphonecore.h b/coreapi/linphonecore.h index 92045740f..68e120bb9 100644 --- a/coreapi/linphonecore.h +++ b/coreapi/linphonecore.h @@ -994,7 +994,7 @@ typedef void (*LinphoneCoreNotifyPresenceReceivedCb)(LinphoneCore *lc, LinphoneF * @param url of the subscriber * Callback prototype */ -typedef void (*LinphoneCoreNewSubscriptionRequestCb)(LinphoneCore *lc, LinphoneFriend *lf, const char *url); +typedef void (*LinphoneCoreNewSubscriptionRequestedCb)(LinphoneCore *lc, LinphoneFriend *lf, const char *url); /** * Callback for requesting authentication information to application or user. * @param lc the LinphoneCore @@ -1076,8 +1076,8 @@ typedef struct _LinphoneCoreVTable{ LinphoneCoreGlobalStateChangedCb global_state_changed; /**NewStringUTF(authentication_token) : NULL); } - static void notify_presence_recv (LinphoneCore *lc, LinphoneFriend *my_friend) { + static void notify_presence_received(LinphoneCore *lc, LinphoneFriend *my_friend) { JNIEnv *env = 0; jint result = jvm->AttachCurrentThread(&env,NULL); if (result != 0) { @@ -490,7 +490,7 @@ public: ,lcData->core ,env->NewObject(lcData->friendClass,lcData->friendCtrId,(jlong)my_friend)); } - static void new_subscription_request (LinphoneCore *lc, LinphoneFriend *my_friend, const char* url) { + static void new_subscription_requested(LinphoneCore *lc, LinphoneFriend *my_friend, const char* url) { JNIEnv *env = 0; jint result = jvm->AttachCurrentThread(&env,NULL); if (result != 0) { diff --git a/coreapi/linphonefriend.h b/coreapi/linphonefriend.h index 0e2bc4c5e..438c1ba0c 100644 --- a/coreapi/linphonefriend.h +++ b/coreapi/linphonefriend.h @@ -37,7 +37,7 @@ extern "C" { typedef enum _LinphoneSubscribePolicy { /** * Does not automatically accept an incoming subscription request. - * This policy implies that a decision has to be taken for each incoming subscription request notified by callback LinphoneCoreVTable.new_subscription_request + * This policy implies that a decision has to be taken for each incoming subscription request notified by callback LinphoneCoreVTable.new_subscription_requested * */ LinphoneSPWait, diff --git a/coreapi/presence.c b/coreapi/presence.c index 1e204316a..e4cd069b9 100644 --- a/coreapi/presence.c +++ b/coreapi/presence.c @@ -1524,9 +1524,9 @@ void linphone_core_add_subscriber(LinphoneCore *lc, const char *subscriber, SalO linphone_friend_set_inc_subscribe_policy(fl,LinphoneSPAccept); fl->inc_subscribe_pending=TRUE; lc->subscribers=ms_list_append(lc->subscribers,(void *)fl); - if (lc->vtable.new_subscription_request!=NULL) { + if (lc->vtable.new_subscription_requested!=NULL) { char *tmp=linphone_address_as_string(fl->uri); - lc->vtable.new_subscription_request(lc,fl,tmp); + lc->vtable.new_subscription_requested(lc,fl,tmp); ms_free(tmp); } } @@ -1958,8 +1958,8 @@ void linphone_notify_recv(LinphoneCore *lc, SalOp *op, SalSubscribeStatus ss, Sa } lf->presence = presence; lf->subscribe_active=TRUE; - if (lc->vtable.notify_presence_recv) - lc->vtable.notify_presence_recv(lc,(LinphoneFriend*)lf); + if (lc->vtable.notify_presence_received) + lc->vtable.notify_presence_received(lc,(LinphoneFriend*)lf); ms_free(tmp); }else{ ms_message("But this person is not part of our friend list, so we don't care."); diff --git a/gtk/main.c b/gtk/main.c index 9f781d2cd..c14b0c75f 100644 --- a/gtk/main.c +++ b/gtk/main.c @@ -237,8 +237,8 @@ static void linphone_gtk_init_liblinphone(const char *config_file, vtable.call_state_changed=linphone_gtk_call_state_changed; vtable.registration_state_changed=linphone_gtk_registration_state_changed; - vtable.notify_presence_recv=linphone_gtk_notify_recv; - vtable.new_subscription_request=linphone_gtk_new_unknown_subscriber; + vtable.notify_presence_received=linphone_gtk_notify_recv; + vtable.new_subscription_requested=linphone_gtk_new_unknown_subscriber; vtable.auth_info_requested=linphone_gtk_auth_info_requested; vtable.display_status=linphone_gtk_display_status; vtable.display_message=linphone_gtk_display_message; diff --git a/tester/liblinphone_tester.c b/tester/liblinphone_tester.c index d9d004c05..6492af82c 100644 --- a/tester/liblinphone_tester.c +++ b/tester/liblinphone_tester.c @@ -187,8 +187,8 @@ LinphoneCoreManager* linphone_core_manager_new2(const char* rc_file, int check_f mgr->v_table.call_state_changed=call_state_changed; mgr->v_table.text_received=text_message_received; mgr->v_table.message_received=message_received; - mgr->v_table.new_subscription_request=new_subscribtion_request; - mgr->v_table.notify_presence_recv=notify_presence_received; + mgr->v_table.new_subscription_requested=new_subscription_requested; + mgr->v_table.notify_presence_received=notify_presence_received; mgr->v_table.transfer_state_changed=linphone_transfer_state_changed; mgr->v_table.info_received=info_message_received; mgr->v_table.subscription_state_changed=linphone_subscription_state_change; diff --git a/tester/liblinphone_tester.h b/tester/liblinphone_tester.h index ae5143671..fa8c7a632 100644 --- a/tester/liblinphone_tester.h +++ b/tester/liblinphone_tester.h @@ -194,7 +194,7 @@ void notify_presence_received(LinphoneCore *lc, LinphoneFriend * lf); void text_message_received(LinphoneCore *lc, LinphoneChatRoom *room, const LinphoneAddress *from_address, const char *message); void message_received(LinphoneCore *lc, LinphoneChatRoom *room, LinphoneChatMessage* message); void info_message_received(LinphoneCore *lc, LinphoneCall *call, const LinphoneInfoMessage *msg); -void new_subscribtion_request(LinphoneCore *lc, LinphoneFriend *lf, const char *url); +void new_subscription_requested(LinphoneCore *lc, LinphoneFriend *lf, const char *url); void auth_info_requested(LinphoneCore *lc, const char *realm, const char *username); void linphone_subscription_state_change(LinphoneCore *lc, LinphoneEvent *ev, LinphoneSubscriptionState state); void linphone_publish_state_changed(LinphoneCore *lc, LinphoneEvent *ev, LinphonePublishState state); diff --git a/tester/presence_tester.c b/tester/presence_tester.c index 688a8b5fc..bb3033f92 100644 --- a/tester/presence_tester.c +++ b/tester/presence_tester.c @@ -31,7 +31,7 @@ static LinphoneCoreManager* presence_linphone_core_manager_new(char* username) { linphone_core_set_primary_contact(mgr->lc,identity_char); return mgr; } -void new_subscribtion_request(LinphoneCore *lc, LinphoneFriend *lf, const char *url){ +void new_subscription_requested(LinphoneCore *lc, LinphoneFriend *lf, const char *url){ char* from=linphone_address_as_string(linphone_friend_get_address(lf)); stats* counters; ms_message("New subscription request from [%s] url [%s]",from,url);