diff --git a/include/linphone/enums/event-log-enums.h b/include/linphone/enums/event-log-enums.h index 22c3d3d34..b209427bb 100644 --- a/include/linphone/enums/event-log-enums.h +++ b/include/linphone/enums/event-log-enums.h @@ -34,6 +34,7 @@ F(ConferenceParticipantSetAdmin) \ F(ConferenceParticipantUnsetAdmin) \ F(ConferenceParticipantDeviceAdded) \ - F(ConferenceParticipantDeviceRemoved) + F(ConferenceParticipantDeviceRemoved) \ + F(ConferenceSubjectChanged) #endif // ifndef _EVENT_LOG_ENUMS_H_ diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 4711b9625..3548dda9f 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -97,6 +97,7 @@ set(LINPHONE_CXX_OBJECTS_PRIVATE_HEADER_FILES event-log/conference-participant-device-event.h event-log/conference-participant-event-p.h event-log/conference-participant-event.h + event-log/conference-subject-event.h event-log/event-log-p.h event-log/event-log.h hacks/hacks.h @@ -174,6 +175,7 @@ set(LINPHONE_CXX_OBJECTS_SOURCE_FILES event-log/conference-event.cpp event-log/conference-participant-device-event.cpp event-log/conference-participant-event.cpp + event-log/conference-subject-event.cpp event-log/event-log.cpp hacks/hacks.cpp logger/logger.cpp diff --git a/src/db/main-db.cpp b/src/db/main-db.cpp index c5f9bb523..ead9d7c04 100644 --- a/src/db/main-db.cpp +++ b/src/db/main-db.cpp @@ -455,6 +455,7 @@ MainDb::MainDb () : AbstractDb(*new MainDbPrivate) {} case EventLog::Type::ConferenceParticipantUnsetAdmin: case EventLog::Type::ConferenceParticipantDeviceAdded: case EventLog::Type::ConferenceParticipantDeviceRemoved: + case EventLog::Type::ConferenceSubjectChanged: break; } diff --git a/src/event-log/conference-event-p.h b/src/event-log/conference-event-p.h index b3f403265..f88f80752 100644 --- a/src/event-log/conference-event-p.h +++ b/src/event-log/conference-event-p.h @@ -30,7 +30,7 @@ LINPHONE_BEGIN_NAMESPACE class ConferenceEventPrivate : public EventLogPrivate { private: - Address address; + Address conferenceAddress; L_DECLARE_PUBLIC(ConferenceEvent); }; diff --git a/src/event-log/conference-event.cpp b/src/event-log/conference-event.cpp index 795997a04..b6f4e67e3 100644 --- a/src/event-log/conference-event.cpp +++ b/src/event-log/conference-event.cpp @@ -26,34 +26,35 @@ using namespace std; LINPHONE_BEGIN_NAMESPACE -ConferenceEvent::ConferenceEvent (Type type, const Address &address) : +ConferenceEvent::ConferenceEvent (Type type, const Address &conferenceAddress) : EventLog(*new ConferenceEventPrivate, type) { L_D(); L_ASSERT(type == Type::ConferenceCreated || type == Type::ConferenceDestroyed); - d->address = address; + d->conferenceAddress = conferenceAddress; } -ConferenceEvent::ConferenceEvent (const ConferenceEvent &src) : ConferenceEvent(src.getType(), src.getAddress()) {} +ConferenceEvent::ConferenceEvent (const ConferenceEvent &src) : + ConferenceEvent(src.getType(), src.getConferenceAddress()) {} -ConferenceEvent::ConferenceEvent (ConferenceEventPrivate &p, Type type, const Address &address) : +ConferenceEvent::ConferenceEvent (ConferenceEventPrivate &p, Type type, const Address &conferenceAddress) : EventLog(p, type) { - L_D(); - d->address = address; -} + L_D(); + d->conferenceAddress = conferenceAddress; + } ConferenceEvent &ConferenceEvent::operator= (const ConferenceEvent &src) { L_D(); if (this != &src) { EventLog::operator=(src); - d->address = src.getPrivate()->address; + d->conferenceAddress = src.getPrivate()->conferenceAddress; } return *this; } -const Address &ConferenceEvent::getAddress () const { +const Address &ConferenceEvent::getConferenceAddress () const { L_D(); - return d->address; + return d->conferenceAddress; } LINPHONE_END_NAMESPACE diff --git a/src/event-log/conference-event.h b/src/event-log/conference-event.h index d915ece90..ff1e93439 100644 --- a/src/event-log/conference-event.h +++ b/src/event-log/conference-event.h @@ -31,16 +31,15 @@ class ConferenceEventPrivate; class LINPHONE_PUBLIC ConferenceEvent : public EventLog { public: - ConferenceEvent (Type type, const Address &address); + ConferenceEvent (Type type, const Address &conferenceAddress); ConferenceEvent (const ConferenceEvent &src); - virtual ~ConferenceEvent () = default; ConferenceEvent &operator= (const ConferenceEvent &src); - const Address &getAddress () const; + const Address &getConferenceAddress () const; protected: - ConferenceEvent (ConferenceEventPrivate &p, Type type, const Address &address); + ConferenceEvent (ConferenceEventPrivate &p, Type type, const Address &conferenceAddress); private: L_DECLARE_PRIVATE(ConferenceEvent); diff --git a/src/event-log/conference-participant-device-event.cpp b/src/event-log/conference-participant-device-event.cpp index 716a08131..ce1ffbe9a 100644 --- a/src/event-log/conference-participant-device-event.cpp +++ b/src/event-log/conference-participant-device-event.cpp @@ -55,7 +55,7 @@ ConferenceParticipantDeviceEvent::ConferenceParticipantDeviceEvent ( ConferenceParticipantDeviceEvent::ConferenceParticipantDeviceEvent (const ConferenceParticipantDeviceEvent &src) : ConferenceParticipantDeviceEvent( src.getType(), - src.getAddress(), + src.getConferenceAddress(), src.getParticipantAddress(), src.getGruuAddress() ) {} diff --git a/src/event-log/conference-participant-event.cpp b/src/event-log/conference-participant-event.cpp index 71ff78c82..00f591b4e 100644 --- a/src/event-log/conference-participant-event.cpp +++ b/src/event-log/conference-participant-event.cpp @@ -43,7 +43,7 @@ ConferenceParticipantEvent::ConferenceParticipantEvent ( } ConferenceParticipantEvent::ConferenceParticipantEvent (const ConferenceParticipantEvent &src) : - ConferenceParticipantEvent(src.getType(), src.getAddress(), src.getParticipantAddress()) {} + ConferenceParticipantEvent(src.getType(), src.getConferenceAddress(), src.getParticipantAddress()) {} ConferenceParticipantEvent::ConferenceParticipantEvent ( ConferenceParticipantEventPrivate &p, diff --git a/src/event-log/conference-subject-event.cpp b/src/event-log/conference-subject-event.cpp new file mode 100644 index 000000000..2cb6c9889 --- /dev/null +++ b/src/event-log/conference-subject-event.cpp @@ -0,0 +1,60 @@ +/* + * conference-subject-event.cpp + * Copyright (C) 2010-2017 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 "conference-event-p.h" +#include "conference-subject-event.h" + +// ============================================================================= + +using namespace std; + +LINPHONE_BEGIN_NAMESPACE + +class ConferenceSubjectEventPrivate : public ConferenceEventPrivate { +public: + string subject; +}; + +// ----------------------------------------------------------------------------- + +ConferenceSubjectEvent::ConferenceSubjectEvent (const Address &address, const string &subject) : + ConferenceEvent(*new ConferenceSubjectEventPrivate, Type::ConferenceSubjectChanged, address) { + L_D(); + d->subject = subject; +} + +ConferenceSubjectEvent::ConferenceSubjectEvent (const ConferenceSubjectEvent &src) : + ConferenceSubjectEvent(src.getConferenceAddress(), src.getSubject()) {} + +ConferenceSubjectEvent &ConferenceSubjectEvent::operator= (const ConferenceSubjectEvent &src) { + L_D(); + if (this != &src) { + ConferenceEvent::operator=(src); + d->subject = src.getPrivate()->subject; + } + + return *this; +} + +const string &ConferenceSubjectEvent::getSubject () const { + L_D(); + return d->subject; +} + +LINPHONE_END_NAMESPACE diff --git a/src/event-log/conference-subject-event.h b/src/event-log/conference-subject-event.h new file mode 100644 index 000000000..efb4e49f4 --- /dev/null +++ b/src/event-log/conference-subject-event.h @@ -0,0 +1,46 @@ +/* + * conference-subject-event.h + * Copyright (C) 2010-2017 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 _CONFERENCE_SUBJECT_EVENT_H_ +#define _CONFERENCE_SUBJECT_EVENT_H_ + +#include "conference-event.h" + +// ============================================================================= + +LINPHONE_BEGIN_NAMESPACE + +class ConferenceSubjectEventPrivate; + +class LINPHONE_PUBLIC ConferenceSubjectEvent : public ConferenceEvent { +public: + ConferenceSubjectEvent (const Address &conferenceAddress, const std::string &subject); + ConferenceSubjectEvent (const ConferenceSubjectEvent &src); + + ConferenceSubjectEvent &operator= (const ConferenceSubjectEvent &src); + + const std::string &getSubject () const; + +private: + L_DECLARE_PRIVATE(ConferenceSubjectEvent); +}; + +LINPHONE_END_NAMESPACE + +#endif // ifndef _CONFERENCE_SUBJECT_EVENT_H_ diff --git a/src/event-log/event-log.h b/src/event-log/event-log.h index 256fd2d53..057c141e6 100644 --- a/src/event-log/event-log.h +++ b/src/event-log/event-log.h @@ -39,7 +39,6 @@ public: EventLog (); EventLog (const EventLog &src); - virtual ~EventLog () = default; EventLog &operator= (const EventLog &src);