fix handling of private renotes
Some checks failed
Lint / pnpm_install (push) Successful in 1m43s
Publish Docker image / Build (push) Successful in 4m15s
Test (production install and build) / production (22.11.0) (push) Successful in 54s
Lint / lint (backend) (push) Successful in 1m58s
Test (backend) / unit (22.11.0) (push) Failing after 8m4s
Lint / lint (frontend) (push) Successful in 2m35s
Lint / lint (frontend-embed) (push) Successful in 2m15s
Lint / lint (frontend-shared) (push) Successful in 2m14s
Lint / lint (misskey-bubble-game) (push) Successful in 2m17s
Test (backend) / e2e (22.11.0) (push) Failing after 11m49s
Lint / lint (misskey-js) (push) Successful in 2m17s
Lint / lint (misskey-reversi) (push) Successful in 2m30s
Lint / typecheck (backend) (push) Failing after 1m52s
Lint / lint (sw) (push) Successful in 2m32s
Lint / typecheck (misskey-js) (push) Successful in 1m29s
Lint / typecheck (sw) (push) Successful in 1m53s

Signed-off-by: eternal-flame-AD <yume@yumechi.jp>
This commit is contained in:
ゆめ 2024-11-21 10:11:42 -06:00
parent 15e669d943
commit 748685e53e
No known key found for this signature in database
2 changed files with 3 additions and 3 deletions

View file

@ -7,6 +7,7 @@ import { setImmediate } from 'node:timers/promises';
import * as mfm from 'mfm-js'; import * as mfm from 'mfm-js';
import { In, DataSource, IsNull, LessThan } from 'typeorm'; import { In, DataSource, IsNull, LessThan } from 'typeorm';
import * as Redis from 'ioredis'; import * as Redis from 'ioredis';
import * as Bull from 'bullmq';
import { Inject, Injectable, OnApplicationShutdown } from '@nestjs/common'; import { Inject, Injectable, OnApplicationShutdown } from '@nestjs/common';
import { extractMentions } from '@/misc/extract-mentions.js'; import { extractMentions } from '@/misc/extract-mentions.js';
import { extractCustomEmojisFromMfm } from '@/misc/extract-custom-emojis-from-mfm.js'; import { extractCustomEmojisFromMfm } from '@/misc/extract-custom-emojis-from-mfm.js';
@ -291,7 +292,7 @@ export class NoteCreateService implements OnApplicationShutdown {
case 'followers': case 'followers':
// 他人のfollowers noteはreject // 他人のfollowers noteはreject
if (data.renote.userId !== user.id) { if (data.renote.userId !== user.id) {
throw new Error('Renote target is not public or home'); throw new Bull.UnrecoverableError('Renote target is not public or home');
} }
// Renote対象がfollowersならfollowersにする // Renote対象がfollowersならfollowersにする
@ -299,7 +300,7 @@ export class NoteCreateService implements OnApplicationShutdown {
break; break;
case 'specified': case 'specified':
// specified / direct noteはreject // specified / direct noteはreject
throw new Error('Renote target is not public or home'); throw new Bull.UnrecoverableError('Renote target is not public or home');
} }
} }

View file

@ -79,7 +79,6 @@ export function markOutgoing<T, L extends 'question' | undefined>(object: T, _ba
export function yumeNormalizeURL(url: string): string { export function yumeNormalizeURL(url: string): string {
const u = new URL(url); const u = new URL(url);
u.hash = '';
u.host = toASCII(u.host); u.host = toASCII(u.host);
if (u.protocol && u.protocol !== 'https:') { if (u.protocol && u.protocol !== 'https:') {
throw new bull.UnrecoverableError('protocol is not https'); throw new bull.UnrecoverableError('protocol is not https');