fix(message_persistence): set from in quoted message even when deleted (#4354)

Needed for https://github.com/status-im/status-desktop/issues/12785
This commit is contained in:
Jonathan Rainville 2023-11-23 13:07:42 -05:00 committed by GitHub
parent 5cd20ded4e
commit b7acde0910
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -365,6 +365,7 @@ func (db sqlitePersistence) tableUserMessagesScanAllFields(row scanner, message
if quotedDeleted.Bool || quotedDeletedForMe.Bool {
message.QuotedMessage = &common.QuotedMessage{
ID: quotedID.String,
From: quotedFrom.String,
Deleted: quotedDeleted.Bool,
DeletedForMe: quotedDeletedForMe.Bool,
}

View File

@ -557,9 +557,9 @@ func TestMessageReplies(t *testing.T) {
require.Equal(t, "", retrievedMessages[4].ResponseTo)
require.Nil(t, retrievedMessages[4].QuotedMessage)
// We have a ResponseTo, but no QuotedMessage only gives the ID and Deleted
// We have a ResponseTo, but no QuotedMessage only gives the ID, From, and Deleted
require.Equal(t, "id-4", retrievedMessages[0].ResponseTo)
require.Equal(t, &common.QuotedMessage{ID: "id-4", Deleted: true}, retrievedMessages[0].QuotedMessage)
require.Equal(t, &common.QuotedMessage{ID: "id-4", Deleted: true, From: "2"}, retrievedMessages[0].QuotedMessage)
}
func TestMessageByChatIDWithTheSameClocks(t *testing.T) {