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

Commit b5391f8

Browse files
committed
"ignore"/"unignore" commands: validate user ID
Extend the accepted patterns so that users are alerted about invalid input. These patterns are approximations of the Matrix user ID grammer. Resolves element-hq/element-web#12743
1 parent a475887 commit b5391f8

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)