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
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,23 @@ struct ProcessedMessage {
}

enum MessageSignature: Hashable {
case good, unsigned, error(String), missingPubkey(String), bad, pending
case good, goodMixed, unsigned, error(String), missingPubkey(String), partial, bad, pending

var message: String {
switch self {
case .good:
return "message_signed".localized
case .goodMixed:
return "message_signature_good_mixed".localized
case .unsigned:
return "message_not_signed".localized
case .error(let message):
return "message_signature_verify_error".localizeWithArguments(message)
case .missingPubkey(let longid):
let message = "message_missing_pubkey".localizeWithArguments(longid)
return "message_signature_verify_error".localizeWithArguments(message)
case .partial:
return "message_signature_partial".localized
case .bad:
return "message_bad_signature".localized
case .pending:
Expand All @@ -44,9 +48,9 @@ struct ProcessedMessage {

var icon: String {
switch self {
case .good:
case .good, .goodMixed:
return "lock"
case .error, .missingPubkey:
case .error, .missingPubkey, .partial:
return "exclamationmark.triangle"
case .unsigned, .bad:
return "xmark"
Expand All @@ -57,9 +61,9 @@ struct ProcessedMessage {

var color: UIColor {
switch self {
case .good:
case .good, .goodMixed:
return .main
case .error, .missingPubkey:
case .error, .missingPubkey, .partial:
return .warningColor
Comment on lines 62 to 67
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.error should use .errorColor, not .warningColor

case .unsigned, .bad:
return .errorColor
Expand Down Expand Up @@ -280,6 +284,10 @@ extension MessageService {

guard signature.match == true else { return .bad }

guard signature.partial != true else { return .partial }

guard signature.mixed != true else { return .goodMixed }

return .good
}
}
Expand Down
2 changes: 2 additions & 0 deletions FlowCrypt/Resources/en.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,10 @@
"message_encrypted" = "encrypted";
"message_not_encrypted" = "not encrypted";
"message_signed" = "signed";
"message_signature_good_mixed" = "signed with mixed keys";
"message_not_signed" = "not signed";
"message_missing_pubkey" = "no public key %@";
"message_signature_partial" = "only partially signed";
"message_signature_verify_error" = "cannot verify signature: %@";
"message_bad_signature" = "bad signature";
"message_signature_pending" = "verifying signature...";
Expand Down
10 changes: 10 additions & 0 deletions appium/tests/specs/inbox/CheckAllEmailSignatureCases.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,15 @@ describe('INBOX: ', () => {
await EmailScreen.checkEncryptionBadge('not encrypted');
await EmailScreen.checkSignatureBadge('bad signature');
await EmailScreen.clickBackButton();

await SearchScreen.clickBackButton();

// partially signed only message
await MailFolderScreen.clickSearchButton();
await SearchScreen.searchAndClickEmailBySubject('Partially signed only message');

await EmailScreen.checkEncryptionBadge('not encrypted');
await EmailScreen.checkSignatureBadge('only partially signed');
await EmailScreen.clickBackButton();
});
});