Commit 21adb54b authored by Matthieu Tanon's avatar Matthieu Tanon

Rename ChatRoomId to ConferenceId for conference event management

parent 386fd751
......@@ -113,7 +113,7 @@ static void call_received(SalCallOp *h) {
}
IdentityAddress confAddr = L_GET_PRIVATE_FROM_C_OBJECT(lc)->mainDb->findOneToOneConferenceChatRoomAddress(from, identAddresses.front());
if (confAddr.isValid()) {
shared_ptr<AbstractChatRoom> chatRoom = L_GET_CPP_PTR_FROM_C_OBJECT(lc)->findChatRoom(ChatRoomId(confAddr, confAddr));
shared_ptr<AbstractChatRoom> chatRoom = L_GET_CPP_PTR_FROM_C_OBJECT(lc)->findChatRoom(ConferenceId(confAddr, confAddr));
L_GET_PRIVATE(static_pointer_cast<ServerGroupChatRoom>(chatRoom))->confirmRecreation(h);
return;
}
......@@ -127,7 +127,7 @@ static void call_received(SalCallOp *h) {
linphone_address_unref(fromAddr);
if (linphone_core_conference_server_enabled(lc)) {
shared_ptr<AbstractChatRoom> chatRoom = L_GET_CPP_PTR_FROM_C_OBJECT(lc)->findChatRoom(
ChatRoomId(IdentityAddress(h->getTo()), IdentityAddress(h->getTo()))
ConferenceId(IdentityAddress(h->getTo()), IdentityAddress(h->getTo()))
);
if (chatRoom) {
L_GET_PRIVATE(static_pointer_cast<ServerGroupChatRoom>(chatRoom))->confirmJoining(h);
......@@ -138,7 +138,7 @@ static void call_received(SalCallOp *h) {
}
} else {
shared_ptr<AbstractChatRoom> chatRoom = L_GET_CPP_PTR_FROM_C_OBJECT(lc)->findChatRoom(
ChatRoomId(IdentityAddress(h->getFrom()), IdentityAddress(h->getTo()))
ConferenceId(IdentityAddress(h->getFrom()), IdentityAddress(h->getTo()))
);
if (!chatRoom) {
chatRoom = L_GET_PRIVATE_FROM_C_OBJECT(lc)->createClientGroupChatRoom(
......@@ -777,7 +777,7 @@ 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<AbstractChatRoom> chatRoom = L_GET_CPP_PTR_FROM_C_OBJECT(lc)->findChatRoom(
ChatRoomId(IdentityAddress(op->getTo()), IdentityAddress(op->getTo()))
ConferenceId(IdentityAddress(op->getTo()), IdentityAddress(op->getTo()))
);
if (chatRoom) {
std::shared_ptr<Participant> participant = chatRoom->findParticipant(IdentityAddress(op->getFrom()));
......@@ -794,7 +794,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(
L_GET_CPP_PTR_FROM_C_OBJECT(lc)->findChatRoom(ChatRoomId(addr, IdentityAddress(op->getTo())))
L_GET_CPP_PTR_FROM_C_OBJECT(lc)->findChatRoom(ConferenceId(addr, IdentityAddress(op->getTo())))
);
if (cr) {
L_GET_CPP_PTR_FROM_C_OBJECT(cr)->leave();
......@@ -806,7 +806,7 @@ static void refer_received(SalOp *op, const SalAddress *refer_to){
} else {
if (linphone_core_conference_server_enabled(lc)) {
shared_ptr<AbstractChatRoom> chatRoom = L_GET_CPP_PTR_FROM_C_OBJECT(lc)->findChatRoom(
ChatRoomId(IdentityAddress(op->getTo()), IdentityAddress(op->getTo()))
ConferenceId(IdentityAddress(op->getTo()), IdentityAddress(op->getTo()))
);
LinphoneChatRoom *cr = L_GET_C_BACK_PTR(chatRoom);
if (cr) {
......@@ -840,7 +840,7 @@ static void refer_received(SalOp *op, const SalAddress *refer_to){
}
} else {
shared_ptr<AbstractChatRoom> chatRoom = L_GET_CPP_PTR_FROM_C_OBJECT(lc)->findChatRoom(
ChatRoomId(addr, IdentityAddress(op->getTo()))
ConferenceId(addr, IdentityAddress(op->getTo()))
);
if (!chatRoom)
chatRoom = L_GET_PRIVATE_FROM_C_OBJECT(lc)->createClientGroupChatRoom("", addr.asString(), Content(), false);
......
......@@ -105,7 +105,7 @@ LinphoneChatRoom *linphone_core_find_chat_room(
const LinphoneAddress *peer_addr,
const LinphoneAddress *local_addr
) {
return L_GET_C_BACK_PTR(L_GET_CPP_PTR_FROM_C_OBJECT(lc)->findChatRoom(LinphonePrivate::ChatRoomId(
return L_GET_C_BACK_PTR(L_GET_CPP_PTR_FROM_C_OBJECT(lc)->findChatRoom(LinphonePrivate::ConferenceId(
LinphonePrivate::IdentityAddress(*L_GET_CPP_PTR_FROM_C_OBJECT(peer_addr)),
LinphonePrivate::IdentityAddress(*L_GET_CPP_PTR_FROM_C_OBJECT(local_addr))
)));
......@@ -134,7 +134,7 @@ int linphone_core_message_received(LinphoneCore *lc, LinphonePrivate::SalOp *op,
}
shared_ptr<LinphonePrivate::AbstractChatRoom> chatRoom = L_GET_CPP_PTR_FROM_C_OBJECT(lc)->findChatRoom(
LinphonePrivate::ChatRoomId(LinphonePrivate::IdentityAddress(peerAddress), LinphonePrivate::IdentityAddress(localAddress))
LinphonePrivate::ConferenceId(LinphonePrivate::IdentityAddress(peerAddress), LinphonePrivate::IdentityAddress(localAddress))
);
if (chatRoom)
reason = L_GET_PRIVATE(chatRoom)->onSipMessageReceived(op, sal_msg);
......
......@@ -2186,7 +2186,7 @@ static void linphone_core_internal_notify_received(LinphoneCore *lc, LinphoneEve
bctbx_free(resourceAddrStr);
const LinphoneAddress *from = linphone_event_get_from(lev);
shared_ptr<AbstractChatRoom> chatRoom = L_GET_CPP_PTR_FROM_C_OBJECT(lc)->findChatRoom(LinphonePrivate::ChatRoomId(
shared_ptr<AbstractChatRoom> chatRoom = L_GET_CPP_PTR_FROM_C_OBJECT(lc)->findChatRoom(LinphonePrivate::ConferenceId(
IdentityAddress(*L_GET_CPP_PTR_FROM_C_OBJECT(resource)),
IdentityAddress(*L_GET_CPP_PTR_FROM_C_OBJECT(from))
));
......@@ -2222,7 +2222,7 @@ static void _linphone_core_conference_subscribe_received(LinphoneCore *lc, Linph
}
const LinphoneAddress *resource = linphone_event_get_resource(lev);
shared_ptr<AbstractChatRoom> chatRoom = L_GET_CPP_PTR_FROM_C_OBJECT(lc)->findChatRoom(LinphonePrivate::ChatRoomId(
shared_ptr<AbstractChatRoom> chatRoom = L_GET_CPP_PTR_FROM_C_OBJECT(lc)->findChatRoom(LinphonePrivate::ConferenceId(
IdentityAddress(*L_GET_CPP_PTR_FROM_C_OBJECT(resource)),
IdentityAddress(*L_GET_CPP_PTR_FROM_C_OBJECT(resource))
));
......
......@@ -158,7 +158,7 @@ int _linphone_call_get_main_video_stream_index (const LinphoneCall *call) {
void _linphone_chat_room_enable_migration(LinphoneChatRoom *cr, bool_t enable) {
shared_ptr<AbstractChatRoom> acr = L_GET_CPP_PTR_FROM_C_OBJECT(cr);
L_GET_PRIVATE(acr->getCore())->mainDb->enableChatRoomMigration(acr->getChatRoomId(), !!enable);
L_GET_PRIVATE(acr->getCore())->mainDb->enableChatRoomMigration(acr->getConferenceId(), !!enable);
}
int _linphone_chat_room_get_transient_message_count (const LinphoneChatRoom *cr) {
......@@ -174,4 +174,4 @@ LinphoneChatMessage * _linphone_chat_room_get_first_transient_message (const Lin
L_GET_PRIVATE(chatRoom)->transientEvents.front()
);
return L_GET_C_BACK_PTR(event->getChatMessage());
}
\ No newline at end of file
}
......@@ -94,7 +94,6 @@ set(LINPHONE_CXX_OBJECTS_PRIVATE_HEADER_FILES
chat/chat-room/basic-chat-room-p.h
chat/chat-room/basic-chat-room.h
chat/chat-room/basic-to-client-group-chat-room.h
chat/chat-room/chat-room-id.h
chat/chat-room/chat-room-listener.h
chat/chat-room/chat-room-p.h
chat/chat-room/chat-room.h
......@@ -125,6 +124,7 @@ set(LINPHONE_CXX_OBJECTS_PRIVATE_HEADER_FILES
chat/notification/imdn.h
chat/notification/is-composing-listener.h
chat/notification/is-composing.h
conference/conference-id.h
conference/conference-listener.h
conference/conference-p.h
conference/conference.h
......@@ -260,7 +260,6 @@ set(LINPHONE_CXX_OBJECTS_SOURCE_FILES
chat/chat-room/abstract-chat-room.cpp
chat/chat-room/basic-chat-room.cpp
chat/chat-room/basic-to-client-group-chat-room.cpp
chat/chat-room/chat-room-id.cpp
chat/chat-room/chat-room.cpp
chat/chat-room/client-group-chat-room.cpp
chat/chat-room/client-group-to-basic-chat-room.cpp
......@@ -280,6 +279,7 @@ set(LINPHONE_CXX_OBJECTS_SOURCE_FILES
chat/modifier/multipart-chat-message-modifier.cpp
chat/notification/imdn.cpp
chat/notification/is-composing.cpp
conference/conference-id.cpp
conference/conference.cpp
conference/handlers/local-conference-event-handler.cpp
conference/handlers/local-conference-list-event-handler.cpp
......
......@@ -22,7 +22,7 @@
#include "c-wrapper/c-wrapper.h"
#include "call/call.h"
#include "chat/chat-message/chat-message.h"
#include "chat/chat-room/chat-room-id.h"
#include "conference/conference-id.h"
#include "event-log/events.h"
// =============================================================================
......@@ -206,7 +206,7 @@ const LinphoneAddress *linphone_event_log_get_peer_address (const LinphoneEventL
event_log->peerAddressCache = linphone_address_new(
static_pointer_cast<const LinphonePrivate::ConferenceEvent>(
L_GET_CPP_PTR_FROM_C_OBJECT(event_log)
)->getChatRoomId().getPeerAddress().asString().c_str()
)->getConferenceId().getPeerAddress().asString().c_str()
);
return event_log->peerAddressCache;
......@@ -220,7 +220,7 @@ const LinphoneAddress *linphone_event_log_get_local_address (const LinphoneEvent
event_log->localAddressCache = linphone_address_new(
static_pointer_cast<const LinphonePrivate::ConferenceEvent>(
L_GET_CPP_PTR_FROM_C_OBJECT(event_log)
)->getChatRoomId().getLocalAddress().asString().c_str()
)->getConferenceId().getLocalAddress().asString().c_str()
);
return event_log->localAddressCache;
......
......@@ -23,7 +23,7 @@
#include <belle-sip/types.h>
#include "chat/chat-message/chat-message.h"
#include "chat/chat-room/chat-room-id.h"
#include "conference/conference-id.h"
#include "chat/modifier/file-transfer-chat-message-modifier.h"
#include "chat/notification/imdn.h"
#include "content/content.h"
......@@ -146,11 +146,11 @@ public:
void setExternalBodyUrl (const std::string &url);
bool hasTextContent () const;
const Content* getTextContent () const;
const Content *getTextContent () const;
bool hasFileTransferContent () const;
const Content* getFileTransferContent () const;
const Content* getFileTransferInformation () const;
const Content *getFileTransferContent () const;
const Content *getFileTransferInformation () const;
void addContent (Content *content);
void removeContent (Content *content);
......@@ -192,7 +192,7 @@ private:
// TODO: to replace salCustomheaders
std::unordered_map<std::string, std::string> customHeaders;
mutable LinphoneErrorInfo * errorInfo = nullptr;
mutable LinphoneErrorInfo *errorInfo = nullptr;
SalOp *salOp = nullptr;
SalCustomHeader *salCustomHeaders = nullptr;
unsigned char currentSendStep = Step::None;
......@@ -209,7 +209,7 @@ private:
// Do not expose.
std::weak_ptr<AbstractChatRoom> chatRoom;
ChatRoomId chatRoomId;
ConferenceId conferenceId;
IdentityAddress fromAddress;
IdentityAddress authenticatedFromAddress;
IdentityAddress toAddress;
......@@ -217,7 +217,7 @@ private:
ChatMessage::State state = ChatMessage::State::Idle;
ChatMessage::Direction direction = ChatMessage::Direction::Incoming;
std::list<Content* > contents;
std::list<Content *> contents;
bool encryptionPrevented = false;
mutable bool contentsNotLoadedFromDatabase = false;
......
......@@ -405,13 +405,13 @@ std::string ChatMessagePrivate::createFakeFileTransferFromUrl(const std::string
void ChatMessagePrivate::setChatRoom (const shared_ptr<AbstractChatRoom> &cr) {
chatRoom = cr;
chatRoomId = cr->getChatRoomId();
conferenceId = cr->getConferenceId();
if (direction == ChatMessage::Direction::Outgoing) {
fromAddress = chatRoomId.getLocalAddress();
toAddress = chatRoomId.getPeerAddress();
fromAddress = conferenceId.getLocalAddress();
toAddress = conferenceId.getPeerAddress();
} else {
fromAddress = chatRoomId.getPeerAddress();
toAddress = chatRoomId.getLocalAddress();
fromAddress = conferenceId.getPeerAddress();
toAddress = conferenceId.getLocalAddress();
}
}
......@@ -905,7 +905,7 @@ shared_ptr<AbstractChatRoom> ChatMessage::getChatRoom () const {
shared_ptr<AbstractChatRoom> chatRoom = d->chatRoom.lock();
if (!chatRoom) {
chatRoom = getCore()->getOrCreateBasicChatRoom(d->chatRoomId);
chatRoom = getCore()->getOrCreateBasicChatRoom(d->conferenceId);
if (!chatRoom) {
lError() << "Unable to get valid chat room instance.";
throw logic_error("Unable to get chat room of chat message.");
......
......@@ -31,7 +31,7 @@
LINPHONE_BEGIN_NAMESPACE
class AbstractChatRoomPrivate;
class ChatRoomId;
class ConferenceId;
class EventLog;
class LINPHONE_PUBLIC AbstractChatRoom : public Object, public CoreAccessor, public ConferenceInterface {
......@@ -57,7 +57,7 @@ public:
virtual bool canHandleCpim () const = 0;
virtual bool canHandleMultipart () const = 0;
virtual const ChatRoomId &getChatRoomId () const = 0;
virtual const ConferenceId &getConferenceId () const = 0;
virtual const IdentityAddress &getPeerAddress () const = 0;
virtual const IdentityAddress &getLocalAddress () const = 0;
......
......@@ -31,14 +31,14 @@ LINPHONE_BEGIN_NAMESPACE
// -----------------------------------------------------------------------------
BasicChatRoom::BasicChatRoom (const shared_ptr<Core> &core, const ChatRoomId &chatRoomId) :
BasicChatRoom(*new BasicChatRoomPrivate, core, chatRoomId) {}
BasicChatRoom::BasicChatRoom (const shared_ptr<Core> &core, const ConferenceId &conferenceId) :
BasicChatRoom(*new BasicChatRoomPrivate, core, conferenceId) {}
BasicChatRoom::BasicChatRoom (
BasicChatRoomPrivate &p,
const std::shared_ptr<Core> &core,
const ChatRoomId &chatRoomId
) : ChatRoom(p, core, chatRoomId) {
const ConferenceId &conferenceId
) : ChatRoom(p, core, conferenceId) {
L_D();
d->me = make_shared<Participant>(nullptr, getLocalAddress());
d->participants.push_back(make_shared<Participant>(nullptr, getPeerAddress()));
......
......@@ -67,10 +67,10 @@ public:
protected:
explicit BasicChatRoom (BasicChatRoomPrivate &p, const std::shared_ptr<Core> &core, const ChatRoomId &chatRoomId);
explicit BasicChatRoom (BasicChatRoomPrivate &p, const std::shared_ptr<Core> &core, const ConferenceId &conferenceId);
private:
BasicChatRoom (const std::shared_ptr<Core> &core, const ChatRoomId &chatRoomId);
BasicChatRoom (const std::shared_ptr<Core> &core, const ConferenceId &conferenceId);
L_DECLARE_PRIVATE(BasicChatRoom);
L_DISABLE_COPY(BasicChatRoom);
......
......@@ -58,7 +58,7 @@ public:
const char *specs = linphone_core_get_linphone_specs(chatMessage->getCore()->getCCore());
time_t currentRealTime = ms_time(nullptr);
LinphoneAddress *lAddr = linphone_address_new(
chatMessage->getChatRoom()->getChatRoomId().getLocalAddress().asString().c_str()
chatMessage->getChatRoom()->getConferenceId().getLocalAddress().asString().c_str()
);
LinphoneProxyConfig *proxy = linphone_core_lookup_known_proxy(q->getCore()->getCCore(), lAddr);
linphone_address_unref(lAddr);
......
......@@ -23,7 +23,7 @@
#include <ctime>
#include "abstract-chat-room-p.h"
#include "chat-room-id.h"
#include "conference/conference-id.h"
#include "chat-room.h"
#include "chat/notification/imdn.h"
#include "chat/notification/is-composing.h"
......@@ -92,7 +92,7 @@ public:
std::list<IdentityAddress> remoteIsComposing;
std::list<std::shared_ptr<EventLog>> transientEvents;
ChatRoomId chatRoomId;
ConferenceId conferenceId;
private:
AbstractChatRoom *proxyChatRoom = nullptr;
......
......@@ -134,7 +134,7 @@ shared_ptr<IsComposingMessage> ChatRoomPrivate::createIsComposingMessage () {
list<shared_ptr<ChatMessage>> ChatRoomPrivate::findChatMessages (const string &messageId) const {
L_Q();
return q->getCore()->getPrivate()->mainDb->findChatMessages(q->getChatRoomId(), messageId);
return q->getCore()->getPrivate()->mainDb->findChatMessages(q->getConferenceId(), messageId);
}
// -----------------------------------------------------------------------------
......@@ -157,7 +157,7 @@ void ChatRoomPrivate::sendDeliveryNotifications () {
L_Q();
LinphoneImNotifPolicy *policy = linphone_core_get_im_notif_policy(q->getCore()->getCCore());
if (linphone_im_notif_policy_get_send_imdn_delivered(policy)) {
auto messages = q->getCore()->getPrivate()->mainDb->findChatMessagesToBeNotifiedAsDelivered(q->getChatRoomId());
auto messages = q->getCore()->getPrivate()->mainDb->findChatMessagesToBeNotifiedAsDelivered(q->getConferenceId());
for (const auto message : messages)
imdnHandler->notifyDelivery(message);
}
......@@ -326,11 +326,11 @@ LinphoneChatRoom *ChatRoomPrivate::getCChatRoom () const {
// =============================================================================
ChatRoom::ChatRoom (ChatRoomPrivate &p, const shared_ptr<Core> &core, const ChatRoomId &chatRoomId) :
ChatRoom::ChatRoom (ChatRoomPrivate &p, const shared_ptr<Core> &core, const ConferenceId &conferenceId) :
AbstractChatRoom(p, core) {
L_D();
d->chatRoomId = chatRoomId;
d->conferenceId = conferenceId;
d->imdnHandler.reset(new Imdn(this));
d->isComposingHandler.reset(new IsComposing(core->getCCore(), d));
}
......@@ -343,19 +343,19 @@ ChatRoom::~ChatRoom () {
// -----------------------------------------------------------------------------
const ChatRoomId &ChatRoom::getChatRoomId () const {
const ConferenceId &ChatRoom::getConferenceId () const {
L_D();
return d->chatRoomId;
return d->conferenceId;
}
const IdentityAddress &ChatRoom::getPeerAddress () const {
L_D();
return d->chatRoomId.getPeerAddress();
return d->conferenceId.getPeerAddress();
}
const IdentityAddress &ChatRoom::getLocalAddress () const {
L_D();
return d->chatRoomId.getLocalAddress();
return d->conferenceId.getLocalAddress();
}
// -----------------------------------------------------------------------------
......@@ -384,16 +384,16 @@ ChatRoom::SecurityLevel ChatRoom::getSecurityLevel () const {
// -----------------------------------------------------------------------------
list<shared_ptr<EventLog>> ChatRoom::getMessageHistory (int nLast) const {
return getCore()->getPrivate()->mainDb->getHistory(getChatRoomId(), nLast, MainDb::Filter::ConferenceChatMessageFilter);
return getCore()->getPrivate()->mainDb->getHistory(getConferenceId(), nLast, MainDb::Filter::ConferenceChatMessageFilter);
}
list<shared_ptr<EventLog>> ChatRoom::getMessageHistoryRange (int begin, int end) const {
return getCore()->getPrivate()->mainDb->getHistoryRange(getChatRoomId(), begin, end, MainDb::Filter::ConferenceChatMessageFilter);
return getCore()->getPrivate()->mainDb->getHistoryRange(getConferenceId(), begin, end, MainDb::Filter::ConferenceChatMessageFilter);
}
list<shared_ptr<EventLog>> ChatRoom::getHistory (int nLast) const {
return getCore()->getPrivate()->mainDb->getHistory(
getChatRoomId(),
getConferenceId(),
nLast,
MainDb::FilterMask({ MainDb::Filter::ConferenceChatMessageFilter, MainDb::Filter::ConferenceInfoNoDeviceFilter })
);
......@@ -401,7 +401,7 @@ list<shared_ptr<EventLog>> ChatRoom::getHistory (int nLast) const {
list<shared_ptr<EventLog>> ChatRoom::getHistoryRange (int begin, int end) const {
return getCore()->getPrivate()->mainDb->getHistoryRange(
getChatRoomId(),
getConferenceId(),
begin,
end,
MainDb::FilterMask({ MainDb::Filter::ConferenceChatMessageFilter, MainDb::Filter::ConferenceInfoNoDeviceFilter })
......@@ -409,7 +409,7 @@ list<shared_ptr<EventLog>> ChatRoom::getHistoryRange (int begin, int end) const
}
int ChatRoom::getHistorySize () const {
return getCore()->getPrivate()->mainDb->getHistorySize(getChatRoomId());
return getCore()->getPrivate()->mainDb->getHistorySize(getConferenceId());
}
void ChatRoom::deleteFromDb () {
......@@ -421,20 +421,20 @@ void ChatRoom::deleteFromDb () {
}
void ChatRoom::deleteHistory () {
getCore()->getPrivate()->mainDb->cleanHistory(getChatRoomId());
getCore()->getPrivate()->mainDb->cleanHistory(getConferenceId());
}
shared_ptr<ChatMessage> ChatRoom::getLastChatMessageInHistory () const {
return getCore()->getPrivate()->mainDb->getLastChatMessage(getChatRoomId());
return getCore()->getPrivate()->mainDb->getLastChatMessage(getConferenceId());
}
int ChatRoom::getChatMessageCount () const {
return getCore()->getPrivate()->mainDb->getChatMessageCount(getChatRoomId());
return getCore()->getPrivate()->mainDb->getChatMessageCount(getConferenceId());
}
int ChatRoom::getUnreadChatMessageCount () const {
L_D();
int dbUnreadCount = getCore()->getPrivate()->mainDb->getUnreadChatMessageCount(getChatRoomId());
int dbUnreadCount = getCore()->getPrivate()->mainDb->getUnreadChatMessageCount(getConferenceId());
int notifiedCount = d->imdnHandler->getDisplayNotificationCount();
L_ASSERT(dbUnreadCount >= notifiedCount);
return dbUnreadCount - notifiedCount;
......@@ -505,7 +505,7 @@ void ChatRoom::markAsRead () {
bool globallyMarkAsReadInDb = true;
CorePrivate *dCore = getCore()->getPrivate();
for (auto &chatMessage : dCore->mainDb->getUnreadChatMessages(d->chatRoomId)) {
for (auto &chatMessage : dCore->mainDb->getUnreadChatMessages(d->conferenceId)) {
// Do not send display notification for file transfer until it has been downloaded (it won't have a file transfer content anymore)
if (!chatMessage->getPrivate()->hasFileTransferContent()) {
bool doNotStoreInDb = d->sendDisplayNotification(chatMessage);
......@@ -517,7 +517,7 @@ void ChatRoom::markAsRead () {
}
if (globallyMarkAsReadInDb)
dCore->mainDb->markChatMessagesAsRead(d->chatRoomId);
dCore->mainDb->markChatMessagesAsRead(d->conferenceId);
}
LINPHONE_END_NAMESPACE
......@@ -39,7 +39,7 @@ public:
~ChatRoom ();
const ChatRoomId &getChatRoomId () const override;
const ConferenceId &getConferenceId () const override;
const IdentityAddress &getPeerAddress () const override;
const IdentityAddress &getLocalAddress () const override;
......@@ -82,7 +82,7 @@ public:
void markAsRead () override;
protected:
explicit ChatRoom (ChatRoomPrivate &p, const std::shared_ptr<Core> &core, const ChatRoomId &chatRoomId);
explicit ChatRoom (ChatRoomPrivate &p, const std::shared_ptr<Core> &core, const ConferenceId &conferenceId);
private:
L_DECLARE_PRIVATE(ChatRoom);
......
......@@ -218,11 +218,11 @@ void ClientGroupChatRoomPrivate::onChatRoomCreated (const Address &remoteContact
IdentityAddress addr(remoteContact);
q->onConferenceCreated(addr);
if (remoteContact.hasParam("isfocus")) {
if (q->getCore()->getPrivate()->remoteListEventHandler->findHandler(q->getChatRoomId())) {
if (q->getCore()->getPrivate()->remoteListEventHandler->findHandler(q->getConferenceId())) {
q->getCore()->getPrivate()->remoteListEventHandler->subscribe();
} else {
bgTask.start(q->getCore(), 32); // It will be stopped when receiving the first notify
qConference->getPrivate()->eventHandler->subscribe(q->getChatRoomId());
qConference->getPrivate()->eventHandler->subscribe(q->getConferenceId());
}
}
}
......@@ -244,7 +244,7 @@ ClientGroupChatRoom::ClientGroupChatRoom (
const IdentityAddress &me,
const string &subject,
const Content &content
) : ChatRoom(*new ClientGroupChatRoomPrivate, core, ChatRoomId(IdentityAddress(), me)),
) : ChatRoom(*new ClientGroupChatRoomPrivate, core, ConferenceId(IdentityAddress(), me)),
RemoteConference(core, me, nullptr) {
L_D_T(RemoteConference, dConference);
......@@ -259,20 +259,20 @@ RemoteConference(core, me, nullptr) {
ClientGroupChatRoom::ClientGroupChatRoom (
const shared_ptr<Core> &core,
const ChatRoomId &chatRoomId,
const ConferenceId &conferenceId,
shared_ptr<Participant> &me,
AbstractChatRoom::CapabilitiesMask capabilities,
const string &subject,
list<shared_ptr<Participant>> &&participants,
unsigned int lastNotifyId,
bool hasBeenLeft
) : ChatRoom(*new ClientGroupChatRoomPrivate, core, chatRoomId),
) : ChatRoom(*new ClientGroupChatRoomPrivate, core, conferenceId),
RemoteConference(core, me->getAddress(), nullptr) {
L_D();
L_D_T(RemoteConference, dConference);
d->capabilities |= capabilities & ClientGroupChatRoom::Capabilities::OneToOne;
const IdentityAddress &peerAddress = chatRoomId.getPeerAddress();
const IdentityAddress &peerAddress = conferenceId.getPeerAddress();
dConference->focus = make_shared<Participant>(this, peerAddress);
dConference->focus->getPrivate()->addDevice(peerAddress);
dConference->conferenceAddress = peerAddress;
......@@ -281,7 +281,7 @@ RemoteConference(core, me->getAddress(), nullptr) {
getMe()->getPrivate()->setAdmin(me->isAdmin());
dConference->eventHandler->setChatRoomId(chatRoomId);
dConference->eventHandler->setConferenceId(conferenceId);
dConference->eventHandler->setLastNotify(lastNotifyId);
if (!hasBeenLeft)
getCore()->getPrivate()->remoteListEventHandler->addHandler(dConference->eventHandler.get());
......@@ -571,7 +571,7 @@ void ClientGroupChatRoom::onConferenceCreated (const IdentityAddress &addr) {
dConference->focus->getPrivate()->setAddress(addr);
dConference->focus->getPrivate()->clearDevices();
dConference->focus->getPrivate()->addDevice(addr);
d->chatRoomId = ChatRoomId(addr, d->chatRoomId.getLocalAddress());
d->conferenceId = ConferenceId(addr, d->conferenceId.getLocalAddress());
d->chatRoomListener->onChatRoomInsertRequested(getSharedFromThis());
d->setState(ChatRoom::State::Created);
}
......@@ -593,7 +593,7 @@ void ClientGroupChatRoom::onConferenceTerminated (const IdentityAddress &addr) {
auto event = make_shared<ConferenceEvent>(
EventLog::Type::ConferenceTerminated,
time(nullptr),
d->chatRoomId
d->conferenceId
);
d->addEvent(event);
......@@ -617,7 +617,7 @@ void ClientGroupChatRoom::onFirstNotifyReceived (const IdentityAddress &addr) {
bool performMigration = false;
shared_ptr<AbstractChatRoom> chatRoom;
if (getParticipantCount() == 1 && d->capabilities & ClientGroupChatRoom::Capabilities::OneToOne) {
ChatRoomId id(getParticipants().front()->getAddress(), getMe()->getAddress());
ConferenceId id(getParticipants().front()->getAddress(), getMe()->getAddress());
chatRoom = getCore()->findChatRoom(id);
if (chatRoom && (chatRoom->getCapabilities() & ChatRoom::Capabilities::Basic))
performMigration = true;
......@@ -631,7 +631,7 @@ void ClientGroupChatRoom::onFirstNotifyReceived (const IdentityAddress &addr) {
auto event = make_shared<ConferenceEvent>(
EventLog::Type::ConferenceCreated,
time(nullptr),
d->chatRoomId
d->conferenceId
);
d->addEvent(event);
......
......@@ -50,7 +50,7 @@ public:
ClientGroupChatRoom (
const std::shared_ptr<Core> &core,
const ChatRoomId &chatRoomId,
const ConferenceId &conferenceId,
std::shared_ptr<Participant> &me,
AbstractChatRoom::CapabilitiesMask capabilities,
const std::string &subject,
......
......@@ -48,9 +48,9 @@ void ProxyChatRoomPrivate::teardownProxy () {
// -----------------------------------------------------------------------------
const ChatRoomId &ProxyChatRoom::getChatRoomId () const {
const ConferenceId &ProxyChatRoom::getConferenceId () const {
L_D();
return d->chatRoom->getChatRoomId();
return d->chatRoom->getConferenceId();
}
const IdentityAddress &ProxyChatRoom::getPeerAddress () const {
......
......@@ -33,7 +33,7 @@ class LINPHONE_PUBLIC ProxyChatRoom : public AbstractChatRoom {
friend class CorePrivate;
public:
const ChatRoomId &getChatRoomId () const override;
const ConferenceId &getConferenceId () const override;
const IdentityAddress &getPeerAddress () const override;
const IdentityAddress &getLocalAddress () const override;
......
......@@ -105,8 +105,8 @@ void RealTimeTextChatRoomPrivate::sendChatMessage (const shared_ptr<ChatMessage>
// =============================================================================
RealTimeTextChatRoom::RealTimeTextChatRoom (const shared_ptr<Core> &core, const ChatRoomId &chatRoomId) :
BasicChatRoom(*new RealTimeTextChatRoomPrivate, core, chatRoomId) {}
RealTimeTextChatRoom::RealTimeTextChatRoom (const shared_ptr<Core> &core, const ConferenceId &conferenceId) :
BasicChatRoom(*new RealTimeTextChatRoomPrivate, core, conferenceId) {}
RealTimeTextChatRoom::CapabilitiesMask RealTimeTextChatRoom::getCapabilities () const {
return BasicChatRoom::getCapabilities() | Capabilities::RealTimeText;
......
......@@ -42,7 +42,7 @@ public:
std::shared_ptr<Call> getCall () const;
private:
RealTimeTextChatRoom (const std::shared_ptr<Core> &core, const ChatRoomId &chatRoomId);
RealTimeTextChatRoom (const std::shared_ptr<Core> &core, const ConferenceId &conferenceId);
L_DECLARE_PRIVATE(RealTimeTextChatRoom);
L_DISABLE_COPY(RealTimeTextChatRoom);
......
......@@ -598,8 +598,8 @@ void ServerGroupChatRoomPrivate::finalizeCreation () {
L_Q();
L_Q_T(LocalConference, qConference);
IdentityAddress confAddr(qConference->getPrivate()->conferenceAddress);
chatRoomId = ChatRoomId(confAddr, confAddr);
qConference->getPrivate()->eventHandler->setChatRoomId(chatRoomId);
conferenceId = ConferenceId(confAddr, confAddr);
qConference->getPrivate()->eventHandler->setConferenceId(conferenceId);
lInfo() << q << " created";
// Let the SIP stack set the domain and the port
shared_ptr<Participant> me = q->getMe();
......@@ -787,7 +787,7 @@ void ServerGroupChatRoomPrivate::onCallSessionSetReleased (const shared_ptr<Call
// =============================================================================
ServerGroupChatRoom::ServerGroupChatRoom (const shared_ptr<Core> &core, SalCallOp *op)
: ChatRoom(*new ServerGroupChatRoomPrivate, core, ChatRoomId()),
: ChatRoom(*new ServerGroupChatRoomPrivate, core, ConferenceId()),
LocalConference(getCore(), IdentityAddress(linphone_proxy_config_get_conference_factory_uri(linphone_core_get_default_proxy_config(core->getCCore()))), nullptr) {
L_D();
L_D_T(LocalConference, dConference);
......@@ -808,7 +808,7 @@ ServerGroupChatRoom::ServerGroupChatRoom (
const string &subject,
list<shared_ptr<Participant>> &&participants,
unsigned int lastNotifyId
) : ChatRoom(*new ServerGroupChatRoomPrivate, core, ChatRoomId(peerAddress, peerAddress)),
) : ChatRoom(*new ServerGroupChatRoomPrivate, core, ConferenceId(peerAddress, peerAddress)),
LocalConference(getCore(), peerAddress, nullptr) {
L_D();
L_D_T(LocalConference, dConference);
......@@ -818,7 +818,7 @@ LocalConference(getCore(), peerAddress, nullptr) {
dConference->participants = move(participants);
dConference->conferenceAddress = peerAddress;
dConference->eventHandler->setLastNotify(lastNotifyId);
dConference->eventHandler->setChatRoomId(d->chatRoomId);
dConference->eventHandler->setConferenceId(d->conferenceId);
getCore()->getPrivate()->localListEventHandler->addHandler(dConference->eventHandler.get());
}
......@@ -983,7 +983,7 @@ void ServerGroupChatRoom::setSubject (const string &subject) {
// -----------------------------------------------------------------------------
ostream &operator<< (ostream &stream, const ServerGroupChatRoom *chatRoom) {
return stream << "ServerGroupChatRoom [" << chatRoom->getChatRoomId().getPeerAddress().asString() << "]";
return stream << "ServerGroupChatRoom [" << chatRoom->getConferenceId().getPeerAddress().asString() << "]";
}
LINPHONE_END_NAMESPACE
/*
* chat-room-id.cpp
* conference-id.cpp
* Copyright (C) 2010-2018 Belledonne Communications SARL
*
* This program is free software; you can redistribute it and/or
......@@ -19,7 +19,7 @@
#include "object/clonable-object-p.h"
#include "chat-room-id.h"
#include "conference-id.h"
// =============================================================================
......@@ -27,7 +27,7 @@ using namespace std;
LINPHONE_BEGIN_NAMESPACE