mirror of https://github.com/zulip/zulip.git
compose: Don't convert bot mentions to silent mentions.
This fixes an unintended consequence of the silent mention conversion
logic added in 4d1ade1f88
, where bots
that looked for personal mentions would not process mentions in 1:1
DMs.
This commit is contained in:
parent
9f509d4ab2
commit
60afdc45eb
|
@ -844,6 +844,13 @@ export function convert_mentions_to_silent_in_direct_messages(mention_text, full
|
||||||
return mention_text;
|
return mention_text;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const user = people.get_user_by_id_assert_valid(user_id);
|
||||||
|
if (user.is_bot) {
|
||||||
|
// Since bots often process mentions as requests for them to
|
||||||
|
// do things, prefer non-silent mentions when DMing them.
|
||||||
|
return mention_text;
|
||||||
|
}
|
||||||
|
|
||||||
const mention_str = people.get_mention_syntax(full_name, user_id, false);
|
const mention_str = people.get_mention_syntax(full_name, user_id, false);
|
||||||
const silent_mention_str = people.get_mention_syntax(full_name, user_id, true);
|
const silent_mention_str = people.get_mention_syntax(full_name, user_id, true);
|
||||||
mention_text = mention_text.replace(mention_str, silent_mention_str);
|
mention_text = mention_text.replace(mention_str, silent_mention_str);
|
||||||
|
|
Loading…
Reference in New Issue