mirror of
https://iceshrimp.dev/crimekillz/iceshrimp-161sh.git
synced 2024-11-22 12:13:48 +01:00
Merge branch 'develop' into beta
This commit is contained in:
commit
b87b90ec40
@ -52,7 +52,8 @@ import { UserProfiles } from "@/models/index.js";
|
||||
import { In } from "typeorm";
|
||||
import { DB_MAX_IMAGE_COMMENT_LENGTH } from "@/misc/hard-limits.js";
|
||||
import { truncate } from "@/misc/truncate.js";
|
||||
import { type Size, getEmojiSize } from "@/misc/emoji-meta.js";
|
||||
import { type Size, getEmojiSize } from "@/misc/emoji-meta.js";\
|
||||
import { fetchMeta } from "@/misc/fetch-meta.js";
|
||||
|
||||
const logger = apLogger;
|
||||
|
||||
@ -544,6 +545,10 @@ function notEmpty(partial: Partial<any>) {
|
||||
export async function updateNote(value: string | IObject, resolver?: Resolver) {
|
||||
const uri = typeof value === "string" ? value : value.id;
|
||||
if (!uri) throw new Error("Missing note uri");
|
||||
const instanceMeta = await fetchMeta();
|
||||
if (instanceMeta.experimentalFeatures?.postEdits === false) {
|
||||
throw new Error("Post edits disabled.");
|
||||
}
|
||||
|
||||
// Skip if URI points to this server
|
||||
if (uri.startsWith(`${config.url}/`)) throw new Error("uri points local");
|
||||
|
@ -1,4 +1,4 @@
|
||||
import * as JSON5 from "json5";
|
||||
import JSON5 from "json5";
|
||||
import { IsNull, MoreThan } from "typeorm";
|
||||
import config from "@/config/index.js";
|
||||
import { fetchMeta } from "@/misc/fetch-meta.js";
|
||||
|
@ -244,8 +244,9 @@ export default define(meta, paramDef, async (ps, user) => {
|
||||
if (user.movedToUri != null) throw new ApiError(meta.errors.accountLocked);
|
||||
|
||||
const instanceMeta = await fetchMeta();
|
||||
if (instanceMeta.experimentalFeatures?.postImports === false)
|
||||
if (instanceMeta.experimentalFeatures?.postEdits === false) {
|
||||
throw new ApiError(meta.errors.editsDisabled);
|
||||
}
|
||||
|
||||
if (!Users.isLocalUser(user)) {
|
||||
throw new ApiError(meta.errors.notLocalUser);
|
||||
|
Loading…
Reference in New Issue
Block a user