File tree Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -684,25 +684,29 @@ export class Client extends (EventEmitter as unknown as new () => TypedEmitter<C
684
684
}
685
685
}
686
686
if ( knownPrefixes . length > 0 ) {
687
- channel . users . set ( match [ 2 ] , knownPrefixes ) ;
687
+ channel . tmpUsers . set ( match [ 2 ] , knownPrefixes ) ;
688
688
}
689
689
else {
690
690
// recombine just in case this server allows weird chars in the nick.
691
691
// We know it isn't a mode char.
692
- channel . users . set ( match [ 1 ] + match [ 2 ] , '' ) ;
692
+ channel . tmpUsers . set ( match [ 1 ] + match [ 2 ] , '' ) ;
693
693
}
694
694
}
695
695
} ) ;
696
- // If the channel user list was modified, flush.
697
- if ( users . length ) {
698
- this . state . flush ?.( )
699
- }
700
696
}
701
697
702
698
private onReplyNameEnd ( message : Message ) {
703
699
this . _casemap ( message , 1 ) ;
704
700
const channel = this . chanData ( message . args [ 1 ] ) ;
705
701
if ( channel ) {
702
+ channel . users . clear ( ) ;
703
+ channel . tmpUsers . forEach ( ( modes , user ) => {
704
+ channel . users . set ( user , modes ) ;
705
+ } ) ;
706
+ channel . tmpUsers . clear ( ) ;
707
+
708
+ this . state . flush ?.( ) ;
709
+
706
710
this . emit ( 'names' , message . args [ 1 ] , channel . users ) ;
707
711
this . _send ( 'MODE' , message . args [ 1 ] ) ;
708
712
}
@@ -1166,6 +1170,7 @@ export class Client extends (EventEmitter as unknown as new () => TypedEmitter<C
1166
1170
key : key ,
1167
1171
serverName : name ,
1168
1172
users : new Map ( ) ,
1173
+ tmpUsers : new Map ( ) ,
1169
1174
mode : '' ,
1170
1175
modeParams : new Map ( ) ,
1171
1176
} ) ;
Original file line number Diff line number Diff line change @@ -90,6 +90,7 @@ export interface ChanData {
90
90
* nick => mode
91
91
*/
92
92
users : Map < string , string > ,
93
+ tmpUsers : Map < string , string > , // used while processing NAMES replies
93
94
mode : string ;
94
95
modeParams : Map < string , string [ ] > ,
95
96
topic ?: string ;
You can’t perform that action at this time.
0 commit comments