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
7444b8ee
Commit
7444b8ee
authored
Sep 18, 2017
by
Filipe de Lima Brito
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update RestApiHelper.kt
parent
4769b391
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
8 deletions
+7
-8
RestApiHelper.kt
...c/main/java/chat/rocket/android/api/rest/RestApiHelper.kt
+7
-8
No files found.
app/src/main/java/chat/rocket/android/api/rest/RestApiHelper.kt
View file @
7444b8ee
...
@@ -136,28 +136,27 @@ object RestApiHelper {
...
@@ -136,28 +136,27 @@ object RestApiHelper {
hostname
.
replace
(
"http://"
,
""
).
replace
(
"https://"
,
""
)
+
hostname
.
replace
(
"http://"
,
""
).
replace
(
"https://"
,
""
)
+
getRestApiUrlForMessages
(
roomType
)
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 roomType The type of the room.
* @param hostname The server hostname.
* @param hostname The server hostname.
* @return A Rest API URL endpoint.
* @return A Rest API URL endpoint.
*/
*/
fun
getEndpointUrlFor
Member
List
(
roomType
:
String
,
hostname
:
String
):
String
=
"https://"
+
fun
getEndpointUrlFor
File
List
(
roomType
:
String
,
hostname
:
String
):
String
=
"https://"
+
hostname
.
replace
(
"http://"
,
""
).
replace
(
"https://"
,
""
)
+
hostname
.
replace
(
"http://"
,
""
).
replace
(
"https://"
,
""
)
+
getRestApiUrlFor
Member
List
(
roomType
)
getRestApiUrlFor
File
List
(
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 roomType The type of the room.
* @param hostname The server hostname.
* @param hostname The server hostname.
* @return A Rest API URL endpoint.
* @return A Rest API URL endpoint.
*/
*/
fun
getEndpointUrlFor
File
List
(
roomType
:
String
,
hostname
:
String
):
String
=
"https://"
+
fun
getEndpointUrlFor
Member
List
(
roomType
:
String
,
hostname
:
String
):
String
=
"https://"
+
hostname
.
replace
(
"http://"
,
""
).
replace
(
"https://"
,
""
)
+
hostname
.
replace
(
"http://"
,
""
).
replace
(
"https://"
,
""
)
+
getRestApiUrlFor
File
List
(
roomType
)
getRestApiUrlFor
Member
List
(
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.
...
@@ -197,7 +196,7 @@ object RestApiHelper {
...
@@ -197,7 +196,7 @@ object RestApiHelper {
* @param roomType The type of the room.
* @param roomType The type of the room.
* @return A Rest API URL or null if the room type does not match.
* @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
var
restApiUrl
:
String
?
=
null
when
(
roomType
)
{
when
(
roomType
)
{
Room
.
TYPE_CHANNEL
->
restApiUrl
=
"/api/v1/channels.members"
Room
.
TYPE_CHANNEL
->
restApiUrl
=
"/api/v1/channels.members"
...
...
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