-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
feat: 通報の即時解決機能を追加 #11032
base: develop
Are you sure you want to change the base?
feat: 通報の即時解決機能を追加 #11032
Conversation
e410b36
to
e443170
Compare
This comment was marked as outdated.
This comment was marked as outdated.
まだ確認できてません🙏 |
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.
機能的には正常に動いています。
通報のメール通知機能に関しては、受信するメアドの設定とON/OFFが選べるようになったらもっといいかもです。
(ioではnoreplyメールボックス宛に大量に送られてしまい該当する部分を削除して運用しています。)
機能外的にはaactの値がどんな風に降ってくるのかが実際試してみないと分からないことになっていましてplaceholderを実装しました( MisskeyIO@e5b84a7 サジェストのものです)
Co-authored-by: まっちゃとーにゅ <17376330+u1-liquid@users.noreply.github.com>
(あ、そういえばそのコミットにその問題ありましたね…🤯) |
@u1-liquid 通報通知をメールで受け取るかオプションで選べるようにしたのと、通報通知を受け取るメールアドレスを設定できるようにしました。 |
このPRによるapi.jsonの差分 差分はこちら--- base
+++ head
@@ -389,6 +389,15 @@
"enableIdenticonGeneration": {
"type": "boolean"
},
+ "doNotSendNotificationEmailsForAbuseReport": {
+ "type": "boolean"
+ },
+ "emailToReceiveAbuseReport": {
+ "type": [
+ "string",
+ "null"
+ ]
+ },
"manifestJsonOverride": {
"type": "string"
},
@@ -589,6 +598,8 @@
"enableChartsForFederatedInstances",
"enableServerMachineStats",
"enableIdenticonGeneration",
+ "doNotSendNotificationEmailsForAbuseReport",
+ "emailToReceiveAbuseReport",
"manifestJsonOverride",
"policies",
"enableFanoutTimeline",
@@ -2995,6 +3006,841 @@
}
}
},
+ "/admin/abuse-report-resolver/create": {
+ "post": {
+ "operationId": "admin/abuse-report-resolver/create",
+ "summary": "admin/abuse-report-resolver/create",
+ "description": "No description provided.\n\n**Credential required**: *Yes* / **Permission**: *write:admin:abuse-report-resolver*",
+ "externalDocs": {
+ "description": "Source code",
+ "url": "https://github.com/misskey-dev/misskey/blob/develop/packages/backend/src/server/api/endpoints/admin/abuse-report-resolver/create.ts"
+ },
+ "tags": [
+ "admin"
+ ],
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "minLength": 1
+ },
+ "targetUserPattern": {
+ "type": [
+ "string",
+ "null"
+ ]
+ },
+ "reporterPattern": {
+ "type": [
+ "string",
+ "null"
+ ]
+ },
+ "reportContentPattern": {
+ "type": [
+ "string",
+ "null"
+ ]
+ },
+ "expiresAt": {
+ "type": "string",
+ "enum": [
+ "1hour",
+ "12hours",
+ "1day",
+ "1week",
+ "1month",
+ "3months",
+ "6months",
+ "1year",
+ "indefinitely"
+ ]
+ },
+ "forward": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "name",
+ "targetUserPattern",
+ "reporterPattern",
+ "reportContentPattern",
+ "expiresAt",
+ "forward"
+ ]
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "OK (with results)",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string"
+ },
+ "targetUserPattern": {
+ "type": [
+ "string",
+ "null"
+ ]
+ },
+ "reporterPattern": {
+ "type": [
+ "string",
+ "null"
+ ]
+ },
+ "reportContentPattern": {
+ "type": [
+ "string",
+ "null"
+ ]
+ },
+ "expiresAt": {
+ "type": "string"
+ },
+ "forward": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "name",
+ "targetUserPattern",
+ "reporterPattern",
+ "reportContentPattern",
+ "expiresAt",
+ "forward"
+ ]
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Error"
+ },
+ "examples": {
+ "INVALID_REGULAR_EXPRESSION_FOR_TARGET_USER": {
+ "value": {
+ "error": {
+ "message": "Invalid regular expression for target user.",
+ "code": "INVALID_REGULAR_EXPRESSION_FOR_TARGET_USER",
+ "id": "c008484a-0a14-4e74-86f4-b176dc49fcaa"
+ }
+ }
+ },
+ "INVALID_REGULAR_EXPRESSION_FOR_REPORTER": {
+ "value": {
+ "error": {
+ "message": "Invalid regular expression for reporter.",
+ "code": "INVALID_REGULAR_EXPRESSION_FOR_REPORTER",
+ "id": "399b4062-257f-44c8-87cc-4ffae2527fbc"
+ }
+ }
+ },
+ "INVALID_REGULAR_EXPRESSION_FOR_REPORT_CONTENT": {
+ "value": {
+ "error": {
+ "message": "Invalid regular expression for report content.",
+ "code": "INVALID_REGULAR_EXPRESSION_FOR_REPORT_CONTENT",
+ "id": "88c124d8-f517-4c63-a464-0abc274168b"
+ }
+ }
+ },
+ "INVALID_PARAM": {
+ "value": {
+ "error": {
+ "message": "Invalid param.",
+ "code": "INVALID_PARAM",
+ "id": "3d81ceae-475f-4600-b2a8-2bc116157532"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "Authentication error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Error"
+ },
+ "examples": {
+ "CREDENTIAL_REQUIRED": {
+ "value": {
+ "error": {
+ "message": "Credential required.",
+ "code": "CREDENTIAL_REQUIRED",
+ "id": "1384574d-a912-4b81-8601-c7b1c4085df1"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Forbidden error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Error"
+ },
+ "examples": {
+ "AUTHENTICATION_FAILED": {
+ "value": {
+ "error": {
+ "message": "Authentication failed. Please ensure your token is correct.",
+ "code": "AUTHENTICATION_FAILED",
+ "id": "b0a7f5f8-dc2f-4171-b91f-de88ad238e14"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "418": {
+ "description": "I'm Ai",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Error"
+ },
+ "examples": {
+ "I_AM_AI": {
+ "value": {
+ "error": {
+ "message": "You sent a request to Ai-chan, Misskey's showgirl, instead of the server.",
+ "code": "I_AM_AI",
+ "id": "60c46cd1-f23a-46b1-bebe-5d2b73951a84"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "500": {
+ "description": "Internal server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Error"
+ },
+ "examples": {
+ "INTERNAL_ERROR": {
+ "value": {
+ "error": {
+ "message": "Internal error occurred. Please contact us if the error persists.",
+ "code": "INTERNAL_ERROR",
+ "id": "5d37dbcb-891e-41ca-a3d6-e690c97775ac"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/admin/abuse-report-resolver/list": {
+ "post": {
+ "operationId": "admin/abuse-report-resolver/list",
+ "summary": "admin/abuse-report-resolver/list",
+ "description": "No description provided.\n\n**Credential required**: *Yes* / **Permission**: *read:admin:abuse-report-resolver*",
+ "externalDocs": {
+ "description": "Source code",
+ "url": "https://github.com/misskey-dev/misskey/blob/develop/packages/backend/src/server/api/endpoints/admin/abuse-report-resolver/list.ts"
+ },
+ "tags": [
+ "admin"
+ ],
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "limit": {
+ "type": "number",
+ "minimum": 1,
+ "maximum": 100,
+ "default": 10
+ },
+ "sinceId": {
+ "type": "string",
+ "format": "misskey:id"
+ },
+ "untilId": {
+ "type": "string",
+ "format": "misskey:id"
+ }
+ }
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "OK (with results)",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string"
+ },
+ "targetUserPattern": {
+ "type": [
+ "string",
+ "null"
+ ]
+ },
+ "reporterPattern": {
+ "type": [
+ "string",
+ "null"
+ ]
+ },
+ "reportContentPattern": {
+ "type": [
+ "string",
+ "null"
+ ]
+ },
+ "expiresAt": {
+ "type": "string"
+ },
+ "forward": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "name",
+ "targetUserPattern",
+ "reporterPattern",
+ "reportContentPattern",
+ "expiresAt",
+ "forward"
+ ]
+ }
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Error"
+ },
+ "examples": {
+ "INVALID_PARAM": {
+ "value": {
+ "error": {
+ "message": "Invalid param.",
+ "code": "INVALID_PARAM",
+ "id": "3d81ceae-475f-4600-b2a8-2bc116157532"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "Authentication error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Error"
+ },
+ "examples": {
+ "CREDENTIAL_REQUIRED": {
+ "value": {
+ "error": {
+ "message": "Credential required.",
+ "code": "CREDENTIAL_REQUIRED",
+ "id": "1384574d-a912-4b81-8601-c7b1c4085df1"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Forbidden error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Error"
+ },
+ "examples": {
+ "AUTHENTICATION_FAILED": {
+ "value": {
+ "error": {
+ "message": "Authentication failed. Please ensure your token is correct.",
+ "code": "AUTHENTICATION_FAILED",
+ "id": "b0a7f5f8-dc2f-4171-b91f-de88ad238e14"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "418": {
+ "description": "I'm Ai",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Error"
+ },
+ "examples": {
+ "I_AM_AI": {
+ "value": {
+ "error": {
+ "message": "You sent a request to Ai-chan, Misskey's showgirl, instead of the server.",
+ "code": "I_AM_AI",
+ "id": "60c46cd1-f23a-46b1-bebe-5d2b73951a84"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "500": {
+ "description": "Internal server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Error"
+ },
+ "examples": {
+ "INTERNAL_ERROR": {
+ "value": {
+ "error": {
+ "message": "Internal error occurred. Please contact us if the error persists.",
+ "code": "INTERNAL_ERROR",
+ "id": "5d37dbcb-891e-41ca-a3d6-e690c97775ac"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/admin/abuse-report-resolver/delete": {
+ "post": {
+ "operationId": "admin/abuse-report-resolver/delete",
+ "summary": "admin/abuse-report-resolver/delete",
+ "description": "No description provided.\n\n**Credential required**: *No* / **Permission**: *write:admin:abuse-report-resolver*",
+ "externalDocs": {
+ "description": "Source code",
+ "url": "https://github.com/misskey-dev/misskey/blob/develop/packages/backend/src/server/api/endpoints/admin/abuse-report-resolver/delete.ts"
+ },
+ "tags": [
+ "admin"
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "resolverId": {
+ "type": "string",
+ "format": "misskey:id"
+ }
+ },
+ "required": [
+ "resolverId"
+ ]
+ }
+ }
+ }
+ },
+ "responses": {
+ "204": {
+ "description": "OK (without any results)"
+ },
+ "400": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Error"
+ },
+ "examples": {
+ "RESOLVER_NOT_FOUND": {
+ "value": {
+ "error": {
+ "message": "Resolver not found.",
+ "code": "RESOLVER_NOT_FOUND",
+ "id": "121fbea9-3e49-4456-998a-d4095c7ac5c5"
+ }
+ }
+ },
+ "INVALID_PARAM": {
+ "value": {
+ "error": {
+ "message": "Invalid param.",
+ "code": "INVALID_PARAM",
+ "id": "3d81ceae-475f-4600-b2a8-2bc116157532"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "Authentication error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Error"
+ },
+ "examples": {
+ "CREDENTIAL_REQUIRED": {
+ "value": {
+ "error": {
+ "message": "Credential required.",
+ "code": "CREDENTIAL_REQUIRED",
+ "id": "1384574d-a912-4b81-8601-c7b1c4085df1"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Forbidden error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Error"
+ },
+ "examples": {
+ "AUTHENTICATION_FAILED": {
+ "value": {
+ "error": {
+ "message": "Authentication failed. Please ensure your token is correct.",
+ "code": "AUTHENTICATION_FAILED",
+ "id": "b0a7f5f8-dc2f-4171-b91f-de88ad238e14"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "418": {
+ "description": "I'm Ai",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Error"
+ },
+ "examples": {
+ "I_AM_AI": {
+ "value": {
+ "error": {
+ "message": "You sent a request to Ai-chan, Misskey's showgirl, instead of the server.",
+ "code": "I_AM_AI",
+ "id": "60c46cd1-f23a-46b1-bebe-5d2b73951a84"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "500": {
+ "description": "Internal server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Error"
+ },
+ "examples": {
+ "INTERNAL_ERROR": {
+ "value": {
+ "error": {
+ "message": "Internal error occurred. Please contact us if the error persists.",
+ "code": "INTERNAL_ERROR",
+ "id": "5d37dbcb-891e-41ca-a3d6-e690c97775ac"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/admin/abuse-report-resolver/update": {
+ "post": {
+ "operationId": "admin/abuse-report-resolver/update",
+ "summary": "admin/abuse-report-resolver/update",
+ "description": "No description provided.\n\n**Credential required**: *Yes* / **Permission**: *write:admin:abuse-report-resolver*",
+ "externalDocs": {
+ "description": "Source code",
+ "url": "https://github.com/misskey-dev/misskey/blob/develop/packages/backend/src/server/api/endpoints/admin/abuse-report-resolver/update.ts"
+ },
+ "tags": [
+ "admin"
+ ],
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "resolverId": {
+ "type": "string",
+ "format": "misskey:id"
+ },
+ "name": {
+ "type": "string"
+ },
+ "targetUserPattern": {
+ "type": [
+ "string",
+ "null"
+ ]
+ },
+ "reporterPattern": {
+ "type": [
+ "string",
+ "null"
+ ]
+ },
+ "reportContentPattern": {
+ "type": [
+ "string",
+ "null"
+ ]
+ },
+ "expiresAt": {
+ "type": "string",
+ "enum": [
+ "1hour",
+ "12hours",
+ "1day",
+ "1week",
+ "1month",
+ "3months",
+ "6months",
+ "1year",
+ "indefinitely"
+ ]
+ },
+ "forward": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "resolverId"
+ ]
+ }
+ }
+ }
+ },
+ "responses": {
+ "204": {
+ "description": "OK (without any results)"
+ },
+ "400": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Error"
+ },
+ "examples": {
+ "RESOLVER_NOT_FOUND": {
+ "value": {
+ "error": {
+ "message": "Resolver not found.",
+ "id": "fd32710e-75e1-4d20-bbd2-f89029acb16e",
+ "code": "RESOLVER_NOT_FOUND"
+ }
+ }
+ },
+ "INVALID_REGULAR_EXPRESSION_FOR_TARGET_USER": {
+ "value": {
+ "error": {
+ "message": "Invalid regular expression for target user.",
+ "code": "INVALID_REGULAR_EXPRESSION_FOR_TARGET_USER",
+ "id": "c008484a-0a14-4e74-86f4-b176dc49fcaa"
+ }
+ }
+ },
+ "INVALID_REGULAR_EXPRESSION_FOR_REPORTER": {
+ "value": {
+ "error": {
+ "message": "Invalid regular expression for reporter.",
+ "code": "INVALID_REGULAR_EXPRESSION_FOR_REPORTER",
+ "id": "399b4062-257f-44c8-87cc-4ffae2527fbc"
+ }
+ }
+ },
+ "INVALID_REGULAR_EXPRESSION_FOR_REPORT_CONTENT": {
+ "value": {
+ "error": {
+ "message": "Invalid regular expression for report content.",
+ "code": "INVALID_REGULAR_EXPRESSION_FOR_REPORT_CONTENT",
+ "id": "88c124d8-f517-4c63-a464-0abc274168b"
+ }
+ }
+ },
+ "INVALID_PARAM": {
+ "value": {
+ "error": {
+ "message": "Invalid param.",
+ "code": "INVALID_PARAM",
+ "id": "3d81ceae-475f-4600-b2a8-2bc116157532"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "Authentication error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Error"
+ },
+ "examples": {
+ "CREDENTIAL_REQUIRED": {
+ "value": {
+ "error": {
+ "message": "Credential required.",
+ "code": "CREDENTIAL_REQUIRED",
+ "id": "1384574d-a912-4b81-8601-c7b1c4085df1"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Forbidden error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Error"
+ },
+ "examples": {
+ "AUTHENTICATION_FAILED": {
+ "value": {
+ "error": {
+ "message": "Authentication failed. Please ensure your token is correct.",
+ "code": "AUTHENTICATION_FAILED",
+ "id": "b0a7f5f8-dc2f-4171-b91f-de88ad238e14"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "418": {
+ "description": "I'm Ai",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Error"
+ },
+ "examples": {
+ "I_AM_AI": {
+ "value": {
+ "error": {
+ "message": "You sent a request to Ai-chan, Misskey's showgirl, instead of the server.",
+ "code": "I_AM_AI",
+ "id": "60c46cd1-f23a-46b1-bebe-5d2b73951a84"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "500": {
+ "description": "Internal server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Error"
+ },
+ "examples": {
+ "INTERNAL_ERROR": {
+ "value": {
+ "error": {
+ "message": "Internal error occurred. Please contact us if the error persists.",
+ "code": "INTERNAL_ERROR",
+ "id": "5d37dbcb-891e-41ca-a3d6-e690c97775ac"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ },
"/admin/avatar-decorations/create": {
"post": {
"operationId": "admin/avatar-decorations/create",
@@ -12066,6 +12912,15 @@
"enableIdenticonGeneration": {
"type": "boolean"
},
+ "doNotSendNotificationEmailsForAbuseReport": {
+ "type": "boolean"
+ },
+ "emailToReceiveAbuseReport": {
+ "type": [
+ "string",
+ "null"
+ ]
+ },
"serverRules": {
"type": "array",
"items": { |
|
} else if (ps.reportContentPattern === null) { | ||
properties.reportContentPattern = null; | ||
} | ||
if (ps.forward) properties.forward = ps.forward; |
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.
if (ps.forward) properties.forward = ps.forward; | |
if (ps.forward !== undefined) properties.forward = ps.forward; |
forwardがtrueになるとfalseに変更できなくなってしまっている
ここはBooleanでFalse
が来たときには更新しないといけないので
undefined
かをチェックしないといけない
…1032](misskey-dev/misskey#11032 (review))) - forward가 `true`가 되면 `false`로 변경할 수 없음
Close #10942
What
通報の即時解決機能を追加しました。

Why
一定の条件で通報を自動解決することでモデレーターの負担を軽減できる
Additional info (optional)
Checklist