feat: show sender name in 'Saved Messages' summary (#6607)

since <https://github.com/deltachat/deltachat-core-rust/pull/5606>, 'Saved Messages' contain the sender name; therefore, show
the name in summaries as for groups
This commit is contained in:
bjoern
2025-03-02 19:59:00 +01:00
committed by GitHub
parent a50b43598f
commit ba0a7f1f0b
2 changed files with 51 additions and 22 deletions

View File

@@ -97,24 +97,25 @@ impl Summary {
let prefix = if msg.state == MessageState::OutDraft {
Some(SummaryPrefix::Draft(stock_str::draft(context).await))
} else if msg.from_id == ContactId::SELF {
if msg.is_info() || chat.is_self_talk() {
if msg.is_info() {
None
} else {
Some(SummaryPrefix::Me(stock_str::self_msg(context).await))
}
} else {
match chat.typ {
Chattype::Group | Chattype::Broadcast | Chattype::Mailinglist => {
if msg.is_info() || contact.is_none() {
None
} else {
msg.get_override_sender_name()
.or_else(|| contact.map(|contact| msg.get_sender_name(contact)))
.map(SummaryPrefix::Username)
}
}
Chattype::Single => None,
} else if chat.typ == Chattype::Group
|| chat.typ == Chattype::Broadcast
|| chat.typ == Chattype::Mailinglist
|| chat.is_self_talk()
{
if msg.is_info() || contact.is_none() {
None
} else {
msg.get_override_sender_name()
.or_else(|| contact.map(|contact| msg.get_sender_name(contact)))
.map(SummaryPrefix::Username)
}
} else {
None
};
let mut text = msg.get_summary_text(context).await;