Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add role badges #4029

Merged
merged 2 commits into from
Sep 25, 2023
Merged

add role badges #4029

merged 2 commits into from
Sep 25, 2023

Conversation

connyduck
Copy link
Collaborator

This adds support for the new Mastodon 4.2 role badges. Admins can define if a role should be visible in the interface and then we get it delivered by the Api on the Account object like this:

"roles": [
        {
              "id": "4",
              "name": "TEST",
              "color": "#ffee00"
        }
  ]
  • keeps compatibility with older Mastodon version and non Mastodon servers
  • Took me a while, but I figured out a way to use the color and have it look ok on all backgrounds (Mastodon itself ignores the color and just always uses its brand color)
  • falls back to Tusky blue in case no color is configured
  • I adjusted the "Follows you" and "Bot" badges so they match the new badge style
  • In case the "Follows you" and "Bot" badges are visible at the same time, "Follows you" gets its own line and "Bot" goes into the same line as the role badge.
  • Will work even with a lot of role badges (right now users can only have 1 role at once though)
  • Will work even when the badges federate (right now they don't)

@digitalf0x
Copy link

Mastodon itself renamed the Bot flag to Automated. As you're modifying that label here, should Tusky follow?

This may include modifying the profile setting inside Tusky (Mastodon changed the label from This is a bot account to This is an automated account).

(I have no strong preference either way.)

@Tak Tak merged commit 5764c90 into tuskyapp:develop Sep 25, 2023
3 checks passed
@connyduck connyduck deleted the role_badges branch September 28, 2023 18:02
@charlag charlag added this to the Tusky 24 milestone Nov 18, 2023
nikclayton added a commit to nikclayton/pachli-android that referenced this pull request Dec 11, 2023
Roles for the logged in user appeared in Mastodon 4.0.0 and can be
displayed on the user's profile screen.

Show them as chips, adjusting the display of the existing "Follows you"
and "Bot" indicators to make allowances for this.

Roles can have a custom colour assigned by the server admin. This is
blended with the app colour so it is not too jarring in the display.

See also tuskyapp/Tusky#4029

Co-authored-by: Konrad Pozniak <[email protected]>
nikclayton added a commit to pachli/pachli-android that referenced this pull request Dec 11, 2023
Roles for the logged in user appeared in Mastodon 4.0.0 and can be
displayed on the user's profile screen.

Show them as chips, adjusting the display of the existing "Follows you"
and "Bot" indicators to make allowances for this.

Roles can have a custom colour assigned by the server admin. This is
blended with the app colour so it is not too jarring in the display.

See also tuskyapp/Tusky#4029

Co-authored-by: Konrad Pozniak <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants