Skip to content

Commit e90e386

Browse files
committed
fix: Report multiple mails for phishing
1 parent 6dd3c22 commit e90e386

File tree

7 files changed

+21
-5
lines changed

7 files changed

+21
-5
lines changed

Mail/Views/Alerts/ReportPhishingView.swift

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,16 @@ struct ReportPhishingView: View {
4949

5050
private func report() async {
5151
await tryOrDisplayError {
52-
var lastResponse = false
53-
messagesWithDuplicates.concurrentForEach { message in
54-
lastResponse = try await mailboxManager.apiFetcher.reportPhishing(message: message)
52+
let latestResponses = try await messagesWithDuplicates.concurrentMap { message in
53+
try await mailboxManager.apiFetcher.reportPhishing(message: message)
5554
}
5655

57-
if lastResponse {
56+
if latestResponses.allSatisfy({ $0 == true }) {
5857
let messagesFreeze = messagesWithDuplicates.map { $0.freezeIfNeeded() }
5958
_ = try await mailboxManager.move(messages: messagesFreeze, to: .spam)
6059
snackbarPresenter.show(message: MailResourcesStrings.Localizable.snackbarReportPhishingConfirmation)
60+
} else {
61+
snackbarPresenter.show(message: MailResourcesStrings.Localizable.snackbarReportPhishingError)
6162
}
6263
}
6364

MailCore/Cache/Actions/Action+List.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ extension Action: CaseIterable {
7979
}
8080

8181
public var shouldDisableMultipleSelection: Bool {
82-
return ![.openMovePanel, .saveThreadInkDrive, .shareMailLink, .reportJunk].contains(self)
82+
return ![.openMovePanel, .saveThreadInkDrive, .shareMailLink, .reportJunk, .phishing, .block, .blockList].contains(self)
8383
}
8484

8585
private static func actionsForMessage(_ message: Message, origin: ActionOrigin,

MailResources/Localizable/de.lproj/Localizable.strings

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1618,6 +1618,9 @@
16181618
/* loco:62ab4ae387f65e26e577dd42 */
16191619
"snackbarReportPhishingConfirmation" = "Erfolgreich gemeldet";
16201620

1621+
/* loco:67e265b380b26e5cb8004cb2 */
1622+
"snackbarReportPhishingError" = "Beim Melden ist ein Fehler aufgetreten. Bitte versuchen Sie es erneut.";
1623+
16211624
/* loco:62c2f9feea59c120ad52bc23 */
16221625
"snackbarRestorationLaunched" = "Starten der Wiederherstellung";
16231626

MailResources/Localizable/en.lproj/Localizable.strings

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1618,6 +1618,9 @@
16181618
/* loco:62ab4ae387f65e26e577dd42 */
16191619
"snackbarReportPhishingConfirmation" = "Successfully reported";
16201620

1621+
/* loco:67e265b380b26e5cb8004cb2 */
1622+
"snackbarReportPhishingError" = "An error occurred while reporting, please try again.";
1623+
16211624
/* loco:62c2f9feea59c120ad52bc23 */
16221625
"snackbarRestorationLaunched" = "Launching the restoration";
16231626

MailResources/Localizable/es.lproj/Localizable.strings

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1618,6 +1618,9 @@
16181618
/* loco:62ab4ae387f65e26e577dd42 */
16191619
"snackbarReportPhishingConfirmation" = "Informado con éxito";
16201620

1621+
/* loco:67e265b380b26e5cb8004cb2 */
1622+
"snackbarReportPhishingError" = "Se produjo un error al reportar, por favor inténtalo nuevamente.";
1623+
16211624
/* loco:62c2f9feea59c120ad52bc23 */
16221625
"snackbarRestorationLaunched" = "Iniciar la restauración";
16231626

MailResources/Localizable/fr.lproj/Localizable.strings

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1618,6 +1618,9 @@
16181618
/* loco:62ab4ae387f65e26e577dd42 */
16191619
"snackbarReportPhishingConfirmation" = "Signalement effectué avec succès";
16201620

1621+
/* loco:67e265b380b26e5cb8004cb2 */
1622+
"snackbarReportPhishingError" = "Une erreur s’est produite lors du signalement, veuillez réessayer.";
1623+
16211624
/* loco:62c2f9feea59c120ad52bc23 */
16221625
"snackbarRestorationLaunched" = "Lancement de la restauration";
16231626

MailResources/Localizable/it.lproj/Localizable.strings

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1618,6 +1618,9 @@
16181618
/* loco:62ab4ae387f65e26e577dd42 */
16191619
"snackbarReportPhishingConfirmation" = "Segnalato con successo";
16201620

1621+
/* loco:67e265b380b26e5cb8004cb2 */
1622+
"snackbarReportPhishingError" = "Si è verificato un errore durante la segnalazione. Riprova.";
1623+
16211624
/* loco:62c2f9feea59c120ad52bc23 */
16221625
"snackbarRestorationLaunched" = "Avvio del restauro";
16231626

0 commit comments

Comments
 (0)