Skip to content

Commit c62d0c1

Browse files
author
Max Presman
committed
adjust test for remove channel protection
1 parent abdb6a3 commit c62d0c1

File tree

13 files changed

+156
-43
lines changed

13 files changed

+156
-43
lines changed

dist/titanium/pubnub.js

+29-8
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,8 @@ return /******/ (function(modules) { // webpackBootstrap
348348
this.setUUID = modules.config.setUUID.bind(modules.config);
349349
this.getFilterExpression = modules.config.getFilterExpression.bind(modules.config);
350350
this.setFilterExpression = modules.config.setFilterExpression.bind(modules.config);
351+
352+
this.setHeartbeatInterval = modules.config.setHeartbeatInterval.bind(modules.config);
351353
}
352354

353355
_createClass(_class, [{
@@ -653,7 +655,7 @@ return /******/ (function(modules) { // webpackBootstrap
653655

654656
this.setFilterExpression(setup.filterExpression);
655657

656-
this.origin = setup.origin || 'pubsub.pubnub.com';
658+
this.origin = setup.origin || 'pubsub.pndsn.com';
657659
this.secure = setup.ssl || false;
658660
this.restore = setup.restore || false;
659661
this.proxy = setup.proxy;
@@ -1614,21 +1616,40 @@ return /******/ (function(modules) { // webpackBootstrap
16141616
_args$channelGroups3 = args.channelGroups,
16151617
channelGroups = _args$channelGroups3 === undefined ? [] : _args$channelGroups3;
16161618

1619+
var actualChannels = [];
1620+
var actualChannelGroups = [];
1621+
16171622

16181623
channels.forEach(function (channel) {
1619-
if (channel in _this3._channels) delete _this3._channels[channel];
1620-
if (channel in _this3._presenceChannels) delete _this3._presenceChannels[channel];
1624+
if (channel in _this3._channels) {
1625+
delete _this3._channels[channel];
1626+
actualChannels.push(channel);
1627+
}
1628+
if (channel in _this3._presenceChannels) {
1629+
delete _this3._presenceChannels[channel];
1630+
actualChannels.push(channel);
1631+
}
16211632
});
16221633

16231634
channelGroups.forEach(function (channelGroup) {
1624-
if (channelGroup in _this3._channelGroups) delete _this3._channelGroups[channelGroup];
1625-
if (channelGroup in _this3._presenceChannelGroups) delete _this3._channelGroups[channelGroup];
1635+
if (channelGroup in _this3._channelGroups) {
1636+
delete _this3._channelGroups[channelGroup];
1637+
actualChannelGroups.push(channelGroup);
1638+
}
1639+
if (channelGroup in _this3._presenceChannelGroups) {
1640+
delete _this3._channelGroups[channelGroup];
1641+
actualChannelGroups.push(channelGroup);
1642+
}
16261643
});
16271644

1645+
if (actualChannels.length === 0 && actualChannelGroups.length === 0) {
1646+
return;
1647+
}
1648+
16281649
if (this._config.suppressLeaveEvents === false && !isOffline) {
1629-
this._leaveEndpoint({ channels: channels, channelGroups: channelGroups }, function (status) {
1630-
status.affectedChannels = channels;
1631-
status.affectedChannelGroups = channelGroups;
1650+
this._leaveEndpoint({ channels: actualChannels, channelGroups: actualChannelGroups }, function (status) {
1651+
status.affectedChannels = actualChannels;
1652+
status.affectedChannelGroups = actualChannelGroups;
16321653
status.currentTimetoken = _this3._currentTimetoken;
16331654
status.lastTimetoken = _this3._lastTimetoken;
16341655
_this3._listenerManager.announceStatus(status);

dist/titanium/pubnub.min.js

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/web/pubnub.js

+29-8
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,8 @@ return /******/ (function(modules) { // webpackBootstrap
370370
this.setUUID = modules.config.setUUID.bind(modules.config);
371371
this.getFilterExpression = modules.config.getFilterExpression.bind(modules.config);
372372
this.setFilterExpression = modules.config.setFilterExpression.bind(modules.config);
373+
374+
this.setHeartbeatInterval = modules.config.setHeartbeatInterval.bind(modules.config);
373375
}
374376

375377
_createClass(_class, [{
@@ -675,7 +677,7 @@ return /******/ (function(modules) { // webpackBootstrap
675677

676678
this.setFilterExpression(setup.filterExpression);
677679

678-
this.origin = setup.origin || 'pubsub.pubnub.com';
680+
this.origin = setup.origin || 'pubsub.pndsn.com';
679681
this.secure = setup.ssl || false;
680682
this.restore = setup.restore || false;
681683
this.proxy = setup.proxy;
@@ -1636,21 +1638,40 @@ return /******/ (function(modules) { // webpackBootstrap
16361638
_args$channelGroups3 = args.channelGroups,
16371639
channelGroups = _args$channelGroups3 === undefined ? [] : _args$channelGroups3;
16381640

1641+
var actualChannels = [];
1642+
var actualChannelGroups = [];
1643+
16391644

16401645
channels.forEach(function (channel) {
1641-
if (channel in _this3._channels) delete _this3._channels[channel];
1642-
if (channel in _this3._presenceChannels) delete _this3._presenceChannels[channel];
1646+
if (channel in _this3._channels) {
1647+
delete _this3._channels[channel];
1648+
actualChannels.push(channel);
1649+
}
1650+
if (channel in _this3._presenceChannels) {
1651+
delete _this3._presenceChannels[channel];
1652+
actualChannels.push(channel);
1653+
}
16431654
});
16441655

16451656
channelGroups.forEach(function (channelGroup) {
1646-
if (channelGroup in _this3._channelGroups) delete _this3._channelGroups[channelGroup];
1647-
if (channelGroup in _this3._presenceChannelGroups) delete _this3._channelGroups[channelGroup];
1657+
if (channelGroup in _this3._channelGroups) {
1658+
delete _this3._channelGroups[channelGroup];
1659+
actualChannelGroups.push(channelGroup);
1660+
}
1661+
if (channelGroup in _this3._presenceChannelGroups) {
1662+
delete _this3._channelGroups[channelGroup];
1663+
actualChannelGroups.push(channelGroup);
1664+
}
16481665
});
16491666

1667+
if (actualChannels.length === 0 && actualChannelGroups.length === 0) {
1668+
return;
1669+
}
1670+
16501671
if (this._config.suppressLeaveEvents === false && !isOffline) {
1651-
this._leaveEndpoint({ channels: channels, channelGroups: channelGroups }, function (status) {
1652-
status.affectedChannels = channels;
1653-
status.affectedChannelGroups = channelGroups;
1672+
this._leaveEndpoint({ channels: actualChannels, channelGroups: actualChannelGroups }, function (status) {
1673+
status.affectedChannels = actualChannels;
1674+
status.affectedChannelGroups = actualChannelGroups;
16541675
status.currentTimetoken = _this3._currentTimetoken;
16551676
status.lastTimetoken = _this3._lastTimetoken;
16561677
_this3._listenerManager.announceStatus(status);

dist/web/pubnub.min.js

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/core/components/config.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/core/components/config.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/core/components/subscription_manager.js

+26-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/core/components/subscription_manager.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/core/pubnub-common.js

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)