Skip to content

Commit c8f6068

Browse files
author
Devendra
committed
backwards compatiblity flag
1 parent 83fbb28 commit c8f6068

20 files changed

Lines changed: 395 additions & 369 deletions

File tree

core/pubnub-common.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -357,10 +357,12 @@ function PN_API(setup) {
357357
// Prevent Leaving a Presence Channel
358358
if (channel.indexOf(PRESENCE_SUFFIX) > 0) return true;
359359

360-
if (COMPATIBLE_35 && (!SSL && jsonp == '0')) return false;
361-
362-
// No Leave Patch (Prevent Blocking Leave if Desired)
363-
if (!COMPATIBLE_35 && NOLEAVE) return false;
360+
if (COMPATIBLE_35) {
361+
if (!SSL) return false;
362+
if (jsonp == '0') return false;
363+
}
364+
365+
if (NOLEAVE) return false;
364366

365367
if (jsonp != '0') data['callback'] = jsonp;
366368

modern/pubnub.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -358,10 +358,12 @@ function PN_API(setup) {
358358
// Prevent Leaving a Presence Channel
359359
if (channel.indexOf(PRESENCE_SUFFIX) > 0) return true;
360360

361-
if (COMPATIBLE_35 && (!SSL && jsonp == '0')) return false;
362-
363-
// No Leave Patch (Prevent Blocking Leave if Desired)
364-
if (!COMPATIBLE_35 && NOLEAVE) return false;
361+
if (COMPATIBLE_35) {
362+
if (!SSL) return false;
363+
if (jsonp == '0') return false;
364+
}
365+
366+
if (NOLEAVE) return false;
365367

366368
if (jsonp != '0') data['callback'] = jsonp;
367369

modern/pubnub.min.js

Lines changed: 56 additions & 56 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: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -358,10 +358,12 @@ function PN_API(setup) {
358358
// Prevent Leaving a Presence Channel
359359
if (channel.indexOf(PRESENCE_SUFFIX) > 0) return true;
360360

361-
if (COMPATIBLE_35 && (!SSL && jsonp == '0')) return false;
362-
363-
// No Leave Patch (Prevent Blocking Leave if Desired)
364-
if (!COMPATIBLE_35 && NOLEAVE) return false;
361+
if (COMPATIBLE_35) {
362+
if (!SSL) return false;
363+
if (jsonp == '0') return false;
364+
}
365+
366+
if (NOLEAVE) return false;
365367

366368
if (jsonp != '0') data['callback'] = jsonp;
367369

phonegap/pubnub.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -358,10 +358,12 @@ function PN_API(setup) {
358358
// Prevent Leaving a Presence Channel
359359
if (channel.indexOf(PRESENCE_SUFFIX) > 0) return true;
360360

361-
if (COMPATIBLE_35 && (!SSL && jsonp == '0')) return false;
362-
363-
// No Leave Patch (Prevent Blocking Leave if Desired)
364-
if (!COMPATIBLE_35 && NOLEAVE) return false;
361+
if (COMPATIBLE_35) {
362+
if (!SSL) return false;
363+
if (jsonp == '0') return false;
364+
}
365+
366+
if (NOLEAVE) return false;
365367

366368
if (jsonp != '0') data['callback'] = jsonp;
367369

phonegap/pubnub.min.js

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

sencha/pubnub.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -358,10 +358,12 @@ function PN_API(setup) {
358358
// Prevent Leaving a Presence Channel
359359
if (channel.indexOf(PRESENCE_SUFFIX) > 0) return true;
360360

361-
if (COMPATIBLE_35 && (!SSL && jsonp == '0')) return false;
362-
363-
// No Leave Patch (Prevent Blocking Leave if Desired)
364-
if (!COMPATIBLE_35 && NOLEAVE) return false;
361+
if (COMPATIBLE_35) {
362+
if (!SSL) return false;
363+
if (jsonp == '0') return false;
364+
}
365+
366+
if (NOLEAVE) return false;
365367

366368
if (jsonp != '0') data['callback'] = jsonp;
367369

sencha/pubnub.min.js

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

smart-tv/pubnub.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -508,10 +508,12 @@ function PN_API(setup) {
508508
// Prevent Leaving a Presence Channel
509509
if (channel.indexOf(PRESENCE_SUFFIX) > 0) return true;
510510

511-
if (COMPATIBLE_35 && (!SSL && jsonp == '0')) return false;
512-
513-
// No Leave Patch (Prevent Blocking Leave if Desired)
514-
if (!COMPATIBLE_35 && NOLEAVE) return false;
511+
if (COMPATIBLE_35) {
512+
if (!SSL) return false;
513+
if (jsonp == '0') return false;
514+
}
515+
516+
if (NOLEAVE) return false;
515517

516518
if (jsonp != '0') data['callback'] = jsonp;
517519

smart-tv/pubnub.min.js

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

0 commit comments

Comments
 (0)