AccountActivity: don't show moderator badge if user already admin

main
Alibek Omarov 5 years ago
parent f6a9c51b86
commit 34ddf62a18
  1. 7
      app/src/main/java/com/keylesspalace/tusky/AccountActivity.kt

@ -392,8 +392,11 @@ class AccountActivity : BottomSheetActivity(), ActionButtonActivity, HasAndroidI
accountLockedImageView.visible(account.locked)
accountBadgeTextView.visible(account.bot)
accountAdminTextView.visible(account.pleroma?.isAdmin ?: false)
accountModeratorTextView.visible(account.pleroma?.isModerator ?: false)
// API can return user is both admin and mod
// but admin rights already implies moderator, so just ignore it
val isAdmin = account.pleroma?.isAdmin ?: false
accountAdminTextView.visible(isAdmin)
accountModeratorTextView.visible(!isAdmin && account.pleroma?.isModerator ?: false)
updateAccountAvatar()
updateToolbar()

Loading…
Cancel
Save