Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BC
public
liblinphone
Commits
47554237
Commit
47554237
authored
Nov 30, 2017
by
Ronan
Browse files
feat(MainDb): invalid chat message when event log is not valid
parent
397dbc39
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/db/main-db.cpp
View file @
47554237
...
...
@@ -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
();
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment