fixed auto complete acct with host sometimes appeared for wrong accounts

This commit is contained in:
Mariotaku Lee 2017-05-21 10:13:09 +08:00
parent ad221e3e2e
commit 87d953942e
No known key found for this signature in database
GPG Key ID: 99505AEA531814F1
1 changed files with 4 additions and 1 deletions

View File

@ -170,7 +170,10 @@ class ComposeAutoCompleteAdapter(context: Context, val requestManager: RequestMa
}
private fun getScreenNameOrAcct(screenName: String, userKey: UserKey): String {
if (account?.key?.host == userKey.host) return screenName
if (account?.type != AccountType.MASTODON || account?.key?.host == userKey.host) {
return screenName
}
if (userKey.host == null) return screenName
return "$screenName@${userKey.host}"
}