Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Register
Sign in
Toggle navigation
Menu
Open sidebar
Tiger Ton
mastodon
Commits
824d1b88
Unverified
Commit
824d1b88
authored
4 years ago
by
Takeshi Umeda
Committed by
GitHub
4 years ago
Browse files
Options
Download
Plain Diff
Merge branch 'master' into feature-circles
parents
6358072b
c747883d
Changes
905
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
app/controllers/relationships_controller.rb
+8
-1
app/controllers/relationships_controller.rb
app/controllers/settings/aliases_controller.rb
+2
-2
app/controllers/settings/aliases_controller.rb
app/controllers/settings/applications_controller.rb
+0
-3
app/controllers/settings/applications_controller.rb
app/controllers/settings/base_controller.rb
+7
-0
app/controllers/settings/base_controller.rb
app/controllers/settings/deletes_controller.rb
+4
-7
app/controllers/settings/deletes_controller.rb
app/controllers/settings/exports/blocked_accounts_controller.rb
+1
-1
...ntrollers/settings/exports/blocked_accounts_controller.rb
app/controllers/settings/exports/blocked_domains_controller.rb
+1
-1
...ontrollers/settings/exports/blocked_domains_controller.rb
app/controllers/settings/exports/bookmarks_controller.rb
+19
-0
app/controllers/settings/exports/bookmarks_controller.rb
app/controllers/settings/exports/following_accounts_controller.rb
+1
-1
...rollers/settings/exports/following_accounts_controller.rb
app/controllers/settings/exports/lists_controller.rb
+1
-1
app/controllers/settings/exports/lists_controller.rb
app/controllers/settings/exports/muted_accounts_controller.rb
+1
-1
...controllers/settings/exports/muted_accounts_controller.rb
app/controllers/settings/exports_controller.rb
+0
-11
app/controllers/settings/exports_controller.rb
app/controllers/settings/featured_tags_controller.rb
+4
-7
app/controllers/settings/featured_tags_controller.rb
app/controllers/settings/identity_proofs_controller.rb
+0
-3
app/controllers/settings/identity_proofs_controller.rb
app/controllers/settings/imports_controller.rb
+0
-3
app/controllers/settings/imports_controller.rb
app/controllers/settings/migration/redirects_controller.rb
+1
-8
app/controllers/settings/migration/redirects_controller.rb
app/controllers/settings/migrations_controller.rb
+1
-8
app/controllers/settings/migrations_controller.rb
app/controllers/settings/pictures_controller.rb
+6
-3
app/controllers/settings/pictures_controller.rb
app/controllers/settings/preferences_controller.rb
+1
-4
app/controllers/settings/preferences_controller.rb
app/controllers/settings/profiles_controller.rb
+0
-3
app/controllers/settings/profiles_controller.rb
with
58 additions
and
68 deletions
+58
-68
app/controllers/relationships_controller.rb
+
8
-
1
View file @
824d1b88
...
...
@@ -5,6 +5,7 @@ class RelationshipsController < ApplicationController
before_action
:authenticate_user!
before_action
:set_accounts
,
only: :show
before_action
:set_relationships
,
only: :show
before_action
:set_body_classes
helper_method
:following_relationship?
,
:followed_by_relationship?
,
:mutual_relationship?
...
...
@@ -28,6 +29,10 @@ class RelationshipsController < ApplicationController
@accounts
=
RelationshipFilter
.
new
(
current_account
,
filter_params
).
results
.
page
(
params
[
:page
]).
per
(
40
)
end
def
set_relationships
@relationships
=
AccountRelationshipsPresenter
.
new
(
@accounts
.
pluck
(
:id
),
current_user
.
account_id
)
end
def
form_account_batch_params
params
.
require
(
:form_account_batch
).
permit
(
:action
,
account_ids:
[])
end
...
...
@@ -49,7 +54,9 @@ class RelationshipsController < ApplicationController
end
def
action_from_button
if
params
[
:unfollow
]
if
params
[
:follow
]
'follow'
elsif
params
[
:unfollow
]
'unfollow'
elsif
params
[
:remove_from_followers
]
'remove_from_followers'
...
...
This diff is collapsed.
Click to expand it.
app/controllers/settings/aliases_controller.rb
+
2
-
2
View file @
824d1b88
# frozen_string_literal: true
class
Settings::AliasesController
<
Settings
::
BaseController
layout
'admin'
skip_before_action
:require_functional!
before_action
:
authenticate_user
!
before_action
:
require_not_suspended
!
before_action
:set_aliases
,
except: :destroy
before_action
:set_alias
,
only: :destroy
...
...
This diff is collapsed.
Click to expand it.
app/controllers/settings/applications_controller.rb
+
0
-
3
View file @
824d1b88
# frozen_string_literal: true
class
Settings::ApplicationsController
<
Settings
::
BaseController
layout
'admin'
before_action
:authenticate_user!
before_action
:set_application
,
only:
[
:show
,
:update
,
:destroy
,
:regenerate
]
before_action
:prepare_scopes
,
only:
[
:create
,
:update
]
...
...
This diff is collapsed.
Click to expand it.
app/controllers/settings/base_controller.rb
+
7
-
0
View file @
824d1b88
# frozen_string_literal: true
class
Settings::BaseController
<
ApplicationController
layout
'admin'
before_action
:authenticate_user!
before_action
:set_body_classes
before_action
:set_cache_headers
...
...
@@ -13,4 +16,8 @@ class Settings::BaseController < ApplicationController
def
set_cache_headers
response
.
headers
[
'Cache-Control'
]
=
'no-cache, no-store, max-age=0, must-revalidate'
end
def
require_not_suspended!
forbidden
if
current_account
.
suspended?
end
end
This diff is collapsed.
Click to expand it.
app/controllers/settings/deletes_controller.rb
+
4
-
7
View file @
824d1b88
# frozen_string_literal: true
class
Settings::DeletesController
<
Settings
::
BaseController
layout
'admin'
skip_before_action
:require_functional!
before_action
:check_enabled_deletion
before_action
:authenticate_user!
before_action
:require_not_suspended!
skip_before_action
:require_functional!
before_action
:check_enabled_deletion
def
show
@confirmation
=
Form
::
DeleteConfirmation
.
new
...
...
@@ -45,8 +42,8 @@ class Settings::DeletesController < Settings::BaseController
end
def
destroy_account!
current_account
.
suspend!
A
dmin
::
Suspens
ionWorker
.
perform_async
(
current_user
.
account_id
,
true
)
current_account
.
suspend!
(
origin: :local
)
A
ccountDelet
ionWorker
.
perform_async
(
current_user
.
account_id
)
sign_out
end
end
This diff is collapsed.
Click to expand it.
app/controllers/settings/exports/blocked_accounts_controller.rb
+
1
-
1
View file @
824d1b88
...
...
@@ -2,7 +2,7 @@
module
Settings
module
Exports
class
BlockedAccountsController
<
Application
Controller
class
BlockedAccountsController
<
Base
Controller
include
ExportControllerConcern
def
index
...
...
This diff is collapsed.
Click to expand it.
app/controllers/settings/exports/blocked_domains_controller.rb
+
1
-
1
View file @
824d1b88
...
...
@@ -2,7 +2,7 @@
module
Settings
module
Exports
class
BlockedDomainsController
<
Application
Controller
class
BlockedDomainsController
<
Base
Controller
include
ExportControllerConcern
def
index
...
...
This diff is collapsed.
Click to expand it.
app/controllers/settings/exports/bookmarks_controller.rb
0 → 100644
+
19
-
0
View file @
824d1b88
# frozen_string_literal: true
module
Settings
module
Exports
class
BookmarksController
<
BaseController
include
ExportControllerConcern
def
index
send_export_file
end
private
def
export_data
@export
.
to_bookmarks_csv
end
end
end
end
This diff is collapsed.
Click to expand it.
app/controllers/settings/exports/following_accounts_controller.rb
+
1
-
1
View file @
824d1b88
...
...
@@ -2,7 +2,7 @@
module
Settings
module
Exports
class
FollowingAccountsController
<
Application
Controller
class
FollowingAccountsController
<
Base
Controller
include
ExportControllerConcern
def
index
...
...
This diff is collapsed.
Click to expand it.
app/controllers/settings/exports/lists_controller.rb
+
1
-
1
View file @
824d1b88
...
...
@@ -2,7 +2,7 @@
module
Settings
module
Exports
class
ListsController
<
Application
Controller
class
ListsController
<
Base
Controller
include
ExportControllerConcern
def
index
...
...
This diff is collapsed.
Click to expand it.
app/controllers/settings/exports/muted_accounts_controller.rb
+
1
-
1
View file @
824d1b88
...
...
@@ -2,7 +2,7 @@
module
Settings
module
Exports
class
MutedAccountsController
<
Application
Controller
class
MutedAccountsController
<
Base
Controller
include
ExportControllerConcern
def
index
...
...
This diff is collapsed.
Click to expand it.
app/controllers/settings/exports_controller.rb
+
0
-
11
View file @
824d1b88
...
...
@@ -3,11 +3,6 @@
class
Settings::ExportsController
<
Settings
::
BaseController
include
Authorization
layout
'admin'
before_action
:authenticate_user!
before_action
:require_not_suspended!
skip_before_action
:require_functional!
def
show
...
...
@@ -16,8 +11,6 @@ class Settings::ExportsController < Settings::BaseController
end
def
create
raise
Mastodon
::
NotPermittedError
unless
user_signed_in?
backup
=
nil
RedisLock
.
acquire
(
lock_options
)
do
|
lock
|
...
...
@@ -37,8 +30,4 @@ class Settings::ExportsController < Settings::BaseController
def
lock_options
{
redis:
Redis
.
current
,
key:
"backup:
#{
current_user
.
id
}
"
}
end
def
require_not_suspended!
forbidden
if
current_account
.
suspended?
end
end
This diff is collapsed.
Click to expand it.
app/controllers/settings/featured_tags_controller.rb
+
4
-
7
View file @
824d1b88
# frozen_string_literal: true
class
Settings::FeaturedTagsController
<
Settings
::
BaseController
layout
'admin'
before_action
:authenticate_user!
before_action
:set_featured_tags
,
only: :index
before_action
:set_featured_tag
,
except:
[
:index
,
:create
]
before_action
:set_
most
_used_tags
,
only: :index
before_action
:set_
recently
_used_tags
,
only: :index
def
index
@featured_tag
=
FeaturedTag
.
new
...
...
@@ -20,7 +17,7 @@ class Settings::FeaturedTagsController < Settings::BaseController
redirect_to
settings_featured_tags_path
else
set_featured_tags
set_
most
_used_tags
set_
recently
_used_tags
render
:index
end
...
...
@@ -41,8 +38,8 @@ class Settings::FeaturedTagsController < Settings::BaseController
@featured_tags
=
current_account
.
featured_tags
.
order
(
statuses_count: :desc
).
reject
(
&
:new_record?
)
end
def
set_
most
_used_tags
@
most
_used_tags
=
Tag
.
most
_used
(
current_account
).
where
.
not
(
id:
@featured_tags
.
map
(
&
:id
)).
limit
(
10
)
def
set_
recently
_used_tags
@
recently
_used_tags
=
Tag
.
recently
_used
(
current_account
).
where
.
not
(
id:
@featured_tags
.
map
(
&
:id
)).
limit
(
10
)
end
def
featured_tag_params
...
...
This diff is collapsed.
Click to expand it.
app/controllers/settings/identity_proofs_controller.rb
+
0
-
3
View file @
824d1b88
# frozen_string_literal: true
class
Settings::IdentityProofsController
<
Settings
::
BaseController
layout
'admin'
before_action
:authenticate_user!
before_action
:check_required_params
,
only: :new
def
index
...
...
This diff is collapsed.
Click to expand it.
app/controllers/settings/imports_controller.rb
+
0
-
3
View file @
824d1b88
# frozen_string_literal: true
class
Settings::ImportsController
<
Settings
::
BaseController
layout
'admin'
before_action
:authenticate_user!
before_action
:set_account
def
show
...
...
This diff is collapsed.
Click to expand it.
app/controllers/settings/migration/redirects_controller.rb
+
1
-
8
View file @
824d1b88
# frozen_string_literal: true
class
Settings::Migration::RedirectsController
<
Settings
::
BaseController
layout
'admin'
skip_before_action
:require_functional!
before_action
:authenticate_user!
before_action
:require_not_suspended!
skip_before_action
:require_functional!
def
new
@redirect
=
Form
::
Redirect
.
new
end
...
...
@@ -38,8 +35,4 @@ class Settings::Migration::RedirectsController < Settings::BaseController
def
resource_params
params
.
require
(
:form_redirect
).
permit
(
:acct
,
:current_password
,
:current_username
)
end
def
require_not_suspended!
forbidden
if
current_account
.
suspended?
end
end
This diff is collapsed.
Click to expand it.
app/controllers/settings/migrations_controller.rb
+
1
-
8
View file @
824d1b88
# frozen_string_literal: true
class
Settings::MigrationsController
<
Settings
::
BaseController
layout
'admin'
skip_before_action
:require_functional!
before_action
:authenticate_user!
before_action
:require_not_suspended!
before_action
:set_migrations
before_action
:set_cooldown
skip_before_action
:require_functional!
def
show
@migration
=
current_account
.
migrations
.
build
end
...
...
@@ -44,8 +41,4 @@ class Settings::MigrationsController < Settings::BaseController
def
on_cooldown?
@cooldown
.
present?
end
def
require_not_suspended!
forbidden
if
current_account
.
suspended?
end
end
This diff is collapsed.
Click to expand it.
app/controllers/settings/pictures_controller.rb
+
6
-
3
View file @
824d1b88
...
...
@@ -2,14 +2,17 @@
module
Settings
class
PicturesController
<
BaseController
before_action
:authenticate_user!
before_action
:set_account
before_action
:set_picture
def
destroy
if
valid_picture?
msg
=
I18n
.
t
(
'generic.changes_saved_msg'
)
if
UpdateAccountService
.
new
.
call
(
@account
,
{
@picture
=>
nil
,
"
#{
@picture
}
_remote_url"
=>
''
})
redirect_to
settings_profile_path
,
notice:
msg
,
status:
303
if
UpdateAccountService
.
new
.
call
(
@account
,
{
@picture
=>
nil
,
"
#{
@picture
}
_remote_url"
=>
''
})
ActivityPub
::
UpdateDistributionWorker
.
perform_async
(
@account
.
id
)
redirect_to
settings_profile_path
,
notice:
I18n
.
t
(
'generic.changes_saved_msg'
),
status:
303
else
redirect_to
settings_profile_path
end
else
bad_request
end
...
...
This diff is collapsed.
Click to expand it.
app/controllers/settings/preferences_controller.rb
+
1
-
4
View file @
824d1b88
# frozen_string_literal: true
class
Settings::PreferencesController
<
Settings
::
BaseController
layout
'admin'
before_action
:authenticate_user!
def
show
;
end
def
update
...
...
@@ -47,6 +43,7 @@ class Settings::PreferencesController < Settings::BaseController
:setting_display_media
,
:setting_expand_spoilers
,
:setting_reduce_motion
,
:setting_disable_swiping
,
:setting_system_font_ui
,
:setting_noindex
,
:setting_theme
,
...
...
This diff is collapsed.
Click to expand it.
app/controllers/settings/profiles_controller.rb
+
0
-
3
View file @
824d1b88
# frozen_string_literal: true
class
Settings::ProfilesController
<
Settings
::
BaseController
layout
'admin'
before_action
:authenticate_user!
before_action
:set_account
def
show
...
...
This diff is collapsed.
Click to expand it.
Prev
1
2
3
4
5
6
7
8
9
…
46
Next
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Snippets