BottomSheetActivity: fix account URL search leading to wrong accounts or threads

main
Alibek Omarov 4 years ago
parent 51083556f1
commit c4931bcc6e
  1. 19
      app/src/main/java/com/keylesspalace/tusky/BottomSheetActivity.kt

@ -83,12 +83,25 @@ abstract class BottomSheetActivity : BaseActivity() {
onEndSearch(url)
if (accounts.isNotEmpty()) {
// HACKHACK: Pleroma, remove when search will work normally
if (accounts[0].pleroma != null) {
val account = accounts.firstOrNull { it.pleroma?.apId == url || it.url == url }
if (account != null) {
viewAccount(account.id)
return@subscribe
}
} else {
viewAccount(accounts[0].id)
return@subscribe
}
}
if (statuses.isNotEmpty()) {
viewThread(statuses[0].id, statuses[0].url)
return@subscribe
} else if (accounts.isNotEmpty()) {
viewAccount(accounts[0].id)
return@subscribe
}
performUrlFallbackAction(url, lookupFallbackBehavior)

Loading…
Cancel
Save