Commit 9cae4319 authored by Eugen Rochko's avatar Eugen Rochko
Browse files

Disable reports

- Return error from reports REST API
- Remove links to report in web UI
- Reject reports from ActivityPub
parent 9b6b1c74
...@@ -7,6 +7,8 @@ class Api::V1::ReportsController < Api::BaseController ...@@ -7,6 +7,8 @@ class Api::V1::ReportsController < Api::BaseController
respond_to :json respond_to :json
def create def create
raise Mastodon::NotPermittedError
@report = ReportService.new.call( @report = ReportService.new.call(
current_account, current_account,
reported_account, reported_account,
......
...@@ -220,7 +220,6 @@ class StatusActionBar extends ImmutablePureComponent { ...@@ -220,7 +220,6 @@ class StatusActionBar extends ImmutablePureComponent {
menu.push(null); menu.push(null);
menu.push({ text: intl.formatMessage(messages.mute, { name: status.getIn(['account', 'username']) }), action: this.handleMuteClick }); menu.push({ text: intl.formatMessage(messages.mute, { name: status.getIn(['account', 'username']) }), action: this.handleMuteClick });
menu.push({ text: intl.formatMessage(messages.block, { name: status.getIn(['account', 'username']) }), action: this.handleBlockClick }); menu.push({ text: intl.formatMessage(messages.block, { name: status.getIn(['account', 'username']) }), action: this.handleBlockClick });
menu.push({ text: intl.formatMessage(messages.report, { name: status.getIn(['account', 'username']) }), action: this.handleReport });
if (isStaff) { if (isStaff) {
menu.push(null); menu.push(null);
......
...@@ -171,8 +171,6 @@ class Header extends ImmutablePureComponent { ...@@ -171,8 +171,6 @@ class Header extends ImmutablePureComponent {
} else { } else {
menu.push({ text: intl.formatMessage(messages.block, { name: account.get('username') }), action: this.props.onBlock }); menu.push({ text: intl.formatMessage(messages.block, { name: account.get('username') }), action: this.props.onBlock });
} }
menu.push({ text: intl.formatMessage(messages.report, { name: account.get('username') }), action: this.props.onReport });
} }
if (account.get('acct') !== account.get('username')) { if (account.get('acct') !== account.get('username')) {
......
...@@ -167,7 +167,7 @@ class ActionBar extends React.PureComponent { ...@@ -167,7 +167,7 @@ class ActionBar extends React.PureComponent {
menu.push(null); menu.push(null);
menu.push({ text: intl.formatMessage(messages.mute, { name: status.getIn(['account', 'username']) }), action: this.handleMuteClick }); menu.push({ text: intl.formatMessage(messages.mute, { name: status.getIn(['account', 'username']) }), action: this.handleMuteClick });
menu.push({ text: intl.formatMessage(messages.block, { name: status.getIn(['account', 'username']) }), action: this.handleBlockClick }); menu.push({ text: intl.formatMessage(messages.block, { name: status.getIn(['account', 'username']) }), action: this.handleBlockClick });
menu.push({ text: intl.formatMessage(messages.report, { name: status.getIn(['account', 'username']) }), action: this.handleReport });
if (isStaff) { if (isStaff) {
menu.push(null); menu.push(null);
menu.push({ text: intl.formatMessage(messages.admin_account, { name: status.getIn(['account', 'username']) }), href: `/admin/accounts/${status.getIn(['account', 'id'])}` }); menu.push({ text: intl.formatMessage(messages.admin_account, { name: status.getIn(['account', 'username']) }), href: `/admin/accounts/${status.getIn(['account', 'id'])}` });
......
...@@ -23,7 +23,7 @@ class ActivityPub::Activity::Flag < ActivityPub::Activity ...@@ -23,7 +23,7 @@ class ActivityPub::Activity::Flag < ActivityPub::Activity
private private
def skip_reports? def skip_reports?
DomainBlock.find_by(domain: @account.domain)&.reject_reports? true
end end
def object_uris def object_uris
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment