Left pane preview/timestamp: Further refine logic

This commit is contained in:
Scott Nonnenberg 2020-08-27 11:36:11 -07:00 committed by Josh Perez
parent bcd4f6407f
commit 8d5e832ed6
2 changed files with 9 additions and 9 deletions

View file

@ -1884,11 +1884,6 @@
}),
]);
// This is the less-restrictive of these two fetches; if it's falsey, both will be
if (!previewMessage) {
return;
}
if (
this.hasDraft() &&
this.get('draftTimestamp') &&
@ -1903,10 +1898,15 @@
: currentTimestamp;
this.set({
lastMessage: previewMessage.getNotificationText() || '',
lastMessageStatus: previewMessage.getMessagePropStatus() || null,
lastMessage:
(previewMessage ? previewMessage.getNotificationText() : '') || '',
lastMessageStatus:
(previewMessage ? previewMessage.getMessagePropStatus() : null) ||
null,
timestamp,
lastMessageDeletedForEveryone: previewMessage.deletedForEveryone,
lastMessageDeletedForEveryone: previewMessage
? previewMessage.deletedForEveryone
: false,
});
window.Signal.Data.updateConversation(this.attributes);

View file

@ -2759,7 +2759,7 @@ async function getLastConversationActivity(
const row = await db.get(
`SELECT * FROM messages WHERE
conversationId = $conversationId AND
(type IS NULL OR 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', 'keychange')) AND
(json_extract(json, '$.expirationTimerUpdate.fromSync') IS NULL OR json_extract(json, '$.expirationTimerUpdate.fromSync') != 1)
ORDER BY received_at DESC
LIMIT 1;`,