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
4780e4eb
Commit
4780e4eb
authored
Apr 26, 2018
by
Leonardo Aramaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add '@' to display name on reply banner if server uses username otherwise stick to the real name
parent
407a7248
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
10 deletions
+9
-10
ChatRoomAdapter.kt
...a/chat/rocket/android/chatroom/adapter/ChatRoomAdapter.kt
+7
-7
ChatRoomPresenter.kt
...rocket/android/chatroom/presentation/ChatRoomPresenter.kt
+2
-3
No files found.
app/src/main/java/chat/rocket/android/chatroom/adapter/ChatRoomAdapter.kt
View file @
4780e4eb
...
@@ -182,8 +182,8 @@ class ChatRoomAdapter(
...
@@ -182,8 +182,8 @@ class ChatRoomAdapter(
message
.
apply
{
message
.
apply
{
when
(
item
.
itemId
)
{
when
(
item
.
itemId
)
{
R
.
id
.
action_menu_msg_delete
->
presenter
?.
deleteMessage
(
roomId
,
id
)
R
.
id
.
action_menu_msg_delete
->
presenter
?.
deleteMessage
(
roomId
,
id
)
R
.
id
.
action_menu_msg_quote
->
presenter
?.
citeMessage
(
roomType
,
roomName
,
id
,
false
)
R
.
id
.
action_menu_msg_quote
->
presenter
?.
citeMessage
(
roomType
,
id
,
false
)
R
.
id
.
action_menu_msg_reply
->
presenter
?.
citeMessage
(
roomType
,
roomName
,
id
,
true
)
R
.
id
.
action_menu_msg_reply
->
presenter
?.
citeMessage
(
roomType
,
id
,
true
)
R
.
id
.
action_menu_msg_copy
->
presenter
?.
copyMessage
(
id
)
R
.
id
.
action_menu_msg_copy
->
presenter
?.
copyMessage
(
id
)
R
.
id
.
action_menu_msg_edit
->
presenter
?.
editMessage
(
roomId
,
id
,
message
.
message
)
R
.
id
.
action_menu_msg_edit
->
presenter
?.
editMessage
(
roomId
,
id
,
message
.
message
)
R
.
id
.
action_menu_msg_pin_unpin
->
{
R
.
id
.
action_menu_msg_pin_unpin
->
{
...
...
app/src/main/java/chat/rocket/android/chatroom/presentation/ChatRoomPresenter.kt
View file @
4780e4eb
...
@@ -326,11 +326,10 @@ class ChatRoomPresenter @Inject constructor(
...
@@ -326,11 +326,10 @@ class ChatRoomPresenter @Inject constructor(
* Quote or reply a message.
* Quote or reply a message.
*
*
* @param roomType The current room type.
* @param roomType The current room type.
* @param roomName The name of the current room.
* @param messageId The id of the message to make citation for.
* @param messageId The id of the message to make citation for.
* @param mentionAuthor true means the citation is a reply otherwise it's a quote.
* @param mentionAuthor true means the citation is a reply otherwise it's a quote.
*/
*/
fun
citeMessage
(
roomType
:
String
,
roomName
:
String
,
messageId
:
String
,
mentionAuthor
:
Boolean
)
{
fun
citeMessage
(
roomType
:
String
,
messageId
:
String
,
mentionAuthor
:
Boolean
)
{
launchUI
(
strategy
)
{
launchUI
(
strategy
)
{
val
message
=
messagesRepository
.
getById
(
messageId
)
val
message
=
messagesRepository
.
getById
(
messageId
)
val
me
:
Myself
?
=
try
{
val
me
:
Myself
?
=
try
{
...
@@ -355,7 +354,7 @@ class ChatRoomPresenter @Inject constructor(
...
@@ -355,7 +354,7 @@ class ChatRoomPresenter @Inject constructor(
private
fun
getDisplayName
(
user
:
SimpleUser
?):
String
{
private
fun
getDisplayName
(
user
:
SimpleUser
?):
String
{
val
username
=
user
?.
username
?:
""
val
username
=
user
?.
username
?:
""
return
if
(
settings
.
useRealName
())
user
?.
name
?:
username
else
username
return
if
(
settings
.
useRealName
())
user
?.
name
?:
"@$username"
else
"@$username"
}
}
/**
/**
...
...
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