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

Enhance: Fedibird形式の絵文字情報連合に対応 #604

Open
wants to merge 28 commits into
base: develop
Choose a base branch
from

Conversation

penginn-net
Copy link
Collaborator

@penginn-net penginn-net commented Dec 27, 2024

What

Enhance: Fedibird形式の絵文字情報連合に対応

Why

Resolve #544

Additional info (optional)

misskey-dev/misskey#10859 (comment)

Checklist

  • コントリビューションガイドを読みました( Read the contribution guide)
  • ローカル環境で動作しました(Test working in a local environment)
  • (必要なら)CHANGELOG_YOJO.mdの更新((If needed) Update CHANGELOG_YOJO.md)
  • (必要なら)テストの追加((If possible) Add tests)

Copy link

codecov bot commented Dec 27, 2024

Codecov Report

Attention: Patch coverage is 54.51128% with 121 lines in your changes missing coverage. Please review.

Project coverage is 40.04%. Comparing base (c3e0bc7) to head (c0f62be).

Files with missing lines Patch % Lines
packages/frontend/src/pages/emoji-edit-dialog.vue 0.00% 24 Missing ⚠️
...kages/frontend/src/pages/custom-emojis-manager.vue 0.00% 19 Missing ⚠️
packages/backend/src/core/CustomEmojiService.ts 5.88% 16 Missing ⚠️
...ckend/src/core/activitypub/models/ApNoteService.ts 0.00% 14 Missing ⚠️
...ckend/src/server/api/endpoints/admin/emoji/copy.ts 58.33% 10 Missing ⚠️
...kend/src/server/api/endpoints/admin/emoji/steal.ts 58.33% 10 Missing ⚠️
.../backend/src/core/activitypub/ApRendererService.ts 0.00% 7 Missing ⚠️
...end/src/server/api/endpoints/admin/emoji/update.ts 54.54% 5 Missing ⚠️
...es/backend/src/core/entities/EmojiEntityService.ts 0.00% 4 Missing ⚠️
...e/processors/ImportCustomEmojisProcessorService.ts 0.00% 4 Missing ⚠️
... and 2 more
Additional details and impacted files
@@             Coverage Diff              @@
##           develop     #604       +/-   ##
============================================
+ Coverage    19.86%   40.04%   +20.17%     
============================================
  Files          797     1696      +899     
  Lines       123252   236300   +113048     
  Branches      1041     3756     +2715     
============================================
+ Hits         24483    94623    +70140     
- Misses       98164   141042    +42878     
- Partials       605      635       +30     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

github-actions bot commented Dec 27, 2024

이 PR에 의한 api.json 차이

차이점은 여기에서 볼 수 있음
--- base
+++ head
@@ -7295,6 +7295,41 @@
                     "items": {
                       "type": "string"
                     }
+                  },
+                  "copyPermission": {
+                    "type": [
+                      "string",
+                      "null"
+                    ],
+                    "enum": [
+                      "allow",
+                      "deny",
+                      "conditional",
+                      null
+                    ],
+                    "default": "allow",
+                    "description": "この絵文字を外部サーバーへコピーすることの許可"
+                  },
+                  "usageInfo": {
+                    "type": [
+                      "string",
+                      "null"
+                    ],
+                    "description": "使用する際の説明"
+                  },
+                  "author": {
+                    "type": [
+                      "string",
+                      "null"
+                    ],
+                    "description": "作者情報"
+                  },
+                  "description": {
+                    "type": [
+                      "string",
+                      "null"
+                    ],
+                    "description": "絵文字の説明"
                   }
                 },
                 "required": [
@@ -7505,6 +7540,41 @@
                     "items": {
                       "type": "string"
                     }
+                  },
+                  "copyPermission": {
+                    "type": [
+                      "string",
+                      "null"
+                    ],
+                    "enum": [
+                      "allow",
+                      "deny",
+                      "conditional",
+                      null
+                    ],
+                    "default": "allow",
+                    "description": "この絵文字を外部サーバーへコピーすることの許可"
+                  },
+                  "usageInfo": {
+                    "type": [
+                      "string",
+                      "null"
+                    ],
+                    "description": "使用する際の説明"
+                  },
+                  "author": {
+                    "type": [
+                      "string",
+                      "null"
+                    ],
+                    "description": "作者情報"
+                  },
+                  "description": {
+                    "type": [
+                      "string",
+                      "null"
+                    ],
+                    "description": "絵文字の説明"
                   }
                 },
                 "required": [
@@ -7679,6 +7749,9 @@
                   "emojiId": {
                     "type": "string",
                     "format": "misskey:id"
+                  },
+                  "usageInfoReaded": {
+                    "type": "boolean"
                   }
                 },
                 "required": [
@@ -7734,6 +7807,24 @@
                       }
                     }
                   },
