mirror of
https://github.com/chatmail/core.git
synced 2026-04-21 23:46:31 +03:00
tweak error texts
This commit is contained in:
11
src/chat.rs
11
src/chat.rs
@@ -183,7 +183,7 @@ impl ChatId {
|
|||||||
context: &Context,
|
context: &Context,
|
||||||
protect: ProtectionStatus,
|
protect: ProtectionStatus,
|
||||||
) -> Result<(), Error> {
|
) -> Result<(), Error> {
|
||||||
ensure!(!self.is_special(), "set protection: invalid chat-id.");
|
ensure!(!self.is_special(), "Invalid chat-id.");
|
||||||
|
|
||||||
let chat = Chat::load_from_db(context, self).await?;
|
let chat = Chat::load_from_db(context, self).await?;
|
||||||
|
|
||||||
@@ -199,14 +199,11 @@ impl ChatId {
|
|||||||
for contact_id in contact_ids.into_iter() {
|
for contact_id in contact_ids.into_iter() {
|
||||||
let contact = Contact::get_by_id(context, contact_id).await?;
|
let contact = Contact::get_by_id(context, contact_id).await?;
|
||||||
if contact.is_verified(context).await != VerifiedStatus::BidirectVerified {
|
if contact.is_verified(context).await != VerifiedStatus::BidirectVerified {
|
||||||
bail!(
|
bail!("{} is not verified.", contact.get_display_name());
|
||||||
"{} is not verified; cannot enable protection.",
|
|
||||||
contact.get_display_name()
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Chattype::Undefined => bail!("set protection: undefined group type"),
|
Chattype::Undefined => bail!("Undefined group type"),
|
||||||
},
|
},
|
||||||
ProtectionStatus::Unprotected => {}
|
ProtectionStatus::Unprotected => {}
|
||||||
};
|
};
|
||||||
@@ -290,7 +287,7 @@ impl ChatId {
|
|||||||
let chat = Chat::load_from_db(context, self).await?;
|
let chat = Chat::load_from_db(context, self).await?;
|
||||||
|
|
||||||
if let Err(e) = self.inner_set_protection(context, protect).await {
|
if let Err(e) = self.inner_set_protection(context, protect).await {
|
||||||
error!(context, "{}", e); // make error user-visible
|
error!(context, "Cannot set protection: {}", e); // make error user-visible
|
||||||
return Err(e);
|
return Err(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user