diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index 1d9786313..2fb96205c 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -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) diff --git a/coreapi/private.h b/coreapi/private.h index be9d0150c..eca250923 100644 --- a/coreapi/private.h +++ b/coreapi/private.h @@ -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; diff --git a/src/chat/chat-room/client-group-chat-room.cpp b/src/chat/chat-room/client-group-chat-room.cpp index 0a6b8cdec..1d51e386e 100644 --- a/src/chat/chat-room/client-group-chat-room.cpp +++ b/src/chat/chat-room/client-group-chat-room.cpp @@ -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)); diff --git a/src/core/core.h b/src/core/core.h index 88251aea5..715abbaf9 100644 --- a/src/core/core.h +++ b/src/core/core.h @@ -32,6 +32,7 @@ class ChatRoom; class CorePrivate; class LINPHONE_PUBLIC Core : public Object { +friend class ClientGroupChatRoom; public: Core ();