diff options
| author | かっこかり <67428053+kakkokari-gtyih@users.noreply.github.com> | 2024-11-09 10:58:09 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-11-09 10:58:09 +0900 |
| commit | 4a62051ce7bd369335cf020d0bd39019f2a45212 (patch) | |
| tree | de8ea29003a51c281a34b64631cba7e20b491119 /packages/backend/src/core/MfmService.ts | |
| parent | refactor(frontend): 動画UIのフルスクリーン周りの調整 (#14877) (diff) | |
| download | sharkey-4a62051ce7bd369335cf020d0bd39019f2a45212.tar.gz sharkey-4a62051ce7bd369335cf020d0bd39019f2a45212.tar.bz2 sharkey-4a62051ce7bd369335cf020d0bd39019f2a45212.zip | |
fix(backend): ローカルユーザーへのメンションを含むノートが連合される際に正しいURLに変換されないことがある問題を修正 (#14879)
* fix: make sure mentions of local users get rendered correctly during AP delivery (resolves #645)
* Update Changelog
* indent
---------
Co-authored-by: Laura Hausmann <laura@hausmann.dev>
Co-authored-by: syuilo <4439005+syuilo@users.noreply.github.com>
Diffstat (limited to 'packages/backend/src/core/MfmService.ts')
| -rw-r--r-- | packages/backend/src/core/MfmService.ts | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/packages/backend/src/core/MfmService.ts b/packages/backend/src/core/MfmService.ts index edfb3aa4fc..8061622340 100644 --- a/packages/backend/src/core/MfmService.ts +++ b/packages/backend/src/core/MfmService.ts @@ -407,7 +407,9 @@ export class MfmService { const a = doc.createElement('a'); const { username, host, acct } = node.props; const remoteUserInfo = mentionedRemoteUsers.find(remoteUser => remoteUser.username.toLowerCase() === username.toLowerCase() && remoteUser.host?.toLowerCase() === host?.toLowerCase()); - a.setAttribute('href', remoteUserInfo ? (remoteUserInfo.url ? remoteUserInfo.url : remoteUserInfo.uri) : `${this.config.url}/${acct}`); + a.setAttribute('href', remoteUserInfo + ? (remoteUserInfo.url ? remoteUserInfo.url : remoteUserInfo.uri) + : `${this.config.url}/${acct.endsWith(`@${this.config.url}`) ? acct.substring(0, acct.length - this.config.url.length - 1) : acct}`); a.className = 'u-url mention'; a.textContent = acct; return a; |