Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

message-list-view: Use specific header for DM conversation with self.

Harshbc9e6e13bbc8
diff --git a/web/src/message_list_view.ts b/web/src/message_list_view.ts
index e356396c333..d915739f579 100644
--- a/web/src/message_list_view.ts
+++ b/web/src/message_list_view.ts
@@ -123,6 +123,7 @@ export type MessageGroup = {
pm_with_url: string;
recipient_users: RecipientRowUser[];
always_display_date: boolean;
+ is_dm_with_self: boolean;
}
);
@@ -458,6 +459,7 @@ function populate_group_from_message(
display_recipient,
pm_with_url: message.pm_with_url,
recipient_users: get_users_for_recipient_row(message),
+ is_dm_with_self: people.is_direct_message_conversation_with_self(user_ids),
display_reply_to_for_tooltip: message_store.get_pm_full_names(user_ids),
always_display_date,
};
diff --git a/web/templates/recipient_row.hbs b/web/templates/recipient_row.hbs
index a6eaa718dd7..c7e55f0afc9 100644
--- a/web/templates/recipient_row.hbs
+++ b/web/templates/recipient_row.hbs
@@ -88,17 +88,21 @@
<div class="message-header-contents">
<a class="message_label_clickable narrows_by_recipient stream_label tippy-narrow-tooltip"
href="{{pm_with_url}}"
- data-tippy-content="{{t 'Go to direct messages with {display_reply_to_for_tooltip}' }}">
+ data-tippy-content="{{#if is_dm_with_self}}{{t 'Go to direct messages with yourself' }}{{else}}{{t 'Go to direct messages with {display_reply_to_for_tooltip}' }}{{/if}}">
<span class="private_message_header_icon"><i class="zulip-icon zulip-icon-user"></i></span>
<span class="private_message_header_name">
- {{~#tr}}You and <z-user-names></z-user-names>
- {{#*inline "z-user-names"}}
- {{#each recipient_users}}
- {{~full_name}}{{#if is_bot}}<i class="zulip-icon zulip-icon-bot" aria-label="{{t 'Bot' }}"></i>{{/if}}
- {{~#if should_add_guest_user_indicator}}&nbsp;<i>({{t 'guest'}})</i>{{/if}}{{#unless @last}}, {{/unless~}}
- {{/each}}
- {{/inline}}
- {{/tr~}}
+ {{#if is_dm_with_self}}
+ {{t 'Messages with yourself' }}
+ {{else}}
+ {{~#tr}}You and <z-user-names></z-user-names>
+ {{#*inline "z-user-names"}}
+ {{#each recipient_users}}
+ {{~full_name}}{{#if is_bot}}<i class="zulip-icon zulip-icon-bot" aria-label="{{t 'Bot' }}"></i>{{/if~}}
+ {{#if should_add_guest_user_indicator}}&nbsp;<i>({{t 'guest'}})</i>{{/if}}{{#unless @last}}, {{/unless}}
+ {{/each}}
+ {{/inline}}
+ {{/tr~}}
+ {{/if}}
</span>
</a>
<span class="recipient_row_date {{#if (and (not always_display_date) date_unchanged )}}recipient_row_date_unchanged{{/if}}">{{{date}}}</span>