summaryrefslogtreecommitdiff
path: root/src/server/api/stream
diff options
context:
space:
mode:
authorMeiMei <30769358+mei23@users.noreply.github.com>2020-01-27 05:36:59 +0900
committersyuilo <Syuilotan@yahoo.co.jp>2020-01-27 05:36:59 +0900
commit0c1076c9176cca40df4a39ba00b11e129f07dbbc (patch)
tree0153d669fd84f75f2bd7e96776ab19f14dd9802c /src/server/api/stream
parentUpdate README.md [AUTOGEN] (#5764) (diff)
downloadsharkey-0c1076c9176cca40df4a39ba00b11e129f07dbbc.tar.gz
sharkey-0c1076c9176cca40df4a39ba00b11e129f07dbbc.tar.bz2
sharkey-0c1076c9176cca40df4a39ba00b11e129f07dbbc.zip
userListチャンネルのオーナーチェック Fix #5772 (#5773)
* userListチャンネルのオーナーチェック Fix #5772 * comment
Diffstat (limited to 'src/server/api/stream')
-rw-r--r--src/server/api/stream/channels/user-list.ts9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/server/api/stream/channels/user-list.ts b/src/server/api/stream/channels/user-list.ts
index 119bacf6ec..e1b7a88830 100644
--- a/src/server/api/stream/channels/user-list.ts
+++ b/src/server/api/stream/channels/user-list.ts
@@ -1,6 +1,6 @@
import autobind from 'autobind-decorator';
import Channel from '../channel';
-import { Notes, UserListJoinings } from '../../../../models';
+import { Notes, UserListJoinings, UserLists } from '../../../../models';
import shouldMuteThisNote from '../../../../misc/should-mute-this-note';
import { User } from '../../../../models/entities/user';
import { PackedNote } from '../../../../models/repositories/note';
@@ -17,6 +17,13 @@ export default class extends Channel {
public async init(params: any) {
this.listId = params.listId as string;
+ // Check existence and owner
+ const list = await UserLists.findOne({
+ id: this.listId,
+ userId: this.user!.id
+ });
+ if (!list) return;
+
// Subscribe stream
this.subscriber.on(`userListStream:${this.listId}`, this.send);