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

Limit pinned toots to 5 #4923

Merged
merged 1 commit into from Sep 13, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions app/validators/status_pin_validator.rb
Expand Up @@ -5,5 +5,6 @@ def validate(pin)
pin.errors.add(:status, I18n.t('statuses.pin_errors.reblog')) if pin.status.reblog?
pin.errors.add(:status, I18n.t('statuses.pin_errors.ownership')) if pin.account_id != pin.status.account_id
pin.errors.add(:status, I18n.t('statuses.pin_errors.private')) unless %w(public unlisted).include?(pin.status.visibility)
pin.errors.add(:status, I18n.t('statuses.pin_errors.limit')) if pin.account.status_pins.count > 4
end
end
1 change: 1 addition & 0 deletions config/locales/en.yml
Expand Up @@ -448,6 +448,7 @@ en:
open_in_web: Open in web
over_character_limit: character limit of %{max} exceeded
pin_errors:
limit: Too many toots pinned
ownership: Someone else's toot cannot be pinned
private: Non-public toot cannot be pinned
reblog: A boost cannot be pinned
Expand Down