+                  "NOT_ALLOWED": {
+                    "value": {
+                      "error": {
+                        "message": "Copy is not allowed this emoji.",
+                        "code": "NOT_ALLOWED",
+                        "id": "1beadfcc-3882-f3c9-ee57-ded45e4741e4"
+                      }
+                    }
+                  },
+                  "SEE_USAGEINFOMATION_OR_LICENSE": {
+                    "value": {
+                      "error": {
+                        "message": "see Usage information or license.",
+                        "code": "SEE_USAGEINFOMATION_OR_LICENSE",
+                        "id": "28d9031e-ddbc-5ba3-c435-fcb5259e8408"
+                      }
+                    }
+                  },
                   "INVALID_PARAM": {
                     "value": {
                       "error": {
@@ -8386,6 +8477,40 @@
                       },
                       "url": {
                         "type": "string"
+                      },
+                      "copyPermission": {
+                        "type": [
+                          "string",
+                          "null"
+                        ],
+                        "enum": [
+                          "allow",
+                          "deny",
+                          "conditional",
+                          null
+                        ],
+                        "description": "この絵文字を外部サーバーへコピーすることの許可"
+                      },
+                      "usageInfo": {
+                        "type": [
+                          "string",
+                          "null"
+                        ],
+                        "description": "使用する際の説明"
+                      },
+                      "author": {
+                        "type": [
+                          "string",
+                          "null"
+                        ],
+                        "description": "作者情報"
+                      },
+                      "description": {
+                        "type": [
+                          "string",
+                          "null"
+                        ],
+                        "description": "絵文字の説明"
                       }
                     },
                     "required": [
@@ -8394,7 +8519,11 @@
                       "name",
                       "category",
                       "host",
-                      "url"
+                      "url",
+                      "copyPermission",
+                      "usageInfo",
+                      "author",
+                      "description"
                     ]
                   }
                 }
@@ -9381,6 +9510,9 @@
                   },
                   "host": {
                     "type": "string"
+                  },
+                  "usageInfoReaded": {
+                    "type": "boolean"
                   }
                 },
                 "required": [
@@ -9446,6 +9578,24 @@
                       }
                     }
                   },
+                  "NOT_ALLOWED": {
+                    "value": {
+                      "error": {
+                        "message": "Copy is not allowed this emoji.",
+                        "code": "NOT_ALLOWED",
+                        "id": "1beadfcc-3882-f3c9-ee57-ded45e4741e4"
+                      }
+                    }
+                  },
+                  "SEE_USAGEINFOMATION_OR_LICENSE": {
+                    "value": {
+                      "error": {
+                        "message": "see Usage information or license.",
+                        "code": "SEE_USAGEINFOMATION_OR_LICENSE",
+                        "id": "28d9031e-ddbc-5ba3-c435-fcb5259e8408"
+                      }
+                    }
+                  },
                   "INVALID_PARAM": {
                     "value": {
                       "error": {
@@ -9612,6 +9762,40 @@
                     "items": {
                       "type": "string"
                     }
+                  },
+                  "copyPermission": {
+                    "type": [
+                      "string",
+                      "null"
+                    ],
+                    "enum": [
+                      "allow",
+                      "deny",
+                      "conditional",
+                      null
+                    ],
+                    "description": "この絵文字を外部サーバーへコピーすることの許可"
+                  },
+                  "usageInfo": {
+                    "type": [
+                      "string",
+                      "null"
+                    ],
+                    "description": "使用する際の説明"
+                  },
+                  "author": {
+                    "type": [
+                      "string",
+                      "null"
+                    ],
+                    "description": "作者情報"
+                  },
+                  "description": {
+                    "type": [
+                      "string",
+                      "null"
+                    ],
+                    "description": "絵文字の説明"
                   }
                 },
                 "anyOf": [
@@ -88962,6 +89146,36 @@
               "type": "string",
               "format": "id"
             }
+          },
+          "copyPermission": {
+            "type": [
+              "string",
+              "null"
+            ],
+            "enum": [
+              "allow",
+              "deny",
+              "conditional",
+              null
+            ]
+          },
+          "usageInfo": {
+            "type": [
+              "string",
+              "null"
+            ]
+          },
+          "author": {
+            "type": [
+              "string",
+              "null"
+            ]
+          },
+          "description": {
+            "type": [
+              "string",
+              "null"
+            ]
           }
         },
         "required": [
@@ -88974,7 +89188,11 @@
           "license",
           "isSensitive",
           "localOnly",
-          "roleIdsThatCanBeUsedThisEmojiAsReaction"
+          "roleIdsThatCanBeUsedThisEmojiAsReaction",
+          "copyPermission",
+          "usageInfo",
+          "author",
+          "description"
         ]
       },
       "Flash": {

Get diff files from Workflow Page

@penginn-net penginn-net changed the title (Draft) Enhance(backend): Fedibird形式の絵文字情報連合に対応 (Draft) Enhance: Fedibird形式の絵文字情報連合に対応 Dec 27, 2024
@kozakura913 kozakura913 added this to the 1.3.0 milestone Dec 27, 2024
@penginn-net penginn-net marked this pull request as ready for review December 30, 2024 17:51
@penginn-net
Copy link
Collaborator Author

れでーふぉーれびゅー

@penginn-net penginn-net changed the title (Draft) Enhance: Fedibird形式の絵文字情報連合に対応 Enhance: Fedibird形式の絵文字情報連合に対応 Dec 30, 2024
Copy link
Collaborator

@kozakura913 kozakura913 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ApRenderServiceで送ってるのにApInboxServiceでは受け取らないの?
ApRenderServiceで送るならbackend/src/core/activitypub/type.tsのIApEmojiの定義も変えないとダメじゃない?

locales/ja-JP.yml Outdated Show resolved Hide resolved
keywords: emoji.aliases,
...(emoji.usageInfo === null ? { } : { usageInfo: emoji.usageInfo }),
...(emoji.author === null ? { } : { author: emoji.author }),
...(emoji.description === null ? { } : { description: emoji.description }),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

送信絵文字全部に詳細まで付くんだ。
idやuriで参照とかじゃないのね。
先行実装がそうなんだよね?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

これが飛んできてた
https://fedibird.com/emojis/92354.json

@kozakura913
Copy link
Collaborator

あとApRenderService/ApInboxServiceで扱うなら連合テストの追加も欲しい

@penginn-net
Copy link
Collaborator Author

penginn-net commented Dec 30, 2024

IApEmoji

https://github.com/yojo-art/cherrypick/pull/604/files#diff-91d29fc6895ff9205d2bc1b73f7fe153bcd097d14df1e55ecf7f1c51a7af4c69R276-R282

ApInboxService

extractApEmojiが呼ばれてるからinboxで受け取ってない?

@kozakura913
Copy link
Collaborator

辿れてなかった

@penginn-net
Copy link
Collaborator Author

penginn-net commented Dec 30, 2024

???

Expected value to strictly be equal to:
{"aliases": [], "author": "@alice@a.test", "category": "category", "copyPermission": "allow", "description": "description", "host": "a.test", "id": "a2f0sdp3gmdl002m", "isSensitive": false, "license": "license", "localOnly": false, "name": "ba143d8946414fdbb875569107b3abbe", "roleIdsThatCanBeUsedThisEmojiAsReaction": [], "url": "https://a.test/files/ab87090f-93ee-4a27-a3c8-418a5d9be7f2", "usageInfo": "usageInfo"}
Received:
{"aliases": [], "author": "@alice@a.test", "category": "category", "copyPermission": "allow", "description": "description", "host": "a.test", "id": "a2f0sdp3gmdl002m", "isSensitive": false, "license": "license", "localOnly": false, "name": "ba143d8946414fdbb875569107b3abbe", "roleIdsThatCanBeUsedThisEmojiAsReaction": [], "url": "https://a.test/files/ab87090f-93ee-4a27-a3c8-418a5d9be7f2", "usageInfo": "usageInfo"}

@kozakura913
Copy link
Collaborator

それ私も踏んで何が違うんだって怒りながらJSON.stringifyして比較したら一致したんだよね。ArrayとかObjectの比較がなんかおかしい

@kozakura913
Copy link
Collaborator

一応、本来はdeepStrictEqualってのがArrayとかObject比較する用のやつ

@penginn-net
Copy link
Collaborator Author

@kozakura913 なおして

@penginn-net
Copy link
Collaborator Author

なんか通った

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fedibird形式の絵文字情報連合に対応
2 participants