mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-29 00:59:20 +00:00
feat(MainDb): create server group chat room from database
This commit is contained in:
parent
04168f9b48
commit
57f638266d
3 changed files with 39 additions and 11 deletions
|
|
@ -78,8 +78,17 @@ void ServerGroupChatRoomPrivate::onChatMessageReceived(const shared_ptr<ChatMess
|
|||
// =============================================================================
|
||||
|
||||
ServerGroupChatRoom::ServerGroupChatRoom (const shared_ptr<Core> &core, SalCallOp *op) :
|
||||
ChatRoom(*new ServerGroupChatRoomPrivate, core, ChatRoomId(IdentityAddress(op->get_to()), IdentityAddress(op->get_to()))),
|
||||
LocalConference(core, IdentityAddress(op->get_to()), nullptr) {}
|
||||
ChatRoom(*new ServerGroupChatRoomPrivate, core, ChatRoomId(IdentityAddress(op->get_to()), IdentityAddress(op->get_to()))),
|
||||
LocalConference(core, IdentityAddress(op->get_to()), nullptr) {}
|
||||
|
||||
ServerGroupChatRoom::ServerGroupChatRoom (
|
||||
const shared_ptr<Core> &core,
|
||||
const IdentityAddress &peerAddress,
|
||||
const string &subject,
|
||||
list<shared_ptr<Participant>> &&participants,
|
||||
unsigned int lastNotifyId
|
||||
) : ChatRoom(*new ServerGroupChatRoomPrivate, core, ChatRoomId(peerAddress, peerAddress)),
|
||||
LocalConference(core, peerAddress, nullptr) {}
|
||||
|
||||
int ServerGroupChatRoom::getCapabilities () const {
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -39,6 +39,15 @@ public:
|
|||
// TODO: Make me private!
|
||||
ServerGroupChatRoom (const std::shared_ptr<Core> &core, SalCallOp *op);
|
||||
|
||||
// TODO: Same idea.
|
||||
ServerGroupChatRoom (
|
||||
const std::shared_ptr<Core> &core,
|
||||
const IdentityAddress &peerAddress,
|
||||
const std::string &subject,
|
||||
std::list<std::shared_ptr<Participant>> &&participants,
|
||||
unsigned int lastNotifyId
|
||||
);
|
||||
|
||||
CapabilitiesMask getCapabilities () const override;
|
||||
bool hasBeenLeft () const override;
|
||||
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@
|
|||
#include "chat/chat-message/chat-message-p.h"
|
||||
#include "chat/chat-room/chat-room-p.h"
|
||||
#include "chat/chat-room/client-group-chat-room.h"
|
||||
#include "chat/chat-room/server-group-chat-room.h"
|
||||
#include "conference/participant-p.h"
|
||||
#include "content/content-type.h"
|
||||
#include "content/content.h"
|
||||
|
|
@ -1873,15 +1874,24 @@ MainDb::MainDb (const shared_ptr<Core> &core) : AbstractDb(*new MainDbPrivate),
|
|||
continue;
|
||||
}
|
||||
|
||||
chatRoom = make_shared<ClientGroupChatRoom>(
|
||||
core,
|
||||
chatRoomId.getPeerAddress(),
|
||||
me,
|
||||
subject,
|
||||
move(participants),
|
||||
lastNotifyId,
|
||||
!!row.get<int>(8, 0)
|
||||
);
|
||||
if (!linphone_core_conference_server_enabled(core->getCCore()))
|
||||
chatRoom = make_shared<ClientGroupChatRoom>(
|
||||
core,
|
||||
chatRoomId.getPeerAddress(),
|
||||
me,
|
||||
subject,
|
||||
move(participants),
|
||||
lastNotifyId,
|
||||
!!row.get<int>(8, 0)
|
||||
);
|
||||
else
|
||||
chatRoom = make_shared<ServerGroupChatRoom>(
|
||||
core,
|
||||
chatRoomId.getPeerAddress(),
|
||||
subject,
|
||||
move(participants),
|
||||
lastNotifyId
|
||||
);
|
||||
}
|
||||
|
||||
if (!chatRoom)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue