Commit eccde9b8 authored by Ronan's avatar Ronan
Browse files

feat(c-tools): remove C_NAME of macros

parent 7d6d2da2
......@@ -23,7 +23,7 @@
// =============================================================================
L_DECLARE_C_CLONABLE_STRUCT_IMPL(Address, Address, address);
L_DECLARE_C_CLONABLE_STRUCT_IMPL(Address, Address);
using namespace std;
......@@ -36,7 +36,7 @@ LinphoneAddress *linphone_address_new (const char *address) {
return nullptr;
}
LinphoneAddress *object = _linphone_address_init();
LinphoneAddress *object = _linphone_Address_init();
object->cppPtr = cppPtr;
return object;
}
......
......@@ -28,12 +28,10 @@
// =============================================================================
#define GET_CALL_CPP_PTR(obj) L_GET_CPP_PTR_FROM_C_STRUCT(obj, CallSessionParams, CallParams)
#define GET_CALL_CPP_PRIVATE_PTR(obj) L_GET_PRIVATE_FROM_C_STRUCT(obj, CallSessionParams)
#define GET_MEDIA_CPP_PTR(obj) L_GET_CPP_PTR_FROM_C_STRUCT(obj, MediaSessionParams)
#define GET_MEDIA_CPP_PRIVATE_PTR(obj) L_GET_PRIVATE_FROM_C_STRUCT(obj, MediaSessionParams)
L_DECLARE_C_CLONABLE_STRUCT_IMPL(MediaSessionParams, CallParams, call_params)
L_DECLARE_C_CLONABLE_STRUCT_IMPL(MediaSessionParams, CallParams)
using namespace std;
......@@ -85,7 +83,7 @@ SalStreamDir get_video_dir_from_call_params (const LinphoneCallParams *params) {
}
void linphone_call_params_set_custom_headers (LinphoneCallParams *params, const SalCustomHeader *ch) {
GET_CALL_CPP_PRIVATE_PTR(params)->setCustomHeaders(ch);
GET_MEDIA_CPP_PRIVATE_PTR(params)->setCustomHeaders(ch);
}
void linphone_call_params_set_custom_sdp_attributes (LinphoneCallParams *params, const SalCustomSdpAttribute *csa) {
......@@ -381,19 +379,19 @@ void linphone_call_params_set_received_fps (LinphoneCallParams *params, float va
// =============================================================================
bool_t linphone_call_params_get_in_conference (const LinphoneCallParams *params) {
return GET_CALL_CPP_PRIVATE_PTR(params)->getInConference();
return GET_MEDIA_CPP_PRIVATE_PTR(params)->getInConference();
}
void linphone_call_params_set_in_conference (LinphoneCallParams *params, bool_t value) {
GET_CALL_CPP_PRIVATE_PTR(params)->setInConference(value);
GET_MEDIA_CPP_PRIVATE_PTR(params)->setInConference(value);
}
bool_t linphone_call_params_get_internal_call_update (const LinphoneCallParams *params) {
return GET_CALL_CPP_PRIVATE_PTR(params)->getInternalCallUpdate();
return GET_MEDIA_CPP_PRIVATE_PTR(params)->getInternalCallUpdate();
}
void linphone_call_params_set_internal_call_update (LinphoneCallParams *params, bool_t value) {
GET_CALL_CPP_PRIVATE_PTR(params)->setInternalCallUpdate(value);
GET_MEDIA_CPP_PRIVATE_PTR(params)->setInternalCallUpdate(value);
}
bool_t linphone_call_params_implicit_rtcp_fb_enabled (const LinphoneCallParams *params) {
......@@ -437,7 +435,7 @@ void linphone_call_params_set_up_ptime (LinphoneCallParams *params, int value) {
}
SalCustomHeader *linphone_call_params_get_custom_headers (const LinphoneCallParams *params) {
return GET_CALL_CPP_PRIVATE_PTR(params)->getCustomHeaders();
return GET_MEDIA_CPP_PRIVATE_PTR(params)->getCustomHeaders();
}
SalCustomSdpAttribute *linphone_call_params_get_custom_sdp_attributes (const LinphoneCallParams *params) {
......@@ -449,11 +447,11 @@ SalCustomSdpAttribute *linphone_call_params_get_custom_sdp_media_attributes (con
}
LinphoneCall *linphone_call_params_get_referer (const LinphoneCallParams *params) {
return GET_CALL_CPP_PRIVATE_PTR(params)->getReferer();
return GET_MEDIA_CPP_PRIVATE_PTR(params)->getReferer();
}
void linphone_call_params_set_referer (LinphoneCallParams *params, LinphoneCall *referer) {
GET_CALL_CPP_PRIVATE_PTR(params)->setReferer(referer);
GET_MEDIA_CPP_PRIVATE_PTR(params)->setReferer(referer);
}
bool_t linphone_call_params_get_update_call_when_ice_completed (const LinphoneCallParams *params) {
......@@ -481,11 +479,11 @@ void linphone_call_params_set_received_video_definition (LinphoneCallParams *par
}
bool_t linphone_call_params_get_no_user_consent (const LinphoneCallParams *params) {
return GET_CALL_CPP_PRIVATE_PTR(params)->getNoUserConsent();
return GET_MEDIA_CPP_PRIVATE_PTR(params)->getNoUserConsent();
}
void linphone_call_params_set_no_user_consent (LinphoneCallParams *params, bool_t value) {
GET_CALL_CPP_PRIVATE_PTR(params)->setNoUserConsent(value);
GET_MEDIA_CPP_PRIVATE_PTR(params)->setNoUserConsent(value);
}
// =============================================================================
......@@ -514,14 +512,14 @@ void linphone_call_params_unref (LinphoneCallParams *cp) {
// =============================================================================
LinphoneCallParams *linphone_call_params_new (LinphoneCore *core) {
LinphoneCallParams *params = _linphone_call_params_init();
LinphoneCallParams *params = _linphone_CallParams_init();
L_SET_CPP_PTR_FROM_C_STRUCT(params, new LinphonePrivate::MediaSessionParams());
GET_MEDIA_CPP_PTR(params)->initDefault(core);
return params;
}
LinphoneCallParams *linphone_call_params_new_for_wrapper (void) {
return _linphone_call_params_init();
return _linphone_CallParams_init();
}
/* DEPRECATED */
......
......@@ -37,12 +37,13 @@
using namespace std;
extern LinphoneParticipant *_linphone_participant_init ();
extern LinphoneParticipant *_linphone_Participant_init ();
static void _linphone_chat_room_constructor (LinphoneChatRoom *cr);
static void _linphone_chat_room_destructor (LinphoneChatRoom *cr);
L_DECLARE_C_STRUCT_IMPL_WITH_XTORS(ChatRoom, ChatRoom, chat_room,
L_DECLARE_C_STRUCT_IMPL_WITH_XTORS(
ChatRoom, ChatRoom,
_linphone_chat_room_constructor, _linphone_chat_room_destructor,
LinphoneChatRoomCbs *cbs;
LinphoneAddress *peerAddressCache;
......@@ -216,7 +217,7 @@ LinphoneChatRoomState linphone_chat_room_get_state (const LinphoneChatRoom *cr)
LinphoneParticipant *linphone_chat_room_add_participant (LinphoneChatRoom *cr, const LinphoneAddress *addr) {
return L_GET_C_BACK_PTR(GET_CPP_PTR(cr)->addParticipant(
*L_GET_CPP_PTR_FROM_C_STRUCT(addr, Address), nullptr, false),
Participant, participant);
Participant);
}
void linphone_chat_room_add_participants (LinphoneChatRoom *cr, const bctbx_list_t *addresses) {
......@@ -237,7 +238,7 @@ int linphone_chat_room_get_nb_participants (const LinphoneChatRoom *cr) {
}
bctbx_list_t *linphone_chat_room_get_participants (const LinphoneChatRoom *cr) {
return L_GET_C_LIST_OF_STRUCT_PTR_FROM_CPP_LIST_OF_CPP_OBJ(GET_CPP_PTR(cr)->getParticipants(), Participant, Participant, participant);
return L_GET_C_LIST_OF_STRUCT_PTR_FROM_CPP_LIST_OF_CPP_OBJ(GET_CPP_PTR(cr)->getParticipants(), Participant, Participant);
}
void linphone_chat_room_remove_participant (LinphoneChatRoom *cr, LinphoneParticipant *participant) {
......@@ -274,7 +275,7 @@ void linphone_chat_room_set_user_data (LinphoneChatRoom *cr, void *ud) {
// =============================================================================
LinphoneChatRoom *linphone_chat_room_new (LinphoneCore *core, const LinphoneAddress *addr) {
LinphoneChatRoom *cr = _linphone_chat_room_init();
LinphoneChatRoom *cr = _linphone_ChatRoom_init();
if (linphone_core_realtime_text_enabled(core))
L_SET_CPP_PTR_FROM_C_STRUCT(cr, std::make_shared<LinphonePrivate::RealTimeTextChatRoom>(core, *L_GET_CPP_PTR_FROM_C_STRUCT(addr, Address)));
else
......@@ -299,7 +300,7 @@ LinphoneChatRoom *linphone_client_group_chat_room_new (LinphoneCore *core, const
from = linphone_core_get_primary_contact(core);
LinphonePrivate::Address me(from);
std::list<LinphonePrivate::Address> l = L_GET_CPP_LIST_OF_CPP_OBJ_FROM_C_LIST_OF_STRUCT_PTR(addresses, Address, Address);
LinphoneChatRoom *cr = _linphone_chat_room_init();
LinphoneChatRoom *cr = _linphone_ChatRoom_init();
L_SET_CPP_PTR_FROM_C_STRUCT(cr, make_shared<LinphonePrivate::ClientGroupChatRoom>(core, me, l));
linphone_core_notify_chat_room_instantiated(core, cr);
L_GET_PRIVATE_FROM_C_STRUCT(cr, ChatRoom)->setState(LinphonePrivate::ChatRoom::State::Instantiated);
......
......@@ -28,11 +28,11 @@
// =============================================================================
L_DECLARE_C_CLONABLE_STRUCT_IMPL(EventLog, EventLog, event_log);
L_DECLARE_C_CLONABLE_STRUCT_IMPL(CallEvent, CallEvent, call_event);
L_DECLARE_C_CLONABLE_STRUCT_IMPL(ConferenceEvent, ConferenceEvent, conference_event);
L_DECLARE_C_CLONABLE_STRUCT_IMPL(ConferenceParticipantEvent, ConferenceParticipantEvent, conference_participant_event);
L_DECLARE_C_CLONABLE_STRUCT_IMPL(ChatMessageEvent, ChatMessageEvent, chat_message_event);
L_DECLARE_C_CLONABLE_STRUCT_IMPL(EventLog, EventLog);
L_DECLARE_C_CLONABLE_STRUCT_IMPL(CallEvent, CallEvent);
L_DECLARE_C_CLONABLE_STRUCT_IMPL(ConferenceEvent, ConferenceEvent);
L_DECLARE_C_CLONABLE_STRUCT_IMPL(ConferenceParticipantEvent, ConferenceParticipantEvent);
L_DECLARE_C_CLONABLE_STRUCT_IMPL(ChatMessageEvent, ChatMessageEvent);
using namespace std;
......@@ -41,7 +41,7 @@ using namespace std;
// -----------------------------------------------------------------------------
LinphoneEventLog *linphone_event_log_new () {
LinphoneEventLog *event_log = _linphone_event_log_init();
LinphoneEventLog *event_log = _linphone_EventLog_init();
L_SET_CPP_PTR_FROM_C_STRUCT(event_log, new LINPHONE_NAMESPACE::EventLog());
return event_log;
}
......@@ -62,7 +62,7 @@ LinphoneEventLogType linphone_event_log_get_type (const LinphoneEventLog *event_
// -----------------------------------------------------------------------------
LinphoneCallEvent *linphone_call_event_new (LinphoneEventLogType type, LinphoneCall *call) {
LinphoneCallEvent *call_event = _linphone_call_event_init();
LinphoneCallEvent *call_event = _linphone_CallEvent_init();
L_SET_CPP_PTR_FROM_C_STRUCT(
call_event,
new LINPHONE_NAMESPACE::CallEvent(
......@@ -74,15 +74,14 @@ LinphoneCallEvent *linphone_call_event_new (LinphoneEventLogType type, LinphoneC
}
// TODO: REMOVE ME.
extern LinphoneCall *_linphone_call_init ();
extern LinphoneCall *_linphone_Call_init ();
LinphoneCall *linphone_call_event_get_call (const LinphoneCallEvent *call_event) {
return L_GET_C_BACK_PTR(
L_GET_CPP_PTR_FROM_C_STRUCT(
call_event, CallEvent
)->getCall(),
Call,
call
Call
);
}
......@@ -128,7 +127,7 @@ const LinphoneAddress *linphone_conference_participant_event_get_participant_add
// -----------------------------------------------------------------------------
LinphoneChatMessageEvent *linphone_chat_message_event_new (LinphoneChatMessage *chat_message) {
LinphoneChatMessageEvent *chat_message_event = _linphone_chat_message_event_init();
LinphoneChatMessageEvent *chat_message_event = _linphone_ChatMessageEvent_init();
L_SET_CPP_PTR_FROM_C_STRUCT(
chat_message_event,
new LINPHONE_NAMESPACE::ChatMessageEvent(
......@@ -139,14 +138,13 @@ LinphoneChatMessageEvent *linphone_chat_message_event_new (LinphoneChatMessage *
}
// TODO: REMOVE ME.
extern LinphoneChatMessage *_linphone_chat_message_init ();
extern LinphoneChatMessage *_linphone_ChatMessage_init ();
LinphoneChatMessage *linphone_chat_message_event_get_chat_message (const LinphoneChatMessageEvent *chat_message_event) {
return L_GET_C_BACK_PTR(
L_GET_CPP_PTR_FROM_C_STRUCT(
chat_message_event, ChatMessageEvent
)->getChatMessage(),
ChatMessage,
chat_message
ChatMessage
);
}
......@@ -25,7 +25,7 @@
using namespace std;
L_DECLARE_C_STRUCT_IMPL(Participant, Participant, participant,
L_DECLARE_C_STRUCT_IMPL(Participant, Participant,
mutable LinphoneAddress *addressCache;
);
......
......@@ -261,15 +261,15 @@ LINPHONE_END_NAMESPACE
#define L_INTERNAL_C_STRUCT_NO_XTOR(OBJECT)
#define L_INTERNAL_DECLARE_C_STRUCT_FUNCTIONS(CPP_CLASS, C_TYPE, C_NAME, CONSTRUCTOR, DESTRUCTOR) \
#define L_INTERNAL_DECLARE_C_STRUCT_FUNCTIONS(CPP_CLASS, C_TYPE, CONSTRUCTOR, DESTRUCTOR) \
BELLE_SIP_DECLARE_VPTR_NO_EXPORT(Linphone ## C_TYPE); \
Linphone ## C_TYPE *_linphone_ ## C_NAME ## _init() { \
Linphone ## C_TYPE *_linphone_ ## C_TYPE ## _init() { \
Linphone ## C_TYPE * object = belle_sip_object_new(Linphone ## C_TYPE); \
new(&object->cppPtr) std::shared_ptr<LINPHONE_NAMESPACE::CPP_CLASS>(); \
CONSTRUCTOR(object); \
return object; \
} \
void _linphone_ ## C_NAME ## _uninit(Linphone ## C_TYPE * object) { \
static void _linphone_ ## C_TYPE ## _uninit(Linphone ## C_TYPE * object) { \
DESTRUCTOR(object); \
object->cppPtr.~shared_ptr (); \
} \
......@@ -277,7 +277,7 @@ LINPHONE_END_NAMESPACE
BELLE_SIP_INSTANCIATE_VPTR( \
Linphone ## C_TYPE, \
belle_sip_object_t, \
_linphone_ ## C_NAME ## _uninit, \
_linphone_ ## C_TYPE ## _uninit, \
NULL, \
NULL, \
FALSE \
......@@ -292,52 +292,52 @@ LINPHONE_END_NAMESPACE
// -----------------------------------------------------------------------------
// Declare wrapped C object with constructor/destructor.
#define L_DECLARE_C_STRUCT_IMPL_WITH_XTORS(CPP_CLASS, C_TYPE, C_NAME, CONSTRUCTOR, DESTRUCTOR, ...) \
#define L_DECLARE_C_STRUCT_IMPL_WITH_XTORS(CPP_CLASS, C_TYPE, CONSTRUCTOR, DESTRUCTOR, ...) \
struct _Linphone ## C_TYPE { \
belle_sip_object_t base; \
std::shared_ptr<LINPHONE_NAMESPACE::CPP_CLASS> cppPtr; \
__VA_ARGS__ \
}; \
L_INTERNAL_DECLARE_C_STRUCT_FUNCTIONS(CPP_CLASS, C_TYPE, C_NAME, CONSTRUCTOR, DESTRUCTOR)
L_INTERNAL_DECLARE_C_STRUCT_FUNCTIONS(CPP_CLASS, C_TYPE, CONSTRUCTOR, DESTRUCTOR)
// Declare wrapped C object.
#define L_DECLARE_C_STRUCT_IMPL(CPP_CLASS, C_TYPE, C_NAME, ...) \
#define L_DECLARE_C_STRUCT_IMPL(CPP_CLASS, C_TYPE, ...) \
struct _Linphone ## C_TYPE { \
belle_sip_object_t base; \
std::shared_ptr<LINPHONE_NAMESPACE::CPP_CLASS> cppPtr; \
__VA_ARGS__ \
}; \
L_INTERNAL_DECLARE_C_STRUCT_FUNCTIONS(CPP_CLASS, C_TYPE, C_NAME, L_INTERNAL_C_STRUCT_NO_XTOR, L_INTERNAL_C_STRUCT_NO_XTOR)
L_INTERNAL_DECLARE_C_STRUCT_FUNCTIONS(CPP_CLASS, C_TYPE, L_INTERNAL_C_STRUCT_NO_XTOR, L_INTERNAL_C_STRUCT_NO_XTOR)
// Declare clonable wrapped C object.
#define L_DECLARE_C_CLONABLE_STRUCT_IMPL(CPP_CLASS, C_TYPE, C_NAME, ...) \
#define L_DECLARE_C_CLONABLE_STRUCT_IMPL(CPP_CLASS, C_TYPE, ...) \
struct _Linphone ## C_TYPE { \
belle_sip_object_t base; \
LINPHONE_NAMESPACE::CPP_CLASS *cppPtr; \
__VA_ARGS__ \
}; \
BELLE_SIP_DECLARE_VPTR_NO_EXPORT(Linphone ## C_TYPE); \
Linphone ## C_TYPE *_linphone_ ## C_NAME ## _init() { \
Linphone ## C_TYPE *_linphone_ ## C_TYPE ## _init() { \
return belle_sip_object_new(Linphone ## C_TYPE); \
} \
void _linphone_ ## C_NAME ## _uninit(Linphone ## C_TYPE * object) { \
static void _linphone_ ## C_TYPE ## _uninit(Linphone ## C_TYPE * object) { \
delete object->cppPtr; \
} \
void _linphone_ ## C_NAME ## _clone(Linphone ## C_TYPE * dest, const Linphone ## C_TYPE * src) { \
static void _linphone_ ## C_TYPE ## _clone(Linphone ## C_TYPE * dest, const Linphone ## C_TYPE * src) { \
L_ASSERT(src->cppPtr); \
dest->cppPtr = new LINPHONE_NAMESPACE::CPP_CLASS(*src->cppPtr); \
} \
BELLE_SIP_DECLARE_NO_IMPLEMENTED_INTERFACES(Linphone ## C_TYPE); \
BELLE_SIP_INSTANCIATE_VPTR(Linphone ## C_TYPE, belle_sip_object_t, \
_linphone_ ## C_NAME ## _uninit, \
_linphone_ ## C_NAME ## _clone, \
_linphone_ ## C_TYPE ## _uninit, \
_linphone_ ## C_TYPE ## _clone, \
NULL, \
FALSE \
);
#define L_DECLARE_C_STRUCT_NEW_DEFAULT(C_TYPE, C_NAME) \
Linphone ## C_TYPE * linphone_ ## C_NAME ## _new() { \
Linphone ## C_TYPE * object = _linphone_ ## C_NAME ## _init(); \
Linphone ## C_TYPE * object = _linphone_ ## C_TYPE ## _init(); \
object->cppPtr = std::make_shared<LINPHONE_NAMESPACE::C_TYPE>(); \
return object; \
}
......@@ -372,9 +372,9 @@ LINPHONE_END_NAMESPACE
))
// Get the wrapped C object of a C++ object.
#define L_GET_C_BACK_PTR(OBJECT, C_TYPE, C_NAME) \
#define L_GET_C_BACK_PTR(OBJECT, C_TYPE) \
LINPHONE_NAMESPACE::Wrapper::getCBackPtr<Linphone ## C_TYPE>( \
OBJECT, _linphone_ ## C_NAME ## _init \
OBJECT, _linphone_ ## C_TYPE ## _init \
)
// Get/set user data on a wrapped C object.
......@@ -392,8 +392,8 @@ LINPHONE_END_NAMESPACE
LINPHONE_NAMESPACE::Wrapper::getCListFromCppList<TYPE *>(LIST)
#define L_GET_CPP_LIST_FROM_C_LIST(LIST, TYPE) \
LINPHONE_NAMESPACE::Wrapper::getCppListFromCList<TYPE *>(LIST)
#define L_GET_C_LIST_OF_STRUCT_PTR_FROM_CPP_LIST_OF_CPP_OBJ(LIST, CPP_TYPE, C_TYPE, C_NAME) \
LINPHONE_NAMESPACE::Wrapper::getCListOfStructPtrFromCppListOfCppObj<LINPHONE_NAMESPACE::CPP_TYPE, Linphone ## C_TYPE>(LIST, _linphone_ ## C_NAME ## _init)
#define L_GET_C_LIST_OF_STRUCT_PTR_FROM_CPP_LIST_OF_CPP_OBJ(LIST, CPP_TYPE, C_TYPE) \
LINPHONE_NAMESPACE::Wrapper::getCListOfStructPtrFromCppListOfCppObj<LINPHONE_NAMESPACE::CPP_TYPE, Linphone ## C_TYPE>(LIST, _linphone_ ## C_TYPE ## _init)
#define L_GET_CPP_LIST_OF_CPP_OBJ_FROM_C_LIST_OF_STRUCT_PTR(LIST, CPP_TYPE, C_TYPE) \
LINPHONE_NAMESPACE::Wrapper::getCppListOfCppObjFromCListOfStructPtr<LINPHONE_NAMESPACE::CPP_TYPE, Linphone ## C_TYPE>(LIST)
......
......@@ -28,8 +28,8 @@
#include "chat-room.h"
extern LinphoneChatRoom * _linphone_chat_room_init();
#define GET_BACK_PTR(object) L_GET_C_BACK_PTR(object->shared_from_this(), ChatRoom, chat_room)
extern LinphoneChatRoom * _linphone_ChatRoom_init();
#define GET_BACK_PTR(object) L_GET_C_BACK_PTR(object->shared_from_this(), ChatRoom)
// =============================================================================
......
......@@ -23,8 +23,8 @@
// =============================================================================
extern LinphoneChatRoom * _linphone_chat_room_init();
extern LinphoneParticipant * _linphone_participant_init();
extern LinphoneChatRoom * _linphone_ChatRoom_init();
extern LinphoneParticipant * _linphone_Participant_init();
using namespace std;
......@@ -101,11 +101,11 @@ void ClientGroupChatRoom::onParticipantAdded (const Address &addr) {
}
participant = make_shared<Participant>(addr);
participants.push_back(participant);
LinphoneChatRoom *cr = L_GET_C_BACK_PTR(this->shared_from_this(), ChatRoom, chat_room);
LinphoneChatRoom *cr = L_GET_C_BACK_PTR(this->shared_from_this(), ChatRoom);
LinphoneChatRoomCbs *cbs = linphone_chat_room_get_callbacks(cr);
LinphoneChatRoomCbsParticipantAddedCb cb = linphone_chat_room_cbs_get_participant_added(cbs);
if (cb)
cb(cr, L_GET_C_BACK_PTR(participant, Participant, participant));
cb(cr, L_GET_C_BACK_PTR(participant, Participant));
}
void ClientGroupChatRoom::onParticipantRemoved (const Address &addr) {
......@@ -114,11 +114,11 @@ void ClientGroupChatRoom::onParticipantRemoved (const Address &addr) {
lWarning() << "Participant " << participant << " removed but not in the list of participants!";
return;
}
LinphoneChatRoom *cr = L_GET_C_BACK_PTR(this->shared_from_this(), ChatRoom, chat_room);
LinphoneChatRoom *cr = L_GET_C_BACK_PTR(this->shared_from_this(), ChatRoom);
LinphoneChatRoomCbs *cbs = linphone_chat_room_get_callbacks(cr);
LinphoneChatRoomCbsParticipantRemovedCb cb = linphone_chat_room_cbs_get_participant_removed(cbs);
if (cb)
cb(cr, L_GET_C_BACK_PTR(participant, Participant, participant));
cb(cr, L_GET_C_BACK_PTR(participant, Participant));
participants.remove(participant);
}
......@@ -129,11 +129,11 @@ void ClientGroupChatRoom::onParticipantSetAdmin (const Address &addr, bool isAdm
return;
}
participant->setAdmin(isAdmin);
LinphoneChatRoom *cr = L_GET_C_BACK_PTR(this->shared_from_this(), ChatRoom, chat_room);
LinphoneChatRoom *cr = L_GET_C_BACK_PTR(this->shared_from_this(), ChatRoom);
LinphoneChatRoomCbs *cbs = linphone_chat_room_get_callbacks(cr);
LinphoneChatRoomCbsParticipantAdminStatusChangedCb cb = linphone_chat_room_cbs_get_participant_admin_status_changed(cbs);
if (cb)
cb(cr, L_GET_C_BACK_PTR(participant, Participant, participant), isAdmin);
cb(cr, L_GET_C_BACK_PTR(participant, Participant), isAdmin);
}
LINPHONE_END_NAMESPACE
......@@ -24,8 +24,8 @@
#include "c-wrapper/c-tools.h"
#include "logger/logger.h"
extern LinphoneChatRoom * _linphone_chat_room_init();
#define GET_BACK_PTR(object) L_GET_C_BACK_PTR(object->shared_from_this(), ChatRoom, chat_room)
extern LinphoneChatRoom * _linphone_ChatRoom_init();
#define GET_BACK_PTR(object) L_GET_C_BACK_PTR(object->shared_from_this(), ChatRoom)
// =============================================================================
......
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