@@ -36,8 +36,6 @@ public class Publish extends Endpoint<List<Object>, PNPublishResult> {
3636 @ Setter
3737 private Boolean replicate ;
3838 @ Setter
39- private Boolean storeInHistory ;
40- @ Setter
4139 private Integer ttl ;
4240
4341 private PublishSequenceManager publishSequenceManager ;
@@ -47,7 +45,7 @@ public Publish(PubNub pubnub, PublishSequenceManager providedPublishSequenceMana
4745
4846 this .publishSequenceManager = providedPublishSequenceManager ;
4947 this .replicate = true ;
50- this .storeInHistory = true ;
48+ this .shouldStore = true ;
5149 }
5250
5351 @ Override
@@ -64,9 +62,6 @@ protected final void validateParams() throws PubNubException {
6462 if (this .getPubnub ().getConfiguration ().getPublishKey () == null || this .getPubnub ().getConfiguration ().getPublishKey ().isEmpty ()) {
6563 throw PubNubException .builder ().pubnubError (PubNubErrorBuilder .PNERROBJ_PUBLISH_KEY_MISSING ).build ();
6664 }
67- // if (storeInHistory && ttl == null) {
68- //
69- // }
7065 }
7166
7267 @ Override
@@ -94,6 +89,9 @@ protected final Call<List<Object>> doWork(Map<String, String> params) throws Pub
9489 if (shouldStore != null ) {
9590 if (shouldStore ) {
9691 params .put ("store" , "1" );
92+ if (ttl != null ) {
93+ params .put ("ttl" , String .valueOf (ttl ));
94+ }
9795 } else {
9896 params .put ("store" , "0" );
9997 }
@@ -105,9 +103,6 @@ protected final Call<List<Object>> doWork(Map<String, String> params) throws Pub
105103 params .put ("norep" , "true" );
106104 }
107105
108- if (storeInHistory && ttl != null ) {
109- params .put ("ttl" , String .valueOf (ttl ));
110- }
111106
112107 if (this .getPubnub ().getConfiguration ().getCipherKey () != null ) {
113108 Crypto crypto = new Crypto (this .getPubnub ().getConfiguration ().getCipherKey ());
0 commit comments