mirror of
https://github.com/chatmail/core.git
synced 2026-05-03 21:36:29 +03:00
feat: do not set "unknown sender for this chat" error
This commit is contained in:
@@ -7214,6 +7214,8 @@ void dc_event_unref(dc_event_t* event);
|
||||
/// "Unknown sender for this chat. See 'info' for more details."
|
||||
///
|
||||
/// Use as message text if assigning the message to a chat is not totally correct.
|
||||
///
|
||||
/// @deprecated 2025-08-18
|
||||
#define DC_STR_UNKNOWN_SENDER_FOR_CHAT 72
|
||||
|
||||
/// "Message from %1$s"
|
||||
|
||||
@@ -1693,12 +1693,6 @@ async fn add_parts(
|
||||
let name: &str = from.display_name.as_ref().unwrap_or(&from.addr);
|
||||
for part in &mut mime_parser.parts {
|
||||
part.param.set(Param::OverrideSenderDisplayname, name);
|
||||
|
||||
if chat.is_protected() {
|
||||
// In protected chat, also mark the message with an error.
|
||||
let s = stock_str::unknown_sender_for_chat(context).await;
|
||||
part.error = Some(s);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -634,7 +634,7 @@ async fn test_unknown_sender() -> Result<()> {
|
||||
// The message from Bob is delivered late, Bob is already removed.
|
||||
let msg = alice.recv_msg(&sent).await;
|
||||
assert_eq!(msg.text, "Hi hi!");
|
||||
assert_eq!(msg.error.unwrap(), "Unknown sender for this chat.");
|
||||
assert_eq!(msg.get_override_sender_name().unwrap(), "bob@example.net");
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -123,9 +123,6 @@ pub enum StockMessage {
|
||||
however, of course, if they like, you may point them to 👉 https://get.delta.chat"))]
|
||||
WelcomeMessage = 71,
|
||||
|
||||
#[strum(props(fallback = "Unknown sender for this chat."))]
|
||||
UnknownSenderForChat = 72,
|
||||
|
||||
#[strum(props(fallback = "Message from %1$s"))]
|
||||
SubjectForNewContact = 73,
|
||||
|
||||
@@ -909,11 +906,6 @@ pub(crate) async fn welcome_message(context: &Context) -> String {
|
||||
translated(context, StockMessage::WelcomeMessage).await
|
||||
}
|
||||
|
||||
/// Stock string: `Unknown sender for this chat.`.
|
||||
pub(crate) async fn unknown_sender_for_chat(context: &Context) -> String {
|
||||
translated(context, StockMessage::UnknownSenderForChat).await
|
||||
}
|
||||
|
||||
/// Stock string: `Message from %1$s`.
|
||||
// TODO: This can compute `self_name` itself instead of asking the caller to do this.
|
||||
pub(crate) async fn subject_for_new_contact(context: &Context, self_name: &str) -> String {
|
||||
|
||||
Reference in New Issue
Block a user