Maybe fix oob in media preview adapter cursor adapter (#1324)

* fix: maybe fix oob exception?

* fix: attachment download was broken again

* refactor: wrap in an if and log warning in the bad state
This commit is contained in:
0x330a
2023-10-04 15:17:07 +11:00
committed by GitHub
parent 443ddfa370
commit 77a18e337b
2 changed files with 10 additions and 6 deletions

View File

@@ -100,9 +100,10 @@ class AttachmentDownloadJob(val attachmentID: Long, val databaseMessageID: Long)
handleFailure(Error.NoSender, null)
return
}
if (!threadRecipient.isGroupRecipient && (contact?.isTrusted == true || storage.getUserPublicKey() != sender)) {
if (!threadRecipient.isGroupRecipient || (contact?.isTrusted != true && storage.getUserPublicKey() != sender)) {
// if we aren't receiving a group message, a message from ourselves (self-send) and the contact sending is not trusted:
// do not continue, but do not fail
handleFailure(Error.NoSender, null)
return
}