@@ -558,6 +558,34 @@ describe('Bot', function () {
558558 this . sendStub . should . have . been . calledWith ( expected ) ;
559559 } ) ;
560560
561+ it ( 'should not convert user at-mentions from IRC if setting is disabled' , function ( ) {
562+ const newConfig = { ...config , allowDiscordStyleNotifyFromIRC : false } ;
563+ this . setCustomBot ( newConfig ) ;
564+
565+ const testUser = this . addUser ( { username : 'testuser' , id : '123' } ) ;
566+
567+ const username = 'ircuser' ;
568+ const text = `Not mentioning @${ testUser . username } ` ;
569+ const expected = `**<${ username } >** Not mentioning @${ testUser . username } ` ;
570+
571+ this . bot . sendToDiscord ( username , '#irc' , text ) ;
572+ this . sendStub . should . have . been . calledWith ( expected ) ;
573+ } ) ;
574+
575+ it ( 'should not convert user initial mentions from IRC if setting is disabled' , function ( ) {
576+ const newConfig = { ...config , allowIRCStyleNotifyFromIRC : false } ;
577+ this . setCustomBot ( newConfig ) ;
578+
579+ const testUser = this . addUser ( { username : 'testuser' , id : '123' } ) ;
580+
581+ const username = 'ircuser' ;
582+ const text = `${ testUser . username } : not mentioning you!` ;
583+ const expected = `**<${ username } >** ${ testUser . username } : not mentioning you!` ;
584+
585+ this . bot . sendToDiscord ( username , '#irc' , text ) ;
586+ this . sendStub . should . have . been . calledWith ( expected ) ;
587+ } ) ;
588+
561589 it ( 'should convert newlines from discord' , function ( ) {
562590 const message = {
563591 mentions : { users : [ ] } ,
0 commit comments