...
 
Commits (2)
......@@ -128,21 +128,20 @@ static void linphone_carddav_vcards_pulled(LinphoneCardDavContext *cdc, bctbx_li
linphone_vcard_set_etag(lvc, vCard->etag);
ms_debug("Downloaded vCard etag/url are %s and %s", vCard->etag, full_url);
lf = linphone_friend_new_from_vcard(lvc);
lf = linphone_core_create_friend_from_vcard(cdc->friend_list->lc, lvc);
linphone_vcard_unref(lvc); /*ref is now owned by friend*/
if (lf) {
local_friend = bctbx_list_find_custom(friends, (int (*)(const void*, const void*))find_matching_friend, lf);
if (local_friend) {
LinphoneFriend *lf2 = (LinphoneFriend *)local_friend->data;
lf->storage_id = lf2->storage_id;
lf->pol = lf2->pol;
lf->subscribe = lf2->subscribe;
lf->refkey = ms_strdup(lf2->refkey);
lf->presence_received = lf2->presence_received;
lf->lc = lf2->lc;
lf->friend_list = lf2->friend_list;
//New setter and getter in private_function.h
linphone_friend_set_storage_id(lf, linphone_friend_get_storage_id(lf2));
linphone_friend_set_inc_subscribe_policy(lf, linphone_friend_get_inc_subscribe_policy(lf2));
linphone_friend_enable_subscribes(lf, linphone_friend_subscribes_enabled(lf2));
linphone_friend_set_ref_key(lf, linphone_friend_get_ref_key(lf2));
linphone_friend_set_presence_received(lf, linphone_friend_is_presence_received(lf2));
linphone_friend_set_friend_list(lf, linphone_friend_get_friend_list(lf2));
if (cdc->contact_updated_cb) {
ms_debug("Contact updated: %s", linphone_friend_get_name(lf));
cdc->contact_updated_cb(cdc, lf, lf2);
......@@ -211,10 +210,11 @@ end:
}
static int find_matching_vcard(LinphoneCardDavResponse *response, LinphoneFriend *lf) {
if (!response->url || !lf || !lf->vcard || !linphone_vcard_get_url(lf->vcard)) {
LinphoneVcard *vcard = linphone_friend_get_vcard(lf);
if (!response->url || !vcard || !linphone_vcard_get_url(vcard)) {
return 1;
}
return strcmp(response->url, linphone_vcard_get_url(lf->vcard));
return strcmp(response->url, linphone_vcard_get_url(vcard));
}
static void linphone_carddav_vcards_fetched(LinphoneCardDavContext *cdc, bctbx_list_t *vCards) {
......
This diff is collapsed.
......@@ -628,7 +628,7 @@ static LinphoneFriendListStatus _linphone_friend_list_remove_friend(LinphoneFrie
}
}
}
if (!list->lc->friends_db_file) {
if (!linphone_core_get_friends_database_path(list->lc)) {
linphone_core_write_friends_config(list->lc);
}
list->friends = bctbx_list_erase_link(list->friends, elem);
......@@ -1035,7 +1035,7 @@ static LinphoneStatus linphone_friend_list_import_friends_from_vcard4(LinphoneFr
while (vcards_iterator != NULL && bctbx_list_get_data(vcards_iterator) != NULL) {
LinphoneVcard *vcard = (LinphoneVcard *)bctbx_list_get_data(vcards_iterator);
LinphoneFriend *lf = linphone_friend_new_from_vcard(vcard);
LinphoneFriend *lf = linphone_core_create_friend_from_vcard(list->lc, vcard);
linphone_vcard_unref(vcard);
if (lf) {
if (LinphoneFriendListOK == linphone_friend_list_import_friend(list, lf, TRUE)) {
......
......@@ -2302,7 +2302,7 @@ static void linphone_core_init(LinphoneCore * lc, LinphoneCoreCbs *cbs, LpConfig
sqlite3_bctbx_vfs_register(0);
#endif
lc->vcard_context = linphone_vcard_context_new();
lc->vcard_context = linphone_vcard_context_new(lc);
linphone_core_initialize_supported_content_types(lc);
lc->bw_controller = ms_bandwidth_controller_new();
......@@ -2658,7 +2658,7 @@ void linphone_core_add_friend_list(LinphoneCore *lc, LinphoneFriendList *list) {
const bctbx_list_t * linphone_core_find_contacts_by_char(LinphoneCore *core, const char *filter, bool_t sip_only) {
// Get sipuri from filter if possible
bctbx_list_t *list = NULL, *_list = NULL;
LinphoneAddress *addr = linphone_core_interpret_url(core, (sip_only) ? filter : "");
LinphoneAddress *addr = linphone_core_interpret_url(core, (filter) ? filter : "");
bctbx_list_t* listFriendsList = (bctbx_list_t*)linphone_core_get_friends_lists(core);
bctbx_list_t* listFriend = (listFriendsList != NULL)
? (bctbx_list_t*)linphone_friend_list_get_friends((LinphoneFriendList*)listFriendsList->data) : NULL;
......
......@@ -390,6 +390,15 @@ void linphone_nat_policy_save_to_config(const LinphoneNatPolicy *policy);
void linphone_core_create_im_notif_policy(LinphoneCore *lc);
/*****************************************************************************
* FRIEND PRIVATE SETTER GETTER *
****************************************************************************/
void linphone_friend_set_presence_received(LinphoneFriend *lf, bool_t p_r);
void linphone_friend_set_storage_id(LinphoneFriend *lf, unsigned int id);
unsigned int linphone_friend_get_storage_id(const LinphoneFriend *lf);
LinphoneFriendList *linphone_friend_get_friend_list(const LinphoneFriend *lf);
void linphone_friend_set_friend_list(LinphoneFriend *lf, LinphoneFriendList * list);
/*****************************************************************************
* REMOTE PROVISIONING FUNCTIONS *
......
......@@ -166,32 +166,6 @@ struct _LinphoneFriendPhoneNumberSipUri {
char *uri;
};
struct _LinphoneFriend{
belle_sip_object_t base;
void *user_data;
LinphoneAddress *uri;
MSList *insubs; /*list of SalOp. There can be multiple instances of a same Friend that subscribe to our presence*/
LinphonePrivate::SalPresenceOp *outsub;
LinphoneSubscribePolicy pol;
MSList *presence_models; /* list of LinphoneFriendPresence. It associates SIP URIs and phone numbers with their respective presence models. */
MSList *phone_number_sip_uri_map; /* list of LinphoneFriendPhoneNumberSipUri. It associates phone numbers with their corresponding SIP URIs. */
struct _LinphoneCore *lc;
BuddyInfo *info;
char *refkey;
bool_t subscribe;
bool_t subscribe_active;
bool_t inc_subscribe_pending;
bool_t commit;
bool_t initial_subscribes_sent; /*used to know if initial subscribe message was sent or not*/
bool_t presence_received;
LinphoneVcard *vcard;
unsigned int storage_id;
LinphoneFriendList *friend_list;
LinphoneSubscriptionState out_sub_state;
};
BELLE_SIP_DECLARE_VPTR_NO_EXPORT(LinphoneFriend);
struct _LinphoneFriendListCbs {
belle_sip_object_t base;
void *user_data;
......@@ -211,7 +185,7 @@ struct _LinphoneFriendList {
char *display_name;
char *rls_uri; /*this field is take in sync with rls_addr*/
LinphoneAddress *rls_addr;
MSList *friends;
bctbx_list_t *friends;
bctbx_map_t *friends_map;
bctbx_map_t *friends_map_uri;
unsigned char *content_digest;
......
......@@ -23,6 +23,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include <belcard/belcard.hpp>
#include "linphone/factory.h"
#include "linphone/types.h"
#include "linphone/wrapper_utils.h"
#include "c-wrapper/c-wrapper.h"
......@@ -36,14 +37,16 @@ using namespace std;
struct _LinphoneVcardContext {
shared_ptr<belcard::BelCardParser> parser;
void *user_data;
LinphoneCore *lc;
};
extern "C" {
LinphoneVcardContext* linphone_vcard_context_new(void) {
LinphoneVcardContext* linphone_vcard_context_new(LinphoneCore *lc) {
LinphoneVcardContext* context = ms_new0(LinphoneVcardContext, 1);
context->parser = belcard::BelCardParser::getInstance();
context->user_data = NULL;
context->user_data = nullptr;
context->lc = lc;
return context;
}
......
......@@ -35,9 +35,10 @@ typedef struct _LinphoneVcardContext LinphoneVcardContext;
/**
* Creates a vCard context to reuse the same BelCardParser object
* @param[in] lc a LinphoneCore object
* @return a new LinphoneVcardContext object
*/
LINPHONE_PUBLIC LinphoneVcardContext* linphone_vcard_context_new(void);
LINPHONE_PUBLIC LinphoneVcardContext* linphone_vcard_context_new(LinphoneCore *lc);
/**
* Destroys the vCard context
......
......@@ -86,6 +86,8 @@ set(C_API_HEADER_FILES
c-chat-room.h
c-dial-plan.h
c-event-log.h
c-friend.h
c-friend-list.h
c-participant.h
c-types.h
)
......
......@@ -33,6 +33,8 @@
#include "linphone/api/c-chat-room-cbs.h"
#include "linphone/api/c-dial-plan.h"
#include "linphone/api/c-event-log.h"
#include "linphone/api/c-friend.h"
#include "linphone/api/c-friend-list.h"
#include "linphone/api/c-participant.h"
#include "linphone/api/c-types.h"
......
This diff is collapsed.
This diff is collapsed.
......@@ -5159,6 +5159,14 @@ LINPHONE_PUBLIC LinphoneFriend * linphone_core_create_friend(LinphoneCore *lc);
*/
LINPHONE_PUBLIC LinphoneFriend * linphone_core_create_friend_with_address(LinphoneCore *lc, const char *address);
/**
* Create a LinphoneFriend from the given vcard.
* @param[in] lc #LinphoneCore object
* @param[in] vc #LinphoneVcard object
* @return The created #LinphoneFriend object
*/
LINPHONE_PUBLIC LinphoneFriend * linphone_core_create_friend_from_vcard(LinphoneCore *lc, LinphoneVcard *vc);
/**
* Set my presence status
* @param[in] lc #LinphoneCore object
......
This diff is collapsed.
This diff is collapsed.
......@@ -46,7 +46,7 @@ typedef struct _SipSetupContext SipSetupContext;
#define SIP_SETUP_CAP_RELAY_PROVIDER (1<<2)
#define SIP_SETUP_CAP_BUDDY_LOOKUP (1<<3)
#define SIP_SETUP_CAP_ACCOUNT_MANAGER (1<<4) /*can create accounts*/
#define SIP_SETUP_CAP_LOGIN (1<<5) /*can login to any account for a given proxy */
#define SIP_SETUP_CAP_LOGIN (1<<5) /*can login to any account for a given proxy */
typedef enum _BuddyLookupStatus{
BuddyLookupNone,
......
......@@ -166,6 +166,8 @@ set(LINPHONE_CXX_OBJECTS_SOURCE_FILES
c-wrapper/api/c-core.cpp
c-wrapper/api/c-dial-plan.cpp
c-wrapper/api/c-event-log.cpp
c-wrapper/api/c-friend.cpp
c-wrapper/api/c-friend-list.cpp
c-wrapper/api/c-participant.cpp
c-wrapper/internal/c-sal.cpp
c-wrapper/internal/c-tools.cpp
......@@ -248,6 +250,8 @@ set(LINPHONE_CXX_OBJECTS_SOURCE_FILES
sal/refer-op.cpp
sal/register-op.cpp
sal/sal.cpp
search/magic-search.cpp
search/search-result.cpp
utils/fs.cpp
utils/general.cpp
utils/payload-type-handler.cpp
......
/*
* c-friend-list.cpp
* Copyright (C) 2010-2018 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
This diff is collapsed.
......@@ -39,6 +39,7 @@
F(Core, Core) \
F(DialPlan, DialPlan) \
F(EventLog, EventLog) \
F(Friend, Friend) \
F(MediaSessionParams, CallParams) \
F(Participant, Participant)
......@@ -88,7 +89,6 @@ BELLE_SIP_TYPE_ID(LinphoneCoreCbs),
BELLE_SIP_TYPE_ID(LinphoneErrorInfo),
BELLE_SIP_TYPE_ID(LinphoneEvent),
BELLE_SIP_TYPE_ID(LinphoneFactory),
BELLE_SIP_TYPE_ID(LinphoneFriend),
BELLE_SIP_TYPE_ID(LinphoneFriendList),
BELLE_SIP_TYPE_ID(LinphoneFriendListCbs),
BELLE_SIP_TYPE_ID(LinphoneImEncryptionEngine),
......
......@@ -34,7 +34,7 @@ LINPHONE_BEGIN_NAMESPACE
class CallSession;
class CallPrivate : public ObjectPrivate, public CallSessionListener {
class CallPrivate : public ObjectPrivate, public CallSessionListener {
public:
CallPrivate () = default;
......
......@@ -22,6 +22,7 @@
#include "linphone/utils/utils.h"
#include "address/address.h"
#include "chat/chat-message/chat-message-p.h"
#include "chat/chat-room/chat-room-p.h"
#include "chat/chat-room/client-group-chat-room.h"
......@@ -2683,6 +2684,32 @@ void MainDb::enableChatRoomMigration (const ChatRoomId &chatRoomId, bool enable)
// -----------------------------------------------------------------------------
std::list<std::shared_ptr<Address>> MainDb::getSipAddressLikeFilter(const string &filter) {
const string query = "SELECT sip_address.value FROM sip_address"
" WHERE sip_address.value"
" LIKE \"%:filter%\"";
return L_SAFE_TRANSACTION {
L_D();
soci::session *session = d->dbSession.getBackendSession();
soci::transaction tr(*session);
list<shared_ptr<Address>> sipAddress;
soci::rowset<soci::row> rows = (session->prepare << query, soci::use(filter));
for (const auto &row : rows) {
string sip = row.get<string>(0);
shared_ptr<Address> address = make_shared<Address>(sip);
sipAddress.push_back(address);
}
return sipAddress;
};
}
// -----------------------------------------------------------------------------
bool MainDb::import (Backend, const string &parameters) {
L_D();
......
......@@ -135,6 +135,12 @@ public:
) const;
void insertOneToOneConferenceChatRoom (const std::shared_ptr<AbstractChatRoom> &chatRoom);
// ---------------------------------------------------------------------------
// Sip Address.
// ---------------------------------------------------------------------------
std::list<std::shared_ptr<Address>> getSipAddressLikeFilter(const std::string &filter);
// ---------------------------------------------------------------------------
// Other.
// ---------------------------------------------------------------------------
......
/*
* friend-p.h
* Copyright (C) 2010-2018 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef _L_FRIEND_P_H_
#define _L_FRIEND_P_H_
#include "friend.h"
#include "object/object-p.h"
#include <bctoolbox/list.h>
#include <bctoolbox/map.h>
#include "address/address.h"
#include "sal/presence-op.h"
#include "linphone/types.h"
#include "linphone/sipsetup.h"
LINPHONE_BEGIN_NAMESPACE
class FriendPrivate : public ObjectPrivate {
public:
FriendPrivate();
~FriendPrivate();
private:
/*Address uri;
LinphoneVcard *vcard;
unsigned int storage_id;
bctbx_list_t *insubs; //list of SalOp. There can be multiple instances of a same Friend that subscribe to our presence
LinphonePrivate::SalPresenceOp *outsub;
LinphoneSubscribePolicy pol;
bctbx_list_t *presence_models; // list of LinphoneFriendPresence. It associates SIP URIs and phone numbers with their respective presence models.
bctbx_list_t *phone_number_sip_uri_map; // list of LinphoneFriendPhoneNumberSipUri. It associates phone numbers with their corresponding SIP URIs.
BuddyInfo *info;
char *refkey;
bool_t subscribe;
bool_t subscribe_active;
bool_t inc_subscribe_pending;
bool_t commit;
bool_t initial_subscribes_sent; //used to know if initial subscribe message was sent or not
bool_t presence_received;
LinphoneSubscriptionState out_sub_state;
//REMOVE ? REWORK FriendList
LinphoneFriendList *friend_list;*/
L_DECLARE_PUBLIC(Friend);
};
LINPHONE_END_NAMESPACE
#endif //_L_FRIEND_P_H_
/*
* friend.cpp
* Copyright (C) 2010-2018 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "linphone/utils/utils.h"
#include "friend-p.h"
#include "c-wrapper/c-wrapper.h"
#include "logger/logger.h"
using namespace std;
LINPHONE_BEGIN_NAMESPACE
LINPHONE_END_NAMESPACE
/*
* friend.h
* Copyright (C) 2010-2018 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef _L_FRIEND_H_
#define _L_FRIEND_H_
#include "object/object.h"
#include "core/core-accessor.h"
LINPHONE_BEGIN_NAMESPACE
class FriendPrivate;
class LINPHONE_PUBLIC Friend : public Object, public CoreAccessor {
public:
Friend();
~Friend();
private:
L_DECLARE_PRIVATE(Friend);
};
LINPHONE_END_NAMESPACE
#endif //_L_FRIEND_H_
/*
* magic-search.cpp
* Copyright (C) 2010-2018 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "magic-search.h"
#include <bctoolbox/list.h>
#include "c-wrapper/internal/c-tools.h"
#include "linphone/core.h"
#include "linphone/types.h"
#include "private.h"
using namespace std;
LINPHONE_BEGIN_NAMESPACE
const unsigned int MagicSearch::sMaxWeight = 10000;
static unsigned int getWeight(const std::string world, const std::string &filter, const unsigned int weightMax = MagicSearch::sMaxWeight) {
return 0;
}
void MagicSearch::getContactListFromFilter(const std::string &filter) {
/*list<LinphoneFriend> friendList =
L_GET_RESOLVED_CPP_LIST_FROM_C_LIST(
linphone_core_get_default_friend_list(this->getCore()->getCCore())->friends,
Friend
);*/
list<LinphoneFriend*> friendList = list<LinphoneFriend*>();
LinphoneFriendList* list = linphone_core_get_default_friend_list(this->getCore()->getCCore());
for (bctbx_list_t *f = list->friends ; f != nullptr; f = bctbx_list_next(f)) {
//unsigned int weight = 0;
// NOM
// PRENOM
// NUMERO
/*weight = */getWeight("", "");
friendList.push_back((LinphoneFriend*)f->data);
}
}
LINPHONE_END_NAMESPACE
/*
* magic-search.h
* Copyright (C) 2010-2018 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef _L_MAGIC_SEARCH_H_
#define _L_MAGIC_SEARCH_H_
#include <string>
#include "core/core.h"
#include "core/core-accessor.h"
LINPHONE_BEGIN_NAMESPACE
class MagicSearch : public CoreAccessor{
public:
static const unsigned int sMaxWeight;
MagicSearch(const std::shared_ptr<Core> &core) : CoreAccessor(core) {};
~MagicSearch();
void getContactListFromFilter(const std::string &filter);
private:
};
LINPHONE_END_NAMESPACE
#endif //_L_MAGIC_SEARCH_H_
/*
* search-result.cpp
* Copyright (C) 2010-2018 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "search-result.h"
LINPHONE_BEGIN_NAMESPACE
LINPHONE_END_NAMESPACE
/*
* search-result.h
* Copyright (C) 2010-2018 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef _L_SEARCH_RESULT_H_
#define _L_SEARCH_RESULT_H_
#include "linphone/utils/general.h"
#include "linphone/types.h"
#include "private.h"
LINPHONE_BEGIN_NAMESPACE
class SearchResult {
public:
SearchResult(LinphoneAddress *a, LinphoneFriend *f = nullptr) : mFriend(f), mAddress(a) {};
~SearchResult();
private:
LinphoneFriend *mFriend;
LinphoneAddress *mAddress;
};
LINPHONE_END_NAMESPACE
#endif //_L_SEARCH_RESULT_H_
......@@ -148,7 +148,7 @@ static void linphone_vcard_update_existing_friends_test(void) {
static void linphone_vcard_phone_numbers_and_sip_addresses(void) {
LinphoneCoreManager* manager = linphone_core_manager_new2("empty_rc", FALSE);
LinphoneVcard *lvc = linphone_vcard_context_get_vcard_from_buffer(linphone_core_get_vcard_context(manager->lc), "BEGIN:VCARD\r\nVERSION:4.0\r\nFN:Sylvain Berfini\r\nIMPP:sip:sberfini@sip.linphone.org\r\nIMPP;TYPE=home:sip:sylvain@sip.linphone.org\r\nTEL;TYPE=work:0952636505\r\nEND:VCARD\r\n");
LinphoneFriend *lf = linphone_friend_new_from_vcard(lvc);
LinphoneFriend *lf = linphone_core_create_friend_from_vcard(manager->lc, lvc);
linphone_vcard_unref(lvc);
const bctbx_list_t *sip_addresses = linphone_friend_get_addresses(lf);
bctbx_list_t *phone_numbers = linphone_friend_get_phone_numbers(lf);
......@@ -160,7 +160,7 @@ static void linphone_vcard_phone_numbers_and_sip_addresses(void) {
linphone_friend_unref(lf);
lvc = linphone_vcard_context_get_vcard_from_buffer(linphone_core_get_vcard_context(manager->lc), "BEGIN:VCARD\r\nVERSION:4.0\r\nFN:Sylvain Berfini\r\nTEL;TYPE=work:0952636505\r\nTEL:0476010203\r\nEND:VCARD\r\n");
lf = linphone_friend_new_from_vcard(lvc);
lf = linphone_core_create_friend_from_vcard(manager->lc, lvc);
linphone_vcard_unref(lvc);
linphone_friend_set_core(lf, manager->lc);
sip_addresses = linphone_friend_get_addresses(lf);
......@@ -279,7 +279,7 @@ static void friends_sqlite_storage(void) {
linphone_vcard_set_etag(lvc, "\"123-456789\"");
linphone_vcard_set_url(lvc, "http://dav.somewhere.fr/addressbook/me/someone.vcf");
lf = linphone_friend_new_from_vcard(lvc);
lf = linphone_core_create_friend_from_vcard(lc, lvc);
linphone_vcard_unref(lvc);
linphone_friend_set_address(lf, addr);
linphone_friend_set_name(lf, "Sylvain");
......@@ -611,7 +611,7 @@ static void carddav_sync_3(void) {
LinphoneCoreManager *manager = linphone_core_manager_new2("carddav_rc", FALSE);
LinphoneCardDAVStats *stats = (LinphoneCardDAVStats *)ms_new0(LinphoneCardDAVStats, 1);
LinphoneVcard *lvc = linphone_vcard_context_get_vcard_from_buffer(linphone_core_get_vcard_context(manager->lc), "BEGIN:VCARD\r\nVERSION:4.0\r\nUID:1f08dd48-29ac-4097-8e48-8596d7776283\r\nFN:Sylvain Berfini\r\nIMPP;TYPE=work:sip:sylvain@sip.linphone.org\r\nEND:VCARD\r\n");
LinphoneFriend *lf = linphone_friend_new_from_vcard(lvc);
LinphoneFriend *lf = linphone_core_create_friend_from_vcard(manager->lc, lvc);
char *friends_db = bc_tester_file("friends.db");
LinphoneFriendList *lfl = linphone_core_create_friend_list(manager->lc);
LinphoneCardDavContext *c = NULL;
......@@ -652,7 +652,7 @@ static void carddav_sync_4(void) {
LinphoneCoreManager *manager = linphone_core_manager_new2("carddav_rc", FALSE);
LinphoneCardDAVStats *stats = (LinphoneCardDAVStats *)ms_new0(LinphoneCardDAVStats, 1);
LinphoneVcard *lvc = linphone_vcard_context_get_vcard_from_buffer(linphone_core_get_vcard_context(manager->lc), "BEGIN:VCARD\r\nVERSION:4.0\r\nFN:Margaux Clerc\r\nIMPP;TYPE=work:sip:margaux@sip.linphone.org\r\nEND:VCARD\r\n");
LinphoneFriend *lf = linphone_friend_new_from_vcard(lvc);
LinphoneFriend *lf = linphone_core_create_friend_from_vcard(manager->lc, lvc);
LinphoneFriendList *lfl = linphone_core_create_friend_list(manager->lc);
LinphoneCardDavContext *c = NULL;
......@@ -749,14 +749,14 @@ static void carddav_integration(void) {
lf = NULL;
lvc = linphone_vcard_context_get_vcard_from_buffer(linphone_core_get_vcard_context(manager->lc), "BEGIN:VCARD\r\nVERSION:4.0\r\nFN:Ghislain Mary\r\nIMPP;TYPE=work:sip:ghislain@sip.linphone.org\r\nEND:VCARD\r\n");
lf = linphone_friend_new_from_vcard(lvc);
lf = linphone_core_create_friend_from_vcard(manager->lc, lvc);
linphone_vcard_unref(lvc);
BC_ASSERT_EQUAL(linphone_friend_list_add_local_friend(lfl, lf), LinphoneFriendListOK, int, "%d");
linphone_friend_unref(lf);
lvc2 = linphone_vcard_context_get_vcard_from_buffer(linphone_core_get_vcard_context(manager->lc), "BEGIN:VCARD\r\nVERSION:4.0\r\nFN:Sylvain Berfini\r\nIMPP:sip:sberfini@sip.linphone.org\r\nUID:1f08dd48-29ac-4097-8e48-8596d7776283\r\nEND:VCARD\r\n");
linphone_vcard_set_url(lvc2, "/card.php/addressbooks/tester/default/me.vcf");
lf2 = linphone_friend_new_from_vcard(lvc2);
lf2 = linphone_core_create_friend_from_vcard(manager->lc, lvc2);
linphone_vcard_unref(lvc2);
linphone_friend_set_ref_key(lf2, refkey);
BC_ASSERT_EQUAL(linphone_friend_list_add_local_friend(lfl, lf2), LinphoneFriendListOK, int, "%d");
......@@ -838,7 +838,7 @@ static void carddav_clean(void) { // This is to ensure the content of the test
lvc = linphone_vcard_context_get_vcard_from_buffer(linphone_core_get_vcard_context(manager->lc), "BEGIN:VCARD\r\nVERSION:4.0\r\nFN:Sylvain Berfini\r\nIMPP:sip:sylvain@sip.linphone.org\r\nUID:1f08dd48-29ac-4097-8e48-8596d7776283\r\nEND:VCARD\r\n");
linphone_vcard_set_url(lvc, "http://dav.linphone.org/card.php/addressbooks/tester/default/me.vcf");
lf = linphone_friend_new_from_vcard(lvc);
lf = linphone_core_create_friend_from_vcard(manager->lc, lvc);
linphone_vcard_unref(lvc);
linphone_friend_list_add_friend(lfl, lf);
wait_for_until(manager->lc, NULL, &stats->sync_done_count, 1, CARDDAV_SYNC_TIMEOUT);
......@@ -886,9 +886,9 @@ static void carddav_server_to_client_and_client_to_sever_sync(void) {
LinphoneFriendListCbs *cbs = linphone_friend_list_get_callbacks(lfl);
LinphoneCardDAVStats *stats = (LinphoneCardDAVStats *)ms_new0(LinphoneCardDAVStats, 1);
LinphoneVcard *lvc1 = linphone_vcard_context_get_vcard_from_buffer(linphone_core_get_vcard_context(manager->lc), "BEGIN:VCARD\r\nVERSION:4.0\r\nFN:Margaux Clerc\r\nIMPP;TYPE=work:sip:margaux@sip.linphone.org\r\nEND:VCARD\r\n");
LinphoneFriend *lf1 = linphone_friend_new_from_vcard(lvc1);
LinphoneFriend *lf1 = linphone_core_create_friend_from_vcard(manager->lc, lvc1);
LinphoneVcard *lvc2 = linphone_vcard_context_get_vcard_from_buffer(linphone_core_get_vcard_context(manager->lc), "BEGIN:VCARD\r\nVERSION:4.0\r\nFN:Ghislain Mary\r\nIMPP;TYPE=work:sip:ghislain@sip.linphone.org\r\nEND:VCARD\r\n");
LinphoneFriend *lf2 = linphone_friend_new_from_vcard(lvc2);
LinphoneFriend *lf2 = linphone_core_create_friend_from_vcard(manager->lc, lvc2);
bctbx_list_t *friends = NULL, *friends_iterator = NULL;
linphone_vcard_unref(lvc1);
......