Commit a5312044 authored by Ronan's avatar Ronan
Browse files

fix(BasicChatRoom): do not notify chat room state when it is fetched from database

parent 146042ac
......@@ -69,7 +69,6 @@ public:
std::shared_ptr<ChatMessage> createChatMessage (ChatMessage::Direction direction);
LinphoneCall *call = nullptr;
ChatRoom::State state = ChatRoom::State::None;
bool isComposing = false;
std::list<Address> remoteIsComposing;
std::list<std::shared_ptr<EventLog>> transientEvents;
......@@ -82,6 +81,8 @@ public:
// TODO: Check all fields before this point.
ChatRoom::State state = ChatRoom::State::None;
public:
virtual void onChatMessageReceived (const std::shared_ptr<ChatMessage> &chatMessage) = 0;
......
......@@ -61,7 +61,7 @@ static IdentityAddress getDefaultLocalAddress (const shared_ptr<Core> &core, con
// -----------------------------------------------------------------------------
shared_ptr<ChatRoom> CorePrivate::createBasicChatRoom (const ChatRoomId &chatRoomId, bool isRtt) {
shared_ptr<ChatRoom> CorePrivate::createBasicChatRoom (const ChatRoomId &chatRoomId, bool isRtt, bool notifyCreation) {
L_Q();
shared_ptr<ChatRoom> chatRoom;
......@@ -73,8 +73,11 @@ shared_ptr<ChatRoom> CorePrivate::createBasicChatRoom (const ChatRoomId &chatRoo
ChatRoomPrivate *dChatRoom = chatRoom->getPrivate();
dChatRoom->setState(ChatRoom::State::Instantiated);
dChatRoom->setState(ChatRoom::State::Created);
if (notifyCreation) {
dChatRoom->setState(ChatRoom::State::Instantiated);
dChatRoom->setState(ChatRoom::State::Created);
} else
dChatRoom->state = ChatRoom::State::Created;
return chatRoom;
}
......
......@@ -54,7 +54,7 @@ public:
void insertChatRoom (const std::shared_ptr<ChatRoom> &chatRoom);
void insertChatRoomWithDb (const std::shared_ptr<ChatRoom> &chatRoom);
std::shared_ptr<ChatRoom> createBasicChatRoom (const ChatRoomId &chatRoomId, bool isRtt);
std::shared_ptr<ChatRoom> createBasicChatRoom (const ChatRoomId &chatRoomId, bool isRtt, bool notifyCreation = true);
std::unique_ptr<MainDb> mainDb;
......
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