Skip to content

Commit

Permalink
show sender name in 'Saved Messages' summary
Browse files Browse the repository at this point in the history
since #5606, 'Saved Messages' contain the sender name;
therefore, show the name in summaries as for groups
  • Loading branch information
r10s committed Mar 1, 2025
1 parent 2ee83bf commit 5cc0b45
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions src/summary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,23 +97,26 @@ 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)
}
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)
}
Chattype::Single => None,
} else {
None
}
};

Expand Down

0 comments on commit 5cc0b45

Please sign in to comment.