Merge pull request #4895 from jugglinmike/gh-12743-ignore-user-names

"ignore"/"unignore" commands: validate user ID
This commit is contained in:
Jorik Schellekens 2020-07-13 16:07:31 +01:00 committed by GitHub
commit ea15725164
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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