You've already forked matrix-react-sdk
							
							
				mirror of
				https://github.com/matrix-org/matrix-react-sdk.git
				synced 2025-11-03 00:33:22 +03:00 
			
		
		
		
	"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 https://github.com/vector-im/riot-web/issues/12743
This commit is contained in:
		@@ -660,7 +660,7 @@ export const Commands = [
 | 
			
		||||
            if (args) {
 | 
			
		||||
                const cli = MatrixClientPeg.get();
 | 
			
		||||
 | 
			
		||||
                const matches = args.match(/^(\S+)$/);
 | 
			
		||||
                const matches = args.match(/^(@[^:]+:\S+)$/);
 | 
			
		||||
                if (matches) {
 | 
			
		||||
                    const userId = matches[1];
 | 
			
		||||
                    const ignoredUsers = cli.getIgnoredUsers();
 | 
			
		||||
@@ -690,7 +690,7 @@ export const Commands = [
 | 
			
		||||
            if (args) {
 | 
			
		||||
                const cli = MatrixClientPeg.get();
 | 
			
		||||
 | 
			
		||||
                const matches = args.match(/^(\S+)$/);
 | 
			
		||||
                const matches = args.match(/(^@[^:]+:\S+$)/);
 | 
			
		||||
                if (matches) {
 | 
			
		||||
                    const userId = matches[1];
 | 
			
		||||
                    const ignoredUsers = cli.getIgnoredUsers();
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user