Commit 4cd5e7ae authored by Ghislain MARY's avatar Ghislain MARY

Change the state of the ClientGroupChatRoom to created only when the first...

Change the state of the ClientGroupChatRoom to created only when the first NOTIFY has been received.
parent fe014194
......@@ -254,8 +254,6 @@ void ClientGroupChatRoom::onConferenceCreated (const Address &addr) {
dConference->conferenceAddress = addr;
d->peerAddress = addr;
CoreAccessor::getCore()->getPrivate()->insertChatRoom(getSharedFromThis());
d->setState(ChatRoom::State::Created);
CoreAccessor::getCore()->getPrivate()->insertChatRoomWithDb(getSharedFromThis());
}
void ClientGroupChatRoom::onConferenceTerminated (const Address &addr) {
......@@ -263,6 +261,12 @@ void ClientGroupChatRoom::onConferenceTerminated (const Address &addr) {
d->setState(ChatRoom::State::Terminated);
}
void ClientGroupChatRoom::onFirstNotifyReceived (const Address &addr) {
L_D();
d->setState(ChatRoom::State::Created);
CoreAccessor::getCore()->getPrivate()->insertChatRoomWithDb(getSharedFromThis());
}
void ClientGroupChatRoom::onParticipantAdded (const shared_ptr<ConferenceParticipantEvent> &event, bool isFullState) {
L_D_T(RemoteConference, dConference);
......
......@@ -64,6 +64,7 @@ private:
/* ConferenceListener */
void onConferenceCreated (const Address &addr) override;
void onConferenceTerminated (const Address &addr) override;
void onFirstNotifyReceived (const Address &addr) override;
void onParticipantAdded (const std::shared_ptr<ConferenceParticipantEvent> &event, bool isFullState) override;
void onParticipantRemoved (const std::shared_ptr<ConferenceParticipantEvent> &event, bool isFullState) override;
void onParticipantSetAdmin (const std::shared_ptr<ConferenceParticipantEvent> &event, bool isFullState) override;
......
......@@ -37,6 +37,7 @@ class ConferenceListener {
public:
virtual void onConferenceCreated (const Address &addr) = 0;
virtual void onConferenceTerminated (const Address &addr) = 0;
virtual void onFirstNotifyReceived (const Address &addr) = 0;
virtual void onParticipantAdded (const std::shared_ptr<ConferenceParticipantEvent> &event, bool isFullState) = 0;
virtual void onParticipantRemoved (const std::shared_ptr<ConferenceParticipantEvent> &event, bool isFullState) = 0;
virtual void onParticipantSetAdmin (const std::shared_ptr<ConferenceParticipantEvent> &event, bool isFullState) = 0;
......
......@@ -189,6 +189,9 @@ void RemoteConferenceEventHandler::notifyReceived (const string &xmlBody) {
}
linphone_address_unref(cAddr);
}
if (isFullState)
d->listener->onFirstNotifyReceived(d->confAddress);
}
}
......
......@@ -89,6 +89,8 @@ void RemoteConference::onConferenceTerminated (const Address &addr) {
d->eventHandler->unsubscribe();
}
void RemoteConference::onFirstNotifyReceived (const Address &addr) {}
void RemoteConference::onParticipantAdded (const std::shared_ptr<ConferenceParticipantEvent> &event, bool isFullState) {
(void)event; // unused
(void)isFullState; // unused
......
......@@ -46,6 +46,7 @@ protected:
/* ConferenceListener */
void onConferenceCreated (const Address &addr) override;
void onConferenceTerminated (const Address &addr) override;
void onFirstNotifyReceived (const Address &addr) override;
void onParticipantAdded (const std::shared_ptr<ConferenceParticipantEvent> &event, bool isFullState) override;
void onParticipantRemoved (const std::shared_ptr<ConferenceParticipantEvent> &event, bool isFullState) override;
void onParticipantSetAdmin (const std::shared_ptr<ConferenceParticipantEvent> &event, bool isFullState) override;
......
......@@ -447,6 +447,7 @@ public:
private:
void onConferenceCreated (const Address &addr) override;
void onConferenceTerminated (const Address &addr) override;
void onFirstNotifyReceived (const Address &addr) override;
void onParticipantAdded (const shared_ptr<ConferenceParticipantEvent> &event, bool isFullState) override;
void onParticipantRemoved (const shared_ptr<ConferenceParticipantEvent> &event, bool isFullState) override;
void onParticipantSetAdmin (const shared_ptr<ConferenceParticipantEvent> &event, bool isFullState) override;
......@@ -473,6 +474,8 @@ void ConferenceEventTester::onConferenceCreated (const Address &addr) {}
void ConferenceEventTester::onConferenceTerminated (const Address &addr) {}
void ConferenceEventTester::onFirstNotifyReceived (const Address &addr) {}
void ConferenceEventTester::onParticipantAdded (const shared_ptr<ConferenceParticipantEvent> &event, bool isFullState) {
(void)isFullState; // unused
const Address addr = event->getParticipantAddress();
......
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