feat(guild): closed channel (discussion-complete support)

Channel.closed; POST /channels/:id/close (member-only); message/command
posts on closed channel -> 409 {error:channel_closed}; GET history still
allowed; listForUser carries closed.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
h z
2026-05-15 16:52:43 +01:00
parent 22fd834ed0
commit 9670da400e
4 changed files with 27 additions and 0 deletions

View File

@@ -1,5 +1,6 @@
import {
Body,
ConflictException,
Controller,
Delete,
Get,
@@ -143,6 +144,9 @@ export class MessagingController {
const channel = await this.channelRepo.findOne({ where: { id: channelId } });
if (!channel) throw new NotFoundException('channel not found');
if (channel.closed) {
throw new ConflictException({ error: 'channel_closed', message: 'channel is closed' });
}
const xType = channel.xType ?? 'general';
const isRotating = xType === 'discuss' || xType === 'work';
const authorUserId = String(body.authorUserId ?? 'anonymous');