Commit 249b7c0e authored by Ronan's avatar Ronan

feat(ConferenceEvent): supports notifyId parameter

parent 8a8aed0e
......@@ -52,8 +52,8 @@ set(LINPHONE_CXX_OBJECTS_PRIVATE_HEADER_FILES
chat/modifier/encryption-chat-message-modifier.h
chat/modifier/multipart-chat-message-modifier.h
chat/notification/imdn.h
chat/notification/is-composing.h
chat/notification/is-composing-listener.h
chat/notification/is-composing.h
conference/conference-listener.h
conference/conference-p.h
conference/conference.h
......
/*
* conference-notified-p.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_NOTIFIED_EVENT_P_H_
#define _CONFERENCE_NOTIFIED_EVENT_P_H_
#include "conference-event-p.h"
#include "conference-notified-event.h"
// =============================================================================
LINPHONE_BEGIN_NAMESPACE
class ConferenceNotifiedEventPrivate : public ConferenceEventPrivate {
private:
unsigned int notifyId = 0;
L_DECLARE_PUBLIC(ConferenceNotifiedEvent);
};
LINPHONE_END_NAMESPACE
#endif // ifndef _CONFERENCE_NOTIFIED_EVENT_P_H_
/*
* conference-notified-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-notified-event-p.h"
// =============================================================================
using namespace std;
LINPHONE_BEGIN_NAMESPACE
// -----------------------------------------------------------------------------
ConferenceNotifiedEvent::ConferenceNotifiedEvent (
Type type,
time_t time,
const Address &conferenceAddress,
unsigned int notifyId
) : ConferenceEvent(*new ConferenceNotifiedEventPrivate, type, time, conferenceAddress) {
L_D();
d->notifyId = notifyId;
}
ConferenceNotifiedEvent::ConferenceNotifiedEvent (
const ConferenceNotifiedEvent &src
) : ConferenceNotifiedEvent(
src.getType(),
src.getTime(),
src.getConferenceAddress(),
src.getNotifyId()
) {}
ConferenceNotifiedEvent::ConferenceNotifiedEvent (
ConferenceNotifiedEventPrivate &p,
Type type,
time_t time,
const Address &conferenceAddress,
unsigned int notifyId
) : ConferenceEvent(p, type, time, conferenceAddress) {
L_D();
d->notifyId = notifyId;
}
ConferenceNotifiedEvent &ConferenceNotifiedEvent::operator= (const ConferenceNotifiedEvent &src) {
L_D();
if (this != &src) {
ConferenceEvent::operator=(src);
d->notifyId = src.getPrivate()->notifyId;
}
return *this;
}
unsigned int ConferenceNotifiedEvent::getNotifyId () const {
L_D();
return d->notifyId;
}
LINPHONE_END_NAMESPACE
......@@ -26,20 +26,25 @@
LINPHONE_BEGIN_NAMESPACE
class Address;
class ConferenceNotifiedEventPrivate;
class LINPHONE_PUBLIC ConferenceNotifiedEvent : public EventLog {
class LINPHONE_PUBLIC ConferenceNotifiedEvent : public ConferenceEvent {
public:
ConferenceNotifiedEvent (Type type, std::time_t time, const Address &conferenceAddress);
ConferenceNotifiedEvent (Type type, std::time_t time, const Address &conferenceAddress, unsigned int notifiyId);
ConferenceNotifiedEvent (const ConferenceNotifiedEvent &src);
ConferenceNotifiedEvent &operator= (const ConferenceNotifiedEvent &src);
const Address &getConferenceAddress () const;
unsigned int getNotifyId () const;
protected:
ConferenceNotifiedEvent (ConferenceNotifiedEventPrivate &p, Type type, std::time_t time, const Address &conferenceAddress);
ConferenceNotifiedEvent (
ConferenceNotifiedEventPrivate &p,
Type type,
std::time_t time,
const Address &conferenceAddress,
unsigned int notifyId
);
private:
L_DECLARE_PRIVATE(ConferenceNotifiedEvent);
......
......@@ -37,6 +37,7 @@ ConferenceParticipantDeviceEvent::ConferenceParticipantDeviceEvent (
Type type,
time_t time,
const Address &conferenceAddress,
unsigned int notifyId,
const Address &participantAddress,
const Address &gruuAddress
) : ConferenceParticipantEvent(
......@@ -44,6 +45,7 @@ ConferenceParticipantDeviceEvent::ConferenceParticipantDeviceEvent (
type,
time,
conferenceAddress,
notifyId,
participantAddress
) {
L_D();
......@@ -59,6 +61,7 @@ ConferenceParticipantDeviceEvent::ConferenceParticipantDeviceEvent (const Confer
src.getType(),
src.getTime(),
src.getConferenceAddress(),
src.getNotifyId(),
src.getParticipantAddress(),
src.getGruuAddress()
) {}
......
......@@ -34,6 +34,7 @@ public:
Type type,
std::time_t time,
const Address &conferenceAddress,
unsigned int notifyId,
const Address &participantAddress,
const Address &gruuAddress
);
......
......@@ -20,14 +20,14 @@
#ifndef _CONFERENCE_PARTICIPANT_EVENT_P_H_
#define _CONFERENCE_PARTICIPANT_EVENT_P_H_
#include "conference-event-p.h"
#include "conference-notified-event-p.h"
#include "conference-participant-event.h"
// =============================================================================
LINPHONE_BEGIN_NAMESPACE
class ConferenceParticipantEventPrivate : public ConferenceEventPrivate {
class ConferenceParticipantEventPrivate : public ConferenceNotifiedEventPrivate {
private:
Address participantAddress;
......
......@@ -31,8 +31,9 @@ ConferenceParticipantEvent::ConferenceParticipantEvent (
Type type,
time_t time,
const Address &conferenceAddress,
unsigned int notifyId,
const Address &participantAddress
) : ConferenceEvent(*new ConferenceParticipantEventPrivate, type, time, conferenceAddress) {
) : ConferenceNotifiedEvent(*new ConferenceParticipantEventPrivate, type, time, conferenceAddress, notifyId) {
L_D();
L_ASSERT(
type == Type::ConferenceParticipantAdded ||
......@@ -49,6 +50,7 @@ ConferenceParticipantEvent::ConferenceParticipantEvent (
src.getType(),
src.getTime(),
src.getConferenceAddress(),
src.getNotifyId(),
src.getParticipantAddress()
) {}
......@@ -57,8 +59,9 @@ ConferenceParticipantEvent::ConferenceParticipantEvent (
Type type,
time_t time,
const Address &conferenceAddress,
unsigned int notifyId,
const Address &participantAddress
) : ConferenceEvent(p, type, time, conferenceAddress) {
) : ConferenceNotifiedEvent(p, type, time, conferenceAddress, notifyId) {
L_D();
d->participantAddress = participantAddress;
}
......
......@@ -20,7 +20,7 @@
#ifndef _CONFERENCE_PARTICIPANT_EVENT_H_
#define _CONFERENCE_PARTICIPANT_EVENT_H_
#include "conference-event.h"
#include "conference-notified-event.h"
// =============================================================================
......@@ -28,12 +28,13 @@ LINPHONE_BEGIN_NAMESPACE
class ConferenceParticipantEventPrivate;
class LINPHONE_PUBLIC ConferenceParticipantEvent : public ConferenceEvent {
class LINPHONE_PUBLIC ConferenceParticipantEvent : public ConferenceNotifiedEvent {
public:
ConferenceParticipantEvent (
Type type,
std::time_t time,
const Address &conferenceAddress,
unsigned int notifyId,
const Address &participantAddress
);
ConferenceParticipantEvent (const ConferenceParticipantEvent &src);
......@@ -48,6 +49,7 @@ protected:
Type type,
std::time_t time,
const Address &conferenceAddress,
unsigned int notifyId,
const Address &participantAddress
);
......
......@@ -17,7 +17,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "conference-event-p.h"
#include "conference-notified-event-p.h"
#include "conference-subject-event.h"
// =============================================================================
......@@ -26,7 +26,7 @@ using namespace std;
LINPHONE_BEGIN_NAMESPACE
class ConferenceSubjectEventPrivate : public ConferenceEventPrivate {
class ConferenceSubjectEventPrivate : public ConferenceNotifiedEventPrivate {
public:
string subject;
};
......@@ -35,15 +35,22 @@ public:
ConferenceSubjectEvent::ConferenceSubjectEvent (
time_t time,
const Address &address,
const Address &conferenceAddress,
unsigned int notifyId,
const string &subject
) : ConferenceEvent(*new ConferenceSubjectEventPrivate, Type::ConferenceSubjectChanged, time, address) {
) : ConferenceNotifiedEvent(
*new ConferenceSubjectEventPrivate,
Type::ConferenceSubjectChanged,
time,
conferenceAddress,
notifyId
) {
L_D();
d->subject = subject;
}
ConferenceSubjectEvent::ConferenceSubjectEvent (const ConferenceSubjectEvent &src) :
ConferenceSubjectEvent(src.getTime(), src.getConferenceAddress(), src.getSubject()) {}
ConferenceSubjectEvent(src.getTime(), src.getConferenceAddress(), src.getNotifyId(), src.getSubject()) {}
ConferenceSubjectEvent &ConferenceSubjectEvent::operator= (const ConferenceSubjectEvent &src) {
L_D();
......
......@@ -20,7 +20,7 @@
#ifndef _CONFERENCE_SUBJECT_EVENT_H_
#define _CONFERENCE_SUBJECT_EVENT_H_
#include "conference-event.h"
#include "conference-notified-event.h"
// =============================================================================
......@@ -28,9 +28,14 @@ LINPHONE_BEGIN_NAMESPACE
class ConferenceSubjectEventPrivate;
class LINPHONE_PUBLIC ConferenceSubjectEvent : public ConferenceEvent {
class LINPHONE_PUBLIC ConferenceSubjectEvent : public ConferenceNotifiedEvent {
public:
ConferenceSubjectEvent (std::time_t time, const Address &conferenceAddress, const std::string &subject);
ConferenceSubjectEvent (
std::time_t time,
const Address &conferenceAddress,
unsigned int notifyId,
const std::string &subject
);
ConferenceSubjectEvent (const ConferenceSubjectEvent &src);
ConferenceSubjectEvent &operator= (const ConferenceSubjectEvent &src);
......
......@@ -38,6 +38,8 @@ static const string getDatabasePath () {
static void open_database () {
MainDb eventsDb;
BC_ASSERT_TRUE(eventsDb.connect(MainDb::Sqlite3, getDatabasePath()));
eventsDb.import(AbstractDb::Backend::Sqlite3, "/home/rabhamon/.local/share/linphone/message-history.db");
}
static void get_events_count () {
......
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