This repository was archived by the owner on May 18, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ import MatrixClientPeg from '../../../MatrixClientPeg';
23
23
import Promise from 'bluebird' ;
24
24
import { addressTypes , getAddressType } from '../../../UserAddress.js' ;
25
25
import GroupStore from '../../../stores/GroupStore' ;
26
+ import * as Email from "../../../email" ;
26
27
27
28
const TRUNCATE_QUERY_LIST = 40 ;
28
29
const QUERY_USER_DIRECTORY_DEBOUNCE_MS = 200 ;
@@ -419,6 +420,10 @@ module.exports = React.createClass({
419
420
// a perfectly valid address if there are close matches.
420
421
const addrType = getAddressType ( query ) ;
421
422
if ( this . props . validAddressTypes . includes ( addrType ) ) {
423
+ if ( addrType === 'email' && ! Email . looksValid ( query ) ) {
424
+ this . setState ( { searchError : _t ( "That doesn't look like a valid email address" ) } ) ;
425
+ return ;
426
+ }
422
427
suggestedList . unshift ( {
423
428
addressType : addrType ,
424
429
address : query ,
Original file line number Diff line number Diff line change 874
874
"Matrix ID" : " Matrix ID" ,
875
875
"Matrix Room ID" : " Matrix Room ID" ,
876
876
"email address" : " email address" ,
877
+ "That doesn't look like a valid email address" : " That doesn't look like a valid email address" ,
877
878
"You have entered an invalid address." : " You have entered an invalid address." ,
878
879
"Try using one of the following valid address types: %(validTypesList)s." : " Try using one of the following valid address types: %(validTypesList)s." ,
879
880
"Preparing to send logs" : " Preparing to send logs" ,
You can’t perform that action at this time.
0 commit comments