force full acct mention in delete & redraft.
This commit is contained in:
parent
890377e901
commit
a45482f975
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue