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
184abb0b
Commit
184abb0b
authored
Nov 11, 2017
by
Leonardo Aramaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved all references of the demo server to open
parent
8779e638
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
73 additions
and
73 deletions
+73
-73
ServerPolicyHelper.java
...n/java/chat/rocket/android/helper/ServerPolicyHelper.java
+1
-1
strings.xml
app/src/main/res/values/strings.xml
+1
-1
RocketChatCacheTest.kt
...rc/test/kotlin/chat.rocket.android/RocketChatCacheTest.kt
+2
-2
RestApiHelperTest.kt
.../kotlin/chat/rocket/android/api/rest/RestApiHelperTest.kt
+54
-54
UrlHelperTest.kt
...c/test/kotlin/chat/rocket/android/helper/UrlHelperTest.kt
+14
-14
server_row.xml
...t-chat-android-widgets/src/main/res/layout/server_row.xml
+1
-1
No files found.
app/src/main/java/chat/rocket/android/helper/ServerPolicyHelper.java
View file @
184abb0b
...
...
@@ -12,7 +12,7 @@ public class ServerPolicyHelper {
public
static
String
enforceHostname
(
String
hostname
)
{
if
(
hostname
==
null
)
{
return
"
demo
.rocket.chat"
;
return
"
open
.rocket.chat"
;
}
return
removeTrailingSlash
(
removeProtocol
(
enforceDefaultHost
(
hostname
)));
...
...
app/src/main/res/values/strings.xml
View file @
184abb0b
...
...
@@ -48,7 +48,7 @@
<string
name=
"dialog_user_registration_password"
>
Password
</string>
<string
name=
"fragment_home_welcome_message"
>
Welcome to Rocket.Chat.Android\nSelect a channel from the drawer.
</string>
<string
name=
"fragment_input_hostname_hostname"
>
Hostname
</string>
<string
name=
"fragment_input_hostname_server_hint"
>
demo
.rocket.chat
</string>
<string
name=
"fragment_input_hostname_server_hint"
>
open
.rocket.chat
</string>
<string
name=
"fragment_input_hostname_connect"
>
CONNECT
</string>
<string
name=
"fragment_login_username_or_email"
>
Username or email
</string>
<string
name=
"fragment_login_password"
>
Password
</string>
...
...
app/src/test/kotlin/chat.rocket.android/RocketChatCacheTest.kt
View file @
184abb0b
...
...
@@ -27,7 +27,7 @@ class RocketChatCacheTest {
@Test
fun
getServerList_ShouldReturnHostnameList
()
{
val
hostnameList
=
JSONObject
()
.
put
(
"http://
demo
.rocket.chat"
,
"images/logo/logo.png"
)
.
put
(
"http://
open
.rocket.chat"
,
"images/logo/logo.png"
)
.
put
(
"http://192.168.0.6:3000"
,
"images/icon.svg"
)
.
toString
()
...
...
@@ -35,7 +35,7 @@ class RocketChatCacheTest {
val
expectedServerList
=
mutableListOf
(
Pair
(
"http://192.168.0.6:3000"
,
"http://192.168.0.6:3000/images/icon.svg"
),
Pair
(
"http://
demo.rocket.chat"
,
"http://demo
.rocket.chat/images/logo/logo.png"
))
Pair
(
"http://
open.rocket.chat"
,
"http://open
.rocket.chat/images/logo/logo.png"
))
val
serverList
=
cache
.
serverList
assertThat
(
serverList
,
equalTo
(
expectedServerList
))
}
...
...
app/src/test/kotlin/chat/rocket/android/api/rest/RestApiHelperTest.kt
View file @
184abb0b
...
...
@@ -8,83 +8,83 @@ class RestApiHelperTest {
@Test
fun
getEndpointUrlForMessagesTest
()
{
assertEquals
(
"https://
demo.rocket.chat/api/v1/channels.messages"
,
RestApiHelper
.
getEndpointUrlForMessages
(
Room
.
TYPE_CHANNEL
,
"demo
.rocket.chat"
))
assertEquals
(
"https://
demo.rocket.chat/api/v1/groups.messages"
,
RestApiHelper
.
getEndpointUrlForMessages
(
Room
.
TYPE_GROUP
,
"demo
.rocket.chat"
))
assertEquals
(
"https://
demo.rocket.chat/api/v1/dm.messages"
,
RestApiHelper
.
getEndpointUrlForMessages
(
Room
.
TYPE_DIRECT_MESSAGE
,
"demo
.rocket.chat"
))
assertEquals
(
"https://
open.rocket.chat/api/v1/channels.messages"
,
RestApiHelper
.
getEndpointUrlForMessages
(
Room
.
TYPE_CHANNEL
,
"open
.rocket.chat"
))
assertEquals
(
"https://
open.rocket.chat/api/v1/groups.messages"
,
RestApiHelper
.
getEndpointUrlForMessages
(
Room
.
TYPE_GROUP
,
"open
.rocket.chat"
))
assertEquals
(
"https://
open.rocket.chat/api/v1/dm.messages"
,
RestApiHelper
.
getEndpointUrlForMessages
(
Room
.
TYPE_DIRECT_MESSAGE
,
"open
.rocket.chat"
))
assertEquals
(
"https://
demo.rocket.chat/api/v1/channels.messages"
,
RestApiHelper
.
getEndpointUrlForMessages
(
Room
.
TYPE_CHANNEL
,
"https://demo
.rocket.chat"
))
assertEquals
(
"https://
demo.rocket.chat/api/v1/groups.messages"
,
RestApiHelper
.
getEndpointUrlForMessages
(
Room
.
TYPE_GROUP
,
"https://demo
.rocket.chat"
))
assertEquals
(
"https://
demo.rocket.chat/api/v1/dm.messages"
,
RestApiHelper
.
getEndpointUrlForMessages
(
Room
.
TYPE_DIRECT_MESSAGE
,
"https://demo
.rocket.chat"
))
assertEquals
(
"https://
open.rocket.chat/api/v1/channels.messages"
,
RestApiHelper
.
getEndpointUrlForMessages
(
Room
.
TYPE_CHANNEL
,
"https://open
.rocket.chat"
))
assertEquals
(
"https://
open.rocket.chat/api/v1/groups.messages"
,
RestApiHelper
.
getEndpointUrlForMessages
(
Room
.
TYPE_GROUP
,
"https://open
.rocket.chat"
))
assertEquals
(
"https://
open.rocket.chat/api/v1/dm.messages"
,
RestApiHelper
.
getEndpointUrlForMessages
(
Room
.
TYPE_DIRECT_MESSAGE
,
"https://open
.rocket.chat"
))
assertEquals
(
"https://
demo.rocket.chat/api/v1/channels.messages"
,
RestApiHelper
.
getEndpointUrlForMessages
(
Room
.
TYPE_CHANNEL
,
"http://demo
.rocket.chat"
))
assertEquals
(
"https://
demo.rocket.chat/api/v1/groups.messages"
,
RestApiHelper
.
getEndpointUrlForMessages
(
Room
.
TYPE_GROUP
,
"http://demo
.rocket.chat"
))
assertEquals
(
"https://
demo.rocket.chat/api/v1/dm.messages"
,
RestApiHelper
.
getEndpointUrlForMessages
(
Room
.
TYPE_DIRECT_MESSAGE
,
"http://demo
.rocket.chat"
))
assertEquals
(
"https://
open.rocket.chat/api/v1/channels.messages"
,
RestApiHelper
.
getEndpointUrlForMessages
(
Room
.
TYPE_CHANNEL
,
"http://open
.rocket.chat"
))
assertEquals
(
"https://
open.rocket.chat/api/v1/groups.messages"
,
RestApiHelper
.
getEndpointUrlForMessages
(
Room
.
TYPE_GROUP
,
"http://open
.rocket.chat"
))
assertEquals
(
"https://
open.rocket.chat/api/v1/dm.messages"
,
RestApiHelper
.
getEndpointUrlForMessages
(
Room
.
TYPE_DIRECT_MESSAGE
,
"http://open
.rocket.chat"
))
assertEquals
(
"https://www.
demo.rocket.chat/api/v1/channels.messages"
,
RestApiHelper
.
getEndpointUrlForMessages
(
Room
.
TYPE_CHANNEL
,
"www.demo
.rocket.chat"
))
assertEquals
(
"https://www.
demo.rocket.chat/api/v1/groups.messages"
,
RestApiHelper
.
getEndpointUrlForMessages
(
Room
.
TYPE_GROUP
,
"www.demo
.rocket.chat"
))
assertEquals
(
"https://www.
demo.rocket.chat/api/v1/dm.messages"
,
RestApiHelper
.
getEndpointUrlForMessages
(
Room
.
TYPE_DIRECT_MESSAGE
,
"www.demo
.rocket.chat"
))
assertEquals
(
"https://www.
open.rocket.chat/api/v1/channels.messages"
,
RestApiHelper
.
getEndpointUrlForMessages
(
Room
.
TYPE_CHANNEL
,
"www.open
.rocket.chat"
))
assertEquals
(
"https://www.
open.rocket.chat/api/v1/groups.messages"
,
RestApiHelper
.
getEndpointUrlForMessages
(
Room
.
TYPE_GROUP
,
"www.open
.rocket.chat"
))
assertEquals
(
"https://www.
open.rocket.chat/api/v1/dm.messages"
,
RestApiHelper
.
getEndpointUrlForMessages
(
Room
.
TYPE_DIRECT_MESSAGE
,
"www.open
.rocket.chat"
))
assertEquals
(
"https://www.
demo.rocket.chat/api/v1/channels.messages"
,
RestApiHelper
.
getEndpointUrlForMessages
(
Room
.
TYPE_CHANNEL
,
"https://www.demo
.rocket.chat"
))
assertEquals
(
"https://www.
demo.rocket.chat/api/v1/groups.messages"
,
RestApiHelper
.
getEndpointUrlForMessages
(
Room
.
TYPE_GROUP
,
"https://www.demo
.rocket.chat"
))
assertEquals
(
"https://www.
demo.rocket.chat/api/v1/dm.messages"
,
RestApiHelper
.
getEndpointUrlForMessages
(
Room
.
TYPE_DIRECT_MESSAGE
,
"https://www.demo
.rocket.chat"
))
assertEquals
(
"https://www.
open.rocket.chat/api/v1/channels.messages"
,
RestApiHelper
.
getEndpointUrlForMessages
(
Room
.
TYPE_CHANNEL
,
"https://www.open
.rocket.chat"
))
assertEquals
(
"https://www.
open.rocket.chat/api/v1/groups.messages"
,
RestApiHelper
.
getEndpointUrlForMessages
(
Room
.
TYPE_GROUP
,
"https://www.open
.rocket.chat"
))
assertEquals
(
"https://www.
open.rocket.chat/api/v1/dm.messages"
,
RestApiHelper
.
getEndpointUrlForMessages
(
Room
.
TYPE_DIRECT_MESSAGE
,
"https://www.open
.rocket.chat"
))
assertEquals
(
"https://www.
demo.rocket.chat/api/v1/channels.messages"
,
RestApiHelper
.
getEndpointUrlForMessages
(
Room
.
TYPE_CHANNEL
,
"http://www.demo
.rocket.chat"
))
assertEquals
(
"https://www.
demo.rocket.chat/api/v1/groups.messages"
,
RestApiHelper
.
getEndpointUrlForMessages
(
Room
.
TYPE_GROUP
,
"http://www.demo
.rocket.chat"
))
assertEquals
(
"https://www.
demo.rocket.chat/api/v1/dm.messages"
,
RestApiHelper
.
getEndpointUrlForMessages
(
Room
.
TYPE_DIRECT_MESSAGE
,
"http://www.demo
.rocket.chat"
))
assertEquals
(
"https://www.
open.rocket.chat/api/v1/channels.messages"
,
RestApiHelper
.
getEndpointUrlForMessages
(
Room
.
TYPE_CHANNEL
,
"http://www.open
.rocket.chat"
))
assertEquals
(
"https://www.
open.rocket.chat/api/v1/groups.messages"
,
RestApiHelper
.
getEndpointUrlForMessages
(
Room
.
TYPE_GROUP
,
"http://www.open
.rocket.chat"
))
assertEquals
(
"https://www.
open.rocket.chat/api/v1/dm.messages"
,
RestApiHelper
.
getEndpointUrlForMessages
(
Room
.
TYPE_DIRECT_MESSAGE
,
"http://www.open
.rocket.chat"
))
}
@Test
fun
getEndpointUrlForFileListTest
()
{
assertEquals
(
"https://
demo.rocket.chat/api/v1/channels.files"
,
RestApiHelper
.
getEndpointUrlForFileList
(
Room
.
TYPE_CHANNEL
,
"demo
.rocket.chat"
))
assertEquals
(
"https://
demo.rocket.chat/api/v1/groups.files"
,
RestApiHelper
.
getEndpointUrlForFileList
(
Room
.
TYPE_GROUP
,
"demo
.rocket.chat"
))
assertEquals
(
"https://
demo.rocket.chat/api/v1/dm.files"
,
RestApiHelper
.
getEndpointUrlForFileList
(
Room
.
TYPE_DIRECT_MESSAGE
,
"demo
.rocket.chat"
))
assertEquals
(
"https://
open.rocket.chat/api/v1/channels.files"
,
RestApiHelper
.
getEndpointUrlForFileList
(
Room
.
TYPE_CHANNEL
,
"open
.rocket.chat"
))
assertEquals
(
"https://
open.rocket.chat/api/v1/groups.files"
,
RestApiHelper
.
getEndpointUrlForFileList
(
Room
.
TYPE_GROUP
,
"open
.rocket.chat"
))
assertEquals
(
"https://
open.rocket.chat/api/v1/dm.files"
,
RestApiHelper
.
getEndpointUrlForFileList
(
Room
.
TYPE_DIRECT_MESSAGE
,
"open
.rocket.chat"
))
assertEquals
(
"https://
demo.rocket.chat/api/v1/channels.files"
,
RestApiHelper
.
getEndpointUrlForFileList
(
Room
.
TYPE_CHANNEL
,
"https://demo
.rocket.chat"
))
assertEquals
(
"https://
demo.rocket.chat/api/v1/groups.files"
,
RestApiHelper
.
getEndpointUrlForFileList
(
Room
.
TYPE_GROUP
,
"https://demo
.rocket.chat"
))
assertEquals
(
"https://
demo.rocket.chat/api/v1/dm.files"
,
RestApiHelper
.
getEndpointUrlForFileList
(
Room
.
TYPE_DIRECT_MESSAGE
,
"https://demo
.rocket.chat"
))
assertEquals
(
"https://
open.rocket.chat/api/v1/channels.files"
,
RestApiHelper
.
getEndpointUrlForFileList
(
Room
.
TYPE_CHANNEL
,
"https://open
.rocket.chat"
))
assertEquals
(
"https://
open.rocket.chat/api/v1/groups.files"
,
RestApiHelper
.
getEndpointUrlForFileList
(
Room
.
TYPE_GROUP
,
"https://open
.rocket.chat"
))
assertEquals
(
"https://
open.rocket.chat/api/v1/dm.files"
,
RestApiHelper
.
getEndpointUrlForFileList
(
Room
.
TYPE_DIRECT_MESSAGE
,
"https://open
.rocket.chat"
))
assertEquals
(
"https://
demo.rocket.chat/api/v1/channels.files"
,
RestApiHelper
.
getEndpointUrlForFileList
(
Room
.
TYPE_CHANNEL
,
"http://demo
.rocket.chat"
))
assertEquals
(
"https://
demo.rocket.chat/api/v1/groups.files"
,
RestApiHelper
.
getEndpointUrlForFileList
(
Room
.
TYPE_GROUP
,
"http://demo
.rocket.chat"
))
assertEquals
(
"https://
demo.rocket.chat/api/v1/dm.files"
,
RestApiHelper
.
getEndpointUrlForFileList
(
Room
.
TYPE_DIRECT_MESSAGE
,
"http://demo
.rocket.chat"
))
assertEquals
(
"https://
open.rocket.chat/api/v1/channels.files"
,
RestApiHelper
.
getEndpointUrlForFileList
(
Room
.
TYPE_CHANNEL
,
"http://open
.rocket.chat"
))
assertEquals
(
"https://
open.rocket.chat/api/v1/groups.files"
,
RestApiHelper
.
getEndpointUrlForFileList
(
Room
.
TYPE_GROUP
,
"http://open
.rocket.chat"
))
assertEquals
(
"https://
open.rocket.chat/api/v1/dm.files"
,
RestApiHelper
.
getEndpointUrlForFileList
(
Room
.
TYPE_DIRECT_MESSAGE
,
"http://open
.rocket.chat"
))
assertEquals
(
"https://www.
demo.rocket.chat/api/v1/channels.files"
,
RestApiHelper
.
getEndpointUrlForFileList
(
Room
.
TYPE_CHANNEL
,
"www.demo
.rocket.chat"
))
assertEquals
(
"https://www.
demo.rocket.chat/api/v1/groups.files"
,
RestApiHelper
.
getEndpointUrlForFileList
(
Room
.
TYPE_GROUP
,
"www.demo
.rocket.chat"
))
assertEquals
(
"https://www.
demo.rocket.chat/api/v1/dm.files"
,
RestApiHelper
.
getEndpointUrlForFileList
(
Room
.
TYPE_DIRECT_MESSAGE
,
"www.demo
.rocket.chat"
))
assertEquals
(
"https://www.
open.rocket.chat/api/v1/channels.files"
,
RestApiHelper
.
getEndpointUrlForFileList
(
Room
.
TYPE_CHANNEL
,
"www.open
.rocket.chat"
))
assertEquals
(
"https://www.
open.rocket.chat/api/v1/groups.files"
,
RestApiHelper
.
getEndpointUrlForFileList
(
Room
.
TYPE_GROUP
,
"www.open
.rocket.chat"
))
assertEquals
(
"https://www.
open.rocket.chat/api/v1/dm.files"
,
RestApiHelper
.
getEndpointUrlForFileList
(
Room
.
TYPE_DIRECT_MESSAGE
,
"www.open
.rocket.chat"
))
assertEquals
(
"https://www.
demo.rocket.chat/api/v1/channels.files"
,
RestApiHelper
.
getEndpointUrlForFileList
(
Room
.
TYPE_CHANNEL
,
"https://www.demo
.rocket.chat"
))
assertEquals
(
"https://www.
demo.rocket.chat/api/v1/groups.files"
,
RestApiHelper
.
getEndpointUrlForFileList
(
Room
.
TYPE_GROUP
,
"https://www.demo
.rocket.chat"
))
assertEquals
(
"https://www.
demo.rocket.chat/api/v1/dm.files"
,
RestApiHelper
.
getEndpointUrlForFileList
(
Room
.
TYPE_DIRECT_MESSAGE
,
"https://www.demo
.rocket.chat"
))
assertEquals
(
"https://www.
open.rocket.chat/api/v1/channels.files"
,
RestApiHelper
.
getEndpointUrlForFileList
(
Room
.
TYPE_CHANNEL
,
"https://www.open
.rocket.chat"
))
assertEquals
(
"https://www.
open.rocket.chat/api/v1/groups.files"
,
RestApiHelper
.
getEndpointUrlForFileList
(
Room
.
TYPE_GROUP
,
"https://www.open
.rocket.chat"
))
assertEquals
(
"https://www.
open.rocket.chat/api/v1/dm.files"
,
RestApiHelper
.
getEndpointUrlForFileList
(
Room
.
TYPE_DIRECT_MESSAGE
,
"https://www.open
.rocket.chat"
))
assertEquals
(
"https://www.
demo.rocket.chat/api/v1/channels.files"
,
RestApiHelper
.
getEndpointUrlForFileList
(
Room
.
TYPE_CHANNEL
,
"http://www.demo
.rocket.chat"
))
assertEquals
(
"https://www.
demo.rocket.chat/api/v1/groups.files"
,
RestApiHelper
.
getEndpointUrlForFileList
(
Room
.
TYPE_GROUP
,
"http://www.demo
.rocket.chat"
))
assertEquals
(
"https://www.
demo.rocket.chat/api/v1/dm.files"
,
RestApiHelper
.
getEndpointUrlForFileList
(
Room
.
TYPE_DIRECT_MESSAGE
,
"http://www.demo
.rocket.chat"
))
assertEquals
(
"https://www.
open.rocket.chat/api/v1/channels.files"
,
RestApiHelper
.
getEndpointUrlForFileList
(
Room
.
TYPE_CHANNEL
,
"http://www.open
.rocket.chat"
))
assertEquals
(
"https://www.
open.rocket.chat/api/v1/groups.files"
,
RestApiHelper
.
getEndpointUrlForFileList
(
Room
.
TYPE_GROUP
,
"http://www.open
.rocket.chat"
))
assertEquals
(
"https://www.
open.rocket.chat/api/v1/dm.files"
,
RestApiHelper
.
getEndpointUrlForFileList
(
Room
.
TYPE_DIRECT_MESSAGE
,
"http://www.open
.rocket.chat"
))
}
@Test
fun
getEndpointUrlForMemberListTest
()
{
assertEquals
(
"https://
demo.rocket.chat/api/v1/channels.members"
,
RestApiHelper
.
getEndpointUrlForMemberList
(
Room
.
TYPE_CHANNEL
,
"demo
.rocket.chat"
))
assertEquals
(
"https://
demo.rocket.chat/api/v1/groups.members"
,
RestApiHelper
.
getEndpointUrlForMemberList
(
Room
.
TYPE_GROUP
,
"demo
.rocket.chat"
))
assertEquals
(
"https://
demo.rocket.chat/api/v1/dm.members"
,
RestApiHelper
.
getEndpointUrlForMemberList
(
Room
.
TYPE_DIRECT_MESSAGE
,
"demo
.rocket.chat"
))
assertEquals
(
"https://
open.rocket.chat/api/v1/channels.members"
,
RestApiHelper
.
getEndpointUrlForMemberList
(
Room
.
TYPE_CHANNEL
,
"open
.rocket.chat"
))
assertEquals
(
"https://
open.rocket.chat/api/v1/groups.members"
,
RestApiHelper
.
getEndpointUrlForMemberList
(
Room
.
TYPE_GROUP
,
"open
.rocket.chat"
))
assertEquals
(
"https://
open.rocket.chat/api/v1/dm.members"
,
RestApiHelper
.
getEndpointUrlForMemberList
(
Room
.
TYPE_DIRECT_MESSAGE
,
"open
.rocket.chat"
))
assertEquals
(
"https://
demo.rocket.chat/api/v1/channels.members"
,
RestApiHelper
.
getEndpointUrlForMemberList
(
Room
.
TYPE_CHANNEL
,
"https://demo
.rocket.chat"
))
assertEquals
(
"https://
demo.rocket.chat/api/v1/groups.members"
,
RestApiHelper
.
getEndpointUrlForMemberList
(
Room
.
TYPE_GROUP
,
"https://demo
.rocket.chat"
))
assertEquals
(
"https://
demo.rocket.chat/api/v1/dm.members"
,
RestApiHelper
.
getEndpointUrlForMemberList
(
Room
.
TYPE_DIRECT_MESSAGE
,
"https://demo
.rocket.chat"
))
assertEquals
(
"https://
open.rocket.chat/api/v1/channels.members"
,
RestApiHelper
.
getEndpointUrlForMemberList
(
Room
.
TYPE_CHANNEL
,
"https://open
.rocket.chat"
))
assertEquals
(
"https://
open.rocket.chat/api/v1/groups.members"
,
RestApiHelper
.
getEndpointUrlForMemberList
(
Room
.
TYPE_GROUP
,
"https://open
.rocket.chat"
))
assertEquals
(
"https://
open.rocket.chat/api/v1/dm.members"
,
RestApiHelper
.
getEndpointUrlForMemberList
(
Room
.
TYPE_DIRECT_MESSAGE
,
"https://open
.rocket.chat"
))
assertEquals
(
"https://
demo.rocket.chat/api/v1/channels.members"
,
RestApiHelper
.
getEndpointUrlForMemberList
(
Room
.
TYPE_CHANNEL
,
"http://demo
.rocket.chat"
))
assertEquals
(
"https://
demo.rocket.chat/api/v1/groups.members"
,
RestApiHelper
.
getEndpointUrlForMemberList
(
Room
.
TYPE_GROUP
,
"http://demo
.rocket.chat"
))
assertEquals
(
"https://
demo.rocket.chat/api/v1/dm.members"
,
RestApiHelper
.
getEndpointUrlForMemberList
(
Room
.
TYPE_DIRECT_MESSAGE
,
"http://demo
.rocket.chat"
))
assertEquals
(
"https://
open.rocket.chat/api/v1/channels.members"
,
RestApiHelper
.
getEndpointUrlForMemberList
(
Room
.
TYPE_CHANNEL
,
"http://open
.rocket.chat"
))
assertEquals
(
"https://
open.rocket.chat/api/v1/groups.members"
,
RestApiHelper
.
getEndpointUrlForMemberList
(
Room
.
TYPE_GROUP
,
"http://open
.rocket.chat"
))
assertEquals
(
"https://
open.rocket.chat/api/v1/dm.members"
,
RestApiHelper
.
getEndpointUrlForMemberList
(
Room
.
TYPE_DIRECT_MESSAGE
,
"http://open
.rocket.chat"
))
assertEquals
(
"https://www.
demo.rocket.chat/api/v1/channels.members"
,
RestApiHelper
.
getEndpointUrlForMemberList
(
Room
.
TYPE_CHANNEL
,
"www.demo
.rocket.chat"
))
assertEquals
(
"https://www.
demo.rocket.chat/api/v1/groups.members"
,
RestApiHelper
.
getEndpointUrlForMemberList
(
Room
.
TYPE_GROUP
,
"www.demo
.rocket.chat"
))
assertEquals
(
"https://www.
demo.rocket.chat/api/v1/dm.members"
,
RestApiHelper
.
getEndpointUrlForMemberList
(
Room
.
TYPE_DIRECT_MESSAGE
,
"www.demo
.rocket.chat"
))
assertEquals
(
"https://www.
open.rocket.chat/api/v1/channels.members"
,
RestApiHelper
.
getEndpointUrlForMemberList
(
Room
.
TYPE_CHANNEL
,
"www.open
.rocket.chat"
))
assertEquals
(
"https://www.
open.rocket.chat/api/v1/groups.members"
,
RestApiHelper
.
getEndpointUrlForMemberList
(
Room
.
TYPE_GROUP
,
"www.open
.rocket.chat"
))
assertEquals
(
"https://www.
open.rocket.chat/api/v1/dm.members"
,
RestApiHelper
.
getEndpointUrlForMemberList
(
Room
.
TYPE_DIRECT_MESSAGE
,
"www.open
.rocket.chat"
))
assertEquals
(
"https://www.
demo.rocket.chat/api/v1/channels.members"
,
RestApiHelper
.
getEndpointUrlForMemberList
(
Room
.
TYPE_CHANNEL
,
"https://www.demo
.rocket.chat"
))
assertEquals
(
"https://www.
demo.rocket.chat/api/v1/groups.members"
,
RestApiHelper
.
getEndpointUrlForMemberList
(
Room
.
TYPE_GROUP
,
"https://www.demo
.rocket.chat"
))
assertEquals
(
"https://www.
demo.rocket.chat/api/v1/dm.members"
,
RestApiHelper
.
getEndpointUrlForMemberList
(
Room
.
TYPE_DIRECT_MESSAGE
,
"https://www.demo
.rocket.chat"
))
assertEquals
(
"https://www.
open.rocket.chat/api/v1/channels.members"
,
RestApiHelper
.
getEndpointUrlForMemberList
(
Room
.
TYPE_CHANNEL
,
"https://www.open
.rocket.chat"
))
assertEquals
(
"https://www.
open.rocket.chat/api/v1/groups.members"
,
RestApiHelper
.
getEndpointUrlForMemberList
(
Room
.
TYPE_GROUP
,
"https://www.open
.rocket.chat"
))
assertEquals
(
"https://www.
open.rocket.chat/api/v1/dm.members"
,
RestApiHelper
.
getEndpointUrlForMemberList
(
Room
.
TYPE_DIRECT_MESSAGE
,
"https://www.open
.rocket.chat"
))
assertEquals
(
"https://www.
demo.rocket.chat/api/v1/channels.members"
,
RestApiHelper
.
getEndpointUrlForMemberList
(
Room
.
TYPE_CHANNEL
,
"http://www.demo
.rocket.chat"
))
assertEquals
(
"https://www.
demo.rocket.chat/api/v1/groups.members"
,
RestApiHelper
.
getEndpointUrlForMemberList
(
Room
.
TYPE_GROUP
,
"http://www.demo
.rocket.chat"
))
assertEquals
(
"https://www.
demo.rocket.chat/api/v1/dm.members"
,
RestApiHelper
.
getEndpointUrlForMemberList
(
Room
.
TYPE_DIRECT_MESSAGE
,
"http://www.demo
.rocket.chat"
))
assertEquals
(
"https://www.
open.rocket.chat/api/v1/channels.members"
,
RestApiHelper
.
getEndpointUrlForMemberList
(
Room
.
TYPE_CHANNEL
,
"http://www.open
.rocket.chat"
))
assertEquals
(
"https://www.
open.rocket.chat/api/v1/groups.members"
,
RestApiHelper
.
getEndpointUrlForMemberList
(
Room
.
TYPE_GROUP
,
"http://www.open
.rocket.chat"
))
assertEquals
(
"https://www.
open.rocket.chat/api/v1/dm.members"
,
RestApiHelper
.
getEndpointUrlForMemberList
(
Room
.
TYPE_DIRECT_MESSAGE
,
"http://www.open
.rocket.chat"
))
}
@Test
...
...
app/src/test/kotlin/chat/rocket/android/helper/UrlHelperTest.kt
View file @
184abb0b
...
...
@@ -7,31 +7,31 @@ class UrlHelperTest {
@Test
fun
removeUriSchemeTest
()
{
assertEquals
(
"
demo.rocket.chat"
,
UrlHelper
.
removeUriScheme
(
"https://demo
.rocket.chat"
))
assertEquals
(
"
demo.rocket.chat"
,
UrlHelper
.
removeUriScheme
(
"http://demo
.rocket.chat"
))
assertEquals
(
"
demo.rocket.chat"
,
UrlHelper
.
removeUriScheme
(
"demo
.rocket.chat"
))
assertEquals
(
"
open.rocket.chat"
,
UrlHelper
.
removeUriScheme
(
"https://open
.rocket.chat"
))
assertEquals
(
"
open.rocket.chat"
,
UrlHelper
.
removeUriScheme
(
"http://open
.rocket.chat"
))
assertEquals
(
"
open.rocket.chat"
,
UrlHelper
.
removeUriScheme
(
"open
.rocket.chat"
))
}
@Test
fun
getSafeHostnameTest
()
{
assertEquals
(
"https://
demo.rocket.chat"
,
UrlHelper
.
getSafeHostname
(
"https://demo
.rocket.chat"
))
assertEquals
(
"https://
demo.rocket.chat"
,
UrlHelper
.
getSafeHostname
(
"http://demo
.rocket.chat"
))
assertEquals
(
"https://
demo.rocket.chat"
,
UrlHelper
.
getSafeHostname
(
"demo
.rocket.chat"
))
assertEquals
(
"https://
open.rocket.chat"
,
UrlHelper
.
getSafeHostname
(
"https://open
.rocket.chat"
))
assertEquals
(
"https://
open.rocket.chat"
,
UrlHelper
.
getSafeHostname
(
"http://open
.rocket.chat"
))
assertEquals
(
"https://
open.rocket.chat"
,
UrlHelper
.
getSafeHostname
(
"open
.rocket.chat"
))
}
@Test
fun
getUrlTest
()
{
assertEquals
(
"https://
demo.rocket.chat/GENERAL/file.txt"
,
UrlHelper
.
getSafeUrl
(
"https://demo
.rocket.chat/GENERAL/file.txt"
))
assertEquals
(
"http://
demo.rocket.chat/GENERAL/file.txt"
,
UrlHelper
.
getSafeUrl
(
"http://demo
.rocket.chat/GENERAL/file.txt"
))
assertEquals
(
"
demo.rocket.chat/GENERAL/file.txt"
,
UrlHelper
.
getSafeUrl
(
"demo
.rocket.chat/GENERAL/file.txt"
))
assertEquals
(
"
demo.rocket.chat/GENERAL/a%20sample%20file.txt"
,
UrlHelper
.
getSafeUrl
(
"demo
.rocket.chat/GENERAL/a sample file.txt"
))
assertEquals
(
"
demo.rocket.chat/GENERAL/file.txt"
,
UrlHelper
.
getSafeUrl
(
"demo
.rocket.chat\\/GENERAL\\/file.txt"
))
assertEquals
(
"https://
open.rocket.chat/GENERAL/file.txt"
,
UrlHelper
.
getSafeUrl
(
"https://open
.rocket.chat/GENERAL/file.txt"
))
assertEquals
(
"http://
open.rocket.chat/GENERAL/file.txt"
,
UrlHelper
.
getSafeUrl
(
"http://open
.rocket.chat/GENERAL/file.txt"
))
assertEquals
(
"
open.rocket.chat/GENERAL/file.txt"
,
UrlHelper
.
getSafeUrl
(
"open
.rocket.chat/GENERAL/file.txt"
))
assertEquals
(
"
open.rocket.chat/GENERAL/a%20sample%20file.txt"
,
UrlHelper
.
getSafeUrl
(
"open
.rocket.chat/GENERAL/a sample file.txt"
))
assertEquals
(
"
open.rocket.chat/GENERAL/file.txt"
,
UrlHelper
.
getSafeUrl
(
"open
.rocket.chat\\/GENERAL\\/file.txt"
))
}
@Test
fun
getAttachmentLinkTest
()
{
assertEquals
(
"https://
demo.rocket.chat/file-upload/aFileId/aFileName.txt"
,
UrlHelper
.
getAttachmentLink
(
"https://demo
.rocket.chat"
,
"aFileId"
,
"aFileName.txt"
))
assertEquals
(
"https://
demo.rocket.chat/file-upload/aFileId/aFileName.txt"
,
UrlHelper
.
getAttachmentLink
(
"http://demo
.rocket.chat"
,
"aFileId"
,
"aFileName.txt"
))
assertEquals
(
"https://
demo.rocket.chat/file-upload/aFileId/aFileName.txt"
,
UrlHelper
.
getAttachmentLink
(
"demo
.rocket.chat"
,
"aFileId"
,
"aFileName.txt"
))
assertEquals
(
"https://
open.rocket.chat/file-upload/aFileId/aFileName.txt"
,
UrlHelper
.
getAttachmentLink
(
"https://open
.rocket.chat"
,
"aFileId"
,
"aFileName.txt"
))
assertEquals
(
"https://
open.rocket.chat/file-upload/aFileId/aFileName.txt"
,
UrlHelper
.
getAttachmentLink
(
"http://open
.rocket.chat"
,
"aFileId"
,
"aFileName.txt"
))
assertEquals
(
"https://
open.rocket.chat/file-upload/aFileId/aFileName.txt"
,
UrlHelper
.
getAttachmentLink
(
"open
.rocket.chat"
,
"aFileId"
,
"aFileName.txt"
))
}
}
\ No newline at end of file
rocket-chat-android-widgets/src/main/res/layout/server_row.xml
View file @
184abb0b
...
...
@@ -53,7 +53,7 @@
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toEndOf=
"@+id/drawee_server_button"
app:layout_constraintTop_toBottomOf=
"@+id/text_view_site_name_label"
tools:text=
"
demo
.rocket.chat"
/>
tools:text=
"
open
.rocket.chat"
/>
<ImageView
android:id=
"@+id/selected_server_dot"
...
...
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