From e05ee8377efae98d3fcffc28869d7223e2cab303 Mon Sep 17 00:00:00 2001 From: Max Presman Date: Mon, 22 Aug 2016 13:12:45 -0700 Subject: [PATCH 1/6] adjust pn_other parsing --- .../com/pubnub/api/endpoints/History.java | 14 +++- .../api/workers/SubscribeMessageWorker.java | 10 ++- .../api/endpoints/HistoryEndpointTest.java | 19 ++++++ .../api/managers/SubscriptionManagerTest.java | 68 +++++++++++++++++++ 4 files changed, 108 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/pubnub/api/endpoints/History.java b/src/main/java/com/pubnub/api/endpoints/History.java index aee10e607..d8a637a7d 100644 --- a/src/main/java/com/pubnub/api/endpoints/History.java +++ b/src/main/java/com/pubnub/api/endpoints/History.java @@ -130,15 +130,25 @@ protected boolean isAuthRequired() { } private JsonNode processMessage(JsonNode message) throws PubNubException { + // if we do not have a crypto key, there is no way to process the node; let's return. if (this.getPubnub().getConfiguration().getCipherKey() == null) { return message; } Crypto crypto = new Crypto(this.getPubnub().getConfiguration().getCipherKey()); - String outputText = crypto.decrypt(message.asText()); - ObjectMapper mapper = new ObjectMapper(); + String inputText; + String outputText; JsonNode outputObject; + + if (message.isObject() && message.has("pn_other")) { + inputText = message.get("pn_other").asText(); + } else { + inputText = message.asText(); + } + + outputText = crypto.decrypt(inputText); + try { outputObject = mapper.readValue(outputText, JsonNode.class); } catch (IOException e) { diff --git a/src/main/java/com/pubnub/api/workers/SubscribeMessageWorker.java b/src/main/java/com/pubnub/api/workers/SubscribeMessageWorker.java index ea8e0ba16..dd4b94271 100644 --- a/src/main/java/com/pubnub/api/workers/SubscribeMessageWorker.java +++ b/src/main/java/com/pubnub/api/workers/SubscribeMessageWorker.java @@ -58,16 +58,24 @@ private void takeMessage() { } private JsonNode processMessage(final JsonNode input) { + // if we do not have a crypto key, there is no way to process the node; let's return. if (pubnub.getConfiguration().getCipherKey() == null) { return input; } Crypto crypto = new Crypto(pubnub.getConfiguration().getCipherKey()); + String inputText; String outputText; JsonNode outputObject; + if (input.isObject() && input.has("pn_other")) { + inputText = input.get("pn_other").asText(); + } else { + inputText = input.asText(); + } + try { - outputText = crypto.decrypt(input.toString()); + outputText = crypto.decrypt(inputText); } catch (PubNubException e) { PNStatus pnStatus = PNStatus.builder().error(true) .errorData(new PNErrorData(e.getMessage(), e)) diff --git a/src/test/java/com/pubnub/api/endpoints/HistoryEndpointTest.java b/src/test/java/com/pubnub/api/endpoints/HistoryEndpointTest.java index 5b870f749..b5024dc3a 100644 --- a/src/test/java/com/pubnub/api/endpoints/HistoryEndpointTest.java +++ b/src/test/java/com/pubnub/api/endpoints/HistoryEndpointTest.java @@ -162,6 +162,25 @@ public void testSyncEncryptedSuccess() throws IOException, PubNubException { } + @org.junit.Test + public void testSyncEncryptedWithPNOtherSuccess() throws IOException, PubNubException { + pubnub.getConfiguration().setCipherKey("hello"); + + stubFor(get(urlPathEqualTo("/v2/history/sub-key/mySubscribeKey/channel/niceChannel")) + .willReturn(aResponse().withBody("[[{\"pn_other\":\"6QoqmS9CnB3W9+I4mhmL7w==\"}],14606134331557852,14606134485013970]"))); + + PNHistoryResult response = partialHistory.channel("niceChannel").includeTimetoken(false).sync(); + + Assert.assertTrue(response.getStartTimetoken().equals(14606134331557852L)); + Assert.assertTrue(response.getEndTimetoken().equals(14606134485013970L)); + + Assert.assertEquals(response.getMessages().size(), 1); + + Assert.assertEquals(response.getMessages().get(0).getTimetoken(), null); + Assert.assertEquals("hey", response.getMessages().get(0).getEntry().get("text").asText()); + + } + @org.junit.Test public void testSyncSuccessWithoutTimeToken() throws IOException, PubNubException { List testArray = new ArrayList(); diff --git a/src/test/java/com/pubnub/api/managers/SubscriptionManagerTest.java b/src/test/java/com/pubnub/api/managers/SubscriptionManagerTest.java index d94085460..538e47cf3 100644 --- a/src/test/java/com/pubnub/api/managers/SubscriptionManagerTest.java +++ b/src/test/java/com/pubnub/api/managers/SubscriptionManagerTest.java @@ -420,6 +420,74 @@ public void presence(PubNub pubnub, PNPresenceEventResult presence) { } + @Test + public void testSubscribeWithEncryption() { + final AtomicInteger atomic = new AtomicInteger(0); + stubFor(get(urlPathEqualTo("/v2/subscribe/mySubscribeKey/ch2,ch1/0")) + .willReturn(aResponse().withBody("{\"t\":{\"t\":\"14718972508742569\",\"r\":1},\"m\":[{\"a\":\"4\",\"f\":512,\"i\":\"ff374d0b-b866-40db-9ced-42d205bb808b\",\"p\":{\"t\":\"14718972508739738\",\"r\":1},\"k\":\"demo-36\",\"c\":\"max_ch1\",\"d\":\"6QoqmS9CnB3W9+I4mhmL7w==\"}]}"))); + + pubnub.getConfiguration().setCipherKey("hello"); + + pubnub.addListener(new SubscribeCallback() { + @Override + public void status(PubNub pubnub, PNStatus status) { + } + + @Override + public void message(PubNub pubnub, PNMessageResult message) { + List requests = findAll(getRequestedFor(urlMatching("/v2/subscribe.*"))); + assertTrue(requests.size() > 0); + assertEquals("hey", message.getMessage().get("text").asText()); + atomic.addAndGet(1); + } + + @Override + public void presence(PubNub pubnub, PNPresenceEventResult presence) { + } + }); + + + pubnub.subscribe().channels(Arrays.asList("ch1", "ch2")).execute(); + + Awaitility.await().atMost(5, TimeUnit.SECONDS) + .untilAtomic(atomic, org.hamcrest.Matchers.greaterThan(0)); + + } + + @Test + public void testSubscribeWithEncryptionPNOther() { + final AtomicInteger atomic = new AtomicInteger(0); + stubFor(get(urlPathEqualTo("/v2/subscribe/mySubscribeKey/ch2,ch1/0")) + .willReturn(aResponse().withBody("{\"t\":{\"t\":\"14718972508742569\",\"r\":1},\"m\":[{\"a\":\"4\",\"f\":512,\"i\":\"ff374d0b-b866-40db-9ced-42d205bb808b\",\"p\":{\"t\":\"14718972508739738\",\"r\":1},\"k\":\"demo-36\",\"c\":\"max_ch1\",\"d\":{\"pn_other\":\"6QoqmS9CnB3W9+I4mhmL7w==\"}}]}"))); + + pubnub.getConfiguration().setCipherKey("hello"); + + pubnub.addListener(new SubscribeCallback() { + @Override + public void status(PubNub pubnub, PNStatus status) { + } + + @Override + public void message(PubNub pubnub, PNMessageResult message) { + List requests = findAll(getRequestedFor(urlMatching("/v2/subscribe.*"))); + assertTrue(requests.size() > 0); + assertEquals("hey", message.getMessage().get("text").asText()); + atomic.addAndGet(1); + } + + @Override + public void presence(PubNub pubnub, PNPresenceEventResult presence) { + } + }); + + + pubnub.subscribe().channels(Arrays.asList("ch1", "ch2")).execute(); + + Awaitility.await().atMost(5, TimeUnit.SECONDS) + .untilAtomic(atomic, org.hamcrest.Matchers.greaterThan(0)); + + } + @Test public void testSubscribePresenceBuilder() { final AtomicInteger atomic = new AtomicInteger(0); From c9a7fc7f5139404496d5b903274a445b32fba8ba Mon Sep 17 00:00:00 2001 From: Max Presman Date: Mon, 22 Aug 2016 16:43:03 -0700 Subject: [PATCH 2/6] 4.0.9 --- .pubnub.yml | 9 ++++++++- CHANGELOG.md | 14 ++++++++++++++ VERSION | 1 - build.gradle | 11 ++++++----- src/main/java/com/pubnub/api/PubNub.java | 2 +- src/test/java/com/pubnub/api/PubNubTest.java | 2 +- 6 files changed, 30 insertions(+), 9 deletions(-) delete mode 100644 VERSION diff --git a/.pubnub.yml b/.pubnub.yml index cdc3657c3..86a213829 100644 --- a/.pubnub.yml +++ b/.pubnub.yml @@ -1,8 +1,15 @@ name: java -version: 4.0.8 +version: 4.0.9 schema: 1 scm: github.com/pubnub/java changelog: + - version: v4.0.9 + date: + changes: + - type: improvement + text: adjustments for handling pn_other and decryption + - type: improvement + text: retrofit version bumps. - version: v4.0.8 date: changes: diff --git a/CHANGELOG.md b/CHANGELOG.md index f8ba805bc..897a535d7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,18 @@ +## [v4.0.9](https://github.com/pubnub/java/tree/v4.0.9) + + + [Full Changelog](https://github.com/pubnub/java/compare/v4.0.8...v4.0.9) + + +- ⭐adjustments for handling pn_other and decryption + + + +- ⭐retrofit version bumps. + + + ## [v4.0.8](https://github.com/pubnub/java/tree/v4.0.8) diff --git a/VERSION b/VERSION deleted file mode 100644 index a7d0a2eda..000000000 --- a/VERSION +++ /dev/null @@ -1 +0,0 @@ -4.0.8 \ No newline at end of file diff --git a/build.gradle b/build.gradle index 36324df65..720a6fb8e 100644 --- a/build.gradle +++ b/build.gradle @@ -1,7 +1,8 @@ plugins { - id 'io.franzbecker.gradle-lombok' version '1.6' + id "io.franzbecker.gradle-lombok" version "1.7" id 'com.github.johnrengelman.shadow' version '1.2.3' id "com.bmuschko.nexus" version "2.3.1" + id 'com.github.ben-manes.versions' version '0.13.0' id 'java' id 'jacoco' id 'maven' @@ -9,7 +10,7 @@ plugins { id 'findbugs' } group = 'com.pubnub' -version = '4.0.8' +version = '4.0.9' description = """""" @@ -27,11 +28,11 @@ repositories { } dependencies { - compile group: 'com.squareup.retrofit2', name: 'retrofit', version:'2.0.2' + compile group: 'com.squareup.retrofit2', name: 'retrofit', version:'2.1.0' compile group: 'com.fasterxml.jackson.core', name: 'jackson-core', version:'2.7.3' compile group: 'com.fasterxml.jackson.core', name: 'jackson-annotations', version:'2.7.3' - compile group: 'com.squareup.retrofit2', name: 'converter-jackson', version:'2.0.2' - compile group: 'com.squareup.okhttp3', name: 'logging-interceptor', version:'3.2.0' + compile group: 'com.squareup.retrofit2', name: 'converter-jackson', version:'2.1.0' + compile group: 'com.squareup.okhttp3', name: 'logging-interceptor', version:'3.4.1' compile group: 'org.slf4j', name: 'slf4j-nop', version:'1.7.21' testCompile group: 'ch.qos.logback', name: 'logback-classic', version:'1.1.7' diff --git a/src/main/java/com/pubnub/api/PubNub.java b/src/main/java/com/pubnub/api/PubNub.java index 0114f32ba..f6a82f984 100644 --- a/src/main/java/com/pubnub/api/PubNub.java +++ b/src/main/java/com/pubnub/api/PubNub.java @@ -54,7 +54,7 @@ public class PubNub { private static final int TIMESTAMP_DIVIDER = 1000; private static final int MAX_SEQUENCE = 65535; - private static final String SDK_VERSION = "4.0.8"; + private static final String SDK_VERSION = "4.0.9"; public PubNub(final PNConfiguration initialConfig) { this.configuration = initialConfig; diff --git a/src/test/java/com/pubnub/api/PubNubTest.java b/src/test/java/com/pubnub/api/PubNubTest.java index eb07719c3..c73e749ea 100644 --- a/src/test/java/com/pubnub/api/PubNubTest.java +++ b/src/test/java/com/pubnub/api/PubNubTest.java @@ -91,7 +91,7 @@ public void GetVersionAndTimeStamp() throws PubNubException { pubnub = new PubNub(pnConfiguration); String version = pubnub.getVersion(); int timeStamp = pubnub.getTimestamp(); - Assert.assertEquals("4.0.8", version); + Assert.assertEquals("4.0.9", version); Assert.assertTrue(timeStamp > 0); } From 53e628702ff5167782131cb68525b27dce98573e Mon Sep 17 00:00:00 2001 From: Max Presman Date: Tue, 23 Aug 2016 16:05:02 -0700 Subject: [PATCH 3/6] adjust pn_other decryption --- src/main/java/com/pubnub/api/endpoints/History.java | 8 ++++++++ .../com/pubnub/api/workers/SubscribeMessageWorker.java | 8 ++++++++ .../com/pubnub/api/endpoints/HistoryEndpointTest.java | 6 +++--- .../com/pubnub/api/managers/SubscriptionManagerTest.java | 2 +- 4 files changed, 20 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/pubnub/api/endpoints/History.java b/src/main/java/com/pubnub/api/endpoints/History.java index d8a637a7d..94f12505c 100644 --- a/src/main/java/com/pubnub/api/endpoints/History.java +++ b/src/main/java/com/pubnub/api/endpoints/History.java @@ -3,6 +3,7 @@ import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.node.ArrayNode; +import com.fasterxml.jackson.databind.node.ObjectNode; import com.pubnub.api.vendor.Crypto; import com.pubnub.api.PubNub; import com.pubnub.api.PubNubException; @@ -155,6 +156,13 @@ private JsonNode processMessage(JsonNode message) throws PubNubException { throw PubNubException.builder().pubnubError(PubNubErrorBuilder.PNERROBJ_PARSING_ERROR).errormsg(e.getMessage()).build(); } + // inject the decoded resposne into the payload + if (message.isObject() && message.has("pn_other")) { + ObjectNode objectNode = (ObjectNode) message; + objectNode.set("pn_other", outputObject); + outputObject = objectNode; + } + return outputObject; } diff --git a/src/main/java/com/pubnub/api/workers/SubscribeMessageWorker.java b/src/main/java/com/pubnub/api/workers/SubscribeMessageWorker.java index dd4b94271..bf9cc977b 100644 --- a/src/main/java/com/pubnub/api/workers/SubscribeMessageWorker.java +++ b/src/main/java/com/pubnub/api/workers/SubscribeMessageWorker.java @@ -2,6 +2,7 @@ import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.node.ObjectNode; import com.pubnub.api.PubNub; import com.pubnub.api.PubNubException; import com.pubnub.api.enums.PNOperationType; @@ -100,6 +101,13 @@ private JsonNode processMessage(final JsonNode input) { return null; } + // inject the decoded response into the payload + if (input.isObject() && input.has("pn_other")) { + ObjectNode objectNode = (ObjectNode) input; + objectNode.set("pn_other", outputObject); + outputObject = objectNode; + } + return outputObject; } diff --git a/src/test/java/com/pubnub/api/endpoints/HistoryEndpointTest.java b/src/test/java/com/pubnub/api/endpoints/HistoryEndpointTest.java index b5024dc3a..28ea0c4de 100644 --- a/src/test/java/com/pubnub/api/endpoints/HistoryEndpointTest.java +++ b/src/test/java/com/pubnub/api/endpoints/HistoryEndpointTest.java @@ -177,7 +177,7 @@ public void testSyncEncryptedWithPNOtherSuccess() throws IOException, PubNubExce Assert.assertEquals(response.getMessages().size(), 1); Assert.assertEquals(response.getMessages().get(0).getTimetoken(), null); - Assert.assertEquals("hey", response.getMessages().get(0).getEntry().get("text").asText()); + Assert.assertEquals("hey", response.getMessages().get(0).getEntry().get("pn_other").get("text").asText()); } @@ -188,11 +188,11 @@ public void testSyncSuccessWithoutTimeToken() throws IOException, PubNubExceptio ObjectMapper mapper = new ObjectMapper(); - Map historyItem1 = new HashMap(); + Map historyItem1 = new HashMap<>(); historyItem1.put("a", 11); historyItem1.put("b", 22); - Map historyItem2 = new HashMap(); + Map historyItem2 = new HashMap<>(); historyItem2.put("a", 33); historyItem2.put("b", 44); diff --git a/src/test/java/com/pubnub/api/managers/SubscriptionManagerTest.java b/src/test/java/com/pubnub/api/managers/SubscriptionManagerTest.java index 538e47cf3..ef444b298 100644 --- a/src/test/java/com/pubnub/api/managers/SubscriptionManagerTest.java +++ b/src/test/java/com/pubnub/api/managers/SubscriptionManagerTest.java @@ -471,7 +471,7 @@ public void status(PubNub pubnub, PNStatus status) { public void message(PubNub pubnub, PNMessageResult message) { List requests = findAll(getRequestedFor(urlMatching("/v2/subscribe.*"))); assertTrue(requests.size() > 0); - assertEquals("hey", message.getMessage().get("text").asText()); + assertEquals("hey", message.getMessage().get("pn_other").get("text").asText()); atomic.addAndGet(1); } From 5f2334a083da635de5110fd9c312f9ad52be1d12 Mon Sep 17 00:00:00 2001 From: Max Presman Date: Fri, 26 Aug 2016 21:25:28 -0700 Subject: [PATCH 4/6] associated_channel_on_subscribe --- src/main/java/com/pubnub/api/PubNubUtil.java | 9 ++++++++ .../consumer/pubsub/PNMessageResult.java | 7 +++++++ .../pubsub/PNPresenceEventResult.java | 6 ++++++ .../api/models/server/SubscribeMessage.java | 2 +- .../api/workers/SubscribeMessageWorker.java | 21 ++++++++++++++++++- 5 files changed, 43 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/pubnub/api/PubNubUtil.java b/src/main/java/com/pubnub/api/PubNubUtil.java index 56a089d5e..49b2d2175 100644 --- a/src/main/java/com/pubnub/api/PubNubUtil.java +++ b/src/main/java/com/pubnub/api/PubNubUtil.java @@ -132,4 +132,13 @@ public static String signSHA256(final String key, final String data) throws PubN return new String(Base64.encode(hmacData, 0), Charset.forName("UTF-8")).replace('+', '-').replace('/', '_'); } + public static String replaceLast(String string, String toReplace, String replacement) { + int pos = string.lastIndexOf(toReplace); + if (pos > -1) { + return string.substring(0, pos).concat(replacement).concat(string.substring(pos + toReplace.length(), string.length())); + } else { + return string; + } + } + } diff --git a/src/main/java/com/pubnub/api/models/consumer/pubsub/PNMessageResult.java b/src/main/java/com/pubnub/api/models/consumer/pubsub/PNMessageResult.java index 99ab46218..93682b092 100644 --- a/src/main/java/com/pubnub/api/models/consumer/pubsub/PNMessageResult.java +++ b/src/main/java/com/pubnub/api/models/consumer/pubsub/PNMessageResult.java @@ -10,9 +10,16 @@ public class PNMessageResult { private JsonNode message; + @Deprecated private String subscribedChannel; + @Deprecated private String actualChannel; + + private String channel; + private String channelGroup; + private Long timetoken; private Object userMetadata; } + diff --git a/src/main/java/com/pubnub/api/models/consumer/pubsub/PNPresenceEventResult.java b/src/main/java/com/pubnub/api/models/consumer/pubsub/PNPresenceEventResult.java index 82eae4283..00254975a 100644 --- a/src/main/java/com/pubnub/api/models/consumer/pubsub/PNPresenceEventResult.java +++ b/src/main/java/com/pubnub/api/models/consumer/pubsub/PNPresenceEventResult.java @@ -15,8 +15,14 @@ public class PNPresenceEventResult { private Integer occupancy; private JsonNode state; + @Deprecated private String subscribedChannel; + @Deprecated private String actualChannel; + + private String channel; + private String channelGroup; + private Long timetoken; private Object userMetadata; diff --git a/src/main/java/com/pubnub/api/models/server/SubscribeMessage.java b/src/main/java/com/pubnub/api/models/server/SubscribeMessage.java index 437f032f1..cfbfa99f1 100644 --- a/src/main/java/com/pubnub/api/models/server/SubscribeMessage.java +++ b/src/main/java/com/pubnub/api/models/server/SubscribeMessage.java @@ -13,7 +13,7 @@ public class SubscribeMessage { private String shard; @JsonProperty("b") - private String subscriptionMatch; // will contain channel group; or channel if user subscribed to channel + private String subscriptionMatch; @JsonProperty("c") private String channel; diff --git a/src/main/java/com/pubnub/api/workers/SubscribeMessageWorker.java b/src/main/java/com/pubnub/api/workers/SubscribeMessageWorker.java index bf9cc977b..f04ee0f71 100644 --- a/src/main/java/com/pubnub/api/workers/SubscribeMessageWorker.java +++ b/src/main/java/com/pubnub/api/workers/SubscribeMessageWorker.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.databind.node.ObjectNode; import com.pubnub.api.PubNub; import com.pubnub.api.PubNubException; +import com.pubnub.api.PubNubUtil; import com.pubnub.api.enums.PNOperationType; import com.pubnub.api.enums.PNStatusCategory; import com.pubnub.api.managers.ListenerManager; @@ -120,13 +121,27 @@ private void processIncomingPayload(final SubscribeMessage message) { subscriptionMatch = null; } - if (message.getChannel().contains("-pnpres")) { + if (message.getChannel().endsWith("-pnpres")) { PresenceEnvelope presencePayload = mapper.convertValue(message.getPayload(), PresenceEnvelope.class); + String associatedChannel = message.getChannel(); + String associatedChannelGroup = message.getSubscriptionMatch(); + + if (associatedChannel != null) { + associatedChannel = PubNubUtil.replaceLast(associatedChannel, "-pnpres", ""); + } + if (associatedChannelGroup != null) { + associatedChannelGroup = PubNubUtil.replaceLast(associatedChannelGroup, "-pnpres", ""); + } + PNPresenceEventResult pnPresenceEventResult = PNPresenceEventResult.builder() .event(presencePayload.getAction()) + // deprecated .actualChannel((subscriptionMatch != null) ? channel : null) .subscribedChannel(subscriptionMatch != null ? subscriptionMatch : channel) + // deprecated + .channel(associatedChannel) + .channelGroup(associatedChannelGroup) .state(presencePayload.getData()) .timetoken(publishMetaData.getPublishTimetoken()) .occupancy(presencePayload.getOccupancy()) @@ -144,8 +159,12 @@ private void processIncomingPayload(final SubscribeMessage message) { PNMessageResult pnMessageResult = PNMessageResult.builder() .message(extractedMessage) + // deprecated .actualChannel((subscriptionMatch != null) ? channel : null) .subscribedChannel(subscriptionMatch != null ? subscriptionMatch : channel) + // deprecated + .channel(channel) + .channelGroup(subscriptionMatch) .timetoken(publishMetaData.getPublishTimetoken()) .build(); From eaf3fdd0245352f7d542f0b754cb1831b634940a Mon Sep 17 00:00:00 2001 From: Max Presman Date: Wed, 7 Sep 2016 13:32:51 -0700 Subject: [PATCH 5/6] 4.0.10 --- .pubnub.yml | 7 ++++++- CHANGELOG.md | 10 ++++++++++ build.gradle | 2 +- src/main/java/com/pubnub/api/PubNub.java | 2 +- 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/.pubnub.yml b/.pubnub.yml index c7f0b1b43..f2de2cd64 100644 --- a/.pubnub.yml +++ b/.pubnub.yml @@ -1,8 +1,13 @@ name: java -version: 4.0.9 +version: 4.0.10 schema: 1 scm: github.com/pubnub/java changelog: + - version: v4.0.10 + date: + changes: + - type: improvement + text: adding channel / channelGroup fields when a message / presence event comes in. - version: v4.0.9 date: changes: diff --git a/CHANGELOG.md b/CHANGELOG.md index 897a535d7..6d475e9fb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,14 @@ +## [v4.0.10](https://github.com/pubnub/java/tree/v4.0.10) + + + [Full Changelog](https://github.com/pubnub/java/compare/v4.0.9...v4.0.10) + + +- ⭐adding channel / channelGroup fields when a message / presence event comes in. + + + ## [v4.0.9](https://github.com/pubnub/java/tree/v4.0.9) diff --git a/build.gradle b/build.gradle index 720a6fb8e..d8fc5a90b 100644 --- a/build.gradle +++ b/build.gradle @@ -10,7 +10,7 @@ plugins { id 'findbugs' } group = 'com.pubnub' -version = '4.0.9' +version = '4.0.10' description = """""" diff --git a/src/main/java/com/pubnub/api/PubNub.java b/src/main/java/com/pubnub/api/PubNub.java index f6a82f984..d32049484 100644 --- a/src/main/java/com/pubnub/api/PubNub.java +++ b/src/main/java/com/pubnub/api/PubNub.java @@ -54,7 +54,7 @@ public class PubNub { private static final int TIMESTAMP_DIVIDER = 1000; private static final int MAX_SEQUENCE = 65535; - private static final String SDK_VERSION = "4.0.9"; + private static final String SDK_VERSION = "4.0.10"; public PubNub(final PNConfiguration initialConfig) { this.configuration = initialConfig; From 2e089bf517ea66f62a91133bb48c5cbbc70ea734 Mon Sep 17 00:00:00 2001 From: Max Presman Date: Wed, 7 Sep 2016 13:47:57 -0700 Subject: [PATCH 6/6] bump up version --- src/test/java/com/pubnub/api/PubNubTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/java/com/pubnub/api/PubNubTest.java b/src/test/java/com/pubnub/api/PubNubTest.java index c73e749ea..90797efe5 100644 --- a/src/test/java/com/pubnub/api/PubNubTest.java +++ b/src/test/java/com/pubnub/api/PubNubTest.java @@ -91,7 +91,7 @@ public void GetVersionAndTimeStamp() throws PubNubException { pubnub = new PubNub(pnConfiguration); String version = pubnub.getVersion(); int timeStamp = pubnub.getTimestamp(); - Assert.assertEquals("4.0.9", version); + Assert.assertEquals("4.0.10", version); Assert.assertTrue(timeStamp > 0); }