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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user