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
ea6006ba
Commit
ea6006ba
authored
Apr 26, 2018
by
Leonardo Aramaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use username on the reply/citation markdown
parent
6b2bdf3b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
19 deletions
+14
-19
ChatRoomPresenter.kt
...rocket/android/chatroom/presentation/ChatRoomPresenter.kt
+14
-19
No files found.
app/src/main/java/chat/rocket/android/chatroom/presentation/ChatRoomPresenter.kt
View file @
ea6006ba
...
...
@@ -194,7 +194,7 @@ class ChatRoomPresenter @Inject constructor(
}
}
catch
(
ex
:
Exception
)
{
Timber
.
d
(
ex
,
"Error uploading file"
)
when
(
ex
)
{
when
(
ex
)
{
is
RocketChatException
->
view
.
showMessage
(
ex
)
else
->
view
.
showGenericErrorMessage
()
}
...
...
@@ -336,33 +336,28 @@ class ChatRoomPresenter @Inject constructor(
val
me
:
Myself
?
=
try
{
retryIO
(
"me()"
)
{
client
.
me
()
}
//TODO: Cache this and use an interactor
}
catch
(
ex
:
Exception
)
{
Timber
.
d
(
ex
,
"Error getting myself info."
)
ex
.
printStackTrace
()
Timber
.
e
(
ex
)
null
}
message
?.
let
{
m
->
val
id
=
m
.
id
val
username
=
m
.
sender
?.
username
val
user
=
"@"
+
if
(
settings
.
useRealName
())
m
.
sender
?.
name
?:
m
.
sender
?.
username
else
m
.
sender
?.
username
val
mention
=
if
(
mentionAuthor
&&
me
?.
username
!=
username
)
user
else
""
val
type
=
roomTypeOf
(
roomType
)
val
room
=
when
(
type
)
{
is
RoomType
.
Channel
->
"channel"
is
RoomType
.
DirectMessage
->
"direct"
is
RoomType
.
PrivateGroup
->
"group"
is
RoomType
.
Livechat
->
"livechat"
is
RoomType
.
Custom
->
"custom"
//TODO: put appropriate callback string here.
}
message
?.
let
{
msg
->
val
id
=
msg
.
id
val
username
=
msg
.
sender
?.
username
?:
""
val
mention
=
if
(
mentionAuthor
&&
me
?.
username
!=
username
)
username
else
""
val
room
=
if
(
roomTypeOf
(
roomType
)
is
RoomType
.
DirectMessage
)
username
else
roomType
view
.
showReplyingAction
(
username
=
user
,
replyMarkdown
=
"[ ]($currentServer/$room
/$roomName
?msg=$id) $mention "
,
username
=
getDisplayName
(
msg
.
sender
)
,
replyMarkdown
=
"[ ]($currentServer/$room
Type/$room
?msg=$id) $mention "
,
quotedMessage
=
mapper
.
map
(
message
).
last
().
preview
?.
message
?:
""
)
}
}
}
private
fun
getDisplayName
(
user
:
SimpleUser
?):
String
{
val
username
=
user
?.
username
?:
""
return
if
(
settings
.
useRealName
())
user
?.
name
?:
username
else
username
}
/**
* Copy message to clipboard.
*
...
...
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