Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20.20.0
20.20.2
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:20.20.0-bookworm AS builder
FROM node:20.20.2-bookworm AS builder

ENV NODE_ENV=production
WORKDIR /misskey
Expand All @@ -12,7 +12,7 @@ COPY . ./
RUN yarn build


FROM node:20.20.0-bookworm-slim AS runner
FROM node:20.20.2-bookworm-slim AS runner

WORKDIR /misskey

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "groundpolis-milkey",
"version": "2022.07.03-milkey-3.6",
"version": "2022.07.03-milkey-3.7",
"private": true,
"author": "Xeltica <xeltica@gmail.com> , Minemu <minemu398@outlook.jp> , Azuki⪥ <cluikeit_31701@outlook.com> , Remito <remitocat@gmail.com> , atsu1125 <atsuchan@atsuchan.page>",
"contributors": [
Expand Down Expand Up @@ -173,7 +173,7 @@
"jsonld": "8.3.3",
"jsrsasign": "10.5.27",
"katex": "0.12.0",
"koa": "2.16.3",
"koa": "2.16.4",
"koa-bodyparser": "4.3.0",
"koa-favicon": "2.1.0",
"koa-json-body": "5.3.0",
Expand Down
2 changes: 1 addition & 1 deletion src/remote/activitypub/ap-request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export function createSignedGet(args: { key: PrivateKey, url: string, additional
}, args.additionalHeaders),
};

const result = signToRequest(request, args.key, ['(request-target)', 'date', 'host', 'accept']);
const result = signToRequest(request, args.key, ['(request-target)', 'date', 'host']);

return {
request,
Expand Down
5 changes: 4 additions & 1 deletion src/server/api/endpoints/i/import-blocking.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ export const meta = {
};

export default define(meta, async (ps, user) => {
const file = await DriveFiles.findOne(ps.fileId);
const file = await DriveFiles.findOne({
id: ps.fileId,
userId: user.id
});

if (file == null) throw new ApiError(meta.errors.noSuchFile);
//if (!file.type.endsWith('/csv')) throw new ApiError(meta.errors.unexpectedFileType);
Expand Down
5 changes: 4 additions & 1 deletion src/server/api/endpoints/i/import-following.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ export const meta = {
};

export default define(meta, async (ps, user) => {
const file = await DriveFiles.findOne(ps.fileId);
const file = await DriveFiles.findOne({
id: ps.fileId,
userId: user.id
});

if (file == null) throw new ApiError(meta.errors.noSuchFile);
//if (!file.type.endsWith('/csv')) throw new ApiError(meta.errors.unexpectedFileType);
Expand Down
5 changes: 4 additions & 1 deletion src/server/api/endpoints/i/import-muting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ export const meta = {
};

export default define(meta, async (ps, user) => {
const file = await DriveFiles.findOne(ps.fileId);
const file = await DriveFiles.findOne({
id: ps.fileId,
userId: user.id
});

if (file == null) throw new ApiError(meta.errors.noSuchFile);
//if (!file.type.endsWith('/csv')) throw new ApiError(meta.errors.unexpectedFileType);
Expand Down
5 changes: 4 additions & 1 deletion src/server/api/endpoints/i/import-user-lists.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ export const meta = {
};

export default define(meta, async (ps, user) => {
const file = await DriveFiles.findOne(ps.fileId);
const file = await DriveFiles.findOne({
id: ps.fileId,
userId: user.id
});

if (file == null) throw new ApiError(meta.errors.noSuchFile);
//if (!file.type.endsWith('/csv')) throw new ApiError(meta.errors.unexpectedFileType);
Expand Down
16 changes: 13 additions & 3 deletions src/server/api/stream/channels/antenna.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,28 @@
import autobind from 'autobind-decorator';
import Channel from '../channel';
import { Notes } from '../../../../models';
import { Notes, Antennas } from '../../../../models';
import { isMutedUserRelated } from '../../../../misc/is-muted-user-related';

export default class extends Channel {
public readonly chName = 'antenna';
public static shouldShare = false;
public static requireCredential = false;
public static requireCredential = true;
private antennaId: string;

@autobind
public async init(params: any) {
if (typeof params.antennaId !== 'string') return false;
if (!this.user) return false;

this.antennaId = params.antennaId as string;

const antennaExists = await Antennas.findOne({
id: this.antennaId,
userId: this.user.id,
});

if (!antennaExists) return false;

// Subscribe stream
this.subscriber.on(`antennaStream:${this.antennaId}`, this.onEvent);
}
Expand All @@ -26,7 +36,7 @@ export default class extends Channel {

// 流れてきたNoteがミュートしているユーザーが関わるものだったら無視する
if (isMutedUserRelated(note, this.muting, false)) return;

this.send('note', note);
} else {
this.send(type, body);
Expand Down
1 change: 1 addition & 0 deletions src/server/api/stream/channels/hashtag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export default class extends Channel {

@autobind
private async onNote(note: PackedNote) {
if (note.isHidden) return;
const noteTags = note.tags ? note.tags.map((t: string) => t.toLowerCase()) : [];
const matched = this.q.some(tags => tags.every(tag => noteTags.includes(normalizeForSearch(tag))));
if (!matched) return;
Expand Down
12 changes: 10 additions & 2 deletions src/server/api/stream/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import channels from './channels';
import { EventEmitter } from 'events';
import { User } from '../../../models/entities/user';
import { Channel as ChannelModel } from '../../../models/entities/channel';
import { Users, Followings, Mutings, UserProfiles, ChannelFollowings } from '../../../models';
import { Users, Followings, Mutings, UserProfiles, ChannelFollowings, Notes } from '../../../models';
import { ApiError } from '../error';
import { AccessToken } from '../../../models/entities/access-token';
import { UserProfile } from '../../../models/entities/user-profile';
Expand Down Expand Up @@ -147,9 +147,17 @@ export class Connection {
* 投稿購読要求時
*/
@autobind
private onSubscribeNote(payload: any, read: boolean) {
private async onSubscribeNote(payload: any, read: boolean) {
if (!payload.id) return;

const packed = await Notes.pack(payload.id, this.user, {
detail: true,
});

if (packed?.isHidden) {
return;
}

if (this.subscribingNotes[payload.id] == null) {
this.subscribingNotes[payload.id] = 0;
}
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7729,10 +7729,10 @@ koa-views@*, koa-views@8.0.0:
pretty "^2.0.0"
resolve-path "^1.4.0"

koa@2.16.3:
version "2.16.3"
resolved "https://registry.yarnpkg.com/koa/-/koa-2.16.3.tgz#dd3a250472862cf7a3ef6e25bf325cc9db620ab5"
integrity sha512-zPPuIt+ku1iCpFBRwseMcPYQ1cJL8l60rSmKeOuGfOXyE6YnTBmf2aEFNL2HQGrD0cPcLO/t+v9RTgC+fwEh/g==
koa@2.16.4:
version "2.16.4"
resolved "https://registry.yarnpkg.com/koa/-/koa-2.16.4.tgz#303b996f5c3f2a3bb771c7db5e4303ee05f2265f"
integrity sha512-3An0GCLDSR34tsCO4H8Tef8Pp2ngtaZDAZnsWJYelqXUK5wyiHvGItgK/xcSkmHLSTn1Jcho1mRQs2ehRzvKKw==
dependencies:
accepts "^1.3.5"
cache-content-type "^1.0.0"
Expand Down
Loading