File tree Expand file tree Collapse file tree 3 files changed +36
-3
lines changed Expand file tree Collapse file tree 3 files changed +36
-3
lines changed Original file line number Diff line number Diff line change @@ -656,7 +656,11 @@ module.exports = class IrcClient extends EventEmitter {
656656 }
657657 } ) ;
658658
659- client . raw ( 'WHO' , target ) ;
659+ if ( client . network . supports ( 'whox' ) ) {
660+ client . raw ( 'WHO' , target , '%cuhsnfdaor' ) ;
661+ } else {
662+ client . raw ( 'WHO' , target ) ;
663+ }
660664 }
661665
662666
@@ -704,7 +708,7 @@ module.exports = class IrcClient extends EventEmitter {
704708 matchAction ( match_regex , cb ) {
705709 return this . match ( match_regex , cb , 'action' ) ;
706710 }
707-
711+
708712 /**
709713 * Truncate a string into blocks of a set size
710714 */
@@ -727,7 +731,7 @@ module.exports = class IrcClient extends EventEmitter {
727731 do {
728732 current_char_length = chars [ end_index ] . length ;
729733 current_block_length += current_char_length ;
730-
734+
731735 // If character does not fit in a single block, include it in current block anyway
732736 // and split it later on by falling back to simple substring
733737 if ( current_char_length > block_size ) {
Original file line number Diff line number Diff line change @@ -99,6 +99,34 @@ var handlers = {
9999 } ) ;
100100 } ,
101101
102+ RPL_WHOSPCRPL : function ( command ) {
103+ var cache = this . cache ( 'who' ) ;
104+ if ( ! cache . members ) {
105+ cache . members = [ ] ;
106+ }
107+ var params = command . params ;
108+
109+ // G = Gone, H = Here
110+ var is_away = params [ 6 ] [ 0 ] . toUpperCase ( ) === 'G' ?
111+ true :
112+ false ;
113+
114+ // Some ircd's use n/a for no level, unify them all to 0 for no level
115+ var op_level = ! / ^ [ 0 - 9 ] + $ / . test ( params [ 9 ] ) ? 0 : parseInt ( params [ 9 ] , 10 ) ;
116+
117+ cache . members . push ( {
118+ nick : params [ 5 ] ,
119+ ident : params [ 2 ] ,
120+ hostname : params [ 3 ] ,
121+ server : params [ 4 ] ,
122+ op_level : op_level ,
123+ real_name : params [ 10 ] ,
124+ account : params [ 8 ] === '0' ? '' : params [ 8 ] ,
125+ away : is_away ,
126+ num_hops_away : parseInt ( params [ 7 ] , 10 ) ,
127+ } ) ;
128+ } ,
129+
102130
103131 RPL_ENDOFWHO : function ( command ) {
104132 var cache = this . cache ( 'who' ) ;
Original file line number Diff line number Diff line change @@ -100,6 +100,7 @@ module.exports = {
100100 '347' : 'RPL_ENDOFINVITELIST' ,
101101 '352' : 'RPL_WHOREPLY' ,
102102 '353' : 'RPL_NAMEREPLY' ,
103+ '354' : 'RPL_WHOSPCRPL' ,
103104 '364' : 'RPL_LINKS' ,
104105 '365' : 'RPL_ENDOFLINKS' ,
105106 '366' : 'RPL_ENDOFNAMES' ,
You can’t perform that action at this time.
0 commit comments