mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-05-07 05:53:06 +00:00
Change the state of ClientGroupChatRoom and ServerGroupChatRoom outside of their constructors.
This commit is contained in:
parent
a57290dbca
commit
05271e8603
3 changed files with 14 additions and 11 deletions
|
|
@ -103,11 +103,9 @@ ClientGroupChatRoom::ClientGroupChatRoom (
|
|||
shared_ptr<Participant> &me,
|
||||
const string &subject,
|
||||
list<shared_ptr<Participant>> &&participants,
|
||||
unsigned int lastNotifyId,
|
||||
bool hasBeenLeft
|
||||
unsigned int lastNotifyId
|
||||
) : ChatRoom(*new ClientGroupChatRoomPrivate, core, ChatRoomId(peerAddress, me->getAddress())),
|
||||
RemoteConference(core, me->getAddress(), nullptr) {
|
||||
L_D();
|
||||
L_D_T(RemoteConference, dConference);
|
||||
|
||||
dConference->focus = make_shared<Participant>(peerAddress);
|
||||
|
|
@ -115,8 +113,6 @@ RemoteConference(core, me->getAddress(), nullptr) {
|
|||
dConference->subject = subject;
|
||||
dConference->participants = move(participants);
|
||||
|
||||
d->state = hasBeenLeft ? ChatRoom::State::Terminated : ChatRoom::State::Created;
|
||||
|
||||
getMe()->getPrivate()->setAdmin(me->isAdmin());
|
||||
|
||||
dConference->eventHandler->setLastNotify(lastNotifyId);
|
||||
|
|
|
|||
|
|
@ -45,8 +45,7 @@ public:
|
|||
std::shared_ptr<Participant> &me,
|
||||
const std::string &subject,
|
||||
std::list<std::shared_ptr<Participant>> &&participants,
|
||||
unsigned int lastNotifyId,
|
||||
bool hasBeenLeft
|
||||
unsigned int lastNotifyId
|
||||
);
|
||||
|
||||
std::shared_ptr<Core> getCore () const;
|
||||
|
|
|
|||
|
|
@ -1906,17 +1906,22 @@ MainDb::MainDb (const shared_ptr<Core> &core) : AbstractDb(*new MainDbPrivate),
|
|||
continue;
|
||||
}
|
||||
|
||||
if (!linphone_core_conference_server_enabled(core->getCCore()))
|
||||
if (!linphone_core_conference_server_enabled(core->getCCore())) {
|
||||
bool hasBeenLeft = !!row.get<int>(8, 0);
|
||||
chatRoom = make_shared<ClientGroupChatRoom>(
|
||||
core,
|
||||
chatRoomId.getPeerAddress(),
|
||||
me,
|
||||
subject,
|
||||
move(participants),
|
||||
lastNotifyId,
|
||||
!!row.get<int>(8, 0)
|
||||
lastNotifyId
|
||||
);
|
||||
else
|
||||
chatRoom->getPrivate()->setState(LinphonePrivate::ChatRoom::State::Instantiated);
|
||||
chatRoom->getPrivate()->setState(hasBeenLeft
|
||||
? ChatRoom::State::Terminated
|
||||
: ChatRoom::State::Created
|
||||
);
|
||||
} else {
|
||||
chatRoom = make_shared<ServerGroupChatRoom>(
|
||||
core,
|
||||
chatRoomId.getPeerAddress(),
|
||||
|
|
@ -1924,6 +1929,9 @@ MainDb::MainDb (const shared_ptr<Core> &core) : AbstractDb(*new MainDbPrivate),
|
|||
move(participants),
|
||||
lastNotifyId
|
||||
);
|
||||
chatRoom->getPrivate()->setState(LinphonePrivate::ChatRoom::State::Instantiated);
|
||||
chatRoom->getPrivate()->setState(LinphonePrivate::ChatRoom::State::Created);
|
||||
}
|
||||
}
|
||||
|
||||
if (!chatRoom)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue