Commit 41d60df0 authored by Ghislain MARY's avatar Ghislain MARY

Normalize event callbacks names.

parent 9a3d935b
......@@ -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;
......
......@@ -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.
......
......@@ -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*/
/*
......
......@@ -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; /**<Notifies global state changes*/
LinphoneCoreRegistrationStateChangedCb registration_state_changed;/**<Notifies registration state changes*/
LinphoneCoreCallStateChangedCb call_state_changed;/**<Notifies call state changes*/
LinphoneCoreNotifyPresenceReceivedCb notify_presence_recv; /**< Notify received presence events*/
LinphoneCoreNewSubscriptionRequestCb new_subscription_request; /**< Notify about pending presence subscription request */
LinphoneCoreNotifyPresenceReceivedCb notify_presence_received; /**< Notify received presence events*/
LinphoneCoreNewSubscriptionRequestedCb new_subscription_requested; /**< Notify about pending presence subscription request */
LinphoneCoreAuthInfoRequestedCb auth_info_requested; /**< Ask the application some authentication information */
LinphoneCoreCallLogUpdatedCb call_log_updated; /**< Notifies that call log list has been updated */
LinphoneCoreMessageReceivedCb message_received; /** a message is received, can be text or external body*/
......@@ -1089,7 +1089,7 @@ typedef struct _LinphoneCoreVTable{
LinphoneCoreCallStatsUpdatedCb call_stats_updated; /**<Notifies on refreshing of call's statistics. */
LinphoneCoreInfoReceivedCb info_received; /**<Notifies an incoming informational message received.*/
LinphoneCoreSubscriptionStateChangedCb subscription_state_changed; /**<Notifies subscription state change */
LinphoneCoreIncomingNotifyCb notify_received; /**< Notifies a an event notification, see linphone_core_subscribe() */
LinphoneCoreNotifyReceivedCb notify_received; /**< Notifies a an event notification, see linphone_core_subscribe() */
LinphoneCorePublishStateChangedCb publish_state_changed;/**Notifies publish state change (only from #LinphoneEvent api)*/
DisplayStatusCb display_status; /**< @deprecated Callback that notifies various events with human readable text.*/
DisplayMessageCb display_message;/**< @deprecated Callback to display a message to the user */
......
......@@ -168,8 +168,8 @@ public:
vTable.text_received = text_received;
vTable.message_received = message_received;
vTable.dtmf_received = dtmf_received;
vTable.new_subscription_request = new_subscription_request;
vTable.notify_presence_recv = notify_presence_recv;
vTable.new_subscription_requested = new_subscription_requested;
vTable.notify_presence_received = notify_presence_received;
vTable.call_stats_updated = callStatsUpdated;
vTable.transfer_state_changed = transferStateChanged;
vTable.info_received = infoReceived;
......@@ -477,7 +477,7 @@ public:
,encrypted
,authentication_token ? env->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) {
......
......@@ -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,
......
......@@ -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.");
......
......@@ -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;
......
......@@ -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;
......
......@@ -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);
......
......@@ -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);
......
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