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
0308747b
Commit
0308747b
authored
Jun 27, 2018
by
Filipe de Lima Brito
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adds UI_Allow_room_names_with_special_chars setting.
parent
452a36a9
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
17 additions
and
16 deletions
+17
-16
RoomUiModelMapper.kt
...hat/rocket/android/chatrooms/adapter/RoomUiModelMapper.kt
+2
-1
ChatRoomsPresenter.kt
...cket/android/chatrooms/presentation/ChatRoomsPresenter.kt
+6
-9
ChatRoomsAdapter.kt
...java/chat/rocket/android/chatrooms/ui/ChatRoomsAdapter.kt
+2
-1
MessageHelper.kt
...src/main/java/chat/rocket/android/helper/MessageHelper.kt
+6
-5
SettingsRepository.kt
...a/chat/rocket/android/server/domain/SettingsRepository.kt
+1
-0
No files found.
app/src/main/java/chat/rocket/android/chatrooms/adapter/RoomUiModelMapper.kt
View file @
0308747b
...
...
@@ -13,6 +13,7 @@ import chat.rocket.android.infrastructure.checkIfMyself
import
chat.rocket.android.server.domain.PublicSettings
import
chat.rocket.android.server.domain.showLastMessage
import
chat.rocket.android.server.domain.useRealName
import
chat.rocket.android.server.domain.useSpecialCharsOnRoom
import
chat.rocket.android.util.extensions.avatarUrl
import
chat.rocket.android.util.extensions.date
import
chat.rocket.android.util.extensions.localDateTime
...
...
@@ -111,7 +112,7 @@ class RoomUiModelMapper(
}
private
fun
mapName
(
name
:
String
,
fullName
:
String
?,
unread
:
Boolean
):
CharSequence
{
val
roomName
=
if
(
settings
.
useRealName
())
{
val
roomName
=
if
(
settings
.
use
SpecialCharsOnRoom
()
||
settings
.
use
RealName
())
{
fullName
?:
name
}
else
{
name
...
...
app/src/main/java/chat/rocket/android/chatrooms/presentation/ChatRoomsPresenter.kt
View file @
0308747b
...
...
@@ -5,8 +5,7 @@ import chat.rocket.android.core.lifecycle.CancelStrategy
import
chat.rocket.android.helper.UserHelper
import
chat.rocket.android.infrastructure.LocalRepository
import
chat.rocket.android.main.presentation.MainNavigator
import
chat.rocket.android.server.domain.SettingsRepository
import
chat.rocket.android.server.domain.useRealName
import
chat.rocket.android.server.domain.*
import
chat.rocket.android.server.infraestructure.ConnectionManager
import
chat.rocket.android.util.extensions.launchUI
import
chat.rocket.android.util.retryIO
...
...
@@ -36,13 +35,11 @@ class ChatRoomsPresenter @Inject constructor(
fun
loadChatRoom
(
chatRoom
:
chat
.
rocket
.
android
.
db
.
model
.
ChatRoom
)
{
with
(
chatRoom
.
chatRoom
)
{
val
isDirectMessage
=
roomTypeOf
(
type
)
is
RoomType
.
DirectMessage
val
roomName
=
if
(
isDirectMessage
&&
fullname
!=
null
&&
settings
.
useRealName
())
{
fullname
!!
}
else
{
name
}
val
roomName
=
if
(
settings
.
useSpecialCharsOnRoom
()
||
(
isDirectMessage
&&
settings
.
useRealName
()))
{
fullname
?:
name
}
else
{
name
}
launchUI
(
strategy
)
{
val
myself
=
getCurrentUser
()
...
...
app/src/main/java/chat/rocket/android/chatrooms/ui/ChatRoomsAdapter.kt
View file @
0308747b
...
...
@@ -18,6 +18,7 @@ import chat.rocket.android.infrastructure.checkIfMyself
import
chat.rocket.android.server.domain.PublicSettings
import
chat.rocket.android.server.domain.showLastMessage
import
chat.rocket.android.server.domain.useRealName
import
chat.rocket.android.server.domain.useSpecialCharsOnRoom
import
chat.rocket.android.util.extensions.*
import
chat.rocket.common.model.RoomType
import
chat.rocket.core.model.ChatRoom
...
...
@@ -123,7 +124,7 @@ class ChatRoomsAdapter(
}
private
fun
chatRoomName
(
chatRoom
:
ChatRoom
):
String
{
return
if
(
settings
.
useRealName
())
{
return
if
(
settings
.
use
SpecialCharsOnRoom
()
||
settings
.
use
RealName
())
{
chatRoom
.
fullName
?:
chatRoom
.
name
}
else
{
chatRoom
.
name
...
...
app/src/main/java/chat/rocket/android/helper/MessageHelper.kt
View file @
0308747b
package
chat.rocket.android.helper
import
chat.rocket.android.server.domain.GetCurrentServerInteractor
import
chat.rocket.android.server.domain.GetSettingsInteractor
import
chat.rocket.android.server.domain.PublicSettings
import
chat.rocket.android.server.domain.useRealName
import
chat.rocket.android.server.domain.*
import
chat.rocket.common.model.RoomType
import
chat.rocket.core.model.ChatRoom
import
chat.rocket.core.model.Message
...
...
@@ -24,7 +21,11 @@ class MessageHelper @Inject constructor(
is
RoomType
.
LiveChat
->
"livechat"
else
->
"custom"
}
val
name
=
if
(
settings
.
useRealName
())
chatRoom
.
fullName
?:
chatRoom
.
name
else
chatRoom
.
name
val
name
=
if
(
settings
.
useSpecialCharsOnRoom
()
||
settings
.
useRealName
())
{
chatRoom
.
fullName
?:
chatRoom
.
name
}
else
{
chatRoom
.
name
}
return
"[ ]($currentServer/$type/$name?msg=${message.id}) "
}
...
...
app/src/main/java/chat/rocket/android/server/domain/SettingsRepository.kt
View file @
0308747b
...
...
@@ -71,6 +71,7 @@ fun PublicSettings.gitlabUrl(): String? = this[ACCOUNT_GITLAB_URL]?.value as Str
fun
PublicSettings
.
isWordpressAuthenticationEnabled
():
Boolean
=
this
[
ACCOUNT_WORDPRESS
]
?.
value
==
true
fun
PublicSettings
.
useRealName
():
Boolean
=
this
[
USE_REALNAME
]
?.
value
==
true
fun
PublicSettings
.
useSpecialCharsOnRoom
():
Boolean
=
this
[
ALLOW_ROOM_NAME_SPECIAL_CHARS
]
?.
value
==
true
fun
PublicSettings
.
faviconLarge
():
String
?
=
this
[
FAVICON_512
]
?.
value
as
String
?
fun
PublicSettings
.
favicon
():
String
?
=
this
[
FAVICON_196
]
?.
value
as
String
?
fun
PublicSettings
.
wideTile
():
String
?
=
this
[
WIDE_TILE_310
]
?.
value
as
String
?
...
...
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