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.

compose_validate: Use explicit check for 1:1 DM detection.

Tim Abbott85b8100f8c32
diff --git a/web/src/compose_validate.ts b/web/src/compose_validate.ts
index ff70d654e5b..47ef61eaaf6 100644
--- a/web/src/compose_validate.ts
+++ b/web/src/compose_validate.ts
@@ -1247,8 +1247,8 @@ export function convert_mentions_to_silent_in_direct_messages(
return mention_text;
}
- const recipient_user_id = compose_pm_pill.get_user_ids();
- if (recipient_user_id.toString() !== user_id.toString()) {
+ const recipient_user_ids = compose_pm_pill.get_user_ids();
+ if (recipient_user_ids.length !== 1 || recipient_user_ids[0] !== user_id) {
return mention_text;
}