Commit 503585ac authored by Ronan's avatar Ronan

fix(MainDb): store basic chat room participants

parent c7eece9e
......@@ -30,6 +30,7 @@ LINPHONE_BEGIN_NAMESPACE
class BasicChatRoomPrivate : public ChatRoomPrivate {
private:
std::string subject;
std::shared_ptr<Participant> me;
std::list<std::shared_ptr<Participant>> participants;
bool cpimAllowed = false;
bool multipartAllowed = false;
......
......@@ -40,6 +40,7 @@ BasicChatRoom::BasicChatRoom (
const ChatRoomId &chatRoomId
) : ChatRoom(p, core, chatRoomId) {
L_D();
d->me = make_shared<Participant>(getLocalAddress());
d->participants.push_back(make_shared<Participant>(getPeerAddress()));
}
......@@ -102,8 +103,8 @@ shared_ptr<Participant> BasicChatRoom::findParticipant (const IdentityAddress &)
}
shared_ptr<Participant> BasicChatRoom::getMe () const {
lError() << "getMe() is not allowed on a BasicChatRoom";
return nullptr;
L_D();
return d->me;
}
int BasicChatRoom::getParticipantCount () const {
......
......@@ -362,8 +362,6 @@ long long MainDbPrivate::insertChatRoom (const shared_ptr<AbstractChatRoom> &cha
soci::use(lastUpdateTime), soci::use(capabilities), soci::use(subject), soci::use(flags), soci::use(notifyId);
id = dbSession.getLastInsertId();
if (!chatRoom->canHandleParticipants())
return id;
// Do not add 'me' when creating a server-group-chat-room.
if (chatRoomId.getLocalAddress() != chatRoomId.getPeerAddress()) {
......
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