File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -140,7 +140,7 @@ function adapter(uri, opts) {
140
140
return debug ( 'ignore different channel' ) ;
141
141
}
142
142
143
- var room = channel . substring ( this . channel . length ) ;
143
+ var room = channel . slice ( this . channel . length , - 1 ) ;
144
144
if ( room !== '' && ! this . rooms . hasOwnProperty ( room ) ) {
145
145
return debug ( 'ignore unknown room %s' , room ) ;
146
146
}
@@ -404,11 +404,12 @@ function adapter(uri, opts) {
404
404
packet . nsp = this . nsp . name ;
405
405
if ( ! ( remote || ( opts && opts . flags && opts . flags . local ) ) ) {
406
406
var msg = msgpack . encode ( [ uid , packet , opts ] ) ;
407
+ var channel = this . channel ;
407
408
if ( opts . rooms && opts . rooms . length === 1 ) {
408
- pub . publish ( this . channel + opts . rooms [ 0 ] , msg ) ;
409
- } else {
410
- pub . publish ( this . channel , msg ) ;
409
+ channel += opts . rooms [ 0 ] + '#' ;
411
410
}
411
+ debug ( 'publishing message to channel %s' , channel ) ;
412
+ pub . publish ( channel , msg ) ;
412
413
}
413
414
Adapter . prototype . broadcast . call ( this , packet , opts ) ;
414
415
} ;
You can’t perform that action at this time.
0 commit comments