mirror of
https://github.com/chatmail/core.git
synced 2026-04-21 15:36:30 +03:00
Resultify Contact::lookup_id_by_addr
Using a Contact ID as an error type is risky and a C leftover.
This commit is contained in:
@@ -1730,8 +1730,9 @@ async fn ndn_maybe_add_info_msg(
|
||||
) -> anyhow::Result<()> {
|
||||
if chat_type == Chattype::Group {
|
||||
if let Some(failed_recipient) = &failed.failed_recipient {
|
||||
let contact_id =
|
||||
Contact::lookup_id_by_addr(context, failed_recipient, Origin::Unknown).await;
|
||||
let contact_id = Contact::lookup_id_by_addr(context, failed_recipient, Origin::Unknown)
|
||||
.await?
|
||||
.ok_or_else(|| Error::msg("ndn_maybe_add_info_msg: Contact ID not found"))?;
|
||||
let contact = Contact::load_from_db(context, contact_id).await?;
|
||||
// Tell the user which of the recipients failed if we know that (because in a group, this might otherwise be unclear)
|
||||
let text = context
|
||||
|
||||
Reference in New Issue
Block a user