mirror of
https://github.com/chatmail/core.git
synced 2026-05-20 15:26:30 +03:00
remove success variable
(replace with else statement)
This commit is contained in:
@@ -1944,7 +1944,6 @@ impl 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> {
|
||||||
let mut success = false;
|
|
||||||
ensure!(!chat_id.is_special(), "Invalid chat ID");
|
ensure!(!chat_id.is_special(), "Invalid chat ID");
|
||||||
if real_group_exists(context, chat_id)
|
if real_group_exists(context, chat_id)
|
||||||
&& sql::execute(
|
&& sql::execute(
|
||||||
@@ -1956,10 +1955,7 @@ pub fn set_muted(context: &Context, chat_id: ChatId, duration: MuteDuration) ->
|
|||||||
.is_ok()
|
.is_ok()
|
||||||
{
|
{
|
||||||
context.call_cb(Event::ChatModified(chat_id));
|
context.call_cb(Event::ChatModified(chat_id));
|
||||||
success = true;
|
} else {
|
||||||
}
|
|
||||||
|
|
||||||
if !success {
|
|
||||||
bail!("Failed to set name");
|
bail!("Failed to set name");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user