Fix conversation last activity calculation

This commit is contained in:
Scott Nonnenberg 2020-08-13 15:47:50 -07:00 committed by GitHub
parent aa43f322b3
commit 2db1569fbd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -1899,7 +1899,7 @@
const currentTimestamp = this.get('timestamp') || null;
const timestamp = activityMessage
? activityMessage.sent_at || currentTimestamp
? activityMessage.get('sent_at') || currentTimestamp
: currentTimestamp;
this.set({

View File

@ -2759,8 +2759,8 @@ async function getLastConversationActivity(
const row = await db.get(
`SELECT * FROM messages WHERE
conversationId = $conversationId AND
type NOT IN ('profile-change', 'verified-change', 'message-history-unsynced') AND
json_extract(json, '$.expirationTimerUpdate.fromSync') != true
(type IS NULL OR type NOT IN ('profile-change', 'verified-change', 'message-history-unsynced')) AND
(json_extract(json, '$.expirationTimerUpdate.fromSync') IS NULL OR json_extract(json, '$.expirationTimerUpdate.fromSync') != 1)
ORDER BY received_at DESC
LIMIT 1;`,
{
@ -2781,7 +2781,7 @@ async function getLastConversationPreview(
const row = await db.get(
`SELECT * FROM messages WHERE
conversationId = $conversationId AND
type NOT IN ('profile-change', 'verified-change', 'message-history-unsynced')
(type IS NULL OR type NOT IN ('profile-change', 'verified-change', 'message-history-unsynced'))
ORDER BY received_at DESC
LIMIT 1;`,
{