Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mastodon
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Pierre Boudes
mastodon
Commits
56af04db
Commit
56af04db
authored
7 years ago
by
Eugen Rochko
Committed by
GitHub
7 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Fix #4918 - Limit pinned toots to 5 (#4923)
parent
60944d5d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/validators/status_pin_validator.rb
+1
-0
1 addition, 0 deletions
app/validators/status_pin_validator.rb
config/locales/en.yml
+1
-0
1 addition, 0 deletions
config/locales/en.yml
with
2 additions
and
0 deletions
app/validators/status_pin_validator.rb
+
1
−
0
View file @
56af04db
...
...
@@ -5,5 +5,6 @@ class StatusPinValidator < ActiveModel::Validator
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
This diff is collapsed.
Click to expand it.
config/locales/en.yml
+
1
−
0
View file @
56af04db
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment