From be47efea460fff8a7ab7d52e4bc8ad17d56c0214 Mon Sep 17 00:00:00 2001 From: Sebastian Molenda Date: Fri, 26 Jan 2024 15:05:29 +0100 Subject: [PATCH] Add ee param to heartbeat, subscribe and leave endpoints --- pubnub/endpoints/presence/heartbeat.py | 3 +++ pubnub/endpoints/presence/leave.py | 3 +++ pubnub/endpoints/pubsub/subscribe.py | 3 +++ 3 files changed, 9 insertions(+) diff --git a/pubnub/endpoints/presence/heartbeat.py b/pubnub/endpoints/presence/heartbeat.py index 20ea60e8..f8bb42e2 100644 --- a/pubnub/endpoints/presence/heartbeat.py +++ b/pubnub/endpoints/presence/heartbeat.py @@ -52,6 +52,9 @@ def custom_params(self): if self._state is not None and len(self._state) > 0: params['state'] = utils.url_write(self._state) + if hasattr(self.pubnub, '_subscription_manager'): + params.update(self.pubnub._subscription_manager.get_custom_params()) + return params def create_response(self, envelope): diff --git a/pubnub/endpoints/presence/leave.py b/pubnub/endpoints/presence/leave.py index 0023a859..113150e8 100644 --- a/pubnub/endpoints/presence/leave.py +++ b/pubnub/endpoints/presence/leave.py @@ -36,6 +36,9 @@ def custom_params(self): if len(self._groups) > 0: params['channel-group'] = utils.join_items(self._groups) + if hasattr(self.pubnub, '_subscription_manager'): + params.update(self.pubnub._subscription_manager.get_custom_params()) + return params def build_path(self): diff --git a/pubnub/endpoints/pubsub/subscribe.py b/pubnub/endpoints/pubsub/subscribe.py index 5f5300bd..b27783cc 100644 --- a/pubnub/endpoints/pubsub/subscribe.py +++ b/pubnub/endpoints/pubsub/subscribe.py @@ -75,6 +75,9 @@ def custom_params(self): if not self.pubnub.config.heartbeat_default_values: params['heartbeat'] = self.pubnub.config.presence_timeout + if hasattr(self.pubnub, '_subscription_manager'): + params.update(self.pubnub._subscription_manager.get_custom_params()) + return params def create_response(self, envelope):