mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-17 11:08:06 +00:00
fix(MainDb): store basic chat room participants
This commit is contained in:
parent
c7eece9e77
commit
503585ac06
3 changed files with 4 additions and 4 deletions
|
|
@ -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()) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue