fix(MainDb): ensure contents are loaded before add event

This commit is contained in:
Ronan Abhamon 2018-02-26 09:23:30 +01:00
parent 9767adccc8
commit de8c673f38

View file

@ -762,6 +762,9 @@ void ChatMessagePrivate::storeInDb () {
updateInDb();
} else {
shared_ptr<EventLog> eventLog = make_shared<ConferenceChatMessageEvent>(time, q->getSharedFromThis());
// Avoid transaction in transaction if contents are not loaded.
loadContentsFromDatabase();
q->getChatRoom()->getPrivate()->addEvent(eventLog);
if (direction == ChatMessage::Direction::Incoming) {