Merge branch 'develop' into notification-read-api
This commit is contained in:
@@ -31,7 +31,7 @@ const ajv = new Ajv({
|
||||
useDefaults: true,
|
||||
});
|
||||
|
||||
ajv.addFormat('misskey:id', /^[a-z0-9]+$/);
|
||||
ajv.addFormat('misskey:id', /^[a-zA-Z0-9]+$/);
|
||||
|
||||
export default function <T extends IEndpointMeta, Ps extends Schema>(meta: T, paramDef: Ps, cb: executor<T, Ps>)
|
||||
: (params: any, user: T['requireCredential'] extends true ? SimpleUserInfo : SimpleUserInfo | null, token: AccessToken | null, file?: any) => Promise<any> {
|
||||
|
@@ -55,10 +55,6 @@ export default define(meta, paramDef, async (ps, me) => {
|
||||
case '-caughtAt': query.orderBy('instance.caughtAt', 'ASC'); break;
|
||||
case '+lastCommunicatedAt': query.orderBy('instance.lastCommunicatedAt', 'DESC'); break;
|
||||
case '-lastCommunicatedAt': query.orderBy('instance.lastCommunicatedAt', 'ASC'); break;
|
||||
case '+driveUsage': query.orderBy('instance.driveUsage', 'DESC'); break;
|
||||
case '-driveUsage': query.orderBy('instance.driveUsage', 'ASC'); break;
|
||||
case '+driveFiles': query.orderBy('instance.driveFiles', 'DESC'); break;
|
||||
case '-driveFiles': query.orderBy('instance.driveFiles', 'ASC'); break;
|
||||
|
||||
default: query.orderBy('instance.id', 'DESC'); break;
|
||||
}
|
||||
|
@@ -64,11 +64,6 @@ export const meta = {
|
||||
optional: false, nullable: false,
|
||||
default: 'https://github.com/misskey-dev/misskey/issues/new',
|
||||
},
|
||||
secure: {
|
||||
type: 'boolean',
|
||||
optional: false, nullable: false,
|
||||
default: false,
|
||||
},
|
||||
defaultDarkTheme: {
|
||||
type: 'string',
|
||||
optional: false, nullable: true,
|
||||
@@ -489,9 +484,6 @@ export default define(meta, paramDef, async (ps, me) => {
|
||||
tosUrl: instance.ToSUrl,
|
||||
repositoryUrl: instance.repositoryUrl,
|
||||
feedbackUrl: instance.feedbackUrl,
|
||||
|
||||
secure: config.https != null,
|
||||
|
||||
disableRegistration: instance.disableRegistration,
|
||||
disableLocalTimeline: instance.disableLocalTimeline,
|
||||
disableGlobalTimeline: instance.disableGlobalTimeline,
|
||||
|
@@ -38,6 +38,7 @@ export const paramDef = {
|
||||
type: 'object',
|
||||
properties: {
|
||||
userId: { type: 'string', format: 'misskey:id' },
|
||||
expiresAt: { type: 'integer', nullable: true },
|
||||
},
|
||||
required: ['userId'],
|
||||
} as const;
|
||||
@@ -67,10 +68,15 @@ export default define(meta, paramDef, async (ps, user) => {
|
||||
throw new ApiError(meta.errors.alreadyMuting);
|
||||
}
|
||||
|
||||
if (ps.expiresAt && ps.expiresAt <= Date.now()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Create mute
|
||||
await Mutings.insert({
|
||||
id: genId(),
|
||||
createdAt: new Date(),
|
||||
expiresAt: ps.expiresAt ? new Date(ps.expiresAt) : null,
|
||||
muterId: muter.id,
|
||||
muteeId: mutee.id,
|
||||
} as Muting);
|
||||
|
@@ -4,8 +4,6 @@
|
||||
|
||||
import * as fs from 'node:fs';
|
||||
import * as http from 'http';
|
||||
import * as http2 from 'http2';
|
||||
import * as https from 'https';
|
||||
import Koa from 'koa';
|
||||
import Router from '@koa/router';
|
||||
import mount from 'koa-mount';
|
||||
@@ -123,16 +121,7 @@ app.use(router.routes());
|
||||
app.use(mount(webServer));
|
||||
|
||||
function createServer() {
|
||||
if (config.https) {
|
||||
const certs: any = {};
|
||||
for (const k of Object.keys(config.https)) {
|
||||
certs[k] = fs.readFileSync(config.https[k]);
|
||||
}
|
||||
certs['allowHTTP1'] = true;
|
||||
return http2.createSecureServer(certs, app.callback()) as https.Server;
|
||||
} else {
|
||||
return http.createServer(app.callback());
|
||||
}
|
||||
return http.createServer(app.callback());
|
||||
}
|
||||
|
||||
// For testing
|
||||
|
@@ -59,5 +59,5 @@ html
|
||||
br
|
||||
| Please turn on your JavaScript
|
||||
div#splash
|
||||
img(src='/favicon.ico')
|
||||
img(src= icon || '/static-assets/splash.png')
|
||||
block content
|
||||
|
Reference in New Issue
Block a user