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
debc714e
Commit
debc714e
authored
May 15, 2018
by
Leonardo Aramaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix quoted message not displaying
parent
5cf2fe1f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
7 deletions
+14
-7
ChatRoomAdapter.kt
...a/chat/rocket/android/chatroom/adapter/ChatRoomAdapter.kt
+2
-2
ChatRoomPresenter.kt
...rocket/android/chatroom/presentation/ChatRoomPresenter.kt
+11
-4
MessageService.kt
...va/chat/rocket/android/chatroom/service/MessageService.kt
+1
-1
No files found.
app/src/main/java/chat/rocket/android/chatroom/adapter/ChatRoomAdapter.kt
View file @
debc714e
...
...
@@ -209,10 +209,10 @@ class ChatRoomAdapter(
message
.
apply
{
when
(
item
.
itemId
)
{
R
.
id
.
action_message_reply
->
{
presenter
?.
citeMessage
(
roomType
,
id
,
true
)
presenter
?.
citeMessage
(
room
Name
,
room
Type
,
id
,
true
)
}
R
.
id
.
action_message_quote
->
{
presenter
?.
citeMessage
(
roomType
,
id
,
false
)
presenter
?.
citeMessage
(
room
Name
,
room
Type
,
id
,
false
)
}
R
.
id
.
action_message_copy
->
{
presenter
?.
copyMessage
(
id
)
...
...
app/src/main/java/chat/rocket/android/chatroom/presentation/ChatRoomPresenter.kt
View file @
debc714e
...
...
@@ -211,8 +211,8 @@ class ChatRoomPresenter @Inject constructor(
isTemporary
=
true
)
try
{
val
message
=
client
.
sendMessage
(
id
,
chatRoomId
,
text
)
messagesRepository
.
save
(
newMessage
)
val
message
=
client
.
sendMessage
(
id
,
chatRoomId
,
text
)
view
.
showNewMessage
(
mapper
.
map
(
newMessage
,
RoomViewModel
(
roles
=
chatRoles
,
isBroadcast
=
chatIsBroadcast
)))
message
...
...
@@ -413,7 +413,7 @@ class ChatRoomPresenter @Inject constructor(
* @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.
*/
fun
citeMessage
(
roomType
:
String
,
messageId
:
String
,
mentionAuthor
:
Boolean
)
{
fun
citeMessage
(
room
Name
:
String
,
room
Type
:
String
,
messageId
:
String
,
mentionAuthor
:
Boolean
)
{
launchUI
(
strategy
)
{
val
message
=
messagesRepository
.
getById
(
messageId
)
val
me
:
Myself
?
=
try
{
...
...
@@ -426,10 +426,17 @@ class ChatRoomPresenter @Inject constructor(
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
val
room
=
if
(
roomTypeOf
(
roomType
)
is
RoomType
.
DirectMessage
)
username
else
roomName
val
chatRoomType
=
when
(
roomTypeOf
(
roomType
))
{
is
RoomType
.
DirectMessage
->
"direct"
is
RoomType
.
PrivateGroup
->
"group"
is
RoomType
.
Channel
->
"channel"
is
RoomType
.
Livechat
->
"livechat"
else
->
"custom"
}
view
.
showReplyingAction
(
username
=
getDisplayName
(
msg
.
sender
),
replyMarkdown
=
"[ ]($currentServer/$
r
oomType/$room?msg=$id) $mention "
,
replyMarkdown
=
"[ ]($currentServer/$
chatR
oomType/$room?msg=$id) $mention "
,
quotedMessage
=
mapper
.
map
(
message
,
RoomViewModel
(
roles
=
chatRoles
,
isBroadcast
=
chatIsBroadcast
)).
last
().
preview
?.
message
?:
""
)
...
...
app/src/main/java/chat/rocket/android/chatroom/service/MessageService.kt
View file @
debc714e
...
...
@@ -50,6 +50,7 @@ class MessageService : JobService() {
val
client
=
connectionManager
.
client
temporaryMessages
.
forEach
{
message
->
try
{
messageRepository
.
save
(
message
.
copy
(
isTemporary
=
false
))
client
.
sendMessage
(
message
=
message
.
message
,
messageId
=
message
.
id
,
...
...
@@ -58,7 +59,6 @@ class MessageService : JobService() {
attachments
=
message
.
attachments
,
alias
=
message
.
senderAlias
)
messageRepository
.
save
(
message
.
copy
(
isTemporary
=
false
))
Timber
.
d
(
"Sent scheduled message given by id: ${message.id}"
)
}
catch
(
ex
:
RocketChatException
)
{
Timber
.
e
(
ex
)
...
...
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