diff --git a/docs/plugins/apis.mdx b/docs/plugins/apis.mdx index d4ae6dfe28..9b263fdd05 100644 --- a/docs/plugins/apis.mdx +++ b/docs/plugins/apis.mdx @@ -585,6 +585,9 @@ Emit a custom event that other plugins can subscribe to. The host prefixes Pass an event-name suffix. Dots are allowed for hierarchy. Subscribers use the fully qualified `.` name in their custom-event handler: see the [handlers reference](/docs/plugins/events#plugin-to-plugin-events). +If the composed name would equal a built-in Owncast event (a plugin slugged +`chat` emitting `message.received`), the host drops the emit instead of +delivering a forged core event. diff --git a/docs/plugins/testing.mdx b/docs/plugins/testing.mdx index f03da463f5..faf5561799 100644 --- a/docs/plugins/testing.mdx +++ b/docs/plugins/testing.mdx @@ -217,7 +217,7 @@ The scenario's top-level `expect` checks what happened across the whole run: | `bannedIPs` | List of IPs banned via `owncast.users.banIP` | | `uploads` | List of `{ name, body?, bodyBase64? }` from `owncast.storage.upload`. `name` is always checked. Non-empty `body` values compare text. Present `bodyBase64` values compare exact decoded bytes | | `videoConfigWrites` | List of partial configs applied via `owncast.videoConfig.write()` | -| `emits` | List of `{ eventType, payload }` for `owncast.events.emit` calls | +| `emits` | List of `{ eventType, payload }` for `owncast.events.emit` calls. `eventType` is the dispatched name, so it carries your plugin's slug prefix | | `commands` | List of `{ name, prefix?, description?, usage?, aliases?, modOnly, caseSensitive, cooldownMs }` chat-command registrations, matched by `name` in any order (`prefix`, `description`, `usage`, and `aliases` are checked only when set) | | `kv` | Partial map of plugin-config state after the scenario | | `httpRequests` | List of `{ url, method?, body? }` outbound `owncast.http.fetch` calls. `url` is an exact match, an omitted `method` matches any, an omitted `body` skips the check | @@ -274,7 +274,7 @@ Example exercising several: "expect": { "chatSends": ["alice: 1 message", "alice: 2 messages"], "kv": { "count:u-alice": "2" }, - "emits": [{ "eventType": "milestone.reached", "payload": { "user": "alice", "count": 2 } }] + "emits": [{ "eventType": "my-plugin.milestone.reached", "payload": { "user": "alice", "count": 2 } }] } } ```