realm: Add setting to notify user on DMing guest.

Added `enable_guest_user_dm_warning` setting to decide whether
clients should show a warning when a user is composing to a guest
user in the organization.

Fixes #30078.

Co-authored-by: adnan-td <generaladnan139@gmail.com>
This commit is contained in:
Vector73
2025-02-06 14:13:13 +00:00
committed by Tim Abbott
parent d852aeffc4
commit cb6f0fd63c
23 changed files with 323 additions and 29 deletions

View File

@@ -687,6 +687,17 @@ export function pm_with_operand_ids(operand: string): number[] | undefined {
return user_ids;
}
export function filter_other_guest_ids(user_ids: number[]): number[] {
return sort_numerically(
user_ids.filter((id) => id !== current_user.user_id && get_by_user_id(id)?.is_guest),
);
}
export function user_ids_to_full_names_array(user_ids: number[]): string[] {
const names = user_ids.map((user_id) => get_by_user_id(user_id).full_name).sort(util.strcmp);
return names;
}
export function emails_to_slug(emails_string: string): string | undefined {
let slug = reply_to_to_user_ids_string(emails_string);