follow up of a01ae38a07
This commit is contained in:
parent
a01ae38a07
commit
8e72c68205
|
@ -523,16 +523,20 @@ export class ChatService {
|
||||||
}
|
}
|
||||||
|
|
||||||
@bindThis
|
@bindThis
|
||||||
public async deleteRoom(room: MiChatRoom, moderator?: MiUser) {
|
public async deleteRoom(room: MiChatRoom, deleter?: MiUser) {
|
||||||
await this.chatRoomsRepository.delete(room.id);
|
await this.chatRoomsRepository.delete(room.id);
|
||||||
|
|
||||||
if (moderator) {
|
if (deleter) {
|
||||||
this.moderationLogService.log(moderator, 'deleteChatRoom', {
|
const deleterIsModerator = await this.roleService.isModerator(deleter);
|
||||||
|
|
||||||
|
if (deleterIsModerator) {
|
||||||
|
this.moderationLogService.log(deleter, 'deleteChatRoom', {
|
||||||
roomId: room.id,
|
roomId: room.id,
|
||||||
room: room,
|
room: room,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@bindThis
|
@bindThis
|
||||||
public async findMyRoomById(ownerId: MiUser['id'], roomId: MiChatRoom['id']) {
|
public async findMyRoomById(ownerId: MiUser['id'], roomId: MiChatRoom['id']) {
|
||||||
|
|
Loading…
Reference in New Issue