Commit db45f422 authored by Filipe de Lima Brito's avatar Filipe de Lima Brito

Update RestApiHelper.kt

parent 7a1137be
package chat.rocket.android.api.rest package chat.rocket.android.api.rest
import chat.rocket.android.helper.UrlHelper
import chat.rocket.core.models.Room import chat.rocket.core.models.Room
import okhttp3.HttpUrl import okhttp3.HttpUrl
import okhttp3.Request import okhttp3.Request
...@@ -132,9 +133,8 @@ object RestApiHelper { ...@@ -132,9 +133,8 @@ object RestApiHelper {
* @param hostname The server hostname. * @param hostname The server hostname.
* @return A Rest API URL endpoint. * @return A Rest API URL endpoint.
*/ */
fun getEndpointUrlForMessages(roomType: String, hostname: String): String = "https://" + fun getEndpointUrlForMessages(roomType: String, hostname: String): String =
hostname.replace("http://", "").replace("https://", "") + UrlHelper.getSafeHostname(hostname) + getRestApiUrlForMessages(roomType)
getRestApiUrlForMessages(roomType)
/** /**
* Returns a Rest API endpoint URL for file list accordingly with the room type and the server hostname. * Returns a Rest API endpoint URL for file list accordingly with the room type and the server hostname.
...@@ -143,9 +143,8 @@ object RestApiHelper { ...@@ -143,9 +143,8 @@ object RestApiHelper {
* @param hostname The server hostname. * @param hostname The server hostname.
* @return A Rest API URL endpoint. * @return A Rest API URL endpoint.
*/ */
fun getEndpointUrlForFileList(roomType: String, hostname: String): String = "https://" + fun getEndpointUrlForFileList(roomType: String, hostname: String): String =
hostname.replace("http://", "").replace("https://", "") + UrlHelper.getSafeHostname(hostname) + getRestApiUrlForFileList(roomType)
getRestApiUrlForFileList(roomType)
/** /**
* Returns a Rest API endpoint URL for member list accordingly with the room type and the server hostname. * Returns a Rest API endpoint URL for member list accordingly with the room type and the server hostname.
...@@ -154,9 +153,8 @@ object RestApiHelper { ...@@ -154,9 +153,8 @@ object RestApiHelper {
* @param hostname The server hostname. * @param hostname The server hostname.
* @return A Rest API URL endpoint. * @return A Rest API URL endpoint.
*/ */
fun getEndpointUrlForMemberList(roomType: String, hostname: String): String = "https://" + fun getEndpointUrlForMemberList(roomType: String, hostname: String): String =
hostname.replace("http://", "").replace("https://", "") + UrlHelper.getSafeHostname(hostname) + getRestApiUrlForMemberList(roomType)
getRestApiUrlForMemberList(roomType)
/** /**
* Returns the correspondent Rest API URL accordingly with the room type to get its favorite or pinned messages. * Returns the correspondent Rest API URL accordingly with the room type to get its favorite or pinned messages.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment