enforce 50 char content limit for message interaction

This commit is contained in:
2026-03-20 22:50:39 +08:00
parent 5e3001b9bf
commit 3ce15d9762

View File

@@ -39,7 +39,16 @@ export class InteractionHandler {
return; return;
} }
// 2. Check if recipient is online // 2. Validate text content length
if (data.type === 'text' && data.content && data.content.length > 50) {
client.emit(WS_EVENT.INTERACTION_DELIVERY_FAILED, {
recipientUserId: data.recipientUserId,
reason: 'Text content exceeds 50 characters',
});
return;
}
// 3. Check if recipient is online
const isOnline = await this.userSocketService.isUserOnline( const isOnline = await this.userSocketService.isUserOnline(
data.recipientUserId, data.recipientUserId,
); );