Skip to content

Commit

Permalink
no presence subscription for channel metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
mohitpubnub committed Feb 5, 2024
1 parent 2704e97 commit 6d95a3a
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 16 deletions.
14 changes: 7 additions & 7 deletions dist/web/pubnub.js
Original file line number Diff line number Diff line change
Expand Up @@ -8482,7 +8482,7 @@
this.options = subscriptionOptions;
this.eventEmitter = eventEmitter;
this.pubnub = pubnub;
this._subscriptions = [
this.subscriptionList = [
new Subscription({
channels: this.channelNames,
channelGroups: this.groupNames,
Expand All @@ -8506,7 +8506,7 @@
this.eventEmitter.removeListener(listener, this.channelNames, this.groupNames);
};
SubscriptionSet.prototype.addSubscription = function (subscription) {
this._subscriptions.push(subscription);
this.subscriptionList.push(subscription);
this.channelNames = __spreadArray(__spreadArray([], __read(this.channelNames), false), __read(subscription.channels), false);
this.groupNames = __spreadArray(__spreadArray([], __read(this.groupNames), false), __read(subscription.channelGroups), false);
};
Expand All @@ -8515,10 +8515,10 @@
var groupsToRemove = subscription.channelGroups;
this.channelNames = this.channelNames.filter(function (c) { return !channelsToRemove.includes(c); });
this.groupNames = this.groupNames.filter(function (cg) { return !groupsToRemove.includes(cg); });
this._subscriptions = this._subscriptions.filter(function (s) { return s !== subscription; });
this.subscriptionList = this.subscriptionList.filter(function (s) { return s !== subscription; });
};
SubscriptionSet.prototype.addSubscriptionSet = function (subscriptionSet) {
this._subscriptions = __spreadArray(__spreadArray([], __read(this._subscriptions), false), __read(subscriptionSet.subscriptions), false);
this.subscriptionList = __spreadArray(__spreadArray([], __read(this.subscriptionList), false), __read(subscriptionSet.subscriptions), false);
this.channelNames = __spreadArray(__spreadArray([], __read(this.channelNames), false), __read(subscriptionSet.channels), false);
this.groupNames = __spreadArray(__spreadArray([], __read(this.groupNames), false), __read(subscriptionSet.channelGroups), false);
};
Expand All @@ -8527,7 +8527,7 @@
var groupsToRemove = subscriptionSet.channelGroups;
this.channelNames = this.channelNames.filter(function (c) { return !channelsToRemove.includes(c); });
this.groupNames = this.groupNames.filter(function (cg) { return !groupsToRemove.includes(cg); });
this._subscriptions = this._subscriptions.filter(function (s) { return !subscriptionSet.subscriptions.includes(s); });
this.subscriptionList = this.subscriptionList.filter(function (s) { return !subscriptionSet.subscriptions.includes(s); });
};
Object.defineProperty(SubscriptionSet.prototype, "channels", {
get: function () {
Expand All @@ -8545,7 +8545,7 @@
});
Object.defineProperty(SubscriptionSet.prototype, "subscriptions", {
get: function () {
return this._subscriptions.slice(0);
return this.subscriptionList.slice(0);
},
enumerable: false,
configurable: true
Expand Down Expand Up @@ -8647,7 +8647,7 @@
}
ChannelMetadata.prototype.subscription = function (subscriptionOptions) {
return new Subscription({
channels: (subscriptionOptions === null || subscriptionOptions === void 0 ? void 0 : subscriptionOptions.receivePresenceEvents) ? [this.id, "".concat(this.id, "-pnpres")] : [this.id],
channels: [this.id],
channelGroups: [],
subscriptionOptions: subscriptionOptions,
eventEmitter: this.eventEmitter,
Expand Down
2 changes: 1 addition & 1 deletion dist/web/pubnub.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/entities/ChannelMetadata.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ var ChannelMetadata = /** @class */ (function () {
}
ChannelMetadata.prototype.subscription = function (subscriptionOptions) {
return new Subscription_1.Subscription({
channels: (subscriptionOptions === null || subscriptionOptions === void 0 ? void 0 : subscriptionOptions.receivePresenceEvents) ? [this.id, "".concat(this.id, "-pnpres")] : [this.id],
channels: [this.id],
channelGroups: [],
subscriptionOptions: subscriptionOptions,
eventEmitter: this.eventEmitter,
Expand Down
12 changes: 6 additions & 6 deletions lib/entities/SubscriptionSet.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ var SubscriptionSet = /** @class */ (function () {
this.options = subscriptionOptions;
this.eventEmitter = eventEmitter;
this.pubnub = pubnub;
this._subscriptions = [
this.subscriptionList = [
new Subscription_1.Subscription({
channels: this.channelNames,
channelGroups: this.groupNames,
Expand All @@ -72,7 +72,7 @@ var SubscriptionSet = /** @class */ (function () {
this.eventEmitter.removeListener(listener, this.channelNames, this.groupNames);
};
SubscriptionSet.prototype.addSubscription = function (subscription) {
this._subscriptions.push(subscription);
this.subscriptionList.push(subscription);
this.channelNames = __spreadArray(__spreadArray([], __read(this.channelNames), false), __read(subscription.channels), false);
this.groupNames = __spreadArray(__spreadArray([], __read(this.groupNames), false), __read(subscription.channelGroups), false);
};
Expand All @@ -81,10 +81,10 @@ var SubscriptionSet = /** @class */ (function () {
var groupsToRemove = subscription.channelGroups;
this.channelNames = this.channelNames.filter(function (c) { return !channelsToRemove.includes(c); });
this.groupNames = this.groupNames.filter(function (cg) { return !groupsToRemove.includes(cg); });
this._subscriptions = this._subscriptions.filter(function (s) { return s !== subscription; });
this.subscriptionList = this.subscriptionList.filter(function (s) { return s !== subscription; });
};
SubscriptionSet.prototype.addSubscriptionSet = function (subscriptionSet) {
this._subscriptions = __spreadArray(__spreadArray([], __read(this._subscriptions), false), __read(subscriptionSet.subscriptions), false);
this.subscriptionList = __spreadArray(__spreadArray([], __read(this.subscriptionList), false), __read(subscriptionSet.subscriptions), false);
this.channelNames = __spreadArray(__spreadArray([], __read(this.channelNames), false), __read(subscriptionSet.channels), false);
this.groupNames = __spreadArray(__spreadArray([], __read(this.groupNames), false), __read(subscriptionSet.channelGroups), false);
};
Expand All @@ -93,7 +93,7 @@ var SubscriptionSet = /** @class */ (function () {
var groupsToRemove = subscriptionSet.channelGroups;
this.channelNames = this.channelNames.filter(function (c) { return !channelsToRemove.includes(c); });
this.groupNames = this.groupNames.filter(function (cg) { return !groupsToRemove.includes(cg); });
this._subscriptions = this._subscriptions.filter(function (s) { return !subscriptionSet.subscriptions.includes(s); });
this.subscriptionList = this.subscriptionList.filter(function (s) { return !subscriptionSet.subscriptions.includes(s); });
};
Object.defineProperty(SubscriptionSet.prototype, "channels", {
get: function () {
Expand All @@ -111,7 +111,7 @@ var SubscriptionSet = /** @class */ (function () {
});
Object.defineProperty(SubscriptionSet.prototype, "subscriptions", {
get: function () {
return this._subscriptions.slice(0);
return this.subscriptionList.slice(0);
},
enumerable: false,
configurable: true
Expand Down
2 changes: 1 addition & 1 deletion src/entities/ChannelMetadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export class ChannelMetadata {
}
subscription(subscriptionOptions?: SubscriptionOptions) {
return new Subscription({
channels: subscriptionOptions?.receivePresenceEvents ? [this.id, `${this.id}-pnpres`] : [this.id],
channels: [this.id],
channelGroups: [],
subscriptionOptions: subscriptionOptions,
eventEmitter: this.eventEmitter,
Expand Down

0 comments on commit 6d95a3a

Please sign in to comment.