Commit 7444b8ee authored by Filipe de Lima Brito's avatar Filipe de Lima Brito

Update RestApiHelper.kt

parent 4769b391
......@@ -136,28 +136,27 @@ object RestApiHelper {
hostname.replace("http://", "").replace("https://", "") +
getRestApiUrlForMessages(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 file list accordingly with the room type and the server hostname.
*
* @param roomType The type of the room.
* @param hostname The server hostname.
* @return A Rest API URL endpoint.
*/
fun getEndpointUrlForMemberList(roomType: String, hostname: String): String = "https://" +
fun getEndpointUrlForFileList(roomType: String, hostname: String): String = "https://" +
hostname.replace("http://", "").replace("https://", "") +
getRestApiUrlForMemberList(roomType)
getRestApiUrlForFileList(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 member list accordingly with the room type and the server hostname.
*
* @param roomType The type of the room.
* @param hostname The server hostname.
* @return A Rest API URL endpoint.
*/
fun getEndpointUrlForFileList(roomType: String, hostname: String): String = "https://" +
fun getEndpointUrlForMemberList(roomType: String, hostname: String): String = "https://" +
hostname.replace("http://", "").replace("https://", "") +
getRestApiUrlForFileList(roomType)
getRestApiUrlForMemberList(roomType)
/**
* Returns the correspondent Rest API URL accordingly with the room type to get its favorite or pinned messages.
......@@ -197,7 +196,7 @@ object RestApiHelper {
* @param roomType The type of the room.
* @return A Rest API URL or null if the room type does not match.
*/
private fun getRestApiUrlForMemberList(roomType: String): String? {
fun getRestApiUrlForMemberList(roomType: String): String? {
var restApiUrl: String? = null
when (roomType) {
Room.TYPE_CHANNEL -> restApiUrl = "/api/v1/channels.members"
......
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