Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit ea15725

Browse files
Merge pull request #4895 from jugglinmike/gh-12743-ignore-user-names
"ignore"/"unignore" commands: validate user ID
2 parents 71e9717 + b5391f8 commit ea15725

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/SlashCommands.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,7 @@ export const Commands = [
660660
if (args) {
661661
const cli = MatrixClientPeg.get();
662662

663-
const matches = args.match(/^(\S+)$/);
663+
const matches = args.match(/^(@[^:]+:\S+)$/);
664664
if (matches) {
665665
const userId = matches[1];
666666
const ignoredUsers = cli.getIgnoredUsers();
@@ -690,7 +690,7 @@ export const Commands = [
690690
if (args) {
691691
const cli = MatrixClientPeg.get();
692692

693-
const matches = args.match(/^(\S+)$/);
693+
const matches = args.match(/(^@[^:]+:\S+$)/);
694694
if (matches) {
695695
const userId = matches[1];
696696
const ignoredUsers = cli.getIgnoredUsers();

0 commit comments

Comments
 (0)