mirror of
https://github.com/zulip/zulip.git
synced 2025-10-23 04:52:12 +00:00
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:
committed by
Tim Abbott
parent
e2d1c233ba
commit
daadf110d9
@@ -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,
|
||||
};
|
||||
|
@@ -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>
|
||||
|
Reference in New Issue
Block a user