fix: check can_send_messages === false instead of !can_send_messages (null blocks messages)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Ai
2026-05-22 13:15:30 +03:00
parent 0ee3ead826
commit 210d4302e7

View File

@@ -113,7 +113,7 @@ export function setupWebSocket(app: FastifyInstance) {
const { rows: [chat] } = await pool.query('SELECT type FROM chats WHERE id = $1', [payload.chatId]);
if (chat.type === 'channel' && !['owner', 'admin'].includes(member.role)) return;
if (!member.can_send_messages && member.role === 'member') return;
if (member.can_send_messages === false && member.role === 'member') return;
const { rows: [msg] } = await pool.query(
`INSERT INTO messages (chat_id, sender_id, content, type, reply_to_id)