mirror of
https://github.com/zulip/zulip.git
synced 2025-10-30 11:33:51 +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_stream: false;
|
||||||
|
is_dm_with_self: boolean;
|
||||||
formatted_send_at_time: string;
|
formatted_send_at_time: string;
|
||||||
recipients: string;
|
recipients: string;
|
||||||
}
|
}
|
||||||
@@ -120,6 +121,7 @@ function format(scheduled_messages: ScheduledMessage[]): ScheduledMessageRenderC
|
|||||||
scheduled_msg_render_context = {
|
scheduled_msg_render_context = {
|
||||||
...scheduled_msg,
|
...scheduled_msg,
|
||||||
is_stream: false as const,
|
is_stream: false as const,
|
||||||
|
is_dm_with_self: people.is_direct_message_conversation_with_self(scheduled_msg.to),
|
||||||
recipients,
|
recipients,
|
||||||
formatted_send_at_time,
|
formatted_send_at_time,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -25,7 +25,11 @@
|
|||||||
<div class="message-header-contents">
|
<div class="message-header-contents">
|
||||||
<div class="message_label_clickable stream_label">
|
<div class="message_label_clickable stream_label">
|
||||||
<span class="private_message_header_icon"><i class="zulip-icon zulip-icon-user"></i></span>
|
<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>
|
<span class="private_message_header_name">{{t "You and {recipients}" }}</span>
|
||||||
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
{{> scheduled_message_stream_pm_common .}}
|
{{> scheduled_message_stream_pm_common .}}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user