scheduled_messages: Add support for self-DM identification.

Similar to drafts, identify when a scheduled message will be sent to
the logged-in user. This allows the UI to show 'You' as the header for
self-scheduled messages, improving the user experience.
This commit is contained in:
Mohammad Reza Kianifar
2025-08-17 04:17:26 +00:00
committed by Tim Abbott
parent e2d1c233ba
commit daadf110d9
2 changed files with 6 additions and 0 deletions

View File

@@ -31,6 +31,7 @@ type ScheduledMessageRenderContext = ScheduledMessage &
}
| {
is_stream: false;
is_dm_with_self: boolean;
formatted_send_at_time: string;
recipients: string;
}
@@ -120,6 +121,7 @@ function format(scheduled_messages: ScheduledMessage[]): ScheduledMessageRenderC
scheduled_msg_render_context = {
...scheduled_msg,
is_stream: false as const,
is_dm_with_self: people.is_direct_message_conversation_with_self(scheduled_msg.to),
recipients,
formatted_send_at_time,
};

View File

@@ -25,7 +25,11 @@
<div class="message-header-contents">
<div class="message_label_clickable stream_label">
<span class="private_message_header_icon"><i class="zulip-icon zulip-icon-user"></i></span>
{{#if is_dm_with_self}}
<span class="private_message_header_name">{{t "You" }}</span>
{{else}}
<span class="private_message_header_name">{{t "You and {recipients}" }}</span>
{{/if}}
</div>
{{> scheduled_message_stream_pm_common .}}
</div>