ChatRoomMessageDeletedPayload chat.room.message.deleted@1
Generated at from
openvibe-contracts v0.76.0 and
openvibe-sdk v0.20.1.
- Version
- 1.0.0
- Owner
- chat
- Visibility
- public
- Status
- active
- Compatibility
- backward
- Decision
- ADR-026
- Schema
https://openvibe.network/contracts/events/payloads/chat.room.message.deleted.v1.json
chat.room.message.deleted v1 (OpenVibe.Chat server/rooms/rooms.js, WS-I task 9). Messages of a public room were deleted (by the author, a room mod or chat staff), or the room turned private or was archived, so what it had published must stop being replayable. Envelope: subject { type: chat_room_message, id: <first id> }, visibility public, actor service:chat. Carries ids only; payload.redacts makes OpenVibe.Events tombstone the chat.room.message.created of each id.
Fields
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
room | string | The room's slug. |
| |
message_ids | array of integer | yes |
| |
redacts | events.redaction-directive | yes | { subject_type: chat_room_message, subject_ids: message_ids as strings }. |
Examples
From the contract's own test fixtures: valid ones validate, rejected ones must fail.
Valid: two-messages
{
"room": "lobby",
"message_ids": [
431,
432
],
"redacts": {
"subject_type": "chat_room_message",
"subject_ids": [
"431",
"432"
]
}
}Rejected: carries-text
{
"message_ids": [
431
],
"text": "hello room",
"redacts": {
"subject_type": "chat_room_message",
"subject_ids": [
"431"
]
}
}Rejected: no-ids
{
"room": "lobby",
"message_ids": [],
"redacts": {
"subject_type": "chat_room_message",
"subject_ids": []
}
}Validate
const contracts = require('openvibe-contracts');
contracts.validate('chat.room.message.deleted@1', value); // { valid, errors: [{ path, message }] }