Ensure getLastConversationPreview
never returns expired messages
This commit is contained in:
parent
1b9d8dcb11
commit
48daaaa81d
1 changed files with 5 additions and 0 deletions
|
@ -4816,6 +4816,10 @@ function getLastConversationPreview({
|
||||||
SELECT json FROM messages
|
SELECT json FROM messages
|
||||||
WHERE
|
WHERE
|
||||||
conversationId = $conversationId AND
|
conversationId = $conversationId AND
|
||||||
|
(
|
||||||
|
expiresAt IS NULL OR
|
||||||
|
(expiresAt > $now)
|
||||||
|
) AND
|
||||||
(
|
(
|
||||||
type IS NULL
|
type IS NULL
|
||||||
OR
|
OR
|
||||||
|
@ -4841,6 +4845,7 @@ function getLastConversationPreview({
|
||||||
).get({
|
).get({
|
||||||
conversationId,
|
conversationId,
|
||||||
ourConversationId,
|
ourConversationId,
|
||||||
|
now: Date.now(),
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!row) {
|
if (!row) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue