force full acct mention in delete & redraft.

This commit is contained in:
tateisu 2019-07-04 05:24:35 +09:00
parent 890377e901
commit a45482f975
2 changed files with 6 additions and 2 deletions

View File

@ -349,7 +349,10 @@ open class TootAccount(parser : TootParser, src : JSONObject) {
internal val reAccountUrl : Pattern =
Pattern.compile("""\Ahttps://(\w[\w.-]*\w)/@(\w+[\w-]*)(?:@(\w[\w.-]*\w))?(?=\z|[?#])""")
fun getAcctFromUrl(url : String) : String? {
fun getAcctFromUrl(url : String?) : String? {
url ?: return null
val m = reAccountUrl.matcher(url)
return if(m.find()) {
val host = m.group(1)

View File

@ -396,10 +396,11 @@ object HTMLDecoder {
when(display_url[0]) {
'@' -> {
// @mention
if(href != null && (options.mentionFullAcct || Pref.bpMentionFullAcct(App1.pref))) {
if(options.mentionFullAcct || Pref.bpMentionFullAcct(App1.pref)) {
val acct = TootAccount.getAcctFromUrl(href)
if(acct != null) return "@$acct"
}
return display_url
}