Commit 38f8ef44 authored by Benjamin REIS's avatar Benjamin REIS

connect cppCore with c_core and add received conference events in db

parent 9f98fa5f
......@@ -2233,6 +2233,8 @@ static void linphone_core_init(LinphoneCore * lc, LinphoneCoreCbs *cbs, LpConfig
lc->sal->set_user_pointer(lc);
lc->sal->set_callbacks(&linphone_sal_callbacks);
new(&lc->cppCore) Core();
#ifdef TUNNEL_ENABLED
lc->tunnel=linphone_core_tunnel_new(lc);
#endif
......@@ -5825,6 +5827,8 @@ void sip_config_uninit(LinphoneCore *lc)
delete lc->sal;
lc->sal=NULL;
lc->cppCore.~Core();
if (lc->sip_conf.guessed_contact)
ms_free(lc->sip_conf.guessed_contact);
if (config->contact)
......
......@@ -33,6 +33,7 @@
#include "linphone/conference.h"
#include "address/address.h"
#include "c-wrapper/internal/c-sal.h"
#include "core/core.h"
#include "sal/call-op.h"
#include "sal/event-op.h"
#include "sal/message-op.h"
......@@ -810,6 +811,10 @@ struct _LinphoneCore
MSList* vtable_refs;
int vtable_notify_recursion;
LinphonePrivate::Sal *sal;
// For migration purposes
LinphonePrivate::Core cppCore;
LinphoneGlobalState state;
struct _LpConfig *config;
MSList *default_audio_codecs;
......
......@@ -26,6 +26,7 @@
#include "conference/remote-conference-event-handler.h"
#include "conference/remote-conference-p.h"
#include "conference/session/call-session-p.h"
#include "core/core-p.h"
#include "event-log/events.h"
#include "logger/logger.h"
#include "sal/refer-op.h"
......@@ -282,6 +283,7 @@ void ClientGroupChatRoom::onParticipantAdded (time_t tm, const Address &addr) {
dConference->eventHandler->getLastNotify(),
addr
);
Conference::getCore()->cppCore.getPrivate()->mainDb.addEvent(event);
if (cb)
cb(cr, L_GET_C_BACK_PTR(&event));
......@@ -306,6 +308,7 @@ void ClientGroupChatRoom::onParticipantRemoved (time_t tm, const Address &addr)
dConference->eventHandler->getLastNotify(),
addr
);
Conference::getCore()->cppCore.getPrivate()->mainDb.addEvent(event);
if (cb)
cb(cr, L_GET_C_BACK_PTR(&event));
......@@ -336,6 +339,7 @@ void ClientGroupChatRoom::onParticipantSetAdmin (time_t tm, const Address &addr,
dConference->eventHandler->getLastNotify(),
addr
);
Conference::getCore()->cppCore.getPrivate()->mainDb.addEvent(event);
if (cb)
cb(cr, L_GET_C_BACK_PTR(&event));
......@@ -353,6 +357,7 @@ void ClientGroupChatRoom::onSubjectChanged (time_t tm, const std::string &subjec
dConference->eventHandler->getLastNotify(),
subject
);
Conference::getCore()->cppCore.getPrivate()->mainDb.addEvent(event);
if (cb)
cb(cr, L_GET_C_BACK_PTR(&event));
......@@ -381,6 +386,7 @@ void ClientGroupChatRoom::onParticipantDeviceAdded (time_t tm, const Address &ad
addr,
gruu
);
Conference::getCore()->cppCore.getPrivate()->mainDb.addEvent(event);
if (cb)
cb(cr, L_GET_C_BACK_PTR(&event));
......@@ -409,6 +415,7 @@ void ClientGroupChatRoom::onParticipantDeviceRemoved (time_t tm, const Address &
addr,
gruu
);
Conference::getCore()->cppCore.getPrivate()->mainDb.addEvent(event);
if (cb)
cb(cr, L_GET_C_BACK_PTR(&event));
......
......@@ -32,6 +32,7 @@ class ChatRoom;
class CorePrivate;
class LINPHONE_PUBLIC Core : public Object {
friend class ClientGroupChatRoom;
public:
Core ();
......
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