Ensure getLastConversationPreview
never returns expired messages
This commit is contained in:
@@ -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) {
|
||||||
|
Reference in New Issue
Block a user