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) accountLockedImageView.visible(account.locked)
accountBadgeTextView.visible(account.bot) accountBadgeTextView.visible(account.bot)
accountAdminTextView.visible(account.pleroma?.isAdmin ?: false) // API can return user is both admin and mod
accountModeratorTextView.visible(account.pleroma?.isModerator ?: false) // 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() updateAccountAvatar()
updateToolbar() updateToolbar()

Loading…
Cancel
Save