Resultify Contact::block

This commit is contained in:
link2xt
2021-06-13 01:33:54 +03:00
parent b16785bb62
commit ad7c7e90b3
5 changed files with 62 additions and 50 deletions

View File

@@ -1196,7 +1196,11 @@ pub async fn decide_on_contact_request(
Err(e) => warn!(context, "decide_on_contact_request error: {}", e),
},
(Block, false) => Contact::block(context, msg.from_id).await,
(Block, false) => {
if let Err(e) = Contact::block(context, msg.from_id).await {
warn!(context, "Can't block contact: {}", e);
}
}
(Block, true) => {
if !msg.chat_id.set_blocked(context, Blocked::Manually).await {
warn!(context, "Block mailing list failed.")