-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added customMessageType to Publish, Signal, Subscribe, History, File. #302
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Additionally there are some build errors related to missing parameters in JS and iOS in fetchMessages
pubnub-gson/pubnub-gson-impl/src/main/java/com/pubnub/internal/java/PubNubForJavaImpl.kt
Show resolved
Hide resolved
channel.publish( | ||
message = generatePayload(), | ||
customMessageType = expectedCustomMessageType | ||
).await { resutl: Result<PNPublishResult> -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this await could just be .sync()
I think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, I will change it.
@@ -93,6 +98,8 @@ class PublishEndpoint internal constructor( | |||
queryParams["norep"] = true.valueString | |||
} | |||
|
|||
customMessageType?.run { queryParams[CUSTOM_MESSAGE_TYPE_QUERY_PARAM] = this } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: I prefer to use .let { it -> }
in situations when changing the receiver (this
) is not required or beneficial.
For example this could easily be ?.let { queryParams[CUSTOM_MESSAGE_TYPE_QUERY_PARAM] = it }
and then we don't have the this
change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would also use .let but I wanted to be in line with approach used in this method where there are:
meta?.run { queryParams["meta"] = pubnub.mapper.toJson(this) }
shouldStore?.run { queryParams["store"] = this.numericString }
ttl?.run { queryParams["ttl"] = this.toString() }
I will refactor this method to use:
.?.let {}
9488fa7
to
cb101dd
Compare
...e-api/src/commonMain/kotlin/com/pubnub/api/models/consumer/pubsub/files/PNFileEventResult.kt
Show resolved
Hide resolved
only fetchMessages
b1495df
to
2df2968
Compare
No description provided.