mirror of
https://github.com/chatmail/core.git
synced 2026-05-05 06:16:30 +03:00
Resultify get_chat_id_by_grpid and create_or_lookup_mailinglist
Use `Option` instead of `Error` to indicate that no chat ID is found.
This commit is contained in:
@@ -2808,10 +2808,10 @@ pub(crate) async fn get_chat_cnt(context: &Context) -> Result<usize> {
|
||||
pub(crate) async fn get_chat_id_by_grpid(
|
||||
context: &Context,
|
||||
grpid: impl AsRef<str>,
|
||||
) -> Result<(ChatId, bool, Blocked)> {
|
||||
) -> Result<Option<(ChatId, bool, Blocked)>> {
|
||||
context
|
||||
.sql
|
||||
.query_row(
|
||||
.query_row_optional(
|
||||
"SELECT id, blocked, protected FROM chats WHERE grpid=?;",
|
||||
paramsv![grpid.as_ref()],
|
||||
|row| {
|
||||
|
||||
Reference in New Issue
Block a user