リファクタ

This commit is contained in:
tateisu 2018-12-02 19:49:48 +09:00
parent 953e180e38
commit 19b187f430
1 changed files with 5 additions and 4 deletions

View File

@ -227,12 +227,13 @@ open class TootAccount(parser : TootParser, src : JSONObject) {
this.id = EntityId.mayDefault(src.parseString("id"))
this.acct = when {
// アクセス元から見て外部ユーザならfull acct
remoteHost?.isNotEmpty() == true -> "${username}@$remoteHost"
// アクセス元から見て内部ユーザなら short acct
else -> username
host.equals(parser.linkHelper.host ,ignoreCase = true ) -> username
// アクセス元から見て外部ユーザならfull acct
else-> "${username}@$host"
}
this.followers_count = src.parseLong("followersCount") ?: - 1L