From fe23907eb3a5e27583f5b406aae204850a3f3023 Mon Sep 17 00:00:00 2001 From: Simon Laux Date: Mon, 11 May 2020 06:29:33 +0200 Subject: [PATCH] fix muting dm chats and rewrite the erroro message so that it makes more sense --- src/chat.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/chat.rs b/src/chat.rs index 45490e1ea..b765766ce 100644 --- a/src/chat.rs +++ b/src/chat.rs @@ -2072,8 +2072,7 @@ impl rusqlite::types::FromSql for MuteDuration { pub fn set_muted(context: &Context, chat_id: ChatId, duration: MuteDuration) -> Result<(), Error> { ensure!(!chat_id.is_special(), "Invalid chat ID"); - if real_group_exists(context, chat_id) - && sql::execute( + if sql::execute( context, &context.sql, "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)); } else { - bail!("Failed to set name"); + bail!("Failed to set mute duration, chat might not exist -"); } Ok(()) }