Merge branch 'develop' into vue3
This commit is contained in:
commit
acbdd3f423
|
@ -32,7 +32,7 @@
|
||||||
"constantinople": "^4.0.1",
|
"constantinople": "^4.0.1",
|
||||||
"core-js": "^3.6.5",
|
"core-js": "^3.6.5",
|
||||||
"gulp/gulp-cli/yargs/yargs-parser": "5.0.0-security.0",
|
"gulp/gulp-cli/yargs/yargs-parser": "5.0.0-security.0",
|
||||||
"lodash": "^4.17.19",
|
"lodash": "^4.17.20",
|
||||||
"mocha/serialize-javascript": "^3.1.0"
|
"mocha/serialize-javascript": "^3.1.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
|
@ -43,7 +43,7 @@ export default defineComponent({
|
||||||
tab: 'featured',
|
tab: 'featured',
|
||||||
featuredPagination: {
|
featuredPagination: {
|
||||||
endpoint: 'channels/featured',
|
endpoint: 'channels/featured',
|
||||||
limit: 5,
|
noPaging: true,
|
||||||
},
|
},
|
||||||
followingPagination: {
|
followingPagination: {
|
||||||
endpoint: 'channels/followed',
|
endpoint: 'channels/followed',
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
|
import $ from 'cafy';
|
||||||
|
import { ID } from '../../../../misc/cafy-id';
|
||||||
import define from '../../define';
|
import define from '../../define';
|
||||||
import { Channels, ChannelFollowings } from '../../../../models';
|
import { Channels, ChannelFollowings } from '../../../../models';
|
||||||
|
import { makePaginationQuery } from '../../common/make-pagination-query';
|
||||||
|
|
||||||
export const meta = {
|
export const meta = {
|
||||||
tags: ['channels', 'account'],
|
tags: ['channels', 'account'],
|
||||||
|
@ -8,6 +11,21 @@ export const meta = {
|
||||||
|
|
||||||
kind: 'read:channels',
|
kind: 'read:channels',
|
||||||
|
|
||||||
|
params: {
|
||||||
|
sinceId: {
|
||||||
|
validator: $.optional.type(ID),
|
||||||
|
},
|
||||||
|
|
||||||
|
untilId: {
|
||||||
|
validator: $.optional.type(ID),
|
||||||
|
},
|
||||||
|
|
||||||
|
limit: {
|
||||||
|
validator: $.optional.num.range(1, 100),
|
||||||
|
default: 5
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
res: {
|
res: {
|
||||||
type: 'array' as const,
|
type: 'array' as const,
|
||||||
optional: false as const, nullable: false as const,
|
optional: false as const, nullable: false as const,
|
||||||
|
@ -20,9 +38,12 @@ export const meta = {
|
||||||
};
|
};
|
||||||
|
|
||||||
export default define(meta, async (ps, me) => {
|
export default define(meta, async (ps, me) => {
|
||||||
const followings = await ChannelFollowings.find({
|
const query = makePaginationQuery(ChannelFollowings.createQueryBuilder(), ps.sinceId, ps.untilId)
|
||||||
followerId: me.id,
|
.andWhere({ followerId: me.id });
|
||||||
});
|
|
||||||
|
const followings = await query
|
||||||
|
.take(ps.limit!)
|
||||||
|
.getMany();
|
||||||
|
|
||||||
return await Promise.all(followings.map(x => Channels.pack(x.followeeId, me)));
|
return await Promise.all(followings.map(x => Channels.pack(x.followeeId, me)));
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
|
import $ from 'cafy';
|
||||||
|
import { ID } from '../../../../misc/cafy-id';
|
||||||
import define from '../../define';
|
import define from '../../define';
|
||||||
import { Channels } from '../../../../models';
|
import { Channels } from '../../../../models';
|
||||||
|
import { makePaginationQuery } from '../../common/make-pagination-query';
|
||||||
|
|
||||||
export const meta = {
|
export const meta = {
|
||||||
tags: ['channels', 'account'],
|
tags: ['channels', 'account'],
|
||||||
|
@ -8,6 +11,21 @@ export const meta = {
|
||||||
|
|
||||||
kind: 'read:channels',
|
kind: 'read:channels',
|
||||||
|
|
||||||
|
params: {
|
||||||
|
sinceId: {
|
||||||
|
validator: $.optional.type(ID),
|
||||||
|
},
|
||||||
|
|
||||||
|
untilId: {
|
||||||
|
validator: $.optional.type(ID),
|
||||||
|
},
|
||||||
|
|
||||||
|
limit: {
|
||||||
|
validator: $.optional.num.range(1, 100),
|
||||||
|
default: 5
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
res: {
|
res: {
|
||||||
type: 'array' as const,
|
type: 'array' as const,
|
||||||
optional: false as const, nullable: false as const,
|
optional: false as const, nullable: false as const,
|
||||||
|
@ -20,9 +38,12 @@ export const meta = {
|
||||||
};
|
};
|
||||||
|
|
||||||
export default define(meta, async (ps, me) => {
|
export default define(meta, async (ps, me) => {
|
||||||
const channels = await Channels.find({
|
const query = makePaginationQuery(Channels.createQueryBuilder(), ps.sinceId, ps.untilId)
|
||||||
userId: me.id,
|
.andWhere({ userId: me.id });
|
||||||
});
|
|
||||||
|
const channels = await query
|
||||||
|
.take(ps.limit!)
|
||||||
|
.getMany();
|
||||||
|
|
||||||
return await Promise.all(channels.map(x => Channels.pack(x, me)));
|
return await Promise.all(channels.map(x => Channels.pack(x, me)));
|
||||||
});
|
});
|
||||||
|
|
|
@ -99,6 +99,8 @@ export default define(meta, async (ps, me) => {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const proxyAccount = instance.proxyAccountId ? await Users.pack(instance.proxyAccountId).catch(() => null) : null;
|
||||||
|
|
||||||
const response: any = {
|
const response: any = {
|
||||||
maintainerName: instance.maintainerName,
|
maintainerName: instance.maintainerName,
|
||||||
maintainerEmail: instance.maintainerEmail,
|
maintainerEmail: instance.maintainerEmail,
|
||||||
|
@ -143,6 +145,8 @@ export default define(meta, async (ps, me) => {
|
||||||
enableDiscordIntegration: instance.enableDiscordIntegration,
|
enableDiscordIntegration: instance.enableDiscordIntegration,
|
||||||
|
|
||||||
enableServiceWorker: instance.enableServiceWorker,
|
enableServiceWorker: instance.enableServiceWorker,
|
||||||
|
|
||||||
|
proxyAccountName: proxyAccount ? proxyAccount.username : null,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (ps.detail) {
|
if (ps.detail) {
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import * as Router from '@koa/router';
|
import * as Router from '@koa/router';
|
||||||
import config from '../config';
|
import config from '../config';
|
||||||
import { fetchMeta } from '../misc/fetch-meta';
|
import { fetchMeta } from '../misc/fetch-meta';
|
||||||
|
import { Users } from '../models';
|
||||||
// import User from '../models/user';
|
// import User from '../models/user';
|
||||||
// import Note from '../models/note';
|
// import Note from '../models/note';
|
||||||
|
|
||||||
|
@ -34,6 +35,8 @@ const nodeinfo2 = async () => {
|
||||||
// Note.count({ '_user.host': null, replyId: { $ne: null } })
|
// Note.count({ '_user.host': null, replyId: { $ne: null } })
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
const proxyAccount = meta.proxyAccountId ? await Users.pack(meta.proxyAccountId).catch(() => null) : null;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
software: {
|
software: {
|
||||||
name: 'misskey',
|
name: 'misskey',
|
||||||
|
@ -72,7 +75,8 @@ const nodeinfo2 = async () => {
|
||||||
enableGithubIntegration: meta.enableGithubIntegration,
|
enableGithubIntegration: meta.enableGithubIntegration,
|
||||||
enableDiscordIntegration: meta.enableDiscordIntegration,
|
enableDiscordIntegration: meta.enableDiscordIntegration,
|
||||||
enableEmail: meta.enableEmail,
|
enableEmail: meta.enableEmail,
|
||||||
enableServiceWorker: meta.enableServiceWorker
|
enableServiceWorker: meta.enableServiceWorker,
|
||||||
|
proxyAccountName: proxyAccount ? proxyAccount.username : null,
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -326,6 +326,9 @@ router.get('/info', async ctx => {
|
||||||
const emojis = await Emojis.find({
|
const emojis = await Emojis.find({
|
||||||
where: { host: null }
|
where: { host: null }
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const proxyAccount = meta.proxyAccountId ? await Users.pack(meta.proxyAccountId).catch(() => null) : null;
|
||||||
|
|
||||||
await ctx.render('info', {
|
await ctx.render('info', {
|
||||||
version: config.version,
|
version: config.version,
|
||||||
machine: os.hostname(),
|
machine: os.hostname(),
|
||||||
|
@ -339,6 +342,7 @@ router.get('/info', async ctx => {
|
||||||
},
|
},
|
||||||
emojis: emojis,
|
emojis: emojis,
|
||||||
meta: meta,
|
meta: meta,
|
||||||
|
proxyAccountName: proxyAccount ? proxyAccount.username : null,
|
||||||
originalUsersCount: await Users.count({ host: null }),
|
originalUsersCount: await Users.count({ host: null }),
|
||||||
originalNotesCount: await Notes.count({ userHost: null })
|
originalNotesCount: await Notes.count({ userHost: null })
|
||||||
});
|
});
|
||||||
|
|
|
@ -79,6 +79,9 @@ html
|
||||||
td
|
td
|
||||||
= meta.maintainerName
|
= meta.maintainerName
|
||||||
| <#{meta.maintainerEmail}>
|
| <#{meta.maintainerEmail}>
|
||||||
|
tr
|
||||||
|
th Proxy account name
|
||||||
|
td= proxyAccountName || '(none)'
|
||||||
tr
|
tr
|
||||||
th System
|
th System
|
||||||
td= os
|
td= os
|
||||||
|
|
|
@ -16,7 +16,7 @@ export async function createNotification(
|
||||||
|
|
||||||
const profile = await UserProfiles.findOne({ userId: notifieeId });
|
const profile = await UserProfiles.findOne({ userId: notifieeId });
|
||||||
|
|
||||||
const isMuted = !profile?.includingNotificationTypes?.includes(type);
|
const isMuted = !(profile?.includingNotificationTypes == null || profile?.includingNotificationTypes.includes(type));
|
||||||
|
|
||||||
// Create notification
|
// Create notification
|
||||||
const notification = await Notifications.save({
|
const notification = await Notifications.save({
|
||||||
|
|
|
@ -135,6 +135,7 @@ export default async (user: User, data: Option, silent = false) => new Promise<N
|
||||||
if (data.localOnly == null) data.localOnly = false;
|
if (data.localOnly == null) data.localOnly = false;
|
||||||
if (data.channel != null) data.visibility = 'public';
|
if (data.channel != null) data.visibility = 'public';
|
||||||
if (data.channel != null) data.visibleUsers = [];
|
if (data.channel != null) data.visibleUsers = [];
|
||||||
|
if (data.channel != null) data.localOnly = true;
|
||||||
|
|
||||||
// サイレンス
|
// サイレンス
|
||||||
if (user.isSilenced && data.visibility === 'public' && data.channel == null) {
|
if (user.isSilenced && data.visibility === 'public' && data.channel == null) {
|
||||||
|
|
14
yarn.lock
14
yarn.lock
|
@ -1775,9 +1775,9 @@ binaryextensions@2:
|
||||||
integrity sha512-bHhs98rj/7i/RZpCSJ3uk55pLXOItjIrh2sRQZSM6OoktScX+LxJzvlU+FELp9j3TdcddTmmYArLSGptCTwjuw==
|
integrity sha512-bHhs98rj/7i/RZpCSJ3uk55pLXOItjIrh2sRQZSM6OoktScX+LxJzvlU+FELp9j3TdcddTmmYArLSGptCTwjuw==
|
||||||
|
|
||||||
bl@^4.0.1:
|
bl@^4.0.1:
|
||||||
version "4.0.2"
|
version "4.0.3"
|
||||||
resolved "https://registry.yarnpkg.com/bl/-/bl-4.0.2.tgz#52b71e9088515d0606d9dd9cc7aa48dc1f98e73a"
|
resolved "https://registry.yarnpkg.com/bl/-/bl-4.0.3.tgz#12d6287adc29080e22a705e5764b2a9522cdc489"
|
||||||
integrity sha512-j4OH8f6Qg2bGuWfRiltT2HYGx0e1QcBTrK9KAHNMwMZdQnDZFk0ZSYIpADjYCB3U12nicC5tVJwSIhwOWjb4RQ==
|
integrity sha512-fs4G6/Hu4/EE+F75J8DuN/0IpQqNjAdC7aEQv7Qt8MHGUH7Ckv2MwTEEeN9QehD0pfIDkMI1bkHYkKy7xHyKIg==
|
||||||
dependencies:
|
dependencies:
|
||||||
buffer "^5.5.0"
|
buffer "^5.5.0"
|
||||||
inherits "^2.0.4"
|
inherits "^2.0.4"
|
||||||
|
@ -5917,10 +5917,10 @@ lodash.uniq@^4.5.0:
|
||||||
resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773"
|
resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773"
|
||||||
integrity sha1-0CJTc662Uq3BvILklFM5qEJ1R3M=
|
integrity sha1-0CJTc662Uq3BvILklFM5qEJ1R3M=
|
||||||
|
|
||||||
lodash@^4.14.0, lodash@^4.15.0, lodash@^4.17.10, lodash@^4.17.11, lodash@^4.17.13, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19:
|
lodash@^4.14.0, lodash@^4.15.0, lodash@^4.17.10, lodash@^4.17.11, lodash@^4.17.13, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.20:
|
||||||
version "4.17.19"
|
version "4.17.20"
|
||||||
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.19.tgz#e48ddedbe30b3321783c5b4301fbd353bc1e4a4b"
|
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.20.tgz#b44a9b6297bcb698f1c51a3545a2b3b368d59c52"
|
||||||
integrity sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==
|
integrity sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==
|
||||||
|
|
||||||
log-symbols@3.0.0:
|
log-symbols@3.0.0:
|
||||||
version "3.0.0"
|
version "3.0.0"
|
||||||
|
|
Loading…
Reference in New Issue