Commit 9c1e5d38 authored by Ronan's avatar Ronan

feat(core): rename ChatRoomId to ConferenceId

parent ba72e9a6
......@@ -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->getCapabilities() & ChatRoom::Capabilities::Basic) {
lError() << "Invalid basic chat room found. It should have been a ClientGroupChatRoom... Recreating it...";
......@@ -785,7 +785,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()));
......@@ -802,7 +802,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();
......@@ -814,7 +814,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) {
......@@ -848,7 +848,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);
......
......@@ -89,7 +89,7 @@ LinphoneChatRoom *linphone_core_get_chat_room_2 (
const LinphoneAddress *peer_addr,
const LinphoneAddress *local_addr
) {
return L_GET_C_BACK_PTR(L_GET_CPP_PTR_FROM_C_OBJECT(lc)->getOrCreateBasicChatRoom(LinphonePrivate::ChatRoomId(
return L_GET_C_BACK_PTR(L_GET_CPP_PTR_FROM_C_OBJECT(lc)->getOrCreateBasicChatRoom(LinphonePrivate::ConferenceId(
LinphonePrivate::IdentityAddress(*L_GET_CPP_PTR_FROM_C_OBJECT(peer_addr)),
LinphonePrivate::IdentityAddress(*L_GET_CPP_PTR_FROM_C_OBJECT(local_addr))
)));
......@@ -116,7 +116,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))
)));
......@@ -144,15 +144,15 @@ int linphone_core_message_received(LinphoneCore *lc, LinphonePrivate::SalOp *op,
localAddress = op->getTo();
}
LinphonePrivate::ChatRoomId chatRoomId{
LinphonePrivate::ConferenceId conferenceId{
LinphonePrivate::IdentityAddress(peerAddress),
LinphonePrivate::IdentityAddress(localAddress)
};
shared_ptr<LinphonePrivate::AbstractChatRoom> chatRoom = L_GET_CPP_PTR_FROM_C_OBJECT(lc)->findChatRoom(chatRoomId);
shared_ptr<LinphonePrivate::AbstractChatRoom> chatRoom = L_GET_CPP_PTR_FROM_C_OBJECT(lc)->findChatRoom(conferenceId);
if (chatRoom)
reason = L_GET_PRIVATE(chatRoom)->onSipMessageReceived(op, sal_msg);
else if (!linphone_core_conference_server_enabled(lc)) {
chatRoom = L_GET_CPP_PTR_FROM_C_OBJECT(lc)->getOrCreateBasicChatRoom(chatRoomId);
chatRoom = L_GET_CPP_PTR_FROM_C_OBJECT(lc)->getOrCreateBasicChatRoom(conferenceId);
if (chatRoom)
reason = L_GET_PRIVATE(chatRoom)->onSipMessageReceived(op, sal_msg);
}
......
......@@ -2210,7 +2210,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))
));
......@@ -2246,7 +2246,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
}
......@@ -84,17 +84,16 @@ set(LINPHONE_CXX_OBJECTS_PRIVATE_HEADER_FILES
call/remote-conference-call.h
chat/chat-message/chat-message-p.h
chat/chat-message/chat-message.h
chat/chat-message/imdn-message.h
chat/chat-message/imdn-message-p.h
chat/chat-message/imdn-message.h
chat/chat-message/is-composing-message.h
chat/chat-message/notification-message.h
chat/chat-message/notification-message-p.h
chat/chat-message/notification-message.h
chat/chat-room/abstract-chat-room-p.h
chat/chat-room/abstract-chat-room.h
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
......@@ -122,6 +121,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
......@@ -138,8 +138,8 @@ set(LINPHONE_CXX_OBJECTS_PRIVATE_HEADER_FILES
conference/params/media-session-params-p.h
conference/params/media-session-params.h
conference/participant-device.h
conference/participant-imdn-state.h
conference/participant-imdn-state-p.h
conference/participant-imdn-state.h
conference/participant-p.h
conference/participant.h
conference/remote-conference-p.h
......@@ -157,9 +157,9 @@ set(LINPHONE_CXX_OBJECTS_PRIVATE_HEADER_FILES
content/content.h
content/file-content.h
content/file-transfer-content.h
content/header/header.h
content/header/header-p.h
content/header/header-param.h
content/header/header.h
core/core-accessor.h
core/core-listener.h
core/core-p.h
......@@ -237,14 +237,14 @@ set(LINPHONE_CXX_OBJECTS_SOURCE_FILES
c-wrapper/api/c-chat-message.cpp
c-wrapper/api/c-chat-room-cbs.cpp
c-wrapper/api/c-chat-room.cpp
c-wrapper/api/c-core.cpp
c-wrapper/api/c-content.cpp
c-wrapper/api/c-core.cpp
c-wrapper/api/c-dial-plan.cpp
c-wrapper/api/c-event-log.cpp
c-wrapper/api/c-magic-search.cpp
c-wrapper/api/c-participant.cpp
c-wrapper/api/c-participant-device.cpp
c-wrapper/api/c-participant-imdn-state.cpp
c-wrapper/api/c-participant.cpp
c-wrapper/api/c-search-result.cpp
c-wrapper/internal/c-sal.cpp
c-wrapper/internal/c-tools.cpp
......@@ -258,7 +258,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
......@@ -276,6 +275,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
......@@ -296,8 +296,8 @@ set(LINPHONE_CXX_OBJECTS_SOURCE_FILES
content/content.cpp
content/file-content.cpp
content/file-transfer-content.cpp
content/header/header.cpp
content/header/header-param.cpp
content/header/header.cpp
core/core-accessor.cpp
core/core-call.cpp
core/core-chat-room.cpp
......@@ -384,7 +384,7 @@ foreach (header ${LINPHONE_CXX_OBJECTS_PRIVATE_HEADER_FILES})
endforeach ()
set(LINPHONE_PRIVATE_HEADER_FILES ${LINPHONE_PRIVATE_HEADER_FILES} PARENT_SCOPE)
if (ANDROID AND CMAKE_C_COMPILER_ID STREQUAL "GNU")
if (ANDROID AND CMAKE_C_COMPILER_ID STREQUAL "GNU")
list(APPEND STRICT_OPTIONS_CXX "-Wno-attributes")
endif()
bc_apply_compile_flags(LINPHONE_CXX_OBJECTS_SOURCE_FILES STRICT_OPTIONS_CPP STRICT_OPTIONS_CXX)
......
......@@ -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,15 +23,15 @@
#include <belle-sip/types.h>
#include "chat/chat-message/chat-message.h"
#include "chat/chat-room/chat-room-id.h"
#include "chat/modifier/file-transfer-chat-message-modifier.h"
#include "chat/notification/imdn.h"
#include "content/content.h"
#include "conference/conference-id.h"
#include "content/content-type.h"
#include "content/content.h"
#include "content/file-content.h"
#include "content/file-transfer-content.h"
#include "db/main-db.h"
#include "db/main-db-chat-message-key.h"
#include "db/main-db.h"
#include "event-log/conference/conference-chat-message-event.h"
#include "object/object-p.h"
#include "sal/sal.h"
......@@ -211,7 +211,7 @@ private:
// Do not expose.
std::weak_ptr<AbstractChatRoom> chatRoom;
ChatRoomId chatRoomId;
ConferenceId conferenceId;
IdentityAddress fromAddress;
IdentityAddress toAddress;
......
......@@ -428,13 +428,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();
}
}
......@@ -906,7 +906,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 {
......@@ -56,7 +56,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,10 +23,10 @@
#include <ctime>
#include "abstract-chat-room-p.h"
#include "chat-room-id.h"
#include "chat-room.h"
#include "chat/notification/imdn.h"
#include "chat/notification/is-composing.h"
#include "conference/conference-id.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);
}
// -----------------------------------------------------------------------------
......@@ -167,7 +167,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 chatMessages = q->getCore()->getPrivate()->mainDb->findChatMessagesToBeNotifiedAsDelivered(q->getChatRoomId());
auto chatMessages = q->getCore()->getPrivate()->mainDb->findChatMessagesToBeNotifiedAsDelivered(q->getConferenceId());
for (const auto &chatMessage : chatMessages) {
ChatMessagePrivate *dChatMessage = chatMessage->getPrivate();
if (dChatMessage->getPositiveDeliveryNotificationRequired()) {
......@@ -234,7 +234,7 @@ void ChatRoomPrivate::notifyIsComposingReceived (const Address &remoteAddress, b
void ChatRoomPrivate::notifyStateChanged () {
L_Q();
LinphoneChatRoom *cr = getCChatRoom();
lInfo() << "Chat room [" << q->getChatRoomId() << "] state changed to: " << Utils::toString(state);
lInfo() << "Chat room [" << q->getConferenceId() << "] state changed to: " << Utils::toString(state);
linphone_core_notify_chat_room_state_changed(q->getCore()->getCCore(), cr, (LinphoneChatRoomState)state);
_linphone_chat_room_notify_state_changed(cr, (LinphoneChatRoomState)state);
}
......@@ -346,11 +346,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));
}
......@@ -363,19 +363,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();
}
// -----------------------------------------------------------------------------
......@@ -400,16 +400,16 @@ ChatRoom::State ChatRoom::getState () 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 })
);
......@@ -417,7 +417,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 })
......@@ -425,7 +425,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 () {
......@@ -437,19 +437,19 @@ 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 {
return getCore()->getPrivate()->mainDb->getUnreadChatMessageCount(getChatRoomId());
return getCore()->getPrivate()->mainDb->getUnreadChatMessageCount(getConferenceId());
}
// -----------------------------------------------------------------------------
......@@ -516,10 +516,10 @@ void ChatRoom::markAsRead () {
L_D();
CorePrivate *dCore = getCore()->getPrivate();
for (auto &chatMessage : dCore->mainDb->getUnreadChatMessages(d->chatRoomId))
for (auto &chatMessage : dCore->mainDb->getUnreadChatMessages(d->conferenceId))
chatMessage->getPrivate()->setState(ChatMessage::State::Displayed);
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;
......@@ -81,7 +81,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);
......
......@@ -222,11 +222,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());
}
}
}
......@@ -248,7 +248,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);
......@@ -263,20 +263,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;
......@@ -285,7 +285,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());
......@@ -548,7 +548,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);
}
......@@ -570,7 +570,7 @@ void ClientGroupChatRoom::onConferenceTerminated (const IdentityAddress &addr) {
auto event = make_shared<ConferenceEvent>(
EventLog::Type::ConferenceTerminated,
time(nullptr),
d->chatRoomId
d->conferenceId
);
d->addEvent(event);
......@@ -595,8 +595,9 @@ void ClientGroupChatRoom::onFirstNotifyReceived (const IdentityAddress &addr) {
bool performMigration = false;
shared_ptr<AbstractChatRoom> chatRoom;
if (getParticipantCount() == 1) {
ChatRoomId id(getParticipants().front()->getAddress(), getMe()->getAddress());
chatRoom = getCore()->findChatRoom(id);
chatRoom = getCore()->findChatRoom(
ConferenceId(getParticipants().front()->getAddress(), getMe()->getAddress())
);
if (chatRoom && (chatRoom->getCapabilities() & ChatRoom::Capabilities::Basic))
performMigration = true;
}
......@@ -609,7 +610,7 @@ void ClientGroupChatRoom::onFirstNotifyReceived (const IdentityAddress &addr) {
auto event = make_shared<ConferenceEvent>(
EventLog::Type::ConferenceCreated,
time(nullptr),
d->chatRoomId
d->conferenceId
);
d->addEvent(event);
......
......@@ -49,7 +49,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 {
......@@ -208,11 +208,11 @@ const IdentityAddress &ProxyChatRoom::getConferenceAddress () const {
// -----------------------------------------------------------------------------
void ProxyChatRoom::allowCpim (bool value) {
}
void ProxyChatRoom::allowMultipart (bool value) {
}
bool ProxyChatRoom::canHandleCpim () 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;