Unverified Commit 2af98d20 authored by Filipe de Lima Brito's avatar Filipe de Lima Brito Committed by GitHub

Merge pull request #2241 from Adizbek/bug-fix-1846-new

[FIX] Removes @ from mentions.
parents bd657f94 3d0a65d4
......@@ -94,10 +94,16 @@ class MessageParser @Inject constructor(
}
private fun getMention(user: SimpleUser): String {
user.id?.let {
if (SYSTEM_MENTIONS.contains(it)) {
return "@$it"
}
}
return if (settings.useRealName()) {
user.name ?: "@${user.username}"
user.name ?: user.username.orEmpty()
} else {
"@${user.username}"
user.username.orEmpty()
}
}
......@@ -527,5 +533,7 @@ class MessageParser @Inject constructor(
*/
private val WEB_URL = Pattern.compile(
"($WEB_URL_WITH_PROTOCOL|$WEB_URL_WITHOUT_PROTOCOL)")
private val SYSTEM_MENTIONS = arrayOf("all", "here")
}
}
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