Skip to content

Commit 83fbb28

Browse files
author
Devendra
committed
adding backward compatibility flag
1 parent a7cda4d commit 83fbb28

26 files changed

Lines changed: 653 additions & 617 deletions

File tree

‎core/pubnub-common.js‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@ function PN_API(setup) {
220220
, PRESENCE_HB_INTERVAL = setup['heartbeat_interval'] || PRESENCE_HB - 3
221221
, PRESENCE_HB_RUNNING = false
222222
, NO_WAIT_FOR_PENDING = setup['no_wait_for_pending']
223+
, COMPATIBLE_35 = setup['compatible_3.5'] || false
223224
, xdr = setup['xdr']
224225
, error = setup['error'] || function() {}
225226
, _is_online = setup['_is_online'] || function() { return 1 }
@@ -356,8 +357,10 @@ function PN_API(setup) {
356357
// Prevent Leaving a Presence Channel
357358
if (channel.indexOf(PRESENCE_SUFFIX) > 0) return true;
358359

360+
if (COMPATIBLE_35 && (!SSL && jsonp == '0')) return false;
361+
359362
// No Leave Patch (Prevent Blocking Leave if Desired)
360-
if (NOLEAVE) return false;
363+
if (!COMPATIBLE_35 && NOLEAVE) return false;
361364

362365
if (jsonp != '0') data['callback'] = jsonp;
363366

‎modern/pubnub-crypto.min.js‎

Lines changed: 26 additions & 24 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎modern/pubnub.js‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@ function PN_API(setup) {
221221
, PRESENCE_HB_INTERVAL = setup['heartbeat_interval'] || PRESENCE_HB - 3
222222
, PRESENCE_HB_RUNNING = false
223223
, NO_WAIT_FOR_PENDING = setup['no_wait_for_pending']
224+
, COMPATIBLE_35 = setup['compatible_3.5'] || false
224225
, xdr = setup['xdr']
225226
, error = setup['error'] || function() {}
226227
, _is_online = setup['_is_online'] || function() { return 1 }
@@ -357,8 +358,10 @@ function PN_API(setup) {
357358
// Prevent Leaving a Presence Channel
358359
if (channel.indexOf(PRESENCE_SUFFIX) > 0) return true;
359360

361+
if (COMPATIBLE_35 && (!SSL && jsonp == '0')) return false;
362+
360363
// No Leave Patch (Prevent Blocking Leave if Desired)
361-
if (NOLEAVE) return false;
364+
if (!COMPATIBLE_35 && NOLEAVE) return false;
362365

363366
if (jsonp != '0') data['callback'] = jsonp;
364367

‎modern/pubnub.min.js‎

Lines changed: 56 additions & 59 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎node.js/pubnub.js‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@ function PN_API(setup) {
221221
, PRESENCE_HB_INTERVAL = setup['heartbeat_interval'] || PRESENCE_HB - 3
222222
, PRESENCE_HB_RUNNING = false
223223
, NO_WAIT_FOR_PENDING = setup['no_wait_for_pending']
224+
, COMPATIBLE_35 = setup['compatible_3.5'] || false
224225
, xdr = setup['xdr']
225226
, error = setup['error'] || function() {}
226227
, _is_online = setup['_is_online'] || function() { return 1 }
@@ -357,8 +358,10 @@ function PN_API(setup) {
357358
// Prevent Leaving a Presence Channel
358359
if (channel.indexOf(PRESENCE_SUFFIX) > 0) return true;
359360

361+
if (COMPATIBLE_35 && (!SSL && jsonp == '0')) return false;
362+
360363
// No Leave Patch (Prevent Blocking Leave if Desired)
361-
if (NOLEAVE) return false;
364+
if (!COMPATIBLE_35 && NOLEAVE) return false;
362365

363366
if (jsonp != '0') data['callback'] = jsonp;
364367

‎phonegap/pubnub-crypto.min.js‎

Lines changed: 26 additions & 24 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎phonegap/pubnub.js‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@ function PN_API(setup) {
221221
, PRESENCE_HB_INTERVAL = setup['heartbeat_interval'] || PRESENCE_HB - 3
222222
, PRESENCE_HB_RUNNING = false
223223
, NO_WAIT_FOR_PENDING = setup['no_wait_for_pending']
224+
, COMPATIBLE_35 = setup['compatible_3.5'] || false
224225
, xdr = setup['xdr']
225226
, error = setup['error'] || function() {}
226227
, _is_online = setup['_is_online'] || function() { return 1 }
@@ -357,8 +358,10 @@ function PN_API(setup) {
357358
// Prevent Leaving a Presence Channel
358359
if (channel.indexOf(PRESENCE_SUFFIX) > 0) return true;
359360

361+
if (COMPATIBLE_35 && (!SSL && jsonp == '0')) return false;
362+
360363
// No Leave Patch (Prevent Blocking Leave if Desired)
361-
if (NOLEAVE) return false;
364+
if (!COMPATIBLE_35 && NOLEAVE) return false;
362365

363366
if (jsonp != '0') data['callback'] = jsonp;
364367

‎phonegap/pubnub.min.js‎

Lines changed: 56 additions & 59 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎sencha/pubnub-crypto.min.js‎

Lines changed: 26 additions & 24 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎sencha/pubnub.js‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@ function PN_API(setup) {
221221
, PRESENCE_HB_INTERVAL = setup['heartbeat_interval'] || PRESENCE_HB - 3
222222
, PRESENCE_HB_RUNNING = false
223223
, NO_WAIT_FOR_PENDING = setup['no_wait_for_pending']
224+
, COMPATIBLE_35 = setup['compatible_3.5'] || false
224225
, xdr = setup['xdr']
225226
, error = setup['error'] || function() {}
226227
, _is_online = setup['_is_online'] || function() { return 1 }
@@ -357,8 +358,10 @@ function PN_API(setup) {
357358
// Prevent Leaving a Presence Channel
358359
if (channel.indexOf(PRESENCE_SUFFIX) > 0) return true;
359360

361+
if (COMPATIBLE_35 && (!SSL && jsonp == '0')) return false;
362+
360363
// No Leave Patch (Prevent Blocking Leave if Desired)
361-
if (NOLEAVE) return false;
364+
if (!COMPATIBLE_35 && NOLEAVE) return false;
362365

363366
if (jsonp != '0') data['callback'] = jsonp;
364367

0 commit comments

Comments
 (0)