Merge remote-tracking branch 'upstream/dev' into closed_groups

# Conflicts:
#	libsession/src/main/java/org/session/libsession/messaging/jobs/AttachmentDownloadJob.kt
This commit is contained in:
0x330a
2023-10-02 10:55:26 +11:00
15 changed files with 117 additions and 416 deletions

View File

@@ -89,16 +89,22 @@ class AttachmentDownloadJob(val attachmentID: Long, val databaseMessageID: Long)
}
val threadRecipient = storage.getRecipientForThread(threadID)
val sender = if (messageDataProvider.isMmsOutgoing(databaseMessageID)) {
val selfSend = messageDataProvider.isMmsOutgoing(databaseMessageID)
val sender = if (selfSend) {
storage.getUserPublicKey()
} else {
messageDataProvider.getIndividualRecipientForMms(databaseMessageID)?.address?.serialize()
}
val contact = sender?.let { storage.getContactWithSessionID(it) }
if (threadRecipient == null || sender == null || contact == null) {
if (threadRecipient == null || sender == null || (contact == null && !selfSend)) {
handleFailure(Error.NoSender, null)
return
}
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
return
}
var tempFile: File? = null
try {