Commit 902cb501 authored by Ghislain MARY's avatar Ghislain MARY

Merge SimpleAddress and GruuAddress classes into a single IdentityAddress class.

parent f117ff95
......@@ -129,7 +129,7 @@ static void call_received(SalCallOp *h) {
linphone_address_unref(toAddr);
linphone_address_unref(fromAddr);
shared_ptr<ChatRoom> chatRoom = lc->cppCore->findChatRoom(
ChatRoomId(SimpleAddress(h->get_to()), SimpleAddress(h->get_to()))
ChatRoomId(IdentityAddress(h->get_to()), IdentityAddress(h->get_to()))
);
if (chatRoom) {
L_GET_PRIVATE(static_pointer_cast<ServerGroupChatRoom>(chatRoom))->confirmJoining(h);
......@@ -753,10 +753,10 @@ static void refer_received(SalOp *op, const SalAddress *refer_to){
if (linphone_core_conference_server_enabled(lc)) {
// Removal of a participant at the server side
shared_ptr<ChatRoom> chatRoom = lc->cppCore->findChatRoom(
ChatRoomId(SimpleAddress(op->get_to()), SimpleAddress(op->get_to()))
ChatRoomId(IdentityAddress(op->get_to()), IdentityAddress(op->get_to()))
);
if (chatRoom) {
std::shared_ptr<Participant> participant = chatRoom->findParticipant(SimpleAddress(op->get_from()));
std::shared_ptr<Participant> participant = chatRoom->findParticipant(IdentityAddress(op->get_from()));
if (!participant || !participant->isAdmin()) {
static_cast<SalReferOp *>(op)->reply(SalReasonDeclined);
return;
......@@ -770,7 +770,7 @@ static void refer_received(SalOp *op, const SalAddress *refer_to){
} else {
// The server asks a participant to leave a chat room
LinphoneChatRoom *cr = L_GET_C_BACK_PTR(
lc->cppCore->findChatRoom(ChatRoomId(addr, SimpleAddress(op->get_to())))
lc->cppCore->findChatRoom(ChatRoomId(addr, IdentityAddress(op->get_to())))
);
if (cr) {
L_GET_CPP_PTR_FROM_C_OBJECT(cr)->leave();
......@@ -781,7 +781,7 @@ static void refer_received(SalOp *op, const SalAddress *refer_to){
}
} else if (addr.hasParam("admin")) {
LinphoneChatRoom *cr = L_GET_C_BACK_PTR(lc->cppCore->findChatRoom(
ChatRoomId(SimpleAddress(op->get_to()), SimpleAddress(op->get_to()))
ChatRoomId(IdentityAddress(op->get_to()), IdentityAddress(op->get_to()))
));
if (cr) {
Address fromAddr(op->get_from());
......@@ -799,7 +799,7 @@ static void refer_received(SalOp *op, const SalAddress *refer_to){
return;
}
} else {
LinphoneChatRoom *cr = L_GET_C_BACK_PTR(lc->cppCore->findChatRoom(ChatRoomId(addr, SimpleAddress(op->get_to()))));
LinphoneChatRoom *cr = L_GET_C_BACK_PTR(lc->cppCore->findChatRoom(ChatRoomId(addr, IdentityAddress(op->get_to()))));
if (!cr)
cr = _linphone_client_group_chat_room_new(lc, addr.asString().c_str(), nullptr);
L_GET_CPP_PTR_FROM_C_OBJECT(cr)->join();
......
......@@ -121,7 +121,7 @@ int linphone_core_message_received(LinphoneCore *lc, LinphonePrivate::SalOp *op,
}
shared_ptr<LinphonePrivate::ChatRoom> chatRoom = lc->cppCore->findChatRoom(
LinphonePrivate::ChatRoomId(LinphonePrivate::SimpleAddress(peerAddress), LinphonePrivate::SimpleAddress(localAddress))
LinphonePrivate::ChatRoomId(LinphonePrivate::IdentityAddress(peerAddress), LinphonePrivate::IdentityAddress(localAddress))
);
if (chatRoom)
......
......@@ -2138,8 +2138,8 @@ static void linphone_core_internal_notify_received(LinphoneCore *lc, LinphoneEve
const LinphoneAddress *from = linphone_event_get_from(lev);
shared_ptr<ChatRoom> chatRoom = lc->cppCore->findChatRoom(LinphonePrivate::ChatRoomId(
SimpleAddress(*L_GET_CPP_PTR_FROM_C_OBJECT(resource)),
SimpleAddress(*L_GET_CPP_PTR_FROM_C_OBJECT(from))
IdentityAddress(*L_GET_CPP_PTR_FROM_C_OBJECT(resource)),
IdentityAddress(*L_GET_CPP_PTR_FROM_C_OBJECT(from))
));
if (chatRoom)
......@@ -2156,8 +2156,8 @@ static void _linphone_core_conference_subscription_state_changed(LinphoneCore *l
) {
const LinphoneAddress *resource = linphone_event_get_resource(lev);
shared_ptr<ChatRoom> chatRoom = lc->cppCore->findChatRoom(LinphonePrivate::ChatRoomId(
SimpleAddress(*L_GET_CPP_PTR_FROM_C_OBJECT(resource)),
SimpleAddress(*L_GET_CPP_PTR_FROM_C_OBJECT(resource))
IdentityAddress(*L_GET_CPP_PTR_FROM_C_OBJECT(resource)),
IdentityAddress(*L_GET_CPP_PTR_FROM_C_OBJECT(resource))
));
if (chatRoom) {
linphone_event_accept_subscription(lev);
......
......@@ -58,8 +58,8 @@ bctbx_list_t **linphone_core_get_call_logs_attribute(LinphoneCore *lc) {
LinphoneChatRoom * linphone_core_find_chat_room (const LinphoneCore *lc, const LinphoneAddress *peerAddr, const LinphoneAddress *localAddr) {
shared_ptr<ChatRoom> chatRoom = lc->cppCore->findChatRoom(ChatRoomId(
SimpleAddress(*L_GET_CPP_PTR_FROM_C_OBJECT(peerAddr)),
SimpleAddress(*L_GET_CPP_PTR_FROM_C_OBJECT(localAddr))
IdentityAddress(*L_GET_CPP_PTR_FROM_C_OBJECT(peerAddr)),
IdentityAddress(*L_GET_CPP_PTR_FROM_C_OBJECT(localAddr))
));
if (chatRoom)
......
......@@ -23,10 +23,8 @@
set(LINPHONE_CXX_OBJECTS_PRIVATE_HEADER_FILES
address/address-p.h
address/address.h
address/gruu-address-p.h
address/gruu-address.h
address/simple-address-p.h
address/simple-address.h
address/identity-address-p.h
address/identity-address.h
c-wrapper/c-wrapper.h
c-wrapper/internal/c-sal.h
c-wrapper/internal/c-tools.h
......@@ -145,8 +143,7 @@ set(LINPHONE_CXX_OBJECTS_PRIVATE_HEADER_FILES
set(LINPHONE_CXX_OBJECTS_SOURCE_FILES
address/address.cpp
address/gruu-address.cpp
address/simple-address.cpp
address/identity-address.cpp
c-wrapper/api/c-address.cpp
c-wrapper/api/c-call-cbs.cpp
c-wrapper/api/c-call-params.cpp
......
......@@ -22,8 +22,7 @@
#include "address-p.h"
#include "c-wrapper/c-wrapper.h"
#include "logger/logger.h"
#include "address/gruu-address.h"
#include "address/simple-address.h"
#include "address/identity-address.h"
// =============================================================================
......@@ -47,28 +46,17 @@ Address::Address (const Address &src) : ClonableObject(*new AddressPrivate) {
d->internalAddress = sal_address_clone(salAddress);
}
Address::Address (const GruuAddress &src) : ClonableObject(*new AddressPrivate) {
Address::Address (const IdentityAddress &src) : ClonableObject(*new AddressPrivate) {
L_D();
string uri = src.getScheme() + ":" + src.getUsername() + "@";
string uri = "sip:" + src.getUsername() + "@";
if (src.getDomain().find(':') != string::npos)
uri += "[" + src.getDomain() + "]";
else
uri += src.getDomain();
uri += "?gr=" + src.getUrn();
if (src.hasGruu())
uri += "?gr=" + src.getGruu();
if (!(d->internalAddress = sal_address_new(L_STRING_TO_C(uri)))) {
lWarning() << "Cannot create Address, bad GruuAddress source";
}
}
Address::Address (const SimpleAddress &src) : ClonableObject(*new AddressPrivate) {
L_D();
string uri = src.getScheme() + ":" + src.getUsername() + "@";
if (src.getDomain().find(':') != string::npos)
uri += "[" + src.getDomain() + "]";
else
uri += src.getDomain();
if (!(d->internalAddress = sal_address_new(L_STRING_TO_C(uri)))) {
lWarning() << "Cannot create Address, bad SimpleAddress source";
lWarning() << "Cannot create Address, bad IdentityAddress source";
}
}
......
......@@ -28,8 +28,7 @@
LINPHONE_BEGIN_NAMESPACE
class AddressPrivate;
class GruuAddress;
class SimpleAddress;
class IdentityAddress;
class LINPHONE_PUBLIC Address : public ClonableObject {
// TODO: Remove me later.
......@@ -38,13 +37,12 @@ class LINPHONE_PUBLIC Address : public ClonableObject {
friend class ClientGroupChatRoomPrivate;
friend class ServerGroupChatRoom;
friend class ServerGroupChatRoomPrivate;
friend class SimpleAddress;
friend class IdentityAddress;
public:
explicit Address (const std::string &address = "");
Address (const Address &src);
Address (const GruuAddress &src);
Address (const SimpleAddress &src);
Address (const IdentityAddress &src);
~Address ();
Address &operator= (const Address &src);
......
/*
* gruu-address-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 _GRUU_ADDRESS_P_H_
#define _GRUU_ADDRESS_P_H_
#include "gruu-address.h"
#include "address/simple-address-p.h"
// =============================================================================
LINPHONE_BEGIN_NAMESPACE
class GruuAddressPrivate : public SimpleAddressPrivate {
private:
std::string urn;
bool valid = false;
L_DECLARE_PUBLIC(GruuAddress);
};
LINPHONE_END_NAMESPACE
#endif // ifndef _GRUU_ADDRESS_P_H_
/*
* gruu-address.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 "linphone/utils/utils.h"
#include "gruu-address-p.h"
#include "c-wrapper/c-wrapper.h"
#include "logger/logger.h"
// =============================================================================
using namespace std;
LINPHONE_BEGIN_NAMESPACE
// -----------------------------------------------------------------------------
GruuAddress::GruuAddress (const string &address) : SimpleAddress(*new GruuAddressPrivate) {
L_D();
Address tmpAddress(address);
if (tmpAddress.isValid()) {
if (!tmpAddress.hasUriParam("gr"))
return;
SimpleAddress base(address);
SimpleAddress::clone(base);
d->urn = tmpAddress.getUriParamValue("gr");
d->valid = true;
}
}
GruuAddress::GruuAddress (const GruuAddress &src) : SimpleAddress(*new GruuAddressPrivate) {
L_D();
SimpleAddress::clone(src);
d->urn = src.getPrivate()->urn;
d->valid = src.getPrivate()->valid;
}
GruuAddress::GruuAddress (const Address &src) : SimpleAddress(*new GruuAddressPrivate) {
L_D();
if (src.isValid()) {
if (!src.hasUriParam("gr"))
return;
SimpleAddress::clone(SimpleAddress(src));
d->urn = src.getUriParamValue("gr");
d->valid = true;
}
}
GruuAddress &GruuAddress::operator= (const GruuAddress &src) {
L_D();
if (this != &src) {
SimpleAddress::operator=(src);
d->urn = src.getPrivate()->urn;
d->valid = src.getPrivate()->valid;
}
return *this;
}
bool GruuAddress::operator== (const GruuAddress &address) const {
return asString() == address.asString();
}
bool GruuAddress::operator!= (const GruuAddress &address) const {
return !(*this == address);
}
bool GruuAddress::operator< (const GruuAddress &address) const {
return asString() < address.asString();
}
bool GruuAddress::isValid () const {
L_D();
return d->valid;
}
string GruuAddress::getUrn () const {
L_D();
return d->urn;
}
void GruuAddress::setUrn (const string &urn) {
L_D();
d->urn = urn;
}
string GruuAddress::asString () const {
Address tmpAddress(*this);
return tmpAddress.asStringUriOnly();
}
LINPHONE_END_NAMESPACE
/*
* gruu-address.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 _GRUU_ADDRESS_H_
#define _GRUU_ADDRESS_H_
#include "address/simple-address.h"
// =============================================================================
LINPHONE_BEGIN_NAMESPACE
class Address;
class GruuAddressPrivate;
class LINPHONE_PUBLIC GruuAddress : public SimpleAddress {
public:
explicit GruuAddress (const std::string &address = "");
GruuAddress (const GruuAddress &src);
GruuAddress (const Address &src);
~GruuAddress () = default;
GruuAddress &operator= (const GruuAddress &src);
bool operator== (const GruuAddress &address) const;
bool operator!= (const GruuAddress &address) const;
bool operator< (const GruuAddress &address) const;
bool isValid () const;
std::string getUrn () const;
void setUrn (const std::string &urn);
std::string asString () const override;
private:
L_DECLARE_PRIVATE(GruuAddress);
};
LINPHONE_END_NAMESPACE
#endif // ifndef _GRUU_ADDRESS_H_
/*
* simple-address-p.h
* identity-address-p.h
* Copyright (C) 2010-2017 Belledonne Communications SARL
*
* This program is free software; you can redistribute it and/or
......@@ -17,25 +17,25 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef _SIMPLE_ADDRESS_P_H_
#define _SIMPLE_ADDRESS_P_H_
#ifndef _IDENTITY_ADDRESS_P_H_
#define _IDENTITY_ADDRESS_P_H_
#include "simple-address.h"
#include "identity-address.h"
#include "object/clonable-object-p.h"
// =============================================================================
LINPHONE_BEGIN_NAMESPACE
class SimpleAddressPrivate : public ClonableObjectPrivate {
class IdentityAddressPrivate : public ClonableObjectPrivate {
private:
std::string scheme;
std::string username;
std::string domain;
std::string gruu;
L_DECLARE_PUBLIC(SimpleAddress);
L_DECLARE_PUBLIC(IdentityAddress);
};
LINPHONE_END_NAMESPACE
#endif // ifndef _SIMPLE_ADDRESS_P_H_
#endif // ifndef _IDENTITY_ADDRESS_P_H_
/*
* simple-address.cpp
* identity-address.cpp
* Copyright (C) 2010-2017 Belledonne Communications SARL
*
* This program is free software; you can redistribute it and/or
......@@ -19,7 +19,7 @@
#include "linphone/utils/utils.h"
#include "simple-address-p.h"
#include "identity-address-p.h"
#include "c-wrapper/c-wrapper.h"
#include "logger/logger.h"
......@@ -31,91 +31,102 @@ LINPHONE_BEGIN_NAMESPACE
// -----------------------------------------------------------------------------
SimpleAddress::SimpleAddress (const string &address) : ClonableObject(*new SimpleAddressPrivate) {
IdentityAddress::IdentityAddress (const string &address) : ClonableObject(*new IdentityAddressPrivate) {
L_D();
Address tmpAddress(address);
if (tmpAddress.isValid()) {
d->scheme = tmpAddress.getScheme();
if (tmpAddress.isValid() && (tmpAddress.getScheme() == "sip")) {
d->username = tmpAddress.getUsername();
d->domain = tmpAddress.getDomain();
if (tmpAddress.hasUriParam("gr")) {
d->gruu = tmpAddress.getUriParamValue("gr");
}
}
}
SimpleAddress::SimpleAddress (const SimpleAddress &src) : ClonableObject(*new SimpleAddressPrivate) {
IdentityAddress::IdentityAddress (const IdentityAddress &src) : ClonableObject(*new IdentityAddressPrivate) {
L_D();
d->scheme = src.getScheme();
d->username = src.getUsername();
d->domain = src.getDomain();
d->gruu = src.getGruu();
}
SimpleAddress::SimpleAddress (const Address &src) : ClonableObject(*new SimpleAddressPrivate) {
IdentityAddress::IdentityAddress (const Address &src) : ClonableObject(*new IdentityAddressPrivate) {
L_D();
d->scheme = src.getScheme();
d->username = src.getUsername();
d->domain = src.getDomain();
if (src.hasUriParam("gr")) {
d->gruu = src.getUriParamValue("gr");
}
}
SimpleAddress::SimpleAddress (SimpleAddressPrivate &p) : ClonableObject(p) {}
SimpleAddress &SimpleAddress::operator= (const SimpleAddress &src) {
IdentityAddress &IdentityAddress::operator= (const IdentityAddress &src) {
L_D();
if (this != &src) {
d->scheme = src.getScheme();
d->username = src.getUsername();
d->domain = src.getDomain();
d->gruu = src.getGruu();
}
return *this;
}
bool SimpleAddress::operator== (const SimpleAddress &address) const {
bool IdentityAddress::operator== (const IdentityAddress &address) const {
return asString() == address.asString();
}
bool SimpleAddress::operator!= (const SimpleAddress &address) const {
bool IdentityAddress::operator!= (const IdentityAddress &address) const {
return !(*this == address);
}
bool SimpleAddress::operator< (const SimpleAddress &address) const {
bool IdentityAddress::operator< (const IdentityAddress &address) const {
return asString() < address.asString();
}
const string &SimpleAddress::getScheme () const {
L_D();
return d->scheme;
bool IdentityAddress::isValid () const {
Address tmpAddress(*this);
return tmpAddress.isValid();
}
const string &SimpleAddress::getUsername () const {
const string &IdentityAddress::getUsername () const {
L_D();
return d->username;
}
bool SimpleAddress::setUsername (const string &username) {
bool IdentityAddress::setUsername (const string &username) {
L_D();
d->username = username;
return true;
}
const string &SimpleAddress::getDomain () const {
const string &IdentityAddress::getDomain () const {
L_D();
return d->domain;
}
bool SimpleAddress::setDomain (const string &domain) {
bool IdentityAddress::setDomain (const string &domain) {
L_D();
d->domain = domain;
return true;
}
string SimpleAddress::asString () const {
Address tmpAddress(*this);
return tmpAddress.asStringUriOnly();
bool IdentityAddress::hasGruu () const {
L_D();
return !d->gruu.empty();
}
void SimpleAddress::clone (const SimpleAddress &src) {
const string &IdentityAddress::getGruu () const {
L_D();
d->scheme = src.getPrivate()->scheme;
d->username = src.getPrivate()->username;
d->domain = src.getPrivate()->domain;
return d->gruu;
}
bool IdentityAddress::setGruu (const string &gruu) {
L_D();
d->gruu = gruu;
return true;
}
string IdentityAddress::asString () const {
Address tmpAddress(*this);
return tmpAddress.asStringUriOnly();
}
LINPHONE_END_NAMESPACE
/*
* simple-address.h
* identity-address.h
* Copyright (C) 2010-2017 Belledonne Communications SARL
*
* This program is free software; you can redistribute it and/or
......@@ -17,8 +17,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef _SIMPLE_ADDRESS_H_
#define _SIMPLE_ADDRESS_H_
#ifndef _IDENTITY_ADDRESS_H_
#define _IDENTITY_ADDRESS_H_
#include "object/clonable-object.h"
......@@ -27,23 +27,23 @@
LINPHONE_BEGIN_NAMESPACE
class Address;
class SimpleAddressPrivate;
class IdentityAddressPrivate;
class LINPHONE_PUBLIC SimpleAddress : public ClonableObject {
class LINPHONE_PUBLIC IdentityAddress : public ClonableObject {
public:
explicit SimpleAddress (const std::string &address = "");
SimpleAddress (const SimpleAddress &src);
SimpleAddress (const Address &src);
~SimpleAddress () = default;
explicit IdentityAddress (const std::string &address = "");
IdentityAddress (const IdentityAddress &src);
IdentityAddress (const Address &src);
~IdentityAddress () = default;
SimpleAddress &operator= (const SimpleAddress &src);
IdentityAddress &operator= (const IdentityAddress &src);
bool operator== (const SimpleAddress &address) const;
bool operator!= (const SimpleAddress &address) const;
bool operator== (const IdentityAddress &address) const;
bool operator!= (const IdentityAddress &address) const;
bool operator< (const SimpleAddress &address) const;
bool operator< (const IdentityAddress &address) const;
const std::string &getScheme () const;
bool isValid () const;
const std::string &getUsername () const;
bool setUsername (const std::string &username);
......@@ -51,18 +51,16 @@ public:
const std::string &getDomain () const;
bool setDomain (const std::string &domain);
bool isSip () const;
bool hasGruu () const;
const std::string &getGruu () const;
bool setGruu (const std::string &gruu);
virtual std::string asString () const;
protected:
explicit SimpleAddress (SimpleAddressPrivate &p);
void clone (const SimpleAddress &src);
private:
L_DECLARE_PRIVATE(SimpleAddress);
L_DECLARE_PRIVATE(IdentityAddress);
};
LINPHONE_END_NAMESPACE
#endif // ifndef _SIMPLE_ADDRESS_H_
#endif // ifndef _IDENTITY_ADDRESS_H_
......@@ -63,11 +63,11 @@ public:
void setIsReadOnly(bool readOnly);
inline void forceFromAddress (const SimpleAddress &fromAddress) {
inline void forceFromAddress (const IdentityAddress &fromAddress) {
this->fromAddress = fromAddress;
}
inline void forceToAddress (const SimpleAddress &toAddress) {
inline void forceToAddress (const IdentityAddress &toAddress) {
this->toAddress = toAddress;
}
......@@ -152,8 +152,8 @@ private:
std::weak_ptr<ChatRoom> chatRoom;
ChatRoomId chatRoomId;
SimpleAddress fromAddress;
SimpleAddress toAddress;
IdentityAddress fromAddress;
IdentityAddress toAddress;
ChatMessage::State state = ChatMessage::State::Idle;
ChatMessage::Direction direction = ChatMessage::Direction::Incoming;
......
......@@ -767,22 +767,22 @@ bool ChatMessage::isRead () const {
return d->state == State::Delivered || d->state == State::Displayed || d->state == State::DeliveredToUser;
}
const SimpleAddress &ChatMessage::getFromAddress () const {
const IdentityAddress &ChatMessage::getFromAddress () const {
L_D();
return d->fromAddress;
}
const SimpleAddress &ChatMessage::getToAddress () const {
const IdentityAddress &ChatMessage::getToAddress () const {
L_D();
return d->toAddress;
}
const SimpleAddress &ChatMessage::getLocalAddress () const {
const IdentityAddress &ChatMessage::getLocalAddress () const {
L_D();
return d->chatRoomId.getLocalAddress();
}
const SimpleAddress &ChatMessage::getRemoteAddress () const {
const IdentityAddress &ChatMessage::getRemoteAddress () const {
L_D();
return d->direction == Direction::Outgoing ? d->chatRoomId.getPeerAddress() : d->fromAddress;
}
......
......@@ -26,7 +26,7 @@
#include "linphone/enums/chat-message-enums.h"
// TODO: Remove me later?
#include "address/simple-address.h"
#include "address/identity-address.h"