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 currentTimestamp = this.get('timestamp') || null;
const timestamp = activityMessage const timestamp = activityMessage
? activityMessage.sent_at || currentTimestamp ? activityMessage.get('sent_at') || currentTimestamp
: currentTimestamp; : currentTimestamp;
this.set({ this.set({

View file

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