Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEAT] Auto enable receivePresenceEvents for channels with '-pnpres' suffix #391

Closed
roman-rr opened this issue Jul 13, 2024 · 2 comments
Closed

Comments

@roman-rr
Copy link

Please review & consider, if possible to automatically enable receivePresenceEvents: true for channels with suffix -pnpres, like so:

// Current usage
const subscriptionSet = pubnub.subscriptionSet({ 
    channels: ['ch1', 'ch2'], 
    subscriptionOptions: { receivePresenceEvents: true } 
});

// Possible variation to reduce code base
const subscriptionSet = pubnub.subscriptionSet({ channels: ['ch1-pnpres', 'ch2-pnpres'] });

And then both cases will have flag receivePresenceEvents: true, which can reduce code double-tube for presence/non-presence channels in client side.

@parfeon
Copy link
Contributor

parfeon commented Jul 13, 2024

@roman-rr thanks for reaching out to us.

I'm not really sure what you want to achieve. receivePresenceEvents - this is a flag which internally used to generate -pnpres versions. In first case set will contain: ch1, ch2, ch1-pnpres and ch2-pnpres and on subscribe updates will be received from all of them (real-time messages and presence updates). Second example will only listen for presence updates.

@roman-rr
Copy link
Author

@parfeon Thanks, I already find out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants