ChatMessageDeletedPayload chat.message.deleted@1

Generated at from openvibe-contracts v0.33.0 and openvibe-sdk v0.5.0.

Version
1.0.0
Owner
chat
Visibility
public
Status
active
Compatibility
backward
Decision
ADR-026
Schema
https://openvibe.network/contracts/events/payloads/chat.message.deleted.v1.json

chat.message.deleted v1 (OpenVibe.Chat server/db/database.js _announceDeleted). Public messages were deleted: by a moderator, through Live's bridge, the author's or an anon's history, a time-range purge or the auto-delete sweep. Envelope: subject { type: chat_message, id: <first id> }, visibility public, priority important, actor service:chat. One event per 500 ids. Carries only ids, never the text, the author or who deleted it; payload.redacts makes OpenVibe.Events tombstone the chat.message.created of each id.

Fields

FieldTypeRequiredDescriptionConstraints
message_idsarray of integeryesChat message ids (the id in chat.message.created).
  • minItems 1
  • maxItems 500
  • unique items
  • items: minimum 1
redactsevents.redaction-directiveyes{ subject_type: chat_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
{
  "message_ids": [
    1201,
    1202
  ],
  "redacts": {
    "subject_type": "chat_message",
    "subject_ids": [
      "1201",
      "1202"
    ]
  }
}
Rejected: carries-text
{
  "message_ids": [
    1201
  ],
  "text": "hello",
  "redacts": {
    "subject_type": "chat_message",
    "subject_ids": [
      "1201"
    ]
  }
}
Rejected: no-ids
{
  "message_ids": [],
  "redacts": {
    "subject_type": "chat_message",
    "subject_ids": [
      "1"
    ]
  }
}

Validate

const contracts = require('openvibe-contracts');
contracts.validate('chat.message.deleted@1', value);   // { valid, errors: [{ path, message }] }