people: Remove is_current_user legacy helper.

This does lookups by email address, which is very much a legacy way to
do things, and could throw exceptions if trying to lookup details on
an unknown user ID.
This commit is contained in:
Tim Abbott
2025-03-05 14:51:50 -08:00
parent 6915ed51d5
commit be0bc77300
8 changed files with 26 additions and 28 deletions

View File

@@ -352,7 +352,7 @@ export function pick_empty_narrow_banner(current_filter: Filter): NarrowBannerDa
if (!first_operand.includes(",")) {
const recipient_user = people.get_by_user_id(user_ids[0]);
// You have no direct messages with this person
if (people.is_current_user(recipient_user.email)) {
if (people.is_my_user_id(recipient_user.user_id)) {
return {
title: $t({
defaultMessage:
@@ -456,7 +456,7 @@ export function pick_empty_narrow_banner(current_filter: Filter): NarrowBannerDa
),
};
}
if (people.is_current_user(first_operand)) {
if (people.is_my_user_id(person_in_dms.user_id)) {
return {
title: $t({
defaultMessage: "You don't have any direct message conversations yet.",