mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-03-23 12:33:38 +00:00
enhance: モデレーターがチャットルームの内容を確認・削除できるように
This commit is contained in:
@@ -59,7 +59,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
||||
throw new ApiError(meta.errors.noSuchRoom);
|
||||
}
|
||||
|
||||
if (!(await this.chatService.isRoomMember(room, me.id))) {
|
||||
if (!await this.chatService.hasPermissionToViewRoomTimeline(me.id, room)) {
|
||||
throw new ApiError(meta.errors.noSuchRoom);
|
||||
}
|
||||
|
||||
|
||||
@@ -42,11 +42,16 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
||||
private chatService: ChatService,
|
||||
) {
|
||||
super(meta, paramDef, async (ps, me) => {
|
||||
const room = await this.chatService.findMyRoomById(me.id, ps.roomId);
|
||||
const room = await this.chatService.findRoomById(ps.roomId);
|
||||
if (room == null) {
|
||||
throw new ApiError(meta.errors.noSuchRoom);
|
||||
}
|
||||
await this.chatService.deleteRoom(room);
|
||||
|
||||
if (!await this.chatService.hasPermissionToDeleteRoom(me.id, room)) {
|
||||
throw new ApiError(meta.errors.noSuchRoom);
|
||||
}
|
||||
|
||||
await this.chatService.deleteRoom(room, me);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user