Unverified Commit 9b4af327 authored by Rafael Kellermann Streit's avatar Rafael Kellermann Streit Committed by GitHub

Merge pull request #1780 from RocketChat/beta

[CHORE] Merge BETA into DEVELOP
parents 71410e16 65de72ff
......@@ -16,7 +16,7 @@ android {
applicationId "chat.rocket.android"
minSdkVersion versions.minSdk
targetSdkVersion versions.targetSdk
versionCode 2047
versionCode 2048
versionName "3.0.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
multiDexEnabled true
......
......@@ -11,6 +11,7 @@ import chat.rocket.common.model.RoomType
import chat.rocket.common.model.UserStatus
import kotlinx.android.synthetic.main.item_chat.view.*
import kotlinx.android.synthetic.main.unread_messages_badge.view.*
import ru.noties.markwon.Markwon
class RoomViewHolder(itemView: View, private val listener: (RoomUiModel) -> Unit) : ViewHolder<RoomItemHolder>(itemView) {
......@@ -32,7 +33,7 @@ class RoomViewHolder(itemView: View, private val listener: (RoomUiModel) -> Unit
if (room.lastMessage != null) {
text_last_message.isVisible = true
text_last_message.text = room.lastMessage
text_last_message.text = Markwon.markdown(context, room.lastMessage.toString()).toString()
} else {
text_last_message.isGone = true
}
......
......@@ -115,6 +115,7 @@ class MessageParser @Inject constructor(
}
class StrongEmphasisVisitor : AbstractVisitor() {
override fun visit(strongEmphasis: StrongEmphasis) {
if (strongEmphasis.openingDelimiter == "__" && strongEmphasis.firstChild != null) {
val child = strongEmphasis.firstChild
......@@ -145,7 +146,7 @@ class MessageParser @Inject constructor(
var offset = 0
mentions.forEach {
val mentionMe = it == currentUser || it == "@all" || it == "@here"
val mentionMe = it == "@$currentUser" || it == "@all" || it == "@here"
offset = text.indexOf(string = it, startIndex = offset, ignoreCase = false)
while (offset > -1) {
val textColor = if (mentionMe) myselfTextColor else othersTextColor
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment