Merge branch 'develop' into pr/ThatOneCalculator/8764
This commit is contained in:
commit
61568ad780
19 changed files with 130 additions and 77 deletions
|
@ -35,13 +35,13 @@
|
|||
"@peertube/http-signature": "1.7.0",
|
||||
"@sinonjs/fake-timers": "10.0.0",
|
||||
"@syuilo/aiscript": "0.11.1",
|
||||
"ajv": "8.11.0",
|
||||
"ajv": "8.11.2",
|
||||
"archiver": "5.3.1",
|
||||
"autobind-decorator": "2.4.0",
|
||||
"autwh": "0.1.0",
|
||||
"aws-sdk": "2.1253.0",
|
||||
"aws-sdk": "2.1258.0",
|
||||
"bcryptjs": "2.4.3",
|
||||
"blurhash": "1.1.5",
|
||||
"blurhash": "2.0.4",
|
||||
"bull": "4.10.1",
|
||||
"cacheable-lookup": "6.1.0",
|
||||
"cbor": "8.1.0",
|
||||
|
@ -58,10 +58,10 @@
|
|||
"file-type": "18.0.0",
|
||||
"fluent-ffmpeg": "2.1.2",
|
||||
"form-data": "^4.0.0",
|
||||
"got": "12.5.2",
|
||||
"got": "12.5.3",
|
||||
"hpagent": "1.2.0",
|
||||
"ioredis": "4.28.5",
|
||||
"ip-cidr": "3.0.10",
|
||||
"ip-cidr": "3.0.11",
|
||||
"is-svg": "4.3.2",
|
||||
"jest-mock": "^29.0.3",
|
||||
"js-yaml": "4.1.0",
|
||||
|
@ -92,7 +92,7 @@
|
|||
"os-utils": "0.0.14",
|
||||
"parse5": "7.1.1",
|
||||
"pg": "8.8.0",
|
||||
"private-ip": "2.3.4",
|
||||
"private-ip": "3.0.0",
|
||||
"probe-image-size": "7.2.3",
|
||||
"promise-limit": "2.7.0",
|
||||
"pug": "3.0.2",
|
||||
|
@ -118,7 +118,7 @@
|
|||
"stringz": "2.1.0",
|
||||
"summaly": "2.7.0",
|
||||
"syslog-pro": "1.0.0",
|
||||
"systeminformation": "5.12.14",
|
||||
"systeminformation": "5.13.5",
|
||||
"tinycolor2": "1.4.2",
|
||||
"tmp": "0.2.1",
|
||||
"ts-loader": "9.4.1",
|
||||
|
@ -136,8 +136,8 @@
|
|||
"xev": "3.0.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@redocly/openapi-core": "1.0.0-beta.112",
|
||||
"@swc/core": "1.3.15",
|
||||
"@redocly/openapi-core": "1.0.0-beta.114",
|
||||
"@swc/core": "1.3.18",
|
||||
"@swc/jest": "0.2.23",
|
||||
"@types/archiver": "5.3.1",
|
||||
"@types/bcryptjs": "2.4.2",
|
||||
|
@ -145,7 +145,7 @@
|
|||
"@types/cbor": "6.0.0",
|
||||
"@types/escape-regexp": "0.0.1",
|
||||
"@types/fluent-ffmpeg": "2.1.20",
|
||||
"@types/jest": "29.2.2",
|
||||
"@types/jest": "29.2.3",
|
||||
"@types/js-yaml": "4.0.5",
|
||||
"@types/jsdom": "20.0.1",
|
||||
"@types/jsonld": "1.5.7",
|
||||
|
@ -186,13 +186,13 @@
|
|||
"@types/web-push": "3.3.2",
|
||||
"@types/websocket": "1.0.5",
|
||||
"@types/ws": "8.5.3",
|
||||
"@typescript-eslint/eslint-plugin": "5.42.1",
|
||||
"@typescript-eslint/parser": "5.42.1",
|
||||
"@typescript-eslint/eslint-plugin": "5.43.0",
|
||||
"@typescript-eslint/parser": "5.43.0",
|
||||
"cross-env": "7.0.3",
|
||||
"eslint": "8.27.0",
|
||||
"eslint": "8.28.0",
|
||||
"eslint-plugin-import": "2.26.0",
|
||||
"execa": "6.1.0",
|
||||
"jest": "29.3.1",
|
||||
"typescript": "4.8.4"
|
||||
"typescript": "4.9.3"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,6 +9,7 @@ import { QueueService } from '@/core/QueueService.js';
|
|||
import { CreateSystemUserService } from '@/core/CreateSystemUserService.js';
|
||||
import { ApRendererService } from '@/core/remote/activitypub/ApRendererService.js';
|
||||
import { DI } from '@/di-symbols.js';
|
||||
import { deepClone } from '@/misc/clone.js';
|
||||
|
||||
const ACTOR_USERNAME = 'relay.actor' as const;
|
||||
|
||||
|
@ -105,7 +106,7 @@ export class RelayService {
|
|||
}));
|
||||
if (relays.length === 0) return;
|
||||
|
||||
const copy = structuredClone(activity);
|
||||
const copy = deepClone(activity);
|
||||
if (!copy.to) copy.to = ['https://www.w3.org/ns/activitystreams#Public'];
|
||||
|
||||
const signed = await this.apRendererService.attachLdSignature(copy, user);
|
||||
|
|
|
@ -9,6 +9,7 @@ import { awaitAll } from '@/misc/prelude/await-all.js';
|
|||
import type { User } from '@/models/entities/User.js';
|
||||
import type { DriveFile } from '@/models/entities/DriveFile.js';
|
||||
import { appendQuery, query } from '@/misc/prelude/url.js';
|
||||
import { deepClone } from '@/misc/clone.js';
|
||||
import { UtilityService } from '../UtilityService.js';
|
||||
import { UserEntityService } from './UserEntityService.js';
|
||||
import { DriveFolderEntityService } from './DriveFolderEntityService.js';
|
||||
|
@ -55,7 +56,7 @@ export class DriveFileEntityService {
|
|||
|
||||
public getPublicProperties(file: DriveFile): DriveFile['properties'] {
|
||||
if (file.properties.orientation != null) {
|
||||
const properties = structuredClone(file.properties);
|
||||
const properties = deepClone(file.properties);
|
||||
if (file.properties.orientation >= 5) {
|
||||
[properties.width, properties.height] = [properties.height, properties.width];
|
||||
}
|
||||
|
|
|
@ -329,12 +329,20 @@ export class NoteEntityService implements OnModuleInit {
|
|||
|
||||
if (packed.user.isCat && packed.text) {
|
||||
const tokens = packed.text ? mfm.parse(packed.text) : [];
|
||||
mfm.inspect(tokens, node => {
|
||||
function nyaizeNode(node: mfm.MfmNode) {
|
||||
if (node.type === 'quote') return;
|
||||
if (node.type === 'text') {
|
||||
// TODO: quoteなtextはskip
|
||||
node.props.text = nyaize(node.props.text);
|
||||
}
|
||||
});
|
||||
if (node.children) {
|
||||
for (const child of node.children) {
|
||||
nyaizeNode(child);
|
||||
}
|
||||
}
|
||||
}
|
||||
for (const node of tokens) {
|
||||
nyaizeNode(node);
|
||||
}
|
||||
packed.text = mfm.toString(tokens);
|
||||
}
|
||||
|
||||
|
|
18
packages/backend/src/misc/clone.ts
Normal file
18
packages/backend/src/misc/clone.ts
Normal file
|
@ -0,0 +1,18 @@
|
|||
// structredCloneが遅いため
|
||||
// SEE: http://var.blog.jp/archives/86038606.html
|
||||
|
||||
type Cloneable = string | number | boolean | null | { [key: string]: Cloneable } | Cloneable[];
|
||||
|
||||
export function deepClone<T extends Cloneable>(x: T): T {
|
||||
if (typeof x === 'object') {
|
||||
if (x === null) return x;
|
||||
if (Array.isArray(x)) return x.map(deepClone) as T;
|
||||
const obj = {} as Record<string, Cloneable>;
|
||||
for (const [k, v] of Object.entries(x)) {
|
||||
obj[k] = deepClone(v);
|
||||
}
|
||||
return obj as T;
|
||||
} else {
|
||||
return x;
|
||||
}
|
||||
}
|
|
@ -26,6 +26,7 @@ import { GalleryPostEntityService } from '@/core/entities/GalleryPostEntityServi
|
|||
import { ClipEntityService } from '@/core/entities/ClipEntityService.js';
|
||||
import { ChannelEntityService } from '@/core/entities/ChannelEntityService.js';
|
||||
import type { ChannelsRepository, ClipsRepository, GalleryPostsRepository, NotesRepository, PagesRepository, UserProfilesRepository, UsersRepository } from '@/models/index.js';
|
||||
import { deepClone } from '@/misc/clone.js';
|
||||
import manifest from './manifest.json' assert { type: 'json' };
|
||||
import { FeedService } from './FeedService.js';
|
||||
import { UrlPreviewService } from './UrlPreviewService.js';
|
||||
|
@ -86,7 +87,7 @@ export class ClientServerService {
|
|||
}
|
||||
|
||||
private async manifestHandler(ctx: Koa.Context) {
|
||||
const res = structuredClone(manifest);
|
||||
const res = deepClone(manifest);
|
||||
|
||||
const instance = await this.metaService.fetch(true);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue