mirror of
https://github.com/zulip/zulip.git
synced 2025-11-01 20:44:04 +00:00
narrow_banner: Fix message view banner for dm with deactivated user.
Previously the empty view banner for DM with any recipients contained "Why not start the conversation". For deactivated users/bots, we are now not displaying it.
This commit is contained in:
@@ -346,12 +346,23 @@ export function pick_empty_narrow_banner(): NarrowBannerData {
|
||||
}),
|
||||
};
|
||||
}
|
||||
// If the recipient is deactivated, we cannot start the conversation.
|
||||
if (!people.is_person_active(recipient_user.user_id)) {
|
||||
return {
|
||||
title: $t(
|
||||
{
|
||||
defaultMessage: "You have no direct messages with {person}.",
|
||||
},
|
||||
{person: recipient_user.full_name},
|
||||
),
|
||||
};
|
||||
}
|
||||
return {
|
||||
title: $t(
|
||||
{
|
||||
defaultMessage: "You have no direct messages with {person} yet.",
|
||||
},
|
||||
{person: people.get_by_user_id(user_ids[0]).full_name},
|
||||
{person: recipient_user.full_name},
|
||||
),
|
||||
html: $t_html(
|
||||
{
|
||||
@@ -366,6 +377,11 @@ export function pick_empty_narrow_banner(): NarrowBannerData {
|
||||
),
|
||||
};
|
||||
}
|
||||
if (people.get_non_active_user_ids_count(user_ids) !== 0) {
|
||||
return {
|
||||
title: $t({defaultMessage: "You have no direct messages with these users."}),
|
||||
};
|
||||
}
|
||||
return {
|
||||
title: $t({defaultMessage: "You have no direct messages with these users yet."}),
|
||||
html: $t_html(
|
||||
|
||||
Reference in New Issue
Block a user