Skip to content

Commit

Permalink
Merge pull request RocketChat#168 from RocketChat/fix/pin-message-sho…
Browse files Browse the repository at this point in the history
…uld-return-nothing

[FIX] Pin a message should return nothing
  • Loading branch information
rafaelks authored May 18, 2018
2 parents e19e551 + 4009bf2 commit 605aa1b
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions core/src/main/kotlin/chat/rocket/core/internal/rest/Message.kt
Original file line number Diff line number Diff line change
Expand Up @@ -178,16 +178,16 @@ suspend fun RocketChatClient.unstarMessage(messageId: String) {
*
* @param messageId The message id to pin.
*/
suspend fun RocketChatClient.pinMessage(messageId: String): Message = withContext(CommonPool) {
val body = FormBody.Builder().add("messageId", messageId).build()
suspend fun RocketChatClient.pinMessage(messageId: String) {
withContext(CommonPool) {
val body = FormBody.Builder().add("messageId", messageId).build()

val httpUrl = requestUrl(restUrl, "chat.pinMessage").build()
val httpUrl = requestUrl(restUrl, "chat.pinMessage").build()

val request = requestBuilder(httpUrl).post(body).build()

val type = Types.newParameterizedType(RestResult::class.java, Message::class.java)
val request = requestBuilder(httpUrl).post(body).build()

return@withContext handleRestCall<RestResult<Message>>(request, type).result()
handleRestCall<Any>(request, Any::class.java)
}
}

/**
Expand Down

0 comments on commit 605aa1b

Please sign in to comment.