Add isMe() method to the conference.

This commit is contained in:
Ghislain MARY 2017-09-28 14:32:23 +02:00
parent b499578df6
commit 15c417b86c
2 changed files with 9 additions and 2 deletions

View file

@ -149,7 +149,7 @@ void Conference::onResetFirstVideoFrameDecoded (const CallSession &session) {
// -----------------------------------------------------------------------------
shared_ptr<Participant> Conference::findParticipant (const Address &addr) {
shared_ptr<Participant> Conference::findParticipant (const Address &addr) const {
for (const auto &participant : participants) {
if (addr.equal(participant->getAddress()))
return participant;
@ -157,4 +157,10 @@ shared_ptr<Participant> Conference::findParticipant (const Address &addr) {
return nullptr;
}
bool Conference::isMe (const Address &addr) const {
Address cleanedAddress = me->getAddress();
cleanedAddress.setPort(0);
return addr.equal(cleanedAddress);
}
LINPHONE_END_NAMESPACE

View file

@ -76,7 +76,8 @@ private:
protected:
explicit Conference (LinphoneCore *core, const Address &myAddress, CallListener *listener = nullptr);
std::shared_ptr<Participant> findParticipant (const Address &addr);
std::shared_ptr<Participant> findParticipant (const Address &addr) const;
bool isMe (const Address &addr) const ;
protected:
LinphoneCore *core = nullptr;