Commit a63b6c76 authored by Benjamin REIS's avatar Benjamin REIS
Browse files

subscribe when creating a chatroom from db + fix creation of basic chat room from db

parent 33c9f56f
......@@ -107,12 +107,17 @@ ClientGroupChatRoom::ClientGroupChatRoom (
RemoteConference(core, me->getAddress(), nullptr) {
L_D();
L_D_T(RemoteConference, dConference);
dConference->focus = make_shared<Participant>(peerAddress);
dConference->conferenceAddress = peerAddress;
dConference->subject = subject;
dConference->participants = move(participants);
d->state = ChatRoom::State::Created;
getMe()->getPrivate()->setAdmin(me->isAdmin());
dConference->eventHandler->subscribe(getChatRoomId());
}
shared_ptr<Core> ClientGroupChatRoom::getCore () const {
......
......@@ -235,6 +235,10 @@ MainDb::MainDb (const shared_ptr<Core> &core) : AbstractDb(*new MainDbPrivate),
soci::use(static_cast<int>(chatRoom->getCapabilities())), soci::use(chatRoom->getSubject());
id = q->getLastInsertId();
if (!chatRoom->canHandleParticipants())
return id;
shared_ptr<Participant> me = chatRoom->getMe();
insertChatRoomParticipant(id, insertSipAddress(me->getAddress().asString()), me->isAdmin());
for (const auto &participant : chatRoom->getParticipants())
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment