Commit 3eeb0974 authored by Sylvain Berfini's avatar Sylvain Berfini 🎩

Fixed compilation when belcard is not found

parent 860ee180
......@@ -114,8 +114,12 @@ else
liblinphone_la_SOURCES+=linphone_tunnel_stubs.c linphone_tunnel.h
endif
if BUILD_VCARD
liblinphone_la_SOURCES+=vcard.cc vcard.h
liblinphone_la_CXXFLAGS=-std=c++11
else
liblinphone_la_SOURCES+=vcard_stubs.c vcard.h
endif
liblinphone_la_LDFLAGS= -version-info $(LIBLINPHONE_SO_VERSION) -no-undefined
......
......@@ -987,10 +987,18 @@ static int create_friend(void *data, int argc, char **argv, char **colName) {
MSList **list = (MSList **)data;
LinphoneFriend *lf = NULL;
LinphoneVCard *vcard = NULL;
unsigned int storage_id = atoi(argv[0]);
vcard = linphone_vcard_new_from_vcard4_buffer(argv[1]);
lf = linphone_friend_new_from_vcard(vcard);
if (!lf) {
lf = linphone_friend_new();
//TODO
}
//TODO
lf->storage_id = storage_id;
*list = ms_list_append(*list, linphone_friend_ref(lf));
linphone_friend_unref(lf);
return 0;
......
/*
vcard_stubs.c
Copyright (C) 2015 Belledonne Communications SARL
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "vcard.h"
struct _LinphoneVCard {
};
LinphoneVCard* linphone_vcard_new(void) {
return NULL;
}
void linphone_vcard_free(LinphoneVCard *vCard) {
}
MSList* linphone_vcard_list_from_vcard4_file(const char *filename) {
return NULL;
}
MSList* linphone_vcard_list_from_vcard4_buffer(const char *buffer) {
return NULL;
}
LinphoneVCard* linphone_vcard_new_from_vcard4_buffer(const char *buffer) {
return NULL;
}
const char * linphone_vcard_as_vcard4_string(LinphoneVCard *vCard) {
return NULL;
}
void linphone_vcard_set_full_name(LinphoneVCard *vCard, const char *name) {
}
const char* linphone_vcard_get_full_name(const LinphoneVCard *vCard) {
return NULL;
}
void linphone_vcard_add_sip_address(LinphoneVCard *vCard, const char *sip_address) {
}
void linphone_vcard_remove_sip_address(LinphoneVCard *vCard, const char *sip_address) {
}
void linphone_vcard_edit_main_sip_address(LinphoneVCard *vCard, const char *sip_address) {
}
MSList* linphone_vcard_get_sip_addresses(const LinphoneVCard *vCard) {
return NULL;
}
\ No newline at end of file
......@@ -22,6 +22,7 @@
#include <time.h>
#if BUILD_VCARD
static char *create_filepath(const char *dir, const char *filename, const char *ext) {
return ms_strdup_printf("%s/%s.%s", dir, filename, ext);
}
......@@ -161,8 +162,10 @@ static void friends_sqlite_storage(void) {
linphone_core_manager_destroy(manager);
}
#endif
#endif
test_t vcard_tests[] = {
#if BUILD_VCARD
{ "Import / Export friends from vCards", linphone_vcard_import_export_friends_test },
{ "Import a lot of friends from vCards", linphone_vcard_import_a_lot_of_friends_test },
#ifdef FRIENDS_SQL_STORAGE_ENABLED
......@@ -170,6 +173,7 @@ test_t vcard_tests[] = {
{ "Friends storage migration from rc to db", friends_migration },
{ "Friends storage in sqlite database", friends_sqlite_storage },
#endif
#endif
};
test_suite_t vcard_test_suite = {
......
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