mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-05-06 21:33:08 +00:00
feat(MainDb): invalid chat message when event log is not valid
This commit is contained in:
parent
397dbc39fb
commit
47554237c1
1 changed files with 9 additions and 1 deletions
|
|
@ -845,12 +845,20 @@ MainDb::MainDb (const shared_ptr<Core> &core) : AbstractDb(*new MainDbPrivate),
|
|||
soci::session *session = dbSession.getBackendSession<soci::session>();
|
||||
soci::rowset<soci::row> rows = (session->prepare << query, soci::use(chatRoomId));
|
||||
for (const auto &row : rows) {
|
||||
shared_ptr<EventLog> eventLog = getEventFromCache(resolveId(row, 0));
|
||||
long long eventId = resolveId(row, 0);
|
||||
shared_ptr<EventLog> eventLog = getEventFromCache(eventId);
|
||||
if (eventLog) {
|
||||
const EventLogPrivate *dEventLog = eventLog->getPrivate();
|
||||
L_ASSERT(dEventLog->dbKey.isValid());
|
||||
dEventLog->dbKey = MainDbEventKey();
|
||||
}
|
||||
// TODO: Try to add a better code here...
|
||||
shared_ptr<ChatMessage> chatMessage = getChatMessageFromCache(eventId);
|
||||
if (chatMessage) {
|
||||
const ChatMessagePrivate *dChatMessage = chatMessage->getPrivate();
|
||||
L_ASSERT(dChatMessage->dbKey.isValid());
|
||||
dChatMessage->dbKey = MainDbChatMessageKey();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue