feat: use dedicated 'call' viewtype (#7174)

a dedicated viewtype allows the UI to show a more advanced UI, but even
when using the defaults,
it has the advantage that incoming/outgoing and the date are directly
visible.

successor of https://github.com/chatmail/core/pull/6650
This commit is contained in:
bjoern
2025-09-04 16:51:51 +02:00
committed by GitHub
parent d4704977bc
commit bed1623dcb
10 changed files with 110 additions and 105 deletions

View File

@@ -97,7 +97,7 @@ 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() {
if msg.is_info() || msg.viewtype == Viewtype::Call {
None
} else {
Some(SummaryPrefix::Me(stock_str::self_msg(context).await))
@@ -233,6 +233,16 @@ impl Message {
type_file = self.param.get(Param::Summary1).map(|s| s.to_string());
append_text = true;
}
Viewtype::Call => {
emoji = Some("📞");
type_name = Some(if self.from_id == ContactId::SELF {
"Outgoing call".to_string()
} else {
"Incoming call".to_string()
});
type_file = None;
append_text = false
}
Viewtype::Text | Viewtype::Unknown => {
emoji = None;
if self.param.get_cmd() == SystemMessage::LocationOnly {