From 6dd6e829a3496c825da7d9ebeec771ded2f6333d Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 17 Nov 2017 15:02:25 +0100 Subject: [PATCH] feat(conference): refactoring, use CoreAccessor and ChatRoomId --- coreapi/linphonecore.c | 2 +- include/linphone/api/c-event-log.h | 13 +++- src/CMakeLists.txt | 12 +-- src/c-wrapper/api/c-event-log.cpp | 34 +++++++-- src/call/call.cpp | 4 +- src/chat/chat-room/basic-chat-room.cpp | 4 +- src/chat/chat-room/chat-room.cpp | 2 +- src/chat/chat-room/chat-room.h | 2 +- src/chat/chat-room/client-group-chat-room.cpp | 28 +++---- .../chat-room/real-time-text-chat-room.cpp | 2 +- .../chat-room/server-group-chat-room-stub.cpp | 6 +- src/conference/conference-p.h | 6 -- src/conference/conference.cpp | 13 ++-- src/conference/conference.h | 10 ++- .../local-conference-event-handler-p.h | 1 - .../local-conference-event-handler.cpp | 10 ++- .../local-conference-event-handler.h | 32 ++++---- .../remote-conference-event-handler-p.h | 11 ++- .../remote-conference-event-handler.cpp | 75 +++++++++++-------- .../remote-conference-event-handler.h | 32 ++++---- src/conference/local-conference.cpp | 8 +- src/conference/local-conference.h | 2 +- src/conference/remote-conference.cpp | 11 ++- src/conference/remote-conference.h | 3 +- src/conference/session/call-session.cpp | 6 +- src/db/main-db.cpp | 13 ++-- .../conference-chat-message-event.cpp | 3 +- src/event-log/conference/conference-event-p.h | 4 +- src/event-log/conference/conference-event.cpp | 12 +-- src/event-log/conference/conference-event.h | 8 +- .../conference/conference-notified-event.cpp | 8 +- .../conference/conference-notified-event.h | 4 +- .../conference-participant-device-event.cpp | 4 +- .../conference-participant-device-event.h | 2 +- .../conference-participant-event.cpp | 8 +- .../conference/conference-participant-event.h | 5 +- .../conference/conference-subject-event.cpp | 4 +- .../conference/conference-subject-event.h | 2 +- 38 files changed, 227 insertions(+), 179 deletions(-) rename src/conference/{ => handlers}/local-conference-event-handler-p.h (98%) rename src/conference/{ => handlers}/local-conference-event-handler.cpp (98%) rename src/conference/{ => handlers}/local-conference-event-handler.h (62%) rename src/conference/{ => handlers}/remote-conference-event-handler-p.h (91%) rename src/conference/{ => handlers}/remote-conference-event-handler.cpp (73%) rename src/conference/{ => handlers}/remote-conference-event-handler.h (66%) diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index bc5be81cd..1a19a1a43 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -50,7 +50,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "chat/chat-room/client-group-chat-room-p.h" #include "chat/chat-room/server-group-chat-room-p.h" -#include "conference/remote-conference-event-handler.h" +#include "conference/handlers/remote-conference-event-handler.h" #include "core/core.h" // For migration purpose. diff --git a/include/linphone/api/c-event-log.h b/include/linphone/api/c-event-log.h index 6edb53ffc..5ebcae081 100644 --- a/include/linphone/api/c-event-log.h +++ b/include/linphone/api/c-event-log.h @@ -66,11 +66,18 @@ LINPHONE_PUBLIC time_t linphone_event_log_get_creation_time (const LinphoneEvent // ----------------------------------------------------------------------------- /** - * Returns the conference address of a conference event. + * Returns the peer address of a conference event. * @param[in] event_log A #LinphoneEventLog object. - * @return The conference address. + * @return The peer address. */ -LINPHONE_PUBLIC const LinphoneAddress *linphone_event_log_get_conference_address (const LinphoneEventLog *event_log); +LINPHONE_PUBLIC const LinphoneAddress *linphone_event_log_get_peer_address (const LinphoneEventLog *event_log); + +/** + * Returns the local address of a conference event. + * @param[in] event_log A #LinphoneEventLog object. + * @return The local address. + */ +LINPHONE_PUBLIC const LinphoneAddress *linphone_event_log_get_local_address (const LinphoneEventLog *event_log); // ----------------------------------------------------------------------------- // ConferenceNotifiedEvent. diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 2df1a80a2..30575da1e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -63,8 +63,10 @@ set(LINPHONE_CXX_OBJECTS_PRIVATE_HEADER_FILES conference/conference-listener.h conference/conference-p.h conference/conference.h - conference/local-conference-event-handler-p.h - conference/local-conference-event-handler.h + conference/handlers/local-conference-event-handler-p.h + conference/handlers/local-conference-event-handler.h + conference/handlers/remote-conference-event-handler-p.h + conference/handlers/remote-conference-event-handler.h conference/local-conference-p.h conference/local-conference.h conference/params/call-session-params-p.h @@ -74,8 +76,6 @@ set(LINPHONE_CXX_OBJECTS_PRIVATE_HEADER_FILES conference/participant-device.h conference/participant-p.h conference/participant.h - conference/remote-conference-event-handler-p.h - conference/remote-conference-event-handler.h conference/remote-conference-p.h conference/remote-conference.h conference/session/call-session-listener.h @@ -178,13 +178,13 @@ set(LINPHONE_CXX_OBJECTS_SOURCE_FILES chat/notification/imdn.cpp chat/notification/is-composing.cpp conference/conference.cpp - conference/local-conference-event-handler.cpp + conference/handlers/local-conference-event-handler.cpp + conference/handlers/remote-conference-event-handler.cpp conference/local-conference.cpp conference/params/call-session-params.cpp conference/params/media-session-params.cpp conference/participant-device.cpp conference/participant.cpp - conference/remote-conference-event-handler.cpp conference/remote-conference.cpp conference/session/call-session.cpp conference/session/media-session.cpp diff --git a/src/c-wrapper/api/c-event-log.cpp b/src/c-wrapper/api/c-event-log.cpp index 2b93bc2d0..0a12eefbb 100644 --- a/src/c-wrapper/api/c-event-log.cpp +++ b/src/c-wrapper/api/c-event-log.cpp @@ -22,6 +22,7 @@ #include "c-wrapper/c-wrapper.h" #include "call/call.h" #include "chat/chat-message/chat-message.h" +#include "chat/chat-room/chat-room-id.h" #include "event-log/events.h" // ============================================================================= @@ -35,7 +36,8 @@ L_DECLARE_C_OBJECT_IMPL_WITH_XTORS( EventLog, _linphone_event_log_constructor, _linphone_event_log_destructor, - mutable LinphoneAddress *conferenceAddressCache; + mutable LinphoneAddress *peerAddressCache; + mutable LinphoneAddress *localAddressCache; mutable LinphoneAddress *participantAddressCache; mutable LinphoneAddress *deviceAddressCache; ); @@ -43,8 +45,10 @@ L_DECLARE_C_OBJECT_IMPL_WITH_XTORS( void _linphone_event_log_constructor (LinphoneEventLog *) {} void _linphone_event_log_destructor (LinphoneEventLog *event_log) { - if (event_log->conferenceAddressCache) - linphone_address_unref(event_log->conferenceAddressCache); + if (event_log->peerAddressCache) + linphone_address_unref(event_log->peerAddressCache); + if (event_log->localAddressCache) + linphone_address_unref(event_log->localAddressCache); if (event_log->participantAddressCache) linphone_address_unref(event_log->participantAddressCache); if (event_log->deviceAddressCache) @@ -190,18 +194,32 @@ time_t linphone_event_log_get_creation_time (const LinphoneEventLog *event_log) // ConferenceEvent. // ----------------------------------------------------------------------------- -const LinphoneAddress *linphone_event_log_get_conference_address (const LinphoneEventLog *event_log) { +const LinphoneAddress *linphone_event_log_get_peer_address (const LinphoneEventLog *event_log) { if (!isConferenceType(linphone_event_log_get_type(event_log))) return nullptr; - if (!event_log->conferenceAddressCache) - event_log->conferenceAddressCache = linphone_address_new( + if (!event_log->peerAddressCache) + event_log->peerAddressCache = linphone_address_new( static_pointer_cast( L_GET_CPP_PTR_FROM_C_OBJECT(event_log) - )->getConferenceAddress().asString().c_str() + )->getChatRoomId().getPeerAddress().asString().c_str() ); - return event_log->conferenceAddressCache; + return event_log->peerAddressCache; +} + +const LinphoneAddress *linphone_event_log_get_local_address (const LinphoneEventLog *event_log) { + if (!isConferenceType(linphone_event_log_get_type(event_log))) + return nullptr; + + if (!event_log->localAddressCache) + event_log->localAddressCache = linphone_address_new( + static_pointer_cast( + L_GET_CPP_PTR_FROM_C_OBJECT(event_log) + )->getChatRoomId().getLocalAddress().asString().c_str() + ); + + return event_log->localAddressCache; } // ----------------------------------------------------------------------------- diff --git a/src/call/call.cpp b/src/call/call.cpp index ea85c024d..3a6eeef86 100644 --- a/src/call/call.cpp +++ b/src/call/call.cpp @@ -227,9 +227,9 @@ Call::Call ( const Address *myAddress = (direction == LinphoneCallIncoming) ? &to : &from; string confType = lp_config_get_string(linphone_core_get_config(core), "misc", "conference_type", "local"); if (confType == "remote") { - d->conference = new RemoteConference(core, *myAddress, d); + d->conference = new RemoteConference(core->cppCore, *myAddress, d); } else { - d->conference = new LocalConference(core, *myAddress, d); + d->conference = new LocalConference(core->cppCore, *myAddress, d); } const Address *remoteAddress = (direction == LinphoneCallIncoming) ? &from : &to; d->conference->addParticipant(*remoteAddress, msp, true); diff --git a/src/chat/chat-room/basic-chat-room.cpp b/src/chat/chat-room/basic-chat-room.cpp index a02a58657..985b09519 100644 --- a/src/chat/chat-room/basic-chat-room.cpp +++ b/src/chat/chat-room/basic-chat-room.cpp @@ -30,13 +30,13 @@ using namespace std; LINPHONE_BEGIN_NAMESPACE BasicChatRoom::BasicChatRoom (const shared_ptr &core, const ChatRoomId &chatRoomId) : - ChatRoom(*new BasicChatRoomPrivate, core, chatRoomId) {} + BasicChatRoom(*new BasicChatRoomPrivate, core, chatRoomId) {} BasicChatRoom::BasicChatRoom ( BasicChatRoomPrivate &p, const std::shared_ptr &core, const ChatRoomId &chatRoomId -) : ChatRoom(p, core, chatRoomId) {} +) : CoreAccessor(core), ChatRoom(p, core, chatRoomId) {} BasicChatRoom::CapabilitiesMask BasicChatRoom::getCapabilities () const { return static_cast(Capabilities::Basic); diff --git a/src/chat/chat-room/chat-room.cpp b/src/chat/chat-room/chat-room.cpp index cc9b2e5b7..0e2b77c6c 100644 --- a/src/chat/chat-room/chat-room.cpp +++ b/src/chat/chat-room/chat-room.cpp @@ -449,7 +449,7 @@ void ChatRoomPrivate::onIsComposingRefreshNeeded () { // ============================================================================= ChatRoom::ChatRoom (ChatRoomPrivate &p, const shared_ptr &core, const ChatRoomId &chatRoomId) : - Object(p), CoreAccessor(core) { + CoreAccessor(core), Object(p) { L_D(); d->chatRoomId = chatRoomId; diff --git a/src/chat/chat-room/chat-room.h b/src/chat/chat-room/chat-room.h index b11d28d93..51f4c59cd 100644 --- a/src/chat/chat-room/chat-room.h +++ b/src/chat/chat-room/chat-room.h @@ -30,7 +30,7 @@ LINPHONE_BEGIN_NAMESPACE class ChatRoomPrivate; -class LINPHONE_PUBLIC ChatRoom : public Object, public CoreAccessor, public ConferenceInterface { +class LINPHONE_PUBLIC ChatRoom : public Object, virtual public CoreAccessor, public ConferenceInterface { friend class Core; friend class CorePrivate; friend class ChatMessage; diff --git a/src/chat/chat-room/client-group-chat-room.cpp b/src/chat/chat-room/client-group-chat-room.cpp index 24fe71db5..5d22c36a9 100644 --- a/src/chat/chat-room/client-group-chat-room.cpp +++ b/src/chat/chat-room/client-group-chat-room.cpp @@ -22,8 +22,8 @@ #include "address/address-p.h" #include "c-wrapper/c-wrapper.h" #include "client-group-chat-room-p.h" +#include "conference/handlers/remote-conference-event-handler.h" #include "conference/participant-p.h" -#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" @@ -81,9 +81,9 @@ ClientGroupChatRoom::ClientGroupChatRoom ( const std::string &factoryUri, const IdentityAddress &me, const std::string &subject -) : +) : CoreAccessor(core), ChatRoom(*new ClientGroupChatRoomPrivate, core, ChatRoomId(IdentityAddress(), me)), -RemoteConference(core->getCCore(), me, nullptr) { +RemoteConference(core, me, nullptr) { L_D_T(RemoteConference, dConference); dConference->focus = make_shared(Address(factoryUri)); RemoteConference::setSubject(subject); @@ -141,7 +141,7 @@ void ClientGroupChatRoom::addParticipants ( } void ClientGroupChatRoom::removeParticipant (const shared_ptr &participant) { - LinphoneCore *cCore = CoreAccessor::getCore()->getCCore(); + LinphoneCore *cCore = getCore()->getCCore(); SalReferOp *referOp = new SalReferOp(cCore->sal); LinphoneAddress *lAddr = linphone_address_new(getConferenceAddress().asString().c_str()); @@ -183,7 +183,7 @@ void ClientGroupChatRoom::setParticipantAdminStatus (shared_ptr &pa return; } - LinphoneCore *cCore = CoreAccessor::getCore()->getCCore(); + LinphoneCore *cCore = getCore()->getCCore(); SalReferOp *referOp = new SalReferOp(cCore->sal); LinphoneAddress *lAddr = linphone_address_new(getConferenceAddress().asString().c_str()); @@ -261,7 +261,7 @@ void ClientGroupChatRoom::onConferenceCreated (const Address &addr) { L_D_T(RemoteConference, dConference); dConference->conferenceAddress = addr; d->chatRoomId = ChatRoomId(addr, d->chatRoomId.getLocalAddress()); - CoreAccessor::getCore()->getPrivate()->insertChatRoom(getSharedFromThis()); + getCore()->getPrivate()->insertChatRoom(getSharedFromThis()); } void ClientGroupChatRoom::onConferenceTerminated (const Address &addr) { @@ -274,7 +274,7 @@ void ClientGroupChatRoom::onConferenceTerminated (const Address &addr) { void ClientGroupChatRoom::onFirstNotifyReceived (const Address &addr) { L_D(); d->setState(ChatRoom::State::Created); - CoreAccessor::getCore()->getPrivate()->insertChatRoomWithDb(getSharedFromThis()); + getCore()->getPrivate()->insertChatRoomWithDb(getSharedFromThis()); } void ClientGroupChatRoom::onParticipantAdded (const shared_ptr &event, bool isFullState) { @@ -299,7 +299,7 @@ void ClientGroupChatRoom::onParticipantAdded (const shared_ptrcppCore->getPrivate()->mainDb->addEvent(event); + getCore()->getPrivate()->mainDb->addEvent(event); if (cb) cb(cr, L_GET_C_BACK_PTR(event)); @@ -322,7 +322,7 @@ void ClientGroupChatRoom::onParticipantRemoved (const shared_ptrcppCore->getPrivate()->mainDb->addEvent(event); + getCore()->getPrivate()->mainDb->addEvent(event); if (cb) cb(cr, L_GET_C_BACK_PTR(event)); @@ -351,7 +351,7 @@ void ClientGroupChatRoom::onParticipantSetAdmin (const shared_ptrcppCore->getPrivate()->mainDb->addEvent(event); + getCore()->getPrivate()->mainDb->addEvent(event); if (cb) cb(cr, L_GET_C_BACK_PTR(event)); @@ -368,7 +368,7 @@ void ClientGroupChatRoom::onSubjectChanged (const shared_ptrcppCore->getPrivate()->mainDb->addEvent(event); + getCore()->getPrivate()->mainDb->addEvent(event); if (cb) cb(cr, L_GET_C_BACK_PTR(event)); @@ -393,7 +393,7 @@ void ClientGroupChatRoom::onParticipantDeviceAdded (const shared_ptrcppCore->getPrivate()->mainDb->addEvent(event); + getCore()->getPrivate()->mainDb->addEvent(event); if (cb) cb(cr, L_GET_C_BACK_PTR(event)); @@ -416,7 +416,7 @@ void ClientGroupChatRoom::onParticipantDeviceRemoved (const shared_ptrcppCore->getPrivate()->mainDb->addEvent(event); + getCore()->getPrivate()->mainDb->addEvent(event); if (cb) cb(cr, L_GET_C_BACK_PTR(event)); @@ -445,7 +445,7 @@ void ClientGroupChatRoom::onCallSessionStateChanged ( Address addr(session->getRemoteContactAddress()->asStringUriOnly()); onConferenceCreated(addr); if (session->getRemoteContactAddress()->hasParam("isfocus")) - dConference->eventHandler->subscribe(getConferenceAddress()); + dConference->eventHandler->subscribe(getChatRoomId()); } else if (d->state == ChatRoom::State::TerminationPending) dConference->focus->getPrivate()->getSession()->terminate(); } else if ((state == LinphoneCallReleased) && (d->state == ChatRoom::State::TerminationPending)) { diff --git a/src/chat/chat-room/real-time-text-chat-room.cpp b/src/chat/chat-room/real-time-text-chat-room.cpp index d4ed5ee45..7a8cb8ef6 100644 --- a/src/chat/chat-room/real-time-text-chat-room.cpp +++ b/src/chat/chat-room/real-time-text-chat-room.cpp @@ -104,7 +104,7 @@ void RealTimeTextChatRoomPrivate::sendMessage (const shared_ptr &ms // ============================================================================= RealTimeTextChatRoom::RealTimeTextChatRoom (const shared_ptr &core, const ChatRoomId &chatRoomId) : - BasicChatRoom(*new RealTimeTextChatRoomPrivate, core, chatRoomId) {} + CoreAccessor(core), BasicChatRoom(*new RealTimeTextChatRoomPrivate, core, chatRoomId) {} RealTimeTextChatRoom::CapabilitiesMask RealTimeTextChatRoom::getCapabilities () const { return BasicChatRoom::getCapabilities() | static_cast(Capabilities::RealTimeText); diff --git a/src/chat/chat-room/server-group-chat-room-stub.cpp b/src/chat/chat-room/server-group-chat-room-stub.cpp index faace05d4..a1fe25c89 100644 --- a/src/chat/chat-room/server-group-chat-room-stub.cpp +++ b/src/chat/chat-room/server-group-chat-room-stub.cpp @@ -77,9 +77,9 @@ bool ServerGroupChatRoomPrivate::isAdminLeft () const { // ============================================================================= -ServerGroupChatRoom::ServerGroupChatRoom (const shared_ptr &core, SalCallOp *op) : - ChatRoom(*new ServerGroupChatRoomPrivate, core, ChatRoomId(IdentityAddress(op->get_to()), IdentityAddress(op->get_to()))), - LocalConference(core->getCCore(), Address(op->get_to()), nullptr) {} +ServerGroupChatRoom::ServerGroupChatRoom (const shared_ptr &core, SalCallOp *op) : CoreAccessor(core), +ChatRoom(*new ServerGroupChatRoomPrivate, core, ChatRoomId(IdentityAddress(op->get_to()), IdentityAddress(op->get_to()))), +LocalConference(core, Address(op->get_to()), nullptr) {} int ServerGroupChatRoom::getCapabilities () const { return 0; diff --git a/src/conference/conference-p.h b/src/conference/conference-p.h index 1b0421da4..f036e6da0 100644 --- a/src/conference/conference-p.h +++ b/src/conference/conference-p.h @@ -20,11 +20,6 @@ #ifndef _CONFERENCE_P_H_ #define _CONFERENCE_P_H_ -#include -#include - -#include "linphone/types.h" - #include "address/address.h" #include "conference.h" @@ -41,7 +36,6 @@ public: std::list> participants; protected: - LinphoneCore *core = nullptr; CallListener *callListener = nullptr; std::shared_ptr activeParticipant; diff --git a/src/conference/conference.cpp b/src/conference/conference.cpp index 4af0f39f6..bb7cd4e67 100644 --- a/src/conference/conference.cpp +++ b/src/conference/conference.cpp @@ -29,10 +29,14 @@ using namespace std; LINPHONE_BEGIN_NAMESPACE -Conference::Conference (ConferencePrivate &p, LinphoneCore *core, const Address &myAddress, CallListener *listener) : mPrivate(&p) { +Conference::Conference ( + ConferencePrivate &p, + const shared_ptr &core, + const Address &myAddress, + CallListener *listener +) : CoreAccessor(core), mPrivate(&p) { L_D(); d->mPublic = this; - d->core = core; d->callListener = listener; d->me = make_shared(myAddress); } @@ -48,11 +52,6 @@ shared_ptr Conference::getActiveParticipant () const { return d->activeParticipant; } -LinphoneCore *Conference::getCore () const { - L_D(); - return d->core; -} - // ----------------------------------------------------------------------------- void Conference::addParticipant (const Address &addr, const CallSessionParams *params, bool hasMedia) { diff --git a/src/conference/conference.h b/src/conference/conference.h index 6bd9eb783..6489a11b4 100644 --- a/src/conference/conference.h +++ b/src/conference/conference.h @@ -24,6 +24,7 @@ #include "conference/conference-interface.h" #include "conference/session/call-session-listener.h" +#include "core/core-accessor.h" // ============================================================================= @@ -33,7 +34,10 @@ class CallListener; class CallSessionPrivate; class ConferencePrivate; -class LINPHONE_PUBLIC Conference : public ConferenceInterface, public CallSessionListener { +class LINPHONE_PUBLIC Conference : + public ConferenceInterface, + public CallSessionListener, + virtual public CoreAccessor { friend class CallSessionPrivate; public: @@ -41,8 +45,6 @@ public: std::shared_ptr getActiveParticipant () const; - LinphoneCore * getCore () const; - std::shared_ptr findParticipant (const std::shared_ptr &session) const; /* ConferenceInterface */ @@ -82,7 +84,7 @@ private: protected: explicit Conference ( ConferencePrivate &p, - LinphoneCore *core, + const std::shared_ptr &core, const Address &myAddress, CallListener *listener = nullptr ); diff --git a/src/conference/local-conference-event-handler-p.h b/src/conference/handlers/local-conference-event-handler-p.h similarity index 98% rename from src/conference/local-conference-event-handler-p.h rename to src/conference/handlers/local-conference-event-handler-p.h index 16ee8c9f1..14211f0fa 100644 --- a/src/conference/local-conference-event-handler-p.h +++ b/src/conference/handlers/local-conference-event-handler-p.h @@ -47,7 +47,6 @@ public: inline unsigned int getLastNotify () const { return lastNotify; }; private: - LinphoneCore *core = nullptr; LocalConference *conf = nullptr; unsigned int lastNotify = 0; diff --git a/src/conference/local-conference-event-handler.cpp b/src/conference/handlers/local-conference-event-handler.cpp similarity index 98% rename from src/conference/local-conference-event-handler.cpp rename to src/conference/handlers/local-conference-event-handler.cpp index 75f2fd85d..b364f4547 100644 --- a/src/conference/local-conference-event-handler.cpp +++ b/src/conference/handlers/local-conference-event-handler.cpp @@ -19,12 +19,15 @@ #include +#include "linphone/utils/utils.h" + #include "conference/local-conference.h" #include "conference/participant-p.h" -#include "linphone/utils/utils.h" #include "local-conference-event-handler-p.h" #include "logger/logger.h" #include "object/object-p.h" + +// TODO: remove me. #include "private.h" // ============================================================================= @@ -247,12 +250,11 @@ string LocalConferenceEventHandlerPrivate::createNotifyParticipantDeviceRemoved // ============================================================================= -LocalConferenceEventHandler::LocalConferenceEventHandler (LinphoneCore *core, LocalConference *localConf) : +LocalConferenceEventHandler::LocalConferenceEventHandler (LocalConference *localConference) : Object(*new LocalConferenceEventHandlerPrivate) { L_D(); xercesc::XMLPlatformUtils::Initialize(); - d->conf = localConf; - d->core = core; + d->conf = localConference; // TODO : init d->lastNotify = last notify } diff --git a/src/conference/local-conference-event-handler.h b/src/conference/handlers/local-conference-event-handler.h similarity index 62% rename from src/conference/local-conference-event-handler.h rename to src/conference/handlers/local-conference-event-handler.h index f34eaee7d..bdb14700b 100644 --- a/src/conference/local-conference-event-handler.h +++ b/src/conference/handlers/local-conference-event-handler.h @@ -20,31 +20,35 @@ #ifndef _LOCAL_CONFERENCE_EVENT_HANDLER_H_ #define _LOCAL_CONFERENCE_EVENT_HANDLER_H_ -#include "address/address.h" #include "linphone/types.h" + +#include "address/address.h" +#include "core/core-accessor.h" #include "object/object.h" +// ============================================================================= + LINPHONE_BEGIN_NAMESPACE class LocalConference; class LocalConferenceEventHandlerPrivate; class LocalConferenceEventHandler : public Object { - public: - LocalConferenceEventHandler (LinphoneCore *core, LocalConference *localConf); - ~LocalConferenceEventHandler (); +public: + LocalConferenceEventHandler (LocalConference *localConference); + ~LocalConferenceEventHandler (); - void subscribeReceived (LinphoneEvent *lev); - void notifyParticipantAdded (const Address &addr); - void notifyParticipantRemoved (const Address &addr); - void notifyParticipantSetAdmin (const Address &addr, bool isAdmin); - void notifySubjectChanged (); - void notifyParticipantDeviceAdded (const Address &addr, const Address &gruu); - void notifyParticipantDeviceRemoved (const Address &addr, const Address &gruu); + void subscribeReceived (LinphoneEvent *lev); + void notifyParticipantAdded (const Address &addr); + void notifyParticipantRemoved (const Address &addr); + void notifyParticipantSetAdmin (const Address &addr, bool isAdmin); + void notifySubjectChanged (); + void notifyParticipantDeviceAdded (const Address &addr, const Address &gruu); + void notifyParticipantDeviceRemoved (const Address &addr, const Address &gruu); - private: - L_DECLARE_PRIVATE(LocalConferenceEventHandler); - L_DISABLE_COPY(LocalConferenceEventHandler); +private: + L_DECLARE_PRIVATE(LocalConferenceEventHandler); + L_DISABLE_COPY(LocalConferenceEventHandler); }; LINPHONE_END_NAMESPACE diff --git a/src/conference/remote-conference-event-handler-p.h b/src/conference/handlers/remote-conference-event-handler-p.h similarity index 91% rename from src/conference/remote-conference-event-handler-p.h rename to src/conference/handlers/remote-conference-event-handler-p.h index 88eba6168..fb69feab3 100644 --- a/src/conference/remote-conference-event-handler-p.h +++ b/src/conference/handlers/remote-conference-event-handler-p.h @@ -20,7 +20,9 @@ #ifndef _REMOTE_CONFERENCE_EVENT_HANDLER_P_H_ #define _REMOTE_CONFERENCE_EVENT_HANDLER_P_H_ -#include "address/address.h" +#include "linphone/types.h" + +#include "chat/chat-room/chat-room-id.h" #include "object/object-p.h" #include "remote-conference-event-handler.h" @@ -30,10 +32,11 @@ LINPHONE_BEGIN_NAMESPACE class RemoteConferenceEventHandlerPrivate : public ObjectPrivate { private: - LinphoneCore *core = nullptr; - ConferenceListener *listener = nullptr; - Address confAddress; + ChatRoomId chatRoomId; + + RemoteConference *conf = nullptr; LinphoneEvent *lev = nullptr; + unsigned int lastNotify = 0; L_DECLARE_PUBLIC(RemoteConferenceEventHandler); diff --git a/src/conference/remote-conference-event-handler.cpp b/src/conference/handlers/remote-conference-event-handler.cpp similarity index 73% rename from src/conference/remote-conference-event-handler.cpp rename to src/conference/handlers/remote-conference-event-handler.cpp index 01bd441a7..df4b8b56a 100644 --- a/src/conference/remote-conference-event-handler.cpp +++ b/src/conference/handlers/remote-conference-event-handler.cpp @@ -17,13 +17,17 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "address/identity-address.h" -#include "private.h" +#include "linphone/utils/utils.h" + +#include "conference/remote-conference.h" +#include "core/core.h" #include "logger/logger.h" #include "remote-conference-event-handler-p.h" -#include "linphone/utils/utils.h" #include "xml/conference-info.h" +// TODO: Remove me later. +#include "private.h" + // ============================================================================= using namespace std; @@ -34,12 +38,11 @@ using namespace Xsd::ConferenceInfo; // ----------------------------------------------------------------------------- -RemoteConferenceEventHandler::RemoteConferenceEventHandler (LinphoneCore *core, ConferenceListener *listener) - : Object(*new RemoteConferenceEventHandlerPrivate) { +RemoteConferenceEventHandler::RemoteConferenceEventHandler (RemoteConference *remoteConference) : +Object(*new RemoteConferenceEventHandlerPrivate) { L_D(); xercesc::XMLPlatformUtils::Initialize(); - d->core = core; - d->listener = listener; + d->conf = remoteConference; // TODO : d->lastNotify = lastNotify } @@ -49,11 +52,11 @@ RemoteConferenceEventHandler::~RemoteConferenceEventHandler () { // ----------------------------------------------------------------------------- -void RemoteConferenceEventHandler::subscribe (const Address &addr) { +void RemoteConferenceEventHandler::subscribe (const ChatRoomId &chatRoomId) { L_D(); - d->confAddress = addr; - LinphoneAddress *lAddr = linphone_address_new(d->confAddress.asString().c_str()); - d->lev = linphone_core_create_subscribe(d->core, lAddr, "conference", 600); + d->chatRoomId = chatRoomId; + LinphoneAddress *lAddr = linphone_address_new(d->chatRoomId.getPeerAddress().asString().c_str()); + d->lev = linphone_core_create_subscribe(d->conf->getCore()->getCCore(), lAddr, "conference", 600); linphone_event_add_custom_header(d->lev, "Last-Notify-Version", Utils::toString(d->lastNotify).c_str()); linphone_address_unref(lAddr); linphone_event_set_internal(d->lev, TRUE); @@ -71,7 +74,10 @@ void RemoteConferenceEventHandler::unsubscribe () { void RemoteConferenceEventHandler::notifyReceived (const string &xmlBody) { L_D(); - lInfo() << "NOTIFY received for conference " << d->confAddress.asString(); + + lInfo() << "NOTIFY received for conference: (remote=" << d->chatRoomId.getPeerAddress().asString() << + ", local=" << d->chatRoomId.getLocalAddress().asString() << ")."; + istringstream data(xmlBody); unique_ptr confInfo = parseConferenceInfo(data, Xsd::XmlSchema::Flags::dont_validate); time_t tm = time(nullptr); @@ -79,20 +85,23 @@ void RemoteConferenceEventHandler::notifyReceived (const string &xmlBody) { tm = static_cast(Utils::stoll(confInfo->getConferenceDescription()->getFreeText().get())); bool isFullState = (confInfo->getState() == StateType::full); - IdentityAddress simpleConfAddress(d->confAddress); - // Temporary workaround + + ConferenceListener *confListener = static_cast(d->conf); + + // TODO: Temporary workaround, remove me. + const IdentityAddress &peerAddress = d->chatRoomId.getPeerAddress(); IdentityAddress entityAddress(confInfo->getEntity().c_str()); - IdentityAddress simpleConfAddress2(simpleConfAddress); - simpleConfAddress2.setDomain(entityAddress.getDomain()); - if ((entityAddress == simpleConfAddress) || (entityAddress == simpleConfAddress2)) { + IdentityAddress peerAddressWorkaround = peerAddress; + peerAddressWorkaround.setDomain(entityAddress.getDomain()); + if ((entityAddress == peerAddress) || (entityAddress == peerAddressWorkaround)) { if ( confInfo->getConferenceDescription().present() && confInfo->getConferenceDescription().get().getSubject().present() ) - d->listener->onSubjectChanged( + confListener->onSubjectChanged( make_shared( tm, - d->confAddress, + d->chatRoomId, d->lastNotify, confInfo->getConferenceDescription().get().getSubject().get() ), @@ -105,16 +114,16 @@ void RemoteConferenceEventHandler::notifyReceived (const string &xmlBody) { return; for (const auto &user : confInfo->getUsers()->getUser()) { - LinphoneAddress *cAddr = linphone_core_interpret_url(d->core, user.getEntity()->c_str()); + LinphoneAddress *cAddr = linphone_core_interpret_url(d->conf->getCore()->getCCore(), user.getEntity()->c_str()); char *cAddrStr = linphone_address_as_string(cAddr); Address addr(cAddrStr); bctbx_free(cAddrStr); if (user.getState() == StateType::deleted) { - d->listener->onParticipantRemoved( + confListener->onParticipantRemoved( make_shared( EventLog::Type::ConferenceParticipantRemoved, tm, - d->confAddress, + d->chatRoomId, d->lastNotify, addr ), @@ -132,11 +141,11 @@ void RemoteConferenceEventHandler::notifyReceived (const string &xmlBody) { } if (user.getState() == StateType::full) { - d->listener->onParticipantAdded( + confListener->onParticipantAdded( make_shared( EventLog::Type::ConferenceParticipantAdded, tm, - d->confAddress, + d->chatRoomId, d->lastNotify, addr ), @@ -144,11 +153,11 @@ void RemoteConferenceEventHandler::notifyReceived (const string &xmlBody) { ); } - d->listener->onParticipantSetAdmin( + confListener->onParticipantSetAdmin( make_shared( isAdmin ? EventLog::Type::ConferenceParticipantSetAdmin : EventLog::Type::ConferenceParticipantUnsetAdmin, tm, - d->confAddress, + d->chatRoomId, d->lastNotify, addr ), @@ -161,11 +170,11 @@ void RemoteConferenceEventHandler::notifyReceived (const string &xmlBody) { Address gruu(endpoint.getEntity().get()); if (endpoint.getState() == StateType::deleted) { - d->listener->onParticipantDeviceRemoved( + confListener->onParticipantDeviceRemoved( make_shared( EventLog::Type::ConferenceParticipantDeviceRemoved, tm, - d->confAddress, + d->chatRoomId, d->lastNotify, addr, gruu @@ -173,11 +182,11 @@ void RemoteConferenceEventHandler::notifyReceived (const string &xmlBody) { isFullState ); } else if (endpoint.getState() == StateType::full) { - d->listener->onParticipantDeviceAdded( + confListener->onParticipantDeviceAdded( make_shared( EventLog::Type::ConferenceParticipantDeviceAdded, tm, - d->confAddress, + d->chatRoomId, d->lastNotify, addr, gruu @@ -191,15 +200,15 @@ void RemoteConferenceEventHandler::notifyReceived (const string &xmlBody) { } if (isFullState) - d->listener->onFirstNotifyReceived(d->confAddress); + confListener->onFirstNotifyReceived(d->chatRoomId.getPeerAddress()); } } // ----------------------------------------------------------------------------- -const Address &RemoteConferenceEventHandler::getConfAddress () const { +const ChatRoomId &RemoteConferenceEventHandler::getChatRoomId () const { L_D(); - return d->confAddress; + return d->chatRoomId; } unsigned int RemoteConferenceEventHandler::getLastNotify () const { diff --git a/src/conference/remote-conference-event-handler.h b/src/conference/handlers/remote-conference-event-handler.h similarity index 66% rename from src/conference/remote-conference-event-handler.h rename to src/conference/handlers/remote-conference-event-handler.h index 2422fdb8d..7598283d2 100644 --- a/src/conference/remote-conference-event-handler.h +++ b/src/conference/handlers/remote-conference-event-handler.h @@ -20,31 +20,33 @@ #ifndef _REMOTE_CONFERENCE_EVENT_HANDLER_H_ #define _REMOTE_CONFERENCE_EVENT_HANDLER_H_ -#include - -#include "conference-listener.h" #include "object/object.h" +// ============================================================================= + LINPHONE_BEGIN_NAMESPACE +class ChatRoomId; +class RemoteConference; class RemoteConferenceEventHandlerPrivate; class RemoteConferenceEventHandler : public Object { - public: - RemoteConferenceEventHandler (LinphoneCore *core, ConferenceListener *listener); - ~RemoteConferenceEventHandler (); +public: + RemoteConferenceEventHandler (RemoteConference *remoteConference); + ~RemoteConferenceEventHandler (); - void subscribe (const Address &confAddress); - void notifyReceived (const std::string &xmlBody); - void unsubscribe (); + void subscribe (const ChatRoomId &chatRoomId); + void notifyReceived (const std::string &xmlBody); + void unsubscribe (); - const Address &getConfAddress () const; - unsigned int getLastNotify () const; - void resetLastNotify (); + const ChatRoomId &getChatRoomId () const; - private: - L_DECLARE_PRIVATE(RemoteConferenceEventHandler); - L_DISABLE_COPY(RemoteConferenceEventHandler); + unsigned int getLastNotify () const; + void resetLastNotify (); + +private: + L_DECLARE_PRIVATE(RemoteConferenceEventHandler); + L_DISABLE_COPY(RemoteConferenceEventHandler); }; LINPHONE_END_NAMESPACE diff --git a/src/conference/local-conference.cpp b/src/conference/local-conference.cpp index 11e41e4e8..36ad2cf57 100644 --- a/src/conference/local-conference.cpp +++ b/src/conference/local-conference.cpp @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "local-conference-event-handler.h" +#include "handlers/local-conference-event-handler.h" #include "local-conference-p.h" #include "participant-p.h" #include "xml/resource-lists.h" @@ -28,10 +28,10 @@ using namespace std; LINPHONE_BEGIN_NAMESPACE -LocalConference::LocalConference (LinphoneCore *core, const Address &myAddress, CallListener *listener) - : Conference(*new LocalConferencePrivate, core, myAddress, listener) { +LocalConference::LocalConference (const shared_ptr &core, const Address &myAddress, CallListener *listener) + : CoreAccessor(core), Conference(*new LocalConferencePrivate, core, myAddress, listener) { L_D(); - d->eventHandler.reset(new LocalConferenceEventHandler(core, this)); + d->eventHandler.reset(new LocalConferenceEventHandler(this)); } // ----------------------------------------------------------------------------- diff --git a/src/conference/local-conference.h b/src/conference/local-conference.h index f27b8f75b..58198518e 100644 --- a/src/conference/local-conference.h +++ b/src/conference/local-conference.h @@ -32,7 +32,7 @@ class LocalConference : public Conference { friend class ServerGroupChatRoomPrivate; public: - LocalConference (LinphoneCore *core, const Address &myAddress, CallListener *listener = nullptr); + LocalConference (const std::shared_ptr &core, const Address &myAddress, CallListener *listener = nullptr); /* ConferenceInterface */ void addParticipant (const Address &addr, const CallSessionParams *params, bool hasMedia) override; diff --git a/src/conference/remote-conference.cpp b/src/conference/remote-conference.cpp index c93dde6ce..194a1235c 100644 --- a/src/conference/remote-conference.cpp +++ b/src/conference/remote-conference.cpp @@ -17,8 +17,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +#include "handlers/remote-conference-event-handler.h" #include "participant-p.h" -#include "remote-conference-event-handler.h" #include "remote-conference-p.h" #include "xml/resource-lists.h" @@ -28,10 +28,13 @@ using namespace std; LINPHONE_BEGIN_NAMESPACE -RemoteConference::RemoteConference (LinphoneCore *core, const Address &myAddress, CallListener *listener) - : Conference(*new RemoteConferencePrivate, core, myAddress, listener) { +RemoteConference::RemoteConference ( + const shared_ptr &core, + const Address &myAddress, + CallListener *listener +) : CoreAccessor(core), Conference(*new RemoteConferencePrivate, core, myAddress, listener) { L_D(); - d->eventHandler.reset(new RemoteConferenceEventHandler(core, this)); + d->eventHandler.reset(new RemoteConferenceEventHandler(this)); } RemoteConference::~RemoteConference () { diff --git a/src/conference/remote-conference.h b/src/conference/remote-conference.h index bf630cfb1..fa85faeb6 100644 --- a/src/conference/remote-conference.h +++ b/src/conference/remote-conference.h @@ -22,6 +22,7 @@ #include "conference-listener.h" #include "conference.h" +#include "core/core-accessor.h" // ============================================================================= @@ -33,7 +34,7 @@ class LINPHONE_PUBLIC RemoteConference : public Conference, public ConferenceLis friend class ClientGroupChatRoomPrivate; public: - RemoteConference (LinphoneCore *core, const Address &myAddress, CallListener *listener = nullptr); + RemoteConference (const std::shared_ptr &core, const Address &myAddress, CallListener *listener = nullptr); virtual ~RemoteConference(); /* ConferenceInterface */ diff --git a/src/conference/session/call-session.cpp b/src/conference/session/call-session.cpp index ccb20d225..fe11ac162 100644 --- a/src/conference/session/call-session.cpp +++ b/src/conference/session/call-session.cpp @@ -22,11 +22,11 @@ #include "c-wrapper/c-wrapper.h" #include "address/address-p.h" -#include "conference/session/call-session-p.h" #include "call/call-p.h" #include "conference/params/call-session-params-p.h" - +#include "conference/session/call-session-p.h" #include "conference/session/call-session.h" +#include "core/core.h" #include "logger/logger.h" @@ -45,7 +45,7 @@ CallSessionPrivate::CallSessionPrivate (const Conference &conference, const Call if (params) this->params = new CallSessionParams(*params); currentParams = new CallSessionParams(); - core = conference.getCore(); + core = conference.getCore()->getCCore(); ei = linphone_error_info_new(); } diff --git a/src/db/main-db.cpp b/src/db/main-db.cpp index 52969d8df..ff4d64310 100644 --- a/src/db/main-db.cpp +++ b/src/db/main-db.cpp @@ -20,10 +20,7 @@ #include #include -// TODO: Remove me. -#ifdef SOCI_ENABLED - #undef SOCI_ENABLED -#endif +#undef SOCI_ENABLED #ifdef SOCI_ENABLED #include @@ -635,7 +632,9 @@ MainDb::MainDb (const shared_ptr &core) : AbstractDb(*new MainDbPrivate), *session << "CREATE TABLE IF NOT EXISTS chat_room (" // Server (for conference) or user sip address. - " peer_sip_address_id" + primaryKeyStr("BIGINT UNSIGNED") + "," + " peer_sip_address_id" + primaryKeyRefStr("BIGINT UNSIGNED") + "," + + " local_sip_address_id" + primaryKeyRefStr("BIGINT UNSIGNED") + "," // Dialog creation date. " creation_date DATE NOT NULL," @@ -651,9 +650,13 @@ MainDb::MainDb (const shared_ptr &core) : AbstractDb(*new MainDbPrivate), " last_notify_id INT UNSIGNED," + " PRIMARY KEY (peer_sip_address_id, local_sip_address_id)," " FOREIGN KEY (peer_sip_address_id)" " REFERENCES sip_address(id)" " ON DELETE CASCADE" + " FOREIGN KEY (local_sip_address_id)" + " REFERENCES sip_address(id)" + " ON DELETE CASCADE" ") " + charset; *session << diff --git a/src/event-log/conference/conference-chat-message-event.cpp b/src/event-log/conference/conference-chat-message-event.cpp index a33819fc2..c3dc766c0 100644 --- a/src/event-log/conference/conference-chat-message-event.cpp +++ b/src/event-log/conference/conference-chat-message-event.cpp @@ -18,6 +18,7 @@ */ #include "chat/chat-message/chat-message.h" +#include "chat/chat-room/chat-room.h" #include "conference-chat-message-event.h" #include "conference-event-p.h" @@ -43,7 +44,7 @@ ConferenceChatMessageEvent::ConferenceChatMessageEvent ( *new ConferenceChatMessageEventPrivate, EventLog::Type::ConferenceChatMessage, creationTime, - chatMessage->getRemoteAddress() + chatMessage->getChatRoom()->getChatRoomId() ) { L_D(); L_ASSERT(chatMessage); diff --git a/src/event-log/conference/conference-event-p.h b/src/event-log/conference/conference-event-p.h index ac633fb7c..18f11ad66 100644 --- a/src/event-log/conference/conference-event-p.h +++ b/src/event-log/conference/conference-event-p.h @@ -20,7 +20,7 @@ #ifndef _CONFERENCE_EVENT_P_H_ #define _CONFERENCE_EVENT_P_H_ -#include "address/identity-address.h" +#include "chat/chat-room/chat-room-id.h" #include "conference-event.h" #include "event-log/event-log-p.h" @@ -30,7 +30,7 @@ LINPHONE_BEGIN_NAMESPACE class ConferenceEventPrivate : public EventLogPrivate { private: - IdentityAddress conferenceAddress; + ChatRoomId chatRoomId; L_DECLARE_PUBLIC(ConferenceEvent); }; diff --git a/src/event-log/conference/conference-event.cpp b/src/event-log/conference/conference-event.cpp index 38d39206b..5f6d88bb8 100644 --- a/src/event-log/conference/conference-event.cpp +++ b/src/event-log/conference/conference-event.cpp @@ -27,26 +27,26 @@ LINPHONE_BEGIN_NAMESPACE // ----------------------------------------------------------------------------- -ConferenceEvent::ConferenceEvent (Type type, time_t creationTime, const IdentityAddress &conferenceAddress) : +ConferenceEvent::ConferenceEvent (Type type, time_t creationTime, const ChatRoomId &chatRoomId) : EventLog(*new ConferenceEventPrivate, type, creationTime) { L_D(); L_ASSERT(type == Type::ConferenceCreated || type == Type::ConferenceDestroyed); - d->conferenceAddress = conferenceAddress; + d->chatRoomId = chatRoomId; } ConferenceEvent::ConferenceEvent ( ConferenceEventPrivate &p, Type type, time_t creationTime, - const IdentityAddress &conferenceAddress + const ChatRoomId &chatRoomId ) : EventLog(p, type, creationTime) { L_D(); - d->conferenceAddress = conferenceAddress; + d->chatRoomId = chatRoomId; } -const IdentityAddress &ConferenceEvent::getConferenceAddress () const { +const ChatRoomId &ConferenceEvent::getChatRoomId () const { L_D(); - return d->conferenceAddress; + return d->chatRoomId; } LINPHONE_END_NAMESPACE diff --git a/src/event-log/conference/conference-event.h b/src/event-log/conference/conference-event.h index 25cdf9a10..077c971f6 100644 --- a/src/event-log/conference/conference-event.h +++ b/src/event-log/conference/conference-event.h @@ -27,16 +27,16 @@ LINPHONE_BEGIN_NAMESPACE class ConferenceEventPrivate; -class IdentityAddress; +class ChatRoomId; class LINPHONE_PUBLIC ConferenceEvent : public EventLog { public: - ConferenceEvent (Type type, time_t creationTime, const IdentityAddress &conferenceAddress); + ConferenceEvent (Type type, time_t creationTime, const ChatRoomId &chatRoomId); - const IdentityAddress &getConferenceAddress () const; + const ChatRoomId &getChatRoomId () const; protected: - ConferenceEvent (ConferenceEventPrivate &p, Type type, time_t creationTime, const IdentityAddress &conferenceAddress); + ConferenceEvent (ConferenceEventPrivate &p, Type type, time_t creationTime, const ChatRoomId &chatRoomId); private: L_DECLARE_PRIVATE(ConferenceEvent); diff --git a/src/event-log/conference/conference-notified-event.cpp b/src/event-log/conference/conference-notified-event.cpp index 4f36e6d7d..372a7e30e 100644 --- a/src/event-log/conference/conference-notified-event.cpp +++ b/src/event-log/conference/conference-notified-event.cpp @@ -30,9 +30,9 @@ LINPHONE_BEGIN_NAMESPACE ConferenceNotifiedEvent::ConferenceNotifiedEvent ( Type type, time_t creationTime, - const IdentityAddress &conferenceAddress, + const ChatRoomId &chatRoomId, unsigned int notifyId -) : ConferenceEvent(*new ConferenceNotifiedEventPrivate, type, creationTime, conferenceAddress) { +) : ConferenceEvent(*new ConferenceNotifiedEventPrivate, type, creationTime, chatRoomId) { L_D(); d->notifyId = notifyId; } @@ -41,9 +41,9 @@ ConferenceNotifiedEvent::ConferenceNotifiedEvent ( ConferenceNotifiedEventPrivate &p, Type type, time_t creationTime, - const IdentityAddress &conferenceAddress, + const ChatRoomId &chatRoomId, unsigned int notifyId -) : ConferenceEvent(p, type, creationTime, conferenceAddress) { +) : ConferenceEvent(p, type, creationTime, chatRoomId) { L_D(); d->notifyId = notifyId; } diff --git a/src/event-log/conference/conference-notified-event.h b/src/event-log/conference/conference-notified-event.h index f93dd0402..1520d930e 100644 --- a/src/event-log/conference/conference-notified-event.h +++ b/src/event-log/conference/conference-notified-event.h @@ -32,7 +32,7 @@ class LINPHONE_PUBLIC ConferenceNotifiedEvent : public ConferenceEvent { public: ConferenceNotifiedEvent ( Type type, time_t creationTime, - const IdentityAddress &conferenceAddress, + const ChatRoomId &chatRoomId, unsigned int notifiyId ); @@ -43,7 +43,7 @@ protected: ConferenceNotifiedEventPrivate &p, Type type, time_t creationTime, - const IdentityAddress &conferenceAddress, + const ChatRoomId &chatRoomId, unsigned int notifyId ); diff --git a/src/event-log/conference/conference-participant-device-event.cpp b/src/event-log/conference/conference-participant-device-event.cpp index 9f44bd540..682618d69 100644 --- a/src/event-log/conference/conference-participant-device-event.cpp +++ b/src/event-log/conference/conference-participant-device-event.cpp @@ -38,7 +38,7 @@ public: ConferenceParticipantDeviceEvent::ConferenceParticipantDeviceEvent ( Type type, time_t creationTime, - const IdentityAddress &conferenceAddress, + const ChatRoomId &chatRoomId, unsigned int notifyId, const IdentityAddress &participantAddress, const IdentityAddress &deviceAddress @@ -46,7 +46,7 @@ ConferenceParticipantDeviceEvent::ConferenceParticipantDeviceEvent ( *new ConferenceParticipantDeviceEventPrivate, type, creationTime, - conferenceAddress, + chatRoomId, notifyId, participantAddress ) { diff --git a/src/event-log/conference/conference-participant-device-event.h b/src/event-log/conference/conference-participant-device-event.h index 62f9a3ed9..979f48061 100644 --- a/src/event-log/conference/conference-participant-device-event.h +++ b/src/event-log/conference/conference-participant-device-event.h @@ -33,7 +33,7 @@ public: ConferenceParticipantDeviceEvent ( Type type, time_t creationTime, - const IdentityAddress &conferenceAddress, + const ChatRoomId &chatRoomId, unsigned int notifyId, const IdentityAddress &participantAddress, const IdentityAddress &deviceAddress diff --git a/src/event-log/conference/conference-participant-event.cpp b/src/event-log/conference/conference-participant-event.cpp index 0c9c3c4aa..d50b86633 100644 --- a/src/event-log/conference/conference-participant-event.cpp +++ b/src/event-log/conference/conference-participant-event.cpp @@ -30,14 +30,14 @@ LINPHONE_BEGIN_NAMESPACE ConferenceParticipantEvent::ConferenceParticipantEvent ( Type type, time_t creationTime, - const IdentityAddress &conferenceAddress, + const ChatRoomId &chatRoomId, unsigned int notifyId, const IdentityAddress &participantAddress ) : ConferenceNotifiedEvent( *new ConferenceParticipantEventPrivate, type, creationTime, - conferenceAddress, + chatRoomId, notifyId ) { L_D(); @@ -54,14 +54,14 @@ ConferenceParticipantEvent::ConferenceParticipantEvent ( ConferenceParticipantEventPrivate &p, Type type, time_t creationTime, - const IdentityAddress &conferenceAddress, + const ChatRoomId &chatRoomId, unsigned int notifyId, const IdentityAddress &participantAddress ) : ConferenceNotifiedEvent( p, type, creationTime, - conferenceAddress, + chatRoomId, notifyId ) { L_D(); diff --git a/src/event-log/conference/conference-participant-event.h b/src/event-log/conference/conference-participant-event.h index 76731dcbc..20f5e71de 100644 --- a/src/event-log/conference/conference-participant-event.h +++ b/src/event-log/conference/conference-participant-event.h @@ -27,13 +27,14 @@ LINPHONE_BEGIN_NAMESPACE class ConferenceParticipantEventPrivate; +class IdentityAddress; class LINPHONE_PUBLIC ConferenceParticipantEvent : public ConferenceNotifiedEvent { public: ConferenceParticipantEvent ( Type type, time_t creationTime, - const IdentityAddress &conferenceAddress, + const ChatRoomId &ChatRoomId, unsigned int notifyId, const IdentityAddress &participantAddress ); @@ -45,7 +46,7 @@ protected: ConferenceParticipantEventPrivate &p, Type type, time_t creationTime, - const IdentityAddress &conferenceAddress, + const ChatRoomId &ChatRoomId, unsigned int notifyId, const IdentityAddress &participantAddress ); diff --git a/src/event-log/conference/conference-subject-event.cpp b/src/event-log/conference/conference-subject-event.cpp index 7d084e82d..55c7c8ae7 100644 --- a/src/event-log/conference/conference-subject-event.cpp +++ b/src/event-log/conference/conference-subject-event.cpp @@ -37,14 +37,14 @@ public: ConferenceSubjectEvent::ConferenceSubjectEvent ( time_t creationTime, - const IdentityAddress &conferenceAddress, + const ChatRoomId &chatRoomId, unsigned int notifyId, const string &subject ) : ConferenceNotifiedEvent( *new ConferenceSubjectEventPrivate, Type::ConferenceSubjectChanged, creationTime, - conferenceAddress, + chatRoomId, notifyId ) { L_D(); diff --git a/src/event-log/conference/conference-subject-event.h b/src/event-log/conference/conference-subject-event.h index 7eba0cab2..d36d47fe3 100644 --- a/src/event-log/conference/conference-subject-event.h +++ b/src/event-log/conference/conference-subject-event.h @@ -34,7 +34,7 @@ class LINPHONE_PUBLIC ConferenceSubjectEvent : public ConferenceNotifiedEvent { public: ConferenceSubjectEvent ( time_t creationTime, - const IdentityAddress &conferenceAddress, + const ChatRoomId &chatRoomId, unsigned int notifyId, const std::string &subject );