File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -110,6 +110,8 @@ module.exports = class IrcClient extends EventEmitter {
110110 // This prevents stale state if a connection gets closed during CAP negotiation
111111 client . network . cap . negotiating = false ;
112112 client . network . cap . requested = [ ] ;
113+
114+ client . command_handler . resetCache ( ) ;
113115 } ) ;
114116
115117 // IRC command routing
Original file line number Diff line number Diff line change @@ -22,6 +22,8 @@ module.exports = class IrcCommandHandler extends EventEmitter {
2222
2323 this . request_extra_caps = [ ] ;
2424
25+ this . resetCache ( ) ;
26+
2527 require ( './handlers/registration' ) ( this ) ;
2628 require ( './handlers/channel' ) ( this ) ;
2729 require ( './handlers/user' ) ( this ) ;
@@ -162,10 +164,7 @@ module.exports = class IrcCommandHandler extends EventEmitter {
162164 * cache.destroy();
163165 */
164166 cache ( id ) {
165- var cache ;
166-
167- this . _caches = this . _caches || Object . create ( null ) ;
168- cache = this . _caches [ id ] ;
167+ let cache = this . _caches [ id ] ;
169168
170169 if ( ! cache ) {
171170 let destroyCacheFn = ( cache , id ) => {
@@ -189,4 +188,8 @@ module.exports = class IrcCommandHandler extends EventEmitter {
189188 hasCache ( id ) {
190189 return this . _caches && Object . prototype . hasOwnProperty . call ( this . _caches , id ) ;
191190 }
191+
192+ resetCache ( ) {
193+ this . _caches = Object . create ( null ) ;
194+ }
192195} ;
You can’t perform that action at this time.
0 commit comments