mirror of
https://github.com/chatmail/core.git
synced 2026-05-24 01:06:31 +03:00
fix muting dm chats
and rewrite the erroro message so that it makes more sense
This commit is contained in:
committed by
holger krekel
parent
e2bf8a8a11
commit
fe23907eb3
@@ -2072,8 +2072,7 @@ impl rusqlite::types::FromSql for MuteDuration {
|
|||||||
|
|
||||||
pub fn set_muted(context: &Context, chat_id: ChatId, duration: MuteDuration) -> Result<(), Error> {
|
pub fn set_muted(context: &Context, chat_id: ChatId, duration: MuteDuration) -> Result<(), Error> {
|
||||||
ensure!(!chat_id.is_special(), "Invalid chat ID");
|
ensure!(!chat_id.is_special(), "Invalid chat ID");
|
||||||
if real_group_exists(context, chat_id)
|
if sql::execute(
|
||||||
&& sql::execute(
|
|
||||||
context,
|
context,
|
||||||
&context.sql,
|
&context.sql,
|
||||||
"UPDATE chats SET muted_until=? WHERE id=?;",
|
"UPDATE chats SET muted_until=? WHERE id=?;",
|
||||||
@@ -2083,7 +2082,7 @@ pub fn set_muted(context: &Context, chat_id: ChatId, duration: MuteDuration) ->
|
|||||||
{
|
{
|
||||||
context.call_cb(Event::ChatModified(chat_id));
|
context.call_cb(Event::ChatModified(chat_id));
|
||||||
} else {
|
} else {
|
||||||
bail!("Failed to set name");
|
bail!("Failed to set mute duration, chat might not exist -");
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user