-
-
Notifications
You must be signed in to change notification settings - Fork 7k
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
Change auto-following admin-selected accounts, show in recommendations #16078
Conversation
009e151
to
6169d8e
Compare
Note: CI fails because other translations have not been updated with the new variable in the setting description. |
usernames_and_domains = begin | ||
value.split(',').map do |str| | ||
username, domain = str.strip.gsub(/\A@/, '').split('@') | ||
domain = nil if TagManager.instance.local_domain?(domain) | ||
|
||
next if username.blank? | ||
|
||
[str, username, domain] | ||
end.compact | ||
end | ||
|
||
usernames_with_no_accounts = usernames_and_domains.filter_map do |(str, username, domain)| | ||
str unless Account.find_remote(username, domain) | ||
end | ||
|
||
if usernames_with_no_accounts.any? && options[:multiple] | ||
record.errors.add(attribute, I18n.t('existing_username_validator.not_found_multiple', usernames: usernames_with_no_accounts.join(', '))) | ||
elsif usernames_with_no_accounts.any? || usernames_and_domains.size > 1 | ||
record.errors.add(attribute, I18n.t('existing_username_validator.not_found')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This changes the scope of this validator from local accounts only to any known account, which kind of makes sense for recommendations but less so for site_contact_username
which also uses this validator.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Counter-point: On mastodon.online, I might as well just point to my mastodon.social account in that field
Not sure if there's any true benefit to enforcing locality in this validator.
6169d8e
to
0fa49f3
Compare
0fa49f3
to
90c5b84
Compare
Instead of making new users automatically follow accounts specified in admin settings, show them at the top of follow recommendations. Also, allow picking remote accounts instead of limiting them to local only.
The "Enable default follows for new users" setting has been removed. "Default follows for new users" has been renamed to "Recommend these accounts to new users", and it no longer defaults to all admin accounts.