Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
BC
public
liblinphone
Commits
7cfbbda3
Commit
7cfbbda3
authored
Mar 09, 2016
by
Ghislain MARY
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Python module automatic wrapper generation.
parent
e645eba1
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
198 additions
and
153 deletions
+198
-153
coreapi/carddav.c
coreapi/carddav.c
+13
-13
coreapi/friend.c
coreapi/friend.c
+8
-8
coreapi/friendlist.c
coreapi/friendlist.c
+12
-12
coreapi/friendlist.h
coreapi/friendlist.h
+22
-12
coreapi/linphonefriend.h
coreapi/linphonefriend.h
+3
-3
coreapi/private.h
coreapi/private.h
+5
-5
coreapi/vcard.cc
coreapi/vcard.cc
+24
-24
coreapi/vcard.h
coreapi/vcard.h
+49
-46
coreapi/vcard_stubs.c
coreapi/vcard_stubs.c
+20
-20
tester/vcard_tester.c
tester/vcard_tester.c
+6
-6
tools/python/apixml2python/handwritten_declarations.mustache
tools/python/apixml2python/handwritten_declarations.mustache
+3
-0
tools/python/apixml2python/handwritten_definitions.mustache
tools/python/apixml2python/handwritten_definitions.mustache
+23
-0
tools/python/apixml2python/linphone.py
tools/python/apixml2python/linphone.py
+10
-4
No files found.
coreapi/carddav.c
View file @
7cfbbda3
...
...
@@ -73,8 +73,8 @@ static void linphone_carddav_sync_done(LinphoneCardDavContext *cdc, bool_t succe
}
static
int
find_matching_friend
(
LinphoneFriend
*
lf1
,
LinphoneFriend
*
lf2
)
{
LinphoneV
C
ard
*
lvc1
=
linphone_friend_get_vcard
(
lf1
);
LinphoneV
C
ard
*
lvc2
=
linphone_friend_get_vcard
(
lf2
);
LinphoneV
c
ard
*
lvc1
=
linphone_friend_get_vcard
(
lf1
);
LinphoneV
c
ard
*
lvc2
=
linphone_friend_get_vcard
(
lf2
);
const
char
*
uid1
=
NULL
,
*
uid2
=
NULL
;
if
(
!
lvc1
||
!
lvc2
)
{
return
1
;
...
...
@@ -93,7 +93,7 @@ static void linphone_carddav_vcards_pulled(LinphoneCardDavContext *cdc, MSList *
while
(
vCards
)
{
LinphoneCardDavResponse
*
vCard
=
(
LinphoneCardDavResponse
*
)
vCards
->
data
;
if
(
vCard
)
{
LinphoneV
C
ard
*
lvc
=
linphone_vcard_new_from_vcard4_buffer
(
vCard
->
vcard
);
LinphoneV
c
ard
*
lvc
=
linphone_vcard_new_from_vcard4_buffer
(
vCard
->
vcard
);
LinphoneFriend
*
lf
=
NULL
;
MSList
*
local_friend
=
NULL
;
...
...
@@ -201,7 +201,7 @@ static void linphone_carddav_vcards_fetched(LinphoneCardDavContext *cdc, MSList
LinphoneCardDavResponse
*
response
=
(
LinphoneCardDavResponse
*
)
vCard
->
data
;
ms_debug
(
"Local friend %s is in the remote vCard list, check eTag"
,
linphone_friend_get_name
(
lf
));
if
(
response
)
{
LinphoneV
C
ard
*
lvc
=
linphone_friend_get_vcard
(
lf
);
LinphoneV
c
ard
*
lvc
=
linphone_friend_get_vcard
(
lf
);
const
char
*
etag
=
linphone_vcard_get_etag
(
lvc
);
ms_debug
(
"Local friend eTag is %s, remote vCard eTag is %s"
,
etag
,
response
->
etag
);
if
(
lvc
&&
etag
&&
strcmp
(
etag
,
response
->
etag
)
==
0
)
{
...
...
@@ -333,7 +333,7 @@ static void process_response_from_carddav_request(void *data, const belle_http_r
{
belle_sip_header_t
*
header
=
belle_sip_message_get_header
((
belle_sip_message_t
*
)
event
->
response
,
"ETag"
);
LinphoneFriend
*
lf
=
(
LinphoneFriend
*
)
query
->
user_data
;
LinphoneV
C
ard
*
lvc
=
linphone_friend_get_vcard
(
lf
);
LinphoneV
c
ard
*
lvc
=
linphone_friend_get_vcard
(
lf
);
if
(
lf
&&
lvc
)
{
if
(
header
)
{
const
char
*
etag
=
belle_sip_header_get_unparsed_value
(
header
);
...
...
@@ -465,7 +465,7 @@ static void linphone_carddav_send_query(LinphoneCardDavQuery *query) {
belle_http_provider_send_request
(
query
->
context
->
friend_list
->
lc
->
http_provider
,
req
,
query
->
http_request_listener
);
}
static
LinphoneCardDavQuery
*
linphone_carddav_create_put_query
(
LinphoneCardDavContext
*
cdc
,
LinphoneV
C
ard
*
lvc
)
{
static
LinphoneCardDavQuery
*
linphone_carddav_create_put_query
(
LinphoneCardDavContext
*
cdc
,
LinphoneV
c
ard
*
lvc
)
{
LinphoneCardDavQuery
*
query
=
(
LinphoneCardDavQuery
*
)
ms_new0
(
LinphoneCardDavQuery
,
1
);
query
->
context
=
cdc
;
query
->
depth
=
NULL
;
...
...
@@ -494,7 +494,7 @@ static char* generate_url_from_server_address_and_uid(const char *server_url) {
}
void
linphone_carddav_put_vcard
(
LinphoneCardDavContext
*
cdc
,
LinphoneFriend
*
lf
)
{
LinphoneV
C
ard
*
lvc
=
linphone_friend_get_vcard
(
lf
);
LinphoneV
c
ard
*
lvc
=
linphone_friend_get_vcard
(
lf
);
if
(
lvc
)
{
LinphoneCardDavQuery
*
query
=
NULL
;
if
(
!
linphone_vcard_get_uid
(
lvc
))
{
...
...
@@ -522,7 +522,7 @@ void linphone_carddav_put_vcard(LinphoneCardDavContext *cdc, LinphoneFriend *lf)
}
else
{
const
char
*
msg
=
NULL
;
if
(
!
lvc
)
{
msg
=
"LinphoneV
C
ard is NULL"
;
msg
=
"LinphoneV
c
ard is NULL"
;
}
else
{
msg
=
"Unknown error"
;
}
...
...
@@ -537,7 +537,7 @@ void linphone_carddav_put_vcard(LinphoneCardDavContext *cdc, LinphoneFriend *lf)
}
}
static
LinphoneCardDavQuery
*
linphone_carddav_create_delete_query
(
LinphoneCardDavContext
*
cdc
,
LinphoneV
C
ard
*
lvc
)
{
static
LinphoneCardDavQuery
*
linphone_carddav_create_delete_query
(
LinphoneCardDavContext
*
cdc
,
LinphoneV
c
ard
*
lvc
)
{
LinphoneCardDavQuery
*
query
=
(
LinphoneCardDavQuery
*
)
ms_new0
(
LinphoneCardDavQuery
,
1
);
query
->
context
=
cdc
;
query
->
depth
=
NULL
;
...
...
@@ -550,7 +550,7 @@ static LinphoneCardDavQuery* linphone_carddav_create_delete_query(LinphoneCardDa
}
void
linphone_carddav_delete_vcard
(
LinphoneCardDavContext
*
cdc
,
LinphoneFriend
*
lf
)
{
LinphoneV
C
ard
*
lvc
=
linphone_friend_get_vcard
(
lf
);
LinphoneV
c
ard
*
lvc
=
linphone_friend_get_vcard
(
lf
);
if
(
lvc
&&
linphone_vcard_get_uid
(
lvc
)
&&
linphone_vcard_get_etag
(
lvc
))
{
LinphoneCardDavQuery
*
query
=
NULL
;
...
...
@@ -574,11 +574,11 @@ void linphone_carddav_delete_vcard(LinphoneCardDavContext *cdc, LinphoneFriend *
}
else
{
const
char
*
msg
=
NULL
;
if
(
!
lvc
)
{
msg
=
"LinphoneV
C
ard is NULL"
;
msg
=
"LinphoneV
c
ard is NULL"
;
}
else
if
(
!
linphone_vcard_get_uid
(
lvc
))
{
msg
=
"LinphoneV
C
ard doesn't have an UID"
;
msg
=
"LinphoneV
c
ard doesn't have an UID"
;
}
else
if
(
!
linphone_vcard_get_etag
(
lvc
))
{
msg
=
"LinphoneV
C
ard doesn't have an eTag"
;
msg
=
"LinphoneV
c
ard doesn't have an eTag"
;
}
if
(
msg
)
{
...
...
coreapi/friend.c
View file @
7cfbbda3
...
...
@@ -197,7 +197,7 @@ void linphone_core_interpret_friend_uri(LinphoneCore *lc, const char *uri, char
int
linphone_friend_set_address
(
LinphoneFriend
*
lf
,
const
LinphoneAddress
*
addr
){
LinphoneAddress
*
fr
=
linphone_address_clone
(
addr
);
LinphoneV
C
ard
*
vcard
=
NULL
;
LinphoneV
c
ard
*
vcard
=
NULL
;
linphone_address_clean
(
fr
);
if
(
lf
->
uri
!=
NULL
)
linphone_address_unref
(
lf
->
uri
);
...
...
@@ -213,7 +213,7 @@ int linphone_friend_set_address(LinphoneFriend *lf, const LinphoneAddress *addr)
int
linphone_friend_set_name
(
LinphoneFriend
*
lf
,
const
char
*
name
){
LinphoneAddress
*
fr
=
lf
->
uri
;
LinphoneV
C
ard
*
vcard
=
NULL
;
LinphoneV
c
ard
*
vcard
=
NULL
;
bool_t
vcard_created
=
FALSE
;
vcard
=
linphone_friend_get_vcard
(
lf
);
...
...
@@ -833,14 +833,14 @@ void linphone_friend_destroy(LinphoneFriend *lf) {
linphone_friend_unref
(
lf
);
}
LinphoneV
C
ard
*
linphone_friend_get_vcard
(
LinphoneFriend
*
fr
)
{
LinphoneV
c
ard
*
linphone_friend_get_vcard
(
LinphoneFriend
*
fr
)
{
if
(
fr
)
{
return
fr
->
vcard
;
}
return
NULL
;
}
void
linphone_friend_set_vcard
(
LinphoneFriend
*
fr
,
LinphoneV
C
ard
*
vcard
)
{
void
linphone_friend_set_vcard
(
LinphoneFriend
*
fr
,
LinphoneV
c
ard
*
vcard
)
{
if
(
!
fr
)
{
return
;
}
...
...
@@ -853,7 +853,7 @@ void linphone_friend_set_vcard(LinphoneFriend *fr, LinphoneVCard *vcard) {
}
bool_t
linphone_friend_create_vcard
(
LinphoneFriend
*
fr
,
const
char
*
name
)
{
LinphoneV
C
ard
*
vcard
=
NULL
;
LinphoneV
c
ard
*
vcard
=
NULL
;
const
char
*
fullName
=
NULL
;
LinphoneAddress
*
addr
=
NULL
;
...
...
@@ -890,7 +890,7 @@ bool_t linphone_friend_create_vcard(LinphoneFriend *fr, const char *name) {
return
TRUE
;
}
LinphoneFriend
*
linphone_friend_new_from_vcard
(
LinphoneV
C
ard
*
vcard
)
{
LinphoneFriend
*
linphone_friend_new_from_vcard
(
LinphoneV
c
ard
*
vcard
)
{
LinphoneAddress
*
linphone_address
=
NULL
;
LinphoneFriend
*
fr
;
const
char
*
name
=
NULL
;
...
...
@@ -1064,7 +1064,7 @@ static int create_friend_list(void *data, int argc, char **argv, char **colName)
static
int
create_friend
(
void
*
data
,
int
argc
,
char
**
argv
,
char
**
colName
)
{
MSList
**
list
=
(
MSList
**
)
data
;
LinphoneFriend
*
lf
=
NULL
;
LinphoneV
C
ard
*
vcard
=
NULL
;
LinphoneV
c
ard
*
vcard
=
NULL
;
unsigned
int
storage_id
=
atoi
(
argv
[
0
]);
vcard
=
linphone_vcard_new_from_vcard4_buffer
(
argv
[
6
]);
...
...
@@ -1127,7 +1127,7 @@ void linphone_core_store_friend_in_db(LinphoneCore *lc, LinphoneFriend *lf) {
if
(
lc
&&
lc
->
friends_db
)
{
char
*
buf
;
int
store_friends
=
lp_config_get_int
(
lc
->
config
,
"misc"
,
"store_friends"
,
1
);
LinphoneV
C
ard
*
vcard
=
linphone_friend_get_vcard
(
lf
);
LinphoneV
c
ard
*
vcard
=
linphone_friend_get_vcard
(
lf
);
if
(
!
store_friends
)
{
return
;
...
...
coreapi/friendlist.c
View file @
7cfbbda3
...
...
@@ -56,35 +56,35 @@ void linphone_friend_list_cbs_set_user_data(LinphoneFriendListCbs *cbs, void *ud
cbs
->
user_data
=
ud
;
}
LinphoneFriendListContactCreatedCb
linphone_friend_list_cbs_get_contact_created
(
const
LinphoneFriendListCbs
*
cbs
)
{
LinphoneFriendListC
bsC
ontactCreatedCb
linphone_friend_list_cbs_get_contact_created
(
const
LinphoneFriendListCbs
*
cbs
)
{
return
cbs
->
contact_created_cb
;
}
void
linphone_friend_list_cbs_set_contact_created
(
LinphoneFriendListCbs
*
cbs
,
LinphoneFriendListContactCreatedCb
cb
)
{
void
linphone_friend_list_cbs_set_contact_created
(
LinphoneFriendListCbs
*
cbs
,
LinphoneFriendListC
bsC
ontactCreatedCb
cb
)
{
cbs
->
contact_created_cb
=
cb
;
}
LinphoneFriendListContactDeletedCb
linphone_friend_list_cbs_get_contact_deleted
(
const
LinphoneFriendListCbs
*
cbs
)
{
LinphoneFriendListC
bsC
ontactDeletedCb
linphone_friend_list_cbs_get_contact_deleted
(
const
LinphoneFriendListCbs
*
cbs
)
{
return
cbs
->
contact_deleted_cb
;
}
void
linphone_friend_list_cbs_set_contact_deleted
(
LinphoneFriendListCbs
*
cbs
,
LinphoneFriendListContactDeletedCb
cb
)
{
void
linphone_friend_list_cbs_set_contact_deleted
(
LinphoneFriendListCbs
*
cbs
,
LinphoneFriendListC
bsC
ontactDeletedCb
cb
)
{
cbs
->
contact_deleted_cb
=
cb
;
}
LinphoneFriendListContactUpdatedCb
linphone_friend_list_cbs_get_contact_updated
(
const
LinphoneFriendListCbs
*
cbs
)
{
LinphoneFriendListC
bsC
ontactUpdatedCb
linphone_friend_list_cbs_get_contact_updated
(
const
LinphoneFriendListCbs
*
cbs
)
{
return
cbs
->
contact_updated_cb
;
}
void
linphone_friend_list_cbs_set_contact_updated
(
LinphoneFriendListCbs
*
cbs
,
LinphoneFriendListContactUpdatedCb
cb
)
{
void
linphone_friend_list_cbs_set_contact_updated
(
LinphoneFriendListCbs
*
cbs
,
LinphoneFriendListC
bsC
ontactUpdatedCb
cb
)
{
cbs
->
contact_updated_cb
=
cb
;
}
LinphoneFriendListSyncStateChangedCb
linphone_friend_list_cbs_get_sync_status_changed
(
const
LinphoneFriendListCbs
*
cbs
)
{
LinphoneFriendList
Cbs
SyncStateChangedCb
linphone_friend_list_cbs_get_sync_status_changed
(
const
LinphoneFriendListCbs
*
cbs
)
{
return
cbs
->
sync_state_changed_cb
;
}
void
linphone_friend_list_cbs_set_sync_status_changed
(
LinphoneFriendListCbs
*
cbs
,
LinphoneFriendListSyncStateChangedCb
cb
)
{
void
linphone_friend_list_cbs_set_sync_status_changed
(
LinphoneFriendListCbs
*
cbs
,
LinphoneFriendList
Cbs
SyncStateChangedCb
cb
)
{
cbs
->
sync_state_changed_cb
=
cb
;
}
...
...
@@ -448,7 +448,7 @@ static LinphoneFriendListStatus _linphone_friend_list_remove_friend(LinphoneFrie
linphone_core_remove_friend_from_db
(
lf
->
lc
,
lf
);
#endif
if
(
remove_from_server
)
{
LinphoneV
C
ard
*
lvc
=
linphone_friend_get_vcard
(
lf
);
LinphoneV
c
ard
*
lvc
=
linphone_friend_get_vcard
(
lf
);
if
(
lvc
&&
linphone_vcard_get_uid
(
lvc
))
{
LinphoneCardDavContext
*
cdc
=
linphone_carddav_context_new
(
list
);
if
(
cdc
)
{
...
...
@@ -757,7 +757,7 @@ int linphone_friend_list_import_friends_from_vcard4_file(LinphoneFriendList *lis
}
while
(
vcards
!=
NULL
&&
vcards
->
data
!=
NULL
)
{
LinphoneV
C
ard
*
vcard
=
(
LinphoneV
C
ard
*
)
vcards
->
data
;
LinphoneV
c
ard
*
vcard
=
(
LinphoneV
c
ard
*
)
vcards
->
data
;
LinphoneFriend
*
lf
=
linphone_friend_new_from_vcard
(
vcard
);
if
(
lf
)
{
if
(
LinphoneFriendListOK
==
linphone_friend_list_import_friend
(
list
,
lf
,
TRUE
))
{
...
...
@@ -793,7 +793,7 @@ int linphone_friend_list_import_friends_from_vcard4_buffer(LinphoneFriendList *l
}
while
(
vcards
!=
NULL
&&
vcards
->
data
!=
NULL
)
{
LinphoneV
C
ard
*
vcard
=
(
LinphoneV
C
ard
*
)
vcards
->
data
;
LinphoneV
c
ard
*
vcard
=
(
LinphoneV
c
ard
*
)
vcards
->
data
;
LinphoneFriend
*
lf
=
linphone_friend_new_from_vcard
(
vcard
);
if
(
lf
)
{
if
(
LinphoneFriendListOK
==
linphone_friend_list_import_friend
(
list
,
lf
,
TRUE
))
{
...
...
@@ -826,7 +826,7 @@ void linphone_friend_list_export_friends_as_vcard4_file(LinphoneFriendList *list
#endif
while
(
friends
!=
NULL
&&
friends
->
data
!=
NULL
)
{
LinphoneFriend
*
lf
=
(
LinphoneFriend
*
)
friends
->
data
;
LinphoneV
C
ard
*
vcard
=
linphone_friend_get_vcard
(
lf
);
LinphoneV
c
ard
*
vcard
=
linphone_friend_get_vcard
(
lf
);
if
(
vcard
)
{
const
char
*
vcard_text
=
linphone_vcard_as_vcard4_string
(
vcard
);
fprintf
(
file
,
"%s"
,
vcard_text
);
...
...
coreapi/friendlist.h
View file @
7cfbbda3
...
...
@@ -248,23 +248,33 @@ typedef struct _LinphoneFriendListCbs LinphoneFriendListCbs;
/**
* Callback used to notify a new contact has been created on the CardDAV server and downloaded locally
* @param list The LinphoneFriendList object the new contact is added to
* @param lf The LinphoneFriend object that has been created
**/
typedef
void
(
*
LinphoneFriendListContactCreatedCb
)(
LinphoneFriendList
*
list
,
LinphoneFriend
*
lf
);
typedef
void
(
*
LinphoneFriendListC
bsC
ontactCreatedCb
)(
LinphoneFriendList
*
list
,
LinphoneFriend
*
lf
);
/**
* Callback used to notify a contact has been deleted on the CardDAV server
* @param list The LinphoneFriendList object a contact has been removed from
* @param lf The LinphoneFriend object that has been deleted
**/
typedef
void
(
*
LinphoneFriendListContactDeletedCb
)(
LinphoneFriendList
*
list
,
LinphoneFriend
*
lf
);
typedef
void
(
*
LinphoneFriendListC
bsC
ontactDeletedCb
)(
LinphoneFriendList
*
list
,
LinphoneFriend
*
lf
);
/**
* Callback used to notify a contact has been updated on the CardDAV server
* @param list The LinphoneFriendList object in which a contact has been updated
* @param new_friend The new LinphoneFriend object corresponding to the updated contact
* @param old_friend The old LinphoneFriend object before update
**/
typedef
void
(
*
LinphoneFriendListContactUpdatedCb
)(
LinphoneFriendList
*
list
,
LinphoneFriend
*
new_friend
,
LinphoneFriend
*
old_friend
);
typedef
void
(
*
LinphoneFriendListC
bsC
ontactUpdatedCb
)(
LinphoneFriendList
*
list
,
LinphoneFriend
*
new_friend
,
LinphoneFriend
*
old_friend
);
/**
* Callback used to notify the status of the synchronization has changed
* @param list The LinphoneFriendList object for which the status has changed
* @param status The new synchronisation status
* @param msg An additional information on the status update
**/
typedef
void
(
*
LinphoneFriendListSyncStateChangedCb
)(
LinphoneFriendList
*
list
,
LinphoneFriendListSyncStatus
status
,
const
char
*
msg
);
typedef
void
(
*
LinphoneFriendList
Cbs
SyncStateChangedCb
)(
LinphoneFriendList
*
list
,
LinphoneFriendListSyncStatus
status
,
const
char
*
msg
);
/**
* Get the LinphoneFriendListCbs object associated with a LinphoneFriendList.
...
...
@@ -305,56 +315,56 @@ LINPHONE_PUBLIC void linphone_friend_list_cbs_set_user_data(LinphoneFriendListCb
* @param[in] cbs LinphoneFriendListCbs object.
* @return The current contact created callback.
**/
LINPHONE_PUBLIC
LinphoneFriendListContactCreatedCb
linphone_friend_list_cbs_get_contact_created
(
const
LinphoneFriendListCbs
*
cbs
);
LINPHONE_PUBLIC
LinphoneFriendListC
bsC
ontactCreatedCb
linphone_friend_list_cbs_get_contact_created
(
const
LinphoneFriendListCbs
*
cbs
);
/**
* Set the contact created callback.
* @param[in] cbs LinphoneFriendListCbs object.
* @param[in] cb The contact created to be used.
**/
LINPHONE_PUBLIC
void
linphone_friend_list_cbs_set_contact_created
(
LinphoneFriendListCbs
*
cbs
,
LinphoneFriendListContactCreatedCb
cb
);
LINPHONE_PUBLIC
void
linphone_friend_list_cbs_set_contact_created
(
LinphoneFriendListCbs
*
cbs
,
LinphoneFriendListC
bsC
ontactCreatedCb
cb
);
/**
* Get the contact deleted callback.
* @param[in] cbs LinphoneFriendListCbs object.
* @return The current contact deleted callback.
**/
LINPHONE_PUBLIC
LinphoneFriendListContactDeletedCb
linphone_friend_list_cbs_get_contact_deleted
(
const
LinphoneFriendListCbs
*
cbs
);
LINPHONE_PUBLIC
LinphoneFriendListC
bsC
ontactDeletedCb
linphone_friend_list_cbs_get_contact_deleted
(
const
LinphoneFriendListCbs
*
cbs
);
/**
* Set the contact deleted callback.
* @param[in] cbs LinphoneFriendListCbs object.
* @param[in] cb The contact deleted to be used.
**/
LINPHONE_PUBLIC
void
linphone_friend_list_cbs_set_contact_deleted
(
LinphoneFriendListCbs
*
cbs
,
LinphoneFriendListContactDeletedCb
cb
);
LINPHONE_PUBLIC
void
linphone_friend_list_cbs_set_contact_deleted
(
LinphoneFriendListCbs
*
cbs
,
LinphoneFriendListC
bsC
ontactDeletedCb
cb
);
/**
* Get the contact updated callback.
* @param[in] cbs LinphoneFriendListCbs object.
* @return The current contact updated callback.
**/
LINPHONE_PUBLIC
LinphoneFriendListContactUpdatedCb
linphone_friend_list_cbs_get_contact_updated
(
const
LinphoneFriendListCbs
*
cbs
);
LINPHONE_PUBLIC
LinphoneFriendListC
bsC
ontactUpdatedCb
linphone_friend_list_cbs_get_contact_updated
(
const
LinphoneFriendListCbs
*
cbs
);
/**
* Set the contact updated callback.
* @param[in] cbs LinphoneFriendListCbs object.
* @param[in] cb The contact updated to be used.
**/
LINPHONE_PUBLIC
void
linphone_friend_list_cbs_set_contact_updated
(
LinphoneFriendListCbs
*
cbs
,
LinphoneFriendListContactUpdatedCb
cb
);
LINPHONE_PUBLIC
void
linphone_friend_list_cbs_set_contact_updated
(
LinphoneFriendListCbs
*
cbs
,
LinphoneFriendListC
bsC
ontactUpdatedCb
cb
);
/**
* Get the sync status changed callback.
* @param[in] cbs LinphoneFriendListCbs object.
* @return The current sync status changedcallback.
**/
LINPHONE_PUBLIC
LinphoneFriendListSyncStateChangedCb
linphone_friend_list_cbs_get_sync_status_changed
(
const
LinphoneFriendListCbs
*
cbs
);
LINPHONE_PUBLIC
LinphoneFriendList
Cbs
SyncStateChangedCb
linphone_friend_list_cbs_get_sync_status_changed
(
const
LinphoneFriendListCbs
*
cbs
);
/**
* Set the contact updated callback.
* @param[in] cbs LinphoneFriendListCbs object.
* @param[in] cb The sync status changed to be used.
**/
LINPHONE_PUBLIC
void
linphone_friend_list_cbs_set_sync_status_changed
(
LinphoneFriendListCbs
*
cbs
,
LinphoneFriendListSyncStateChangedCb
cb
);
LINPHONE_PUBLIC
void
linphone_friend_list_cbs_set_sync_status_changed
(
LinphoneFriendListCbs
*
cbs
,
LinphoneFriendList
Cbs
SyncStateChangedCb
cb
);
/**
* Starts a CardDAV synchronization using value set using linphone_friend_list_set_uri.
...
...
coreapi/linphonefriend.h
View file @
7cfbbda3
...
...
@@ -437,14 +437,14 @@ LINPHONE_PUBLIC LinphoneCore *linphone_friend_get_core(const LinphoneFriend *fr)
* Returns the vCard object associated to this friend, if any
* @param[in] fr LinphoneFriend object
*/
LINPHONE_PUBLIC
LinphoneV
C
ard
*
linphone_friend_get_vcard
(
LinphoneFriend
*
fr
);
LINPHONE_PUBLIC
LinphoneV
c
ard
*
linphone_friend_get_vcard
(
LinphoneFriend
*
fr
);
/**
* Binds a vCard object to a friend
* @param[in] fr LinphoneFriend object
* @param[in] vcard The vCard object to bind
*/
LINPHONE_PUBLIC
void
linphone_friend_set_vcard
(
LinphoneFriend
*
fr
,
LinphoneV
C
ard
*
vcard
);
LINPHONE_PUBLIC
void
linphone_friend_set_vcard
(
LinphoneFriend
*
fr
,
LinphoneV
c
ard
*
vcard
);
/**
* Creates a vCard object associated to this friend if there isn't one yet and if the full name is available, either by the parameter or the one in the friend's SIP URI
...
...
@@ -459,7 +459,7 @@ LINPHONE_PUBLIC bool_t linphone_friend_create_vcard(LinphoneFriend *fr, const ch
* @param vcard a vCard object
* @return a new #LinphoneFriend with \link linphone_friend_get_vcard() vCard initialized \endlink
*/
LINPHONE_PUBLIC
LinphoneFriend
*
linphone_friend_new_from_vcard
(
LinphoneV
C
ard
*
vcard
);
LINPHONE_PUBLIC
LinphoneFriend
*
linphone_friend_new_from_vcard
(
LinphoneV
c
ard
*
vcard
);
/**
* Sets the database filename where friends will be stored.
...
...
coreapi/private.h
View file @
7cfbbda3
...
...
@@ -694,7 +694,7 @@ struct _LinphoneFriend{
bool_t
commit
;
bool_t
initial_subscribes_sent
;
/*used to know if initial subscribe message was sent or not*/
bool_t
presence_received
;
LinphoneV
C
ard
*
vcard
;
LinphoneV
c
ard
*
vcard
;
unsigned
int
storage_id
;
LinphoneFriendList
*
friend_list
;
};
...
...
@@ -704,10 +704,10 @@ BELLE_SIP_DECLARE_VPTR(LinphoneFriend);
struct
_LinphoneFriendListCbs
{
belle_sip_object_t
base
;
void
*
user_data
;
LinphoneFriendListContactCreatedCb
contact_created_cb
;
LinphoneFriendListContactDeletedCb
contact_deleted_cb
;
LinphoneFriendListContactUpdatedCb
contact_updated_cb
;
LinphoneFriendListSyncStateChangedCb
sync_state_changed_cb
;
LinphoneFriendListC
bsC
ontactCreatedCb
contact_created_cb
;
LinphoneFriendListC
bsC
ontactDeletedCb
contact_deleted_cb
;
LinphoneFriendListC
bsC
ontactUpdatedCb
contact_updated_cb
;
LinphoneFriendList
Cbs
SyncStateChangedCb
sync_state_changed_cb
;
};
BELLE_SIP_DECLARE_VPTR
(
LinphoneFriendListCbs
);
...
...
coreapi/vcard.cc
View file @
7cfbbda3
...
...
@@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "sal/sal.h"
#include <bctoolbox/crypto.h>
struct
_LinphoneV
C
ard
{
struct
_LinphoneV
c
ard
{
shared_ptr
<
belcard
::
BelCard
>
belCard
;
char
*
etag
;
char
*
url
;
...
...
@@ -34,13 +34,13 @@ struct _LinphoneVCard {
extern
"C"
{
#endif
LinphoneV
C
ard
*
linphone_vcard_new
(
void
)
{
LinphoneV
C
ard
*
vCard
=
(
LinphoneV
C
ard
*
)
ms_new0
(
LinphoneV
C
ard
,
1
);
LinphoneV
c
ard
*
linphone_vcard_new
(
void
)
{
LinphoneV
c
ard
*
vCard
=
(
LinphoneV
c
ard
*
)
ms_new0
(
LinphoneV
c
ard
,
1
);
vCard
->
belCard
=
belcard
::
BelCardGeneric
::
create
<
belcard
::
BelCard
>
();
return
vCard
;
}
void
linphone_vcard_free
(
LinphoneV
C
ard
*
vCard
)
{
void
linphone_vcard_free
(
LinphoneV
c
ard
*
vCard
)
{
if
(
!
vCard
)
return
;
vCard
->
belCard
.
reset
();
...
...
@@ -55,7 +55,7 @@ MSList* linphone_vcard_list_from_vcard4_file(const char *filename) {
if
(
belCards
)
{
for
(
auto
it
=
belCards
->
getCards
().
begin
();
it
!=
belCards
->
getCards
().
end
();
++
it
)
{
shared_ptr
<
belcard
::
BelCard
>
belcard
=
(
*
it
);
LinphoneV
C
ard
*
vCard
=
linphone_vcard_new
();
LinphoneV
c
ard
*
vCard
=
linphone_vcard_new
();
vCard
->
belCard
=
belcard
;
result
=
ms_list_append
(
result
,
vCard
);
}
...
...
@@ -72,7 +72,7 @@ MSList* linphone_vcard_list_from_vcard4_buffer(const char *buffer) {
if
(
belCards
)
{
for
(
auto
it
=
belCards
->
getCards
().
begin
();
it
!=
belCards
->
getCards
().
end
();
++
it
)
{
shared_ptr
<
belcard
::
BelCard
>
belCard
=
(
*
it
);
LinphoneV
C
ard
*
vCard
=
linphone_vcard_new
();
LinphoneV
c
ard
*
vCard
=
linphone_vcard_new
();
vCard
->
belCard
=
belCard
;
result
=
ms_list_append
(
result
,
vCard
);
}
...
...
@@ -81,8 +81,8 @@ MSList* linphone_vcard_list_from_vcard4_buffer(const char *buffer) {
return
result
;
}
LinphoneV
C
ard
*
linphone_vcard_new_from_vcard4_buffer
(
const
char
*
buffer
)
{
LinphoneV
C
ard
*
vCard
=
NULL
;
LinphoneV
c
ard
*
linphone_vcard_new_from_vcard4_buffer
(
const
char
*
buffer
)
{
LinphoneV
c
ard
*
vCard
=
NULL
;
if
(
buffer
)
{
belcard
::
BelCardParser
parser
=
belcard
::
BelCardParser
::
getInstance
();
shared_ptr
<
belcard
::
BelCard
>
belCard
=
parser
.
parseOne
(
buffer
);
...
...
@@ -96,13 +96,13 @@ LinphoneVCard* linphone_vcard_new_from_vcard4_buffer(const char *buffer) {
return
vCard
;
}
const
char
*
linphone_vcard_as_vcard4_string
(
LinphoneV
C
ard
*
vCard
)
{
const
char
*
linphone_vcard_as_vcard4_string
(
LinphoneV
c
ard
*
vCard
)
{
if
(
!
vCard
)
return
NULL
;
return
vCard
->
belCard
->
toFoldedString
().
c_str
();
}
void
linphone_vcard_set_full_name
(
LinphoneV
C
ard
*
vCard
,
const
char
*
name
)
{
void
linphone_vcard_set_full_name
(
LinphoneV
c
ard
*
vCard
,
const
char
*
name
)
{
if
(
!
vCard
||
!
name
)
return
;
shared_ptr
<
belcard
::
BelCardFullName
>
fn
=
belcard
::
BelCardGeneric
::
create
<
belcard
::
BelCardFullName
>
();
...
...
@@ -110,14 +110,14 @@ void linphone_vcard_set_full_name(LinphoneVCard *vCard, const char *name) {
vCard
->
belCard
->
setFullName
(
fn
);
}
const
char
*
linphone_vcard_get_full_name
(
const
LinphoneV
C
ard
*
vCard
)
{
const
char
*
linphone_vcard_get_full_name
(
const
LinphoneV
c
ard
*
vCard
)
{
if
(
!
vCard
)
return
NULL
;
const
char
*
result
=
vCard
->
belCard
->
getFullName
()
?
vCard
->
belCard
->
getFullName
()
->
getValue
().
c_str
()
:
NULL
;
return
result
;
}
void
linphone_vcard_add_sip_address
(
LinphoneV
C
ard
*
vCard
,
const
char
*
sip_address
)
{
void
linphone_vcard_add_sip_address
(
LinphoneV
c
ard
*
vCard
,
const
char
*
sip_address
)
{
if
(
!
vCard
||
!
sip_address
)
return
;
shared_ptr
<
belcard
::
BelCardImpp
>
impp
=
belcard
::
BelCardGeneric
::
create
<
belcard
::
BelCardImpp
>
();
...
...
@@ -125,7 +125,7 @@ void linphone_vcard_add_sip_address(LinphoneVCard *vCard, const char *sip_addres
vCard
->
belCard
->
addImpp
(
impp
);
}
void
linphone_vcard_remove_sip_address
(
LinphoneV
C
ard
*
vCard
,
const
char
*
sip_address
)
{
void
linphone_vcard_remove_sip_address
(
LinphoneV
c
ard
*
vCard
,
const
char
*
sip_address
)
{
if
(
!
vCard
)
return
;
for
(
auto
it
=
vCard
->
belCard
->
getImpp
().
begin
();
it
!=
vCard
->
belCard
->
getImpp
().
end
();
++
it
)
{
...
...
@@ -137,7 +137,7 @@ void linphone_vcard_remove_sip_address(LinphoneVCard *vCard, const char *sip_add
}
}
void
linphone_vcard_edit_main_sip_address
(
LinphoneV
C
ard
*
vCard
,
const
char
*
sip_address
)
{
void
linphone_vcard_edit_main_sip_address
(
LinphoneV
c
ard
*
vCard
,
const
char
*
sip_address
)
{
if
(
!
vCard
||
!
sip_address
)
return
;
if
(
vCard
->
belCard
->
getImpp
().
size
()
>
0
)
{
...
...
@@ -150,7 +150,7 @@ void linphone_vcard_edit_main_sip_address(LinphoneVCard *vCard, const char *sip_
}
}
MSList
*
linphone_vcard_get_sip_addresses
(
const
LinphoneV
C
ard
*
vCard
)
{
MSList
*
linphone_vcard_get_sip_addresses
(
const
LinphoneV
c
ard
*
vCard
)
{
MSList
*
result
=
NULL
;
if
(
!
vCard
)
return
NULL
;
...
...
@@ -163,7 +163,7 @@ MSList* linphone_vcard_get_sip_addresses(const LinphoneVCard *vCard) {
return
result
;
}
bool_t
linphone_vcard_generate_unique_id
(
LinphoneV
C
ard
*
vCard
)
{
bool_t
linphone_vcard_generate_unique_id
(
LinphoneV
c
ard
*
vCard
)
{
char
uuid
[
64
];
if
(
vCard
)
{
...
...
@@ -180,7 +180,7 @@ bool_t linphone_vcard_generate_unique_id(LinphoneVCard *vCard) {
return
FALSE
;
}
void
linphone_vcard_set_uid
(
LinphoneV
C
ard
*
vCard
,
const
char
*
uid
)
{
void
linphone_vcard_set_uid
(
LinphoneV
c
ard
*
vCard
,
const
char
*
uid
)
{
if
(
!
vCard
||
!
uid
)
return
;
shared_ptr
<
belcard
::
BelCardUniqueId
>
uniqueId
=
belcard
::
BelCardGeneric
::
create
<
belcard
::
BelCardUniqueId
>
();
...
...
@@ -188,14 +188,14 @@ void linphone_vcard_set_uid(LinphoneVCard *vCard, const char *uid) {
vCard
->
belCard
->
setUniqueId
(
uniqueId
);
}
const
char
*
linphone_vcard_get_uid
(
const
LinphoneV
C
ard
*
vCard
)
{
const
char
*
linphone_vcard_get_uid
(
const
LinphoneV
c
ard
*
vCard
)
{
if
(
vCard
&&
vCard
->
belCard
->
getUniqueId
())
{
return
vCard
->
belCard
->
getUniqueId
()
->
getValue
().
c_str
();
}
return
NULL
;
}
void
linphone_vcard_set_etag
(
LinphoneV
C
ard
*
vCard
,
const
char
*
etag
)
{
void
linphone_vcard_set_etag
(
LinphoneV
c
ard
*
vCard
,
const
char
*
etag
)
{
if
(
!
vCard
)
{
return
;
}
...
...
@@ -205,12 +205,12 @@ void linphone_vcard_set_etag(LinphoneVCard *vCard, const char * etag) {
vCard
->
etag
=
ms_strdup
(
etag
);
}
const
char
*
linphone_vcard_get_etag
(
const
LinphoneV
C
ard
*
vCard
)
{
const
char
*
linphone_vcard_get_etag
(
const
LinphoneV
c
ard
*
vCard
)
{
if
(
!
vCard
)
return
NULL
;
return
vCard
->
etag
;
}
void
linphone_vcard_set_url
(
LinphoneV
C
ard
*
vCard
,
const
char
*
url
)
{
void
linphone_vcard_set_url
(
LinphoneV
c
ard
*
vCard
,
const
char
*
url
)
{
if
(
!
vCard
)
{
return
;
}
...
...
@@ -220,14 +220,14 @@ void linphone_vcard_set_url(LinphoneVCard *vCard, const char * url) {
vCard
->
url
=
ms_strdup
(
url
);
}
const
char
*
linphone_vcard_get_url
(
const
LinphoneV
C
ard
*
vCard
)
{
const
char
*
linphone_vcard_get_url
(
const
LinphoneV
c
ard
*
vCard
)
{
if
(
!
vCard
)
return
NULL
;
return
vCard
->
url
;
}
#define VCARD_MD5_HASH_SIZE 16
void
linphone_vcard_compute_md5_hash
(
LinphoneV
C
ard
*
vCard
)
{
void
linphone_vcard_compute_md5_hash
(
LinphoneV
c
ard
*
vCard
)
{
unsigned
char
digest
[
VCARD_MD5_HASH_SIZE
];
const
char
*
text
=
NULL
;
if
(
!
vCard
)
{
...
...
@@ -239,7 +239,7 @@ void linphone_vcard_compute_md5_hash(LinphoneVCard *vCard) {
memcpy
(
vCard
->
md5
,
digest
,
sizeof
(
digest
));
}
bool_t
linphone_vcard_compare_md5_hash
(
LinphoneV
C
ard
*
vCard
)
{
bool_t
linphone_vcard_compare_md5_hash
(
LinphoneV
c
ard
*
vCard
)
{
unsigned
char
*
previous_md5
=
vCard
->
md5
;
unsigned
char
*
new_md5
=
NULL
;
int
result
=
-
1
;
...
...
coreapi/vcard.h
View file @
7cfbbda3
...
...
@@ -36,151 +36,154 @@ extern "C"
* @{
*/
typedef
struct
_LinphoneVCard
LinphoneVCard
;
/**
* The LinphoneVcard object.
*/
typedef
struct
_LinphoneVcard
LinphoneVcard
;
/**
* Creates a LinphoneV
C
ard object that has a pointer to an empty vCard
* Creates a LinphoneV
c
ard object that has a pointer to an empty vCard
*/
LINPHONE_PUBLIC
LinphoneV
C
ard
*
linphone_vcard_new
(
void
);
LINPHONE_PUBLIC
LinphoneV
c
ard
*
linphone_vcard_new
(
void
);
/**
* Deletes a LinphoneV
C
ard object properly
* @param[in] vCard the LinphoneV
C
ard to destroy
* Deletes a LinphoneV
c
ard object properly
* @param[in] vCard the LinphoneV
c
ard to destroy
*/
LINPHONE_PUBLIC
void
linphone_vcard_free
(
LinphoneV
C
ard
*
vCard
);
LINPHONE_PUBLIC
void
linphone_vcard_free
(
LinphoneV
c
ard
*
vCard
);
/**
* Uses belcard to parse the content of a file and returns all the vcards it contains as LinphoneV
C
ards, or NULL if it contains none.
* Uses belcard to parse the content of a file and returns all the vcards it contains as LinphoneV
c
ards, or NULL if it contains none.
* @param[in] file the path to the file to parse
* @return \mslist{LinphoneV
C
ard}
* @return \mslist{LinphoneV
c
ard}
*/
LINPHONE_PUBLIC
MSList
*
linphone_vcard_list_from_vcard4_file
(
const
char
*
file
);
/**
* Uses belcard to parse the content of a buffer and returns all the vcards it contains as LinphoneV
C
ards, or NULL if it contains none.
* Uses belcard to parse the content of a buffer and returns all the vcards it contains as LinphoneV
c
ards, or NULL if it contains none.
* @param[in] buffer the buffer to parse
* @return \mslist{LinphoneV
C
ard}