/*
* conference-participant-event.cpp
* Copyright (C) 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 3 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, see .
*/
#include "address/address.h"
#include "conference-event-p.h"
#include "conference-participant-event.h"
// =============================================================================
using namespace std;
LINPHONE_BEGIN_NAMESPACE
class ConferenceParticipantEventPrivate : public ConferenceEventPrivate {
public:
shared_ptr participantAddress;
};
// -----------------------------------------------------------------------------
ConferenceParticipantEvent::ConferenceParticipantEvent (
Type type,
const shared_ptr &conferenceAddress,
const shared_ptr &participantAddress
) : ConferenceEvent(*new ConferenceParticipantEventPrivate, type, conferenceAddress) {
L_D(ConferenceParticipantEvent);
L_ASSERT(
type == Type::ConferenceParticipantAdded ||
type == Type::ConferenceParticipantRemoved ||
type == Type::ConferenceParticipantSetAdmin ||
type == Type::ConferenceParticipantUnsetAdmin
);
L_ASSERT(participantAddress);
d->participantAddress = make_shared(*participantAddress);
}
ConferenceParticipantEvent::ConferenceParticipantEvent (const ConferenceParticipantEvent &src) :
ConferenceParticipantEvent(src.getType(), src.getAddress(), src.getParticipantAddress()) {}
ConferenceParticipantEvent &ConferenceParticipantEvent::operator= (const ConferenceParticipantEvent &src) {
L_D(ConferenceParticipantEvent);
if (this != &src) {
ConferenceEvent::operator=(src);
d->participantAddress = make_shared(*src.getPrivate()->participantAddress);
}
return *this;
}
shared_ptr ConferenceParticipantEvent::getParticipantAddress () const {
L_D(const ConferenceParticipantEvent);
return d->participantAddress;
}
LINPHONE_END_NAMESPACE