File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -1427,10 +1427,19 @@ AGServerSocket.prototype.deauthenticate = async function (options) {
1427
1427
} ;
1428
1428
1429
1429
AGServerSocket . prototype . kickOut = function ( channel , message ) {
1430
- delete this . channelSubscriptions [ channel ] ;
1431
- this . channelSubscriptionsCount -- ;
1432
- this . transmit ( '#kickOut' , { channel, message} ) ;
1433
- return this . server . brokerEngine . unsubscribeSocket ( this , channel ) ;
1430
+ let channels = channel ;
1431
+ if ( ! channels ) {
1432
+ channels = Object . keys ( this . channelSubscriptions ) ;
1433
+ }
1434
+ if ( ! Array . isArray ( channels ) ) {
1435
+ channels = [ channel ] ;
1436
+ }
1437
+ for ( const channelName of channels ) {
1438
+ delete this . channelSubscriptions [ channelName ] ;
1439
+ this . channelSubscriptionsCount -- ;
1440
+ this . transmit ( '#kickOut' , { channel : channelName , message} ) ;
1441
+ this . server . brokerEngine . unsubscribeSocket ( this , channelName ) ;
1442
+ }
1434
1443
} ;
1435
1444
1436
1445
AGServerSocket . prototype . subscriptions = function ( ) {
You can’t perform that action at this time.
0 commit comments