Skip to content

Commit 5450dfc

Browse files
LnamwMatthieu-dgl
authored andcommitted
feat: Display also the groupContact when tapping recipient
1 parent 460edfc commit 5450dfc

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

Mail/Views/New Message/AutocompletionView.swift

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,17 @@ struct AutocompletionView: View {
7979
)
8080
var autocompleteRecipients = autocompleteContacts.map { Recipient(email: $0.email, name: $0.name) }
8181

82-
let realResults = autocompleteRecipients.filter { !addedRecipients.map(\.email).contains($0.email) }
82+
let autocompleteGroupContact = mailboxManager.contactManager.frozenGroupContacts(matching: trimmedSearch, fetchLimit: nil)
83+
84+
// TODO: Find group or organisation name
85+
var autocompleteGroupRecipients = autocompleteGroupContact.map { Recipient(
86+
email: "Afficher nom groupe ou organisation ?",
87+
name: "Groupe/carnet ? \($0.name)"
88+
) }
89+
90+
var result = autocompleteRecipients + autocompleteGroupRecipients
91+
92+
let realResults = autocompleteRecipients.filter { !addedRecipients.map(\.email).contains($0.email) }
8393

8494
shouldAddUserProposal = !(realResults.count == 1 && realResults.first?.email == textDebounce.text)
8595
if shouldAddUserProposal {

0 commit comments

Comments
 (0)