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

FEATURE: Allow actor preferred username changed #124

Merged

Conversation

angusmcleod
Copy link
Contributor

@angusmcleod angusmcleod commented Oct 18, 2024

The following will happen on remote services if you change the username:

  • Mastodon: The username displayed for the actor will not change until someone performs a lookup of the new handle. Following / Posting etc will continue to work regardless of the username displayed.

  • Discourse: The username will be updated the next time there is any interaction with the actor, including:

    • any activities are received from the actor; and
    • the actor is the subject of a lookup in the "Follow" modal.

See further: https://socialhub.activitypub.rocks/t/changeable-usernames/830/13?u=angus

Copy link
Contributor

@pmusaraj pmusaraj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, will merge, we can address the username change period question in a followup, if it's an issue.

opts[:min_length] = SiteSetting.min_username_length
opts[:max_length] = SiteSetting.max_username_length
end
add_error(I18n.t("discourse_activity_pub.actor.warning.#{key}", opts))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@angusmcleod should the plugin also account for username change period in core? Not sure if that raises an error, and note that the setting also blocks username changes entirely if set to 0.

Copy link
Contributor Author

@angusmcleod angusmcleod Oct 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The username changes handled by the ActorHandler will be unaffected by username_change_period, as changes are not filtered through the UserGaurdian that applies it. Even though we leverage some User username logic for the Actor username, e.g. UsernameValidator, I don't think it'd make sense to apply the UserGuardian, or restrictions like username_change_period to Actor changes, as different considerations are in play. We may restrict Actor username changes, but it will be for different reasons, e.g. that a plurality of other ActivityPub services do not support changes beyond a certain period. To put it another way, the considerations pertinent to Actors are sometimes overlapping, but mostly different from the considerations pertinent to Users (or other models), so I think it's best to keep them separate (which is also why we have a separate model for them).

@pmusaraj pmusaraj merged commit e43c1d3 into discourse:main Oct 22, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants