@@ -40,7 +40,6 @@ const SERVER_PORT = BOUNCER_MODE=='gateway'?(config.serverPort?config.serverPort
40
40
const INGRESSWEBIRC = config . ingresswebircPassword ?config . ingresswebircPassword :'' ;
41
41
const SERVER = BOUNCER_MODE == 'gateway' ?( config . server ?config . server :'' ) :'' ;
42
42
const DEBUG = config . debug ?config . debug :false ;
43
- const IRCV3_MONITOR = config . ircv3Monitor ?true :false ;
44
43
45
44
46
45
// Reload passwords on sighup
@@ -320,6 +319,21 @@ server = doServer(tlsOptions,function(socket) {
320
319
case 'QUIT' :
321
320
this . end ( ) ;
322
321
break ;
322
+ case 'MONITOR' :
323
+ if ( this . hash && connections [ this . hash ] ) {
324
+ if ( command [ 1 ] == "+" ) {
325
+ if ( ! connections [ this . hash ] . ircv3Monitor )
326
+ connections [ this . hash ] . ircv3Monitor = true ;
327
+ connections [ this . hash ] . write ( "MONITOR + " + command . slice ( 2 ) . toString ( ) + "\n" ) ;
328
+ }
329
+ else if ( command [ 1 ] == "-" ) {
330
+ connections [ this . hash ] . write ( "MONITOR - " + command . slice ( 2 ) . toString ( ) + "\n" ) ;
331
+ }
332
+ else {
333
+ connections [ this . hash ] . write ( "MONITOR " + command . slice ( 1 ) . toString ( ) + "\n" ) ;
334
+ }
335
+ }
336
+ break ;
323
337
case 'CAP' :
324
338
this . write ( ":*jbnc NOTICE * :*** No CAPabilities available. ***\n" ) ;
325
339
continue ;
@@ -646,7 +660,7 @@ function clientReconnect(socket) {
646
660
socket . write ( connection . connectbuf + "\n" ) ;
647
661
if ( connection . nick != socket . irc . nick )
648
662
socket . write ( ":" + connection . nick_original + " NICK " + connection . nick + "\n" ) ;
649
- if ( IRCV3_MONITOR )
663
+ if ( connections [ this . hash ] . ircv3Monitor )
650
664
connection . write ( "MONITOR S\n" ) ;
651
665
if ( ! connection . connected ) {
652
666
connection . write ( "AWAY\n" ) ;
@@ -810,6 +824,7 @@ function clientConnect(socket) {
810
824
connection . opmode = BOUNCER_DEFAULT_OPMODE ;
811
825
connection . userhostInNames = false ;
812
826
connection . messagetags = false ;
827
+ connection . ircv3Monitor = false ;
813
828
814
829
// Temp Buffer
815
830
connection . _buffer = '' ;
0 commit comments