Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions FlowCrypt/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,20 @@ android {
namespace = "com.flowcrypt.email"

defaultConfig {
/*
The following argument makes the Android Test Orchestrator run its
"pm clear" command after each test invocation. This command ensures
that the app"s state is completely cleared between tests.
*/
testInstrumentationRunnerArguments += mapOf("clearPackageData" to "true")

applicationId = "com.flowcrypt.email"
minSdk = extra["minSdkVersion"] as Int
targetSdk = extra["targetSdkVersion"] as Int
versionCode = extra["appVersionCode"] as Int
versionName = extra["appVersionName"] as String
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
buildConfigField("int", "MIN_SDK_VERSION", "$minSdk")

/*
The following argument makes the Android Test Orchestrator run its
"pm clear" command after each test invocation. This command ensures
that the app"s state is completely cleared between tests.
*/
testInstrumentationRunnerArguments += mapOf("clearPackageData" to "true")
multiDexEnabled = true
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,30 @@
{
"encryptionType": "ENCRYPTED",
"localFolder": {
"account": "default@flowcrypt.test",
"attributes": [
"\\HasNoChildren"
],
"folderAlias": "INBOX",
"fullName": "INBOX",
"isAll": false,
"isCustom": false,
"isDrafts": false,
"isOutbox": false,
"labelListVisibility": "SHOW",
"msgCount": 1
},
"msgBlocks": [
{
"content": " \u003c!DOCTYPE html\u003e\n \u003chtml\u003e\n \u003chead\u003e\n \u003cmeta name\u003d\"viewport\" content\u003d\"width\u003ddevice-width\"/\u003e\n \u003cstyle\u003e\n body { word-wrap: break-word; word-break: break-word; hyphens: auto; margin-left: 0px; padding-left: 0px; }\n body img { display: inline !important; height: auto !important; max-width: 95% !important; }\n body pre { white-space: pre-wrap !important; }\n body \u003e div.MsgBlock \u003e table { zoom: 75% } /* table layouts tend to overflow - eg emails from fb */\n \u003c/style\u003e\n \u003c/head\u003e\n \u003cbody\u003e\u003cdiv class\u003d\"MsgBlock GREEN\" style\u003d\"padding-left: 8px;min-height: 50px;padding-top: 4px;padding-bottom: 4px;width: 100%;border: 1px solid #f0f0f0;border-left: 8px solid #31A217;border-right: none;background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFoAAABaCAMAAAAPdrEwAAAAh1BMVEXw8PD////w8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PD7MuHIAAAALXRSTlMAAAECBAcICw4QEhUZIyYqMTtGTV5kdn2Ii5mfoKOqrbG0uL6/xcnM0NTX2t1l7cN4AAAB0UlEQVR4Ae3Y3Y4SQRCG4bdHweFHRBTBH1FRFLXv//qsA8kmvbMdXhh2Q0KfknpSCQc130c67s22+e9+v/+d84fxkSPH0m/+5P9vN7vRV0vPfx7or1NB23e99KAHuoXOOc6moQsBwNN1Q9g4Wdh1uq3MA7Qn0+2ylAt7WbWpyT+Wo8roKH6v2QhZ2ghZ2ghZ2ghZ2ghZ2ghZ2ghZ2ghZ2ghZ2ghZ2ghZ2ghZ2ghZ2gjZ2AUNOLmwgQdogEJ2dnF3UJdU3WjqO/u96aYtVd/7jqvIyu76G5se6GaY7tNNcy5d7se7eWVnDz87fMkuVuS8epF6f9NPObPY5re9y4N1/vya9Gr3se2bfvl9M0mkyZdv077p+a/3z4Meby5Br4NWiV51BaiUqfLro9I3WiR61RVcffwfXI7u5zZ20EOA82Uu8x3SlrSwXQuBSvSqK0AletUVoBK96gpIwlZy0MJWctDCVnLQwlZy0MJWctDCVnLQwlZy0MJWctDCVnLQwlZy0MJWctDCVnLQwlZy0MJWckIletUVIJJxITN6wtZd2EI+0NquyIJOnUpFVvRpcwmV6FVXgEr0qitAJXrVFaASveoKUIledQWoRK+6AlSiV13BP+/VVbky7Xq1AAAAAElFTkSuQmCC);\"\u003e\u003chtml\u003e\u003chead\u003e\u003c/head\u003e\u003cbody\u003eEncrypted text\u003c/body\u003e\u003c/html\u003e\u003c/div\u003e\u003c!-- next MsgBlock --\u003e\n\u003cdiv class\u003d\"MsgBlock PLAIN\" style\u003d\"padding-left: 8px;min-height: 50px;padding-top: 4px;padding-bottom: 4px;width: 100%;border: none;\"\u003e\u003chtml\u003e\u003chead\u003e\u003c/head\u003e\u003cbody\u003eFooter with some text\u003c/body\u003e\u003c/html\u003e\u003c/div\u003e\u003c!-- next MsgBlock --\u003e\n\u003c/body\u003e\n \u003c/html\u003e",
"content": " \u003c!DOCTYPE html\u003e\n \u003chtml\u003e\n \u003chead\u003e\n \u003cmeta name\u003d\"viewport\" content\u003d\"width\u003ddevice-width\"\u003e\n \u003cstyle\u003e\n body { word-wrap: break-word; word-break: break-word; hyphens: auto; margin-left: 0px; padding-left: 0px; }\n blockquote { border-left: 1px solid #CCCCCC; margin: 0px 0px 0px 10px; padding:10px 0px 0px 10px; }\n body img { display: inline !important; height: auto !important; max-width: 95% !important; }\n details \u003e summary { list-style-type: none; }\n details \u003e summary::-webkit-details-marker { display: none; }\n details \u003e summary::before { content: \u0027▪▪▪\u0027; color: #31a217; border: 2px solid; border-radius: 5px; padding: 0px 5px 0px 5px; font-size: 75%; }\n summary:active:before { opacity: 0.5; }\n body pre { white-space: pre-wrap !important; }\n body \u003e div.MsgBlock \u003e table { zoom: 75% } /* table layouts tend to overflow - eg emails from fb */\n @media (prefers-color-scheme: dark) {\n .MsgBlock.GREEN { background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFoAAABaCAMAAAAPdrEwAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAJcEhZcwAACxMAAAsTAQCanBgAAABCUExURUdwTAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHPTtPsAAAAWdFJOUwAQbDIRQwiFQnQhUxl9SilkOzpLa2NiUIRSAAABRElEQVRYw+3ZTXOEMAgGYIwhEExstx///6/2sJ09roBy6Jb34MXhGZ1dCUYAXZgeYbg2Sb8EPdZHBmQyfzlre37+zS0jPa8VQre8Ht2V00ZFs/DZqGpDHw4blQ2OzTaqW6fVRkNTttloavcWG40Lid5G8xKltdGx+Onsm2tZ1dirc8FmugXJAHzQceTEkMEkQR34XG0mc232oL+j7ED0GSFvRDDK4bjhmbuoDAChLeKiBwDUGHoB4J0Ky8U/IRfaGSLe1+5vgkm/Bi0iIvVauoqICGQymROP0fsSVVt799qHpW5bUei0VWUuW1nksJu2pPbebHJRX0ztpcXIRtskm2yjbLDNstp2yErbJavsVqZvd7/OI3ub3u8GYz4fU2T6v0i0k+czmX8+/8y5LSFyp69v6hFP4E78e4jZhwjZhrjvQ1joHzaDDNBRxE1iAAAAAElFTkSuQmCC); }\n }\n \n @media (prefers-color-scheme: light) {\n .MsgBlock.GREEN { background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFoAAABaCAMAAAAPdrEwAAAAh1BMVEXw8PD////w8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PD7MuHIAAAALXRSTlMAAAECBAcICw4QEhUZIyYqMTtGTV5kdn2Ii5mfoKOqrbG0uL6/xcnM0NTX2t1l7cN4AAAB0UlEQVR4Ae3Y3Y4SQRCG4bdHweFHRBTBH1FRFLXv//qsA8kmvbMdXhh2Q0KfknpSCQc130c67s22+e9+v/+d84fxkSPH0m/+5P9vN7vRV0vPfx7or1NB23e99KAHuoXOOc6moQsBwNN1Q9g4Wdh1uq3MA7Qn0+2ylAt7WbWpyT+Wo8roKH6v2QhZ2ghZ2ghZ2ghZ2ghZ2ghZ2ghZ2ghZ2ghZ2ghZ2ghZ2ghZ2ghZ2gjZ2AUNOLmwgQdogEJ2dnF3UJdU3WjqO/u96aYtVd/7jqvIyu76G5se6GaY7tNNcy5d7se7eWVnDz87fMkuVuS8epF6f9NPObPY5re9y4N1/vya9Gr3se2bfvl9M0mkyZdv077p+a/3z4Meby5Br4NWiV51BaiUqfLro9I3WiR61RVcffwfXI7u5zZ20EOA82Uu8x3SlrSwXQuBSvSqK0AletUVoBK96gpIwlZy0MJWctDCVnLQwlZy0MJWctDCVnLQwlZy0MJWctDCVnLQwlZy0MJWctDCVnLQwlZy0MJWckIletUVIJJxITN6wtZd2EI+0NquyIJOnUpFVvRpcwmV6FVXgEr0qitAJXrVFaASveoKUIledQWoRK+6AlSiV13BP+/VVbky7Xq1AAAAAElFTkSuQmCC); }\n }\n \u003c/style\u003e\n \u003c/head\u003e\n \u003cbody\u003e\u003cdiv class\u003d\"MsgBlock GREEN\" style\u003d\"padding-left: 8px;min-height: 50px;padding-top: 4px;padding-bottom: 4px;width: 100%;border: 1px solid #f0f0f0;border-left: 8px solid #31A217;border-right: none;\"\u003eEncrypted text\u003c/div\u003e\u003c!-- next MsgBlock --\u003e\n\u003cdiv class\u003d\"MsgBlock PLAIN\" style\u003d\"padding-left: 8px;min-height: 50px;padding-top: 4px;padding-bottom: 4px;width: 100%;border: none;\"\u003eFooter with some text\u003c/div\u003e\u003c!-- next MsgBlock --\u003e\n\u003c/body\u003e\n \u003c/html\u003e",
"isOpenPGPMimeSigned": false,
"type": "plainHtml"
}
],
"msgEntity": {
"cc": [],
"account": "default@flowcrypt.test",
"accountType": "flowcrypt.test",
"cc": [],
"flags": "\\SEEN",
"folder": "INBOX",
"from": [
Expand All @@ -25,19 +39,20 @@
"id": 149,
"isDraft": false,
"isEncrypted": true,
"isGmailThread": false,
"isOutboxMsg": false,
"isPasswordProtected": false,
"isSeen": true,
"msgState": "NONE",
"receivedDate": 1671805307000,
"replyToAddresses": "Default User \u003cdefault@flowcrypt.test\u003e",
"replyToAddress": [
{
"address": "default@flowcrypt.test",
"encodedPersonal": "Default User",
"personal": "Default User"
}
],
"replyToAddresses": "Default User \u003cdefault@flowcrypt.test\u003e",
"sentDate": 1671805307000,
"subject": "multipart/alternative. PGP message in text/plain",
"to": [
Expand All @@ -58,16 +73,5 @@
"hasUnverifiedSignatures": false,
"isPartialSigned": true,
"keyIdOfSigningKeys": []
},
"localFolder": {
"account": "default@flowcrypt.test",
"attributes": [
"\\HasNoChildren"
],
"folderAlias": "INBOX",
"fullName": "INBOX",
"isCustom": false,
"msgCount": 25,
"labelListVisibility": "SHOW"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ class CreateMessageTestRecipientsDuringReplyAllFlowTest : BaseComposeScreenTest(
hasSignedParts = false,
hasMixedSignatures = false,
isPartialSigned = false,
keyIdOfSigningKeys = emptyList(),
keyIdOfSigningKeys = emptySet(),
hasBadSignatures = false
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ import com.flowcrypt.email.util.GeneralUtil
import com.flowcrypt.email.util.PrivateKeysManager
import com.flowcrypt.email.util.TestGeneralUtil
import kotlinx.coroutines.runBlocking
import org.apache.commons.io.FilenameUtils
import org.hamcrest.MatcherAssert
import org.hamcrest.Matchers.allOf
import org.hamcrest.Matchers.anything
Expand Down Expand Up @@ -1081,7 +1082,12 @@ class MessageDetailsFlowTest : BaseMessageDetailsFlowTest() {
accountEntity = addAccountToDatabaseRule.accountEntityWithDecryptedInfo
)

val attachmentName = "thumb_up.png"
val attachmentName = requireNotNull((msgInfo?.msgBlocks?.first {
it.type == MsgBlock.Type.DECRYPTED_ATT
} as DecryptedAttMsgBlock).attMeta.name)

val baseAttachmentName = FilenameUtils.getBaseName(attachmentName)

val downloadCompleteLabel = getResString(R.string.download_complete)
val uiAutomatorTimeout = 5000L

Expand All @@ -1097,19 +1103,22 @@ class MessageDetailsFlowTest : BaseMessageDetailsFlowTest() {
.check(matches(isDisplayed()))
.perform(click())


//Unfortunately, due to the Scoped Storage,
//we don't have direct access to the file system and we can't check that a new file was created.
//we don't have direct access to the file system and we can't check that a new file was created
//(Also we can't use the full original name because there can be
//an existing file with the same name).
//So we will use just a base name.
//That's why we will use UIAutomator to check that we have a notification
//with text == "Download complete"
val device = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation())
device.openNotification()
//wait until we have a notification in the notification bar
device.wait(Until.hasObject(By.text(attachmentName)), uiAutomatorTimeout)
device.wait(Until.hasObject(By.textContains(baseAttachmentName)), uiAutomatorTimeout)
//check that we have a notification with text == "Download complete"
val attachmentNameUiObject2 = device.findObject(By.text(attachmentName))
val attachmentNameUiObject2 = device.findObject(By.textContains(baseAttachmentName))
assertNotNull(attachmentNameUiObject2)
val downloadCompleteLabelUiObject2 = device.findObject(By.text(downloadCompleteLabel))
assertEquals(attachmentName, attachmentNameUiObject2.text)
assertNotNull(downloadCompleteLabelUiObject2)
assertEquals(downloadCompleteLabel, downloadCompleteLabelUiObject2.text)
device.pressHome()
}
Expand Down Expand Up @@ -1177,11 +1186,11 @@ class MessageDetailsFlowTest : BaseMessageDetailsFlowTest() {

val attachmentMessageBlock = msgInfo?.msgBlocks?.get(2) as DecryptedAttMsgBlock

assertEquals(4, msgInfo.msgBlocks?.size)
assertEquals(MsgBlock.Type.PLAIN_HTML, msgInfo.msgBlocks?.get(0)?.type)
assertEquals(MsgBlock.Type.ENCRYPTED_SUBJECT, msgInfo.msgBlocks?.get(1)?.type)
assertEquals(4, msgInfo.msgBlocks.size)
assertEquals(MsgBlock.Type.PLAIN_HTML, msgInfo.msgBlocks[0].type)
assertEquals(MsgBlock.Type.ENCRYPTED_SUBJECT, msgInfo.msgBlocks[1].type)
assertEquals(MsgBlock.Type.DECRYPTED_ATT, attachmentMessageBlock.type)
assertEquals(MsgBlock.Type.PUBLIC_KEY, msgInfo.msgBlocks?.get(3)?.type)
assertEquals(MsgBlock.Type.PUBLIC_KEY, msgInfo.msgBlocks[3].type)

baseCheck(msgInfo)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ class EncryptedForwardOfEncryptedMessageWithOriginalAttachmentsComposeGmailApiFl
hasSignedParts = false,
hasMixedSignatures = false,
isPartialSigned = false,
keyIdOfSigningKeys = emptyList(),
keyIdOfSigningKeys = emptySet(),
hasBadSignatures = false
)
).toInitializationData(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ class EncryptedForwardOfStandardMessageWithOriginalAttachmentsComposeGmailApiFlo
hasSignedParts = false,
hasMixedSignatures = false,
isPartialSigned = false,
keyIdOfSigningKeys = emptyList(),
keyIdOfSigningKeys = emptySet(),
hasBadSignatures = false
)
).toInitializationData(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ class EncryptedReplyAllComposeGmailApiFlow : BaseComposeGmailFlow() {
hasSignedParts = true,
hasMixedSignatures = false,
isPartialSigned = false,
keyIdOfSigningKeys = emptyList(),
keyIdOfSigningKeys = emptySet(),
hasBadSignatures = false
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ class EncryptedReplyComposeGmailApiFlow : BaseComposeGmailFlow() {
hasSignedParts = false,
hasMixedSignatures = false,
isPartialSigned = false,
keyIdOfSigningKeys = emptyList(),
keyIdOfSigningKeys = emptySet(),
hasBadSignatures = false
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ class StandardForwardOfEncryptedMessageWithOriginalAttachmentsComposeGmailApiFlo
hasSignedParts = false,
hasMixedSignatures = false,
isPartialSigned = false,
keyIdOfSigningKeys = emptyList(),
keyIdOfSigningKeys = emptySet(),
hasBadSignatures = false
)
).toInitializationData(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ class StandardForwardOfEncryptedPgpMimeMessageWithOriginalAttachmentsComposeGmai
hasSignedParts = false,
hasMixedSignatures = false,
isPartialSigned = false,
keyIdOfSigningKeys = emptyList(),
keyIdOfSigningKeys = emptySet(),
hasBadSignatures = false
)
).toInitializationData(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ class StandardForwardOfStandardMessageWithOriginalAttachmentsComposeGmailApiFlow
hasSignedParts = false,
hasMixedSignatures = false,
isPartialSigned = false,
keyIdOfSigningKeys = emptyList(),
keyIdOfSigningKeys = emptySet(),
hasBadSignatures = false
)
).toInitializationData(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ class StandardReplyAllComposeGmailApiFlow : BaseComposeGmailFlow() {
hasSignedParts = false,
hasMixedSignatures = false,
isPartialSigned = false,
keyIdOfSigningKeys = emptyList(),
keyIdOfSigningKeys = emptySet(),
hasBadSignatures = false
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ class StandardReplyComposeGmailApiFlow : BaseComposeGmailFlow() {
hasSignedParts = false,
hasMixedSignatures = false,
isPartialSigned = false,
keyIdOfSigningKeys = emptyList(),
keyIdOfSigningKeys = emptySet(),
hasBadSignatures = false
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ package com.flowcrypt.email
import android.app.Application
import android.content.Context
import android.util.Log
import androidx.core.content.edit
import androidx.lifecycle.DefaultLifecycleObserver
import androidx.lifecycle.LifecycleOwner
import androidx.lifecycle.ProcessLifecycleOwner
Expand Down Expand Up @@ -211,10 +212,9 @@ class FlowCryptApplication : Application(), Configuration.Provider {
val sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this)
if (sharedPreferences.all.isEmpty()) {
if (!sharedPreferences.contains(Constants.PREF_KEY_INSTALL_VERSION)) {
sharedPreferences
.edit()
.putString(Constants.PREF_KEY_INSTALL_VERSION, BuildConfig.VERSION_NAME)
.apply()
sharedPreferences.edit {
putString(Constants.PREF_KEY_INSTALL_VERSION, BuildConfig.VERSION_NAME)
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*
* © 2016-present FlowCrypt a.s. Limitations apply. Contact human@flowcrypt.com
* Contributors: DenBond7
* Contributors: denbond7
*/

package com.flowcrypt.email.api.oauth

import android.net.Uri
import androidx.core.net.toUri
import net.openid.appauth.AuthorizationRequest
import net.openid.appauth.AuthorizationServiceConfiguration
import net.openid.appauth.ResponseTypeValues
Expand All @@ -15,7 +15,7 @@ import java.util.concurrent.TimeUnit
* @author Denys Bondarenko
*/
class OAuth2Helper {
enum class Provider constructor(val openidConfigurationUrl: String) {
enum class Provider(val openidConfigurationUrl: String) {
MICROSOFT(OPENID_CONFIGURATION_URL_MICROSOFT)
}

Expand Down Expand Up @@ -53,7 +53,7 @@ class OAuth2Helper {
configuration,
MICROSOFT_AZURE_APP_ID,
ResponseTypeValues.CODE,
Uri.parse(redirectUri)
redirectUri.toUri()
)
.setResponseMode(AuthorizationRequest.ResponseMode.QUERY)
.setPrompt(AuthorizationRequest.Prompt.SELECT_ACCOUNT)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* © 2016-present FlowCrypt a.s. Limitations apply. Contact human@flowcrypt.com
* Contributors: denbond7
*/

package com.flowcrypt.email.api.retrofit.response.model

import com.google.gson.annotations.Expose
import kotlinx.parcelize.IgnoredOnParcel
import kotlinx.parcelize.Parcelize

/**
* @author Denys Bondarenko
*/
@Parcelize
data class AlternativeContentMsgBlock(
@Expose override val error: MsgBlockError? = null,
@Expose val plainBlocks: List<MsgBlock>,
@Expose val otherBlocks: List<MsgBlock>,
@Expose override val isOpenPGPMimeSigned: Boolean
) : MsgBlock {
@IgnoredOnParcel
@Expose
override val content: String? = null

@IgnoredOnParcel
@Expose
override val type: MsgBlock.Type = MsgBlock.Type.ALTERNATIVE

@IgnoredOnParcel
val allBlocks: List<MsgBlock>
get() = plainBlocks + otherBlocks
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* © 2016-present FlowCrypt a.s. Limitations apply. Contact human@flowcrypt.com
* Contributors: DenBond7
* Contributors: denbond7
*/

package com.flowcrypt.email.api.retrofit.response.model
Expand Down Expand Up @@ -83,7 +83,10 @@ interface MsgBlock : Parcelable {
ENCRYPTED_SUBJECT,

@SerializedName("securityWarning")
SECURITY_WARNING;
SECURITY_WARNING,

@SerializedName("alternative")
ALTERNATIVE;

fun isContentBlockType(): Boolean = CONTENT_BLOCK_TYPES.contains(this)

Expand All @@ -105,7 +108,8 @@ interface MsgBlock : Parcelable {
DECRYPTED_HTML,
SIGNED_CONTENT,
VERIFIED_MSG,
DECRYPTED_AND_OR_SIGNED_CONTENT
DECRYPTED_AND_OR_SIGNED_CONTENT,
ALTERNATIVE
)

val DECRYPTED_CONTENT_BLOCK_TYPES = setOf(
Expand Down
Loading