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 {
110
110
// This prevents stale state if a connection gets closed during CAP negotiation
111
111
client . network . cap . negotiating = false ;
112
112
client . network . cap . requested = [ ] ;
113
+
114
+ client . command_handler . resetCache ( ) ;
113
115
} ) ;
114
116
115
117
// IRC command routing
Original file line number Diff line number Diff line change @@ -22,6 +22,8 @@ module.exports = class IrcCommandHandler extends EventEmitter {
22
22
23
23
this . request_extra_caps = [ ] ;
24
24
25
+ this . resetCache ( ) ;
26
+
25
27
require ( './handlers/registration' ) ( this ) ;
26
28
require ( './handlers/channel' ) ( this ) ;
27
29
require ( './handlers/user' ) ( this ) ;
@@ -162,10 +164,7 @@ module.exports = class IrcCommandHandler extends EventEmitter {
162
164
* cache.destroy();
163
165
*/
164
166
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 ] ;
169
168
170
169
if ( ! cache ) {
171
170
let destroyCacheFn = ( cache , id ) => {
@@ -189,4 +188,8 @@ module.exports = class IrcCommandHandler extends EventEmitter {
189
188
hasCache ( id ) {
190
189
return this . _caches && Object . prototype . hasOwnProperty . call ( this . _caches , id ) ;
191
190
}
191
+
192
+ resetCache ( ) {
193
+ this . _caches = Object . create ( null ) ;
194
+ }
192
195
} ;
You can’t perform that action at this time.
0 commit comments