-
Notifications
You must be signed in to change notification settings - Fork 11
Closed
Labels
Milestone
Description
It's similarly weird to use map if we are talking about a single Future executing one time with a single failure or success. Map implies working with array of potentially many items, which seems a mismatch for what we're doing (even if this is otherwise common in iOS development).
I'll merge this but file a separate issue.
Originally posted by @tomholub in #410 (comment)
return getPubKeys(for: recipients)
.mapError { ComposeMessageError.validationError($0) }
.map { allRecipientPubs in
let replyToMimeMsg = input.replyToMime
.flatMap { String(data: $0, encoding: .utf8) }
return SendableMsg(
text: text,
to: recipients.map(\.email),
cc: [],
bcc: [],
from: email,
subject: subject,
replyToMimeMsg: replyToMimeMsg,
atts: atts,
pubKeys: allRecipientPubs + [myPubKey]
)
}
}
Reactions are currently unavailable