Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
DenBond7 committed Nov 12, 2024
1 parent 6fdae4d commit 2f128f0
Showing 1 changed file with 3 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import com.flowcrypt.email.api.email.model.LocalFolder
import com.flowcrypt.email.api.email.model.MessageFlag
import com.flowcrypt.email.api.retrofit.response.base.Result
import com.flowcrypt.email.api.retrofit.response.model.AttMsgBlock
import com.flowcrypt.email.api.retrofit.response.model.DecryptErrorMsgBlock
import com.flowcrypt.email.api.retrofit.response.model.MsgBlock
import com.flowcrypt.email.api.retrofit.response.model.PublicKeyMsgBlock
import com.flowcrypt.email.database.MessageState
Expand All @@ -32,7 +31,6 @@ import com.flowcrypt.email.security.pgp.PgpKey
import com.flowcrypt.email.security.pgp.PgpMsg
import com.flowcrypt.email.ui.adapter.MessagesInThreadListAdapter
import com.flowcrypt.email.util.cache.DiskLruCache
import com.flowcrypt.email.util.exception.ExceptionUtil
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.flow.Flow
Expand Down Expand Up @@ -87,8 +85,8 @@ class ProcessMessageViewModel(
)
)

val existedMsgSnapshot = MsgsCacheManager.getMsgSnapshot(messageEntity.id.toString())
if (existedMsgSnapshot != null) {
val existingMsgSnapshot = MsgsCacheManager.getMsgSnapshot(messageEntity.id.toString())
if (existingMsgSnapshot != null) {
emit(
Result.loading(
progressMsg = context.getString(R.string.processing),
Expand All @@ -97,7 +95,7 @@ class ProcessMessageViewModel(
)
)
UpdateMsgsSeenStateWorker.enqueue(application)
val processingResult = processingMsgSnapshot(existedMsgSnapshot)
val processingResult = processingMsgSnapshot(existingMsgSnapshot)
emit(
Result.loading(
progressMsg = context.getString(R.string.processing),
Expand Down Expand Up @@ -397,17 +395,6 @@ class ProcessMessageViewModel(
e.printStackTrace()
}
}

is DecryptErrorMsgBlock -> {
if (block.decryptErr?.details?.type == PgpDecryptAndOrVerify.DecryptionErrorType.NEED_PASSPHRASE) {
val fingerprints = block.decryptErr.fingerprints ?: emptyList()
if (fingerprints.isEmpty()) {
ExceptionUtil.handleError(IllegalStateException("Fingerprints were not provided"))
} else {
//passphraseNeededLiveData.postValue(fingerprints)
}
}
}
}
}
}
Expand Down

0 comments on commit 2f128f0

Please sign in to comment.