users: Add "(guest)" to names for guest users.

This commit adds code to add "(guest)" to user names of guest
users in the following places -
- right sidebar
- user pills, including the pills in search suggestion typehaead
- typeaheads for user
- sender names in message feed
- user profile popover and modals.
- user name in not subscribed warning banner.

Note that the indicator is shown only if enable_guest_user_indicator
setting is set to true.

As a result of this change, we now translate "deactivated" text
shown in user pills for deactivated users.

Fixes part of #26700.
This commit is contained in:
Sahil Batra
2023-09-13 23:00:52 +05:30
committed by Tim Abbott
parent c51c1d5135
commit 49a047c27f
29 changed files with 100 additions and 9 deletions

View File

@@ -418,6 +418,8 @@ export class MessageListView {
message_container.sender_is_bot = people.sender_is_bot(message_container.msg);
message_container.sender_is_guest = people.sender_is_guest(message_container.msg);
message_container.should_add_guest_indicator_for_sender =
people.should_add_guest_user_indicator(message_container.msg.sender_id);
message_container.small_avatar_url = people.small_avatar_url(message_container.msg);
if (message_container.msg.stream_id) {