mirror of
https://github.com/chatmail/core.git
synced 2026-05-05 06:16:30 +03:00
feat: Tweak initial info-message for unencrypted chats (#7427)
Fix https://github.com/chatmail/core/issues/7404
This commit is contained in:
@@ -3463,7 +3463,13 @@ pub(crate) async fn create_group_ex(
|
||||
if !context.get_config_bool(Config::Bot).await?
|
||||
&& !context.get_config_bool(Config::SkipStartMessages).await?
|
||||
{
|
||||
let text = stock_str::new_group_send_first_message(context).await;
|
||||
let text = if !grpid.is_empty() {
|
||||
// Add "Others will only see this group after you sent a first message." message.
|
||||
stock_str::new_group_send_first_message(context).await
|
||||
} else {
|
||||
// Add "Messages in this chat use classic email and are not encrypted." message.
|
||||
stock_str::chat_unencrypted_explanation(context).await
|
||||
};
|
||||
add_info_msg(context, chat_id, &text, create_smeared_timestamp(context)).await?;
|
||||
}
|
||||
if let (true, true) = (sync.into(), !grpid.is_empty()) {
|
||||
|
||||
@@ -447,6 +447,9 @@ https://delta.chat/donate"))]
|
||||
fallback = "You are using a proxy. If you're having trouble connecting, try a different proxy."
|
||||
))]
|
||||
ProxyEnabledDescription = 221,
|
||||
|
||||
#[strum(props(fallback = "Messages in this chat use classic email and are not encrypted."))]
|
||||
ChatUnencryptedExplanation = 230,
|
||||
}
|
||||
|
||||
impl StockMessage {
|
||||
@@ -1335,6 +1338,11 @@ pub(crate) async fn proxy_description(context: &Context) -> String {
|
||||
translated(context, StockMessage::ProxyEnabledDescription).await
|
||||
}
|
||||
|
||||
/// Stock string: `Messages in this chat use classic email and are not encrypted.`.
|
||||
pub(crate) async fn chat_unencrypted_explanation(context: &Context) -> String {
|
||||
translated(context, StockMessage::ChatUnencryptedExplanation).await
|
||||
}
|
||||
|
||||
impl Context {
|
||||
/// Set the stock string for the [StockMessage].
|
||||
///
|
||||
|
||||
Reference in New Issue
Block a user