Some mentioned users are not present in DM when safe_dm_mentions is enabled
When the option safe_dm_mentions
is set to true
and you write a DM with the text @foo @bar hey folks let's talk about @baz
, the resulting DM is @bar hey folks let's talk about @baz
with no @foo
in it.
That happens because @safe_mention_regex
from the Formatter
catches only the last mentioned user at the beginning of DM (this line):
> Regex.named_captures(~r/^(\s*(?<mentions>@.+?\s+)+)(?<rest>.*)/s, "@foo @bar hey folks let's talk about @baz")
%{"mentions" => "@bar ", "rest" => "hey folks let's talk about @baz"}