Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
AloqaIM-Android
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
AloqaIM-Android
Commits
db45f422
Commit
db45f422
authored
Sep 19, 2017
by
Filipe de Lima Brito
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update RestApiHelper.kt
parent
7a1137be
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
9 deletions
+7
-9
RestApiHelper.kt
...c/main/java/chat/rocket/android/api/rest/RestApiHelper.kt
+7
-9
No files found.
app/src/main/java/chat/rocket/android/api/rest/RestApiHelper.kt
View file @
db45f422
package
chat.rocket.android.api.rest
import
chat.rocket.android.helper.UrlHelper
import
chat.rocket.core.models.Room
import
okhttp3.HttpUrl
import
okhttp3.Request
...
...
@@ -132,9 +133,8 @@ object RestApiHelper {
* @param hostname The server hostname.
* @return A Rest API URL endpoint.
*/
fun
getEndpointUrlForMessages
(
roomType
:
String
,
hostname
:
String
):
String
=
"https://"
+
hostname
.
replace
(
"http://"
,
""
).
replace
(
"https://"
,
""
)
+
getRestApiUrlForMessages
(
roomType
)
fun
getEndpointUrlForMessages
(
roomType
:
String
,
hostname
:
String
):
String
=
UrlHelper
.
getSafeHostname
(
hostname
)
+
getRestApiUrlForMessages
(
roomType
)
/**
* Returns a Rest API endpoint URL for file list accordingly with the room type and the server hostname.
...
...
@@ -143,9 +143,8 @@ object RestApiHelper {
* @param hostname The server hostname.
* @return A Rest API URL endpoint.
*/
fun
getEndpointUrlForFileList
(
roomType
:
String
,
hostname
:
String
):
String
=
"https://"
+
hostname
.
replace
(
"http://"
,
""
).
replace
(
"https://"
,
""
)
+
getRestApiUrlForFileList
(
roomType
)
fun
getEndpointUrlForFileList
(
roomType
:
String
,
hostname
:
String
):
String
=
UrlHelper
.
getSafeHostname
(
hostname
)
+
getRestApiUrlForFileList
(
roomType
)
/**
* Returns a Rest API endpoint URL for member list accordingly with the room type and the server hostname.
...
...
@@ -154,9 +153,8 @@ object RestApiHelper {
* @param hostname The server hostname.
* @return A Rest API URL endpoint.
*/
fun
getEndpointUrlForMemberList
(
roomType
:
String
,
hostname
:
String
):
String
=
"https://"
+
hostname
.
replace
(
"http://"
,
""
).
replace
(
"https://"
,
""
)
+
getRestApiUrlForMemberList
(
roomType
)
fun
getEndpointUrlForMemberList
(
roomType
:
String
,
hostname
:
String
):
String
=
UrlHelper
.
getSafeHostname
(
hostname
)
+
getRestApiUrlForMemberList
(
roomType
)
/**
* Returns the correspondent Rest API URL accordingly with the room type to get its favorite or pinned messages.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment