prepare_msg: return Err if no address is configured

Address is used to generate Message-Id.

Previously error toast was shown, but MsgId was returned from
chat::prepare_msg anyway. Now chat::prepare_msg returns an error.

error!() is removed, because FFI library shows errors via
.unwrap_or_log_default().
This commit is contained in:
Alexander Krotov
2020-10-04 04:34:32 +03:00
committed by link2xt
parent de97e0263f
commit a0c92753a9
2 changed files with 18 additions and 1 deletions

View File

@@ -1015,7 +1015,7 @@ impl Chat {
);
}
} else {
error!(context, "Cannot send message, not configured.",);
bail!("Cannot prepare message for sending, address is not configured.");
}
schedule_ephemeral_task(context).await;