mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-27 12:05:22 +00:00
fix: only resume AttachmentDownloadJobs and fix boolean logic on returning early in download job
This commit is contained in:
parent
9dfd051e63
commit
1ee1d1795d
@ -9,6 +9,7 @@ import androidx.appcompat.app.AlertDialog
|
||||
import kotlinx.android.synthetic.main.dialog_download.view.*
|
||||
import network.loki.messenger.R
|
||||
import org.session.libsession.messaging.contacts.Contact
|
||||
import org.session.libsession.messaging.jobs.AttachmentDownloadJob
|
||||
import org.session.libsession.messaging.jobs.JobQueue
|
||||
import org.session.libsession.utilities.recipients.Recipient
|
||||
import org.thoughtcrime.securesms.conversation.v2.utilities.BaseDialog
|
||||
@ -42,7 +43,7 @@ class DownloadDialog(private val recipient: Recipient) : BaseDialog() {
|
||||
val contact = contactDB.getContactWithSessionID(sessionID) ?: return
|
||||
val threadID = DatabaseFactory.getThreadDatabase(requireContext()).getThreadIdIfExistsFor(recipient)
|
||||
contactDB.setContactIsTrusted(contact, true, threadID)
|
||||
JobQueue.shared.resumePendingJobs()
|
||||
JobQueue.shared.resumePendingJobs(AttachmentDownloadJob.KEY)
|
||||
dismiss()
|
||||
}
|
||||
}
|
@ -76,7 +76,7 @@ class AttachmentDownloadJob(val attachmentID: Long, val databaseMessageID: Long)
|
||||
handleFailure(Error.NoSender, null)
|
||||
return
|
||||
}
|
||||
if (!threadRecipient.isGroupRecipient && (!contact.isTrusted || storage.getUserPublicKey() != sender.address.serialize())) {
|
||||
if (!threadRecipient.isGroupRecipient && !(contact.isTrusted || storage.getUserPublicKey() != sender.address.serialize())) {
|
||||
Log.e("Loki", "Thread isn't a group recipient, or contact isn't trusted or self-send")
|
||||
return
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user