docs: update documentation for Home Assistant integration and Apprise icons

- Add Home Assistant integration guide with REST command examples (README.md)
- Document Apprise `type` field mapping to status icons (, ⚠️, ) across agent.md and architecture.md
- Update prerequisites to Nextcloud 33 (INSTALL.md)
- Remove outdated link preview suppression note (agent.md)
- Fix folder name casing in troubleshooting section (INSTALL.md)
This commit is contained in:
kyle
2026-06-14 00:38:59 -07:00
parent 5347ddcdb0
commit 472a1e4967
4 changed files with 110 additions and 6 deletions
+19 -3
View File
@@ -186,10 +186,10 @@ public function __construct(
| Method | Lines | Purpose |
|---|---|---|
| `mapPayload(array)` | ~548-583 | Maps Discord webhook JSON to Talk message text. Extracts: `content`, embed `title` (bold), embed `description`, embed `fields` (name: value). Joins with `\n\n`. |
| `mapApprisePayload(array, roomToken)` | ~608-766 | Maps Apprise JSON to internal format. Handles: `body`, `title`/`subject` as message, `type` prefix ([Info], [Success], [Warning], [Error]), `attachments` (remote URL, local file, base64), `type=image` special case. Returns `{message, senderName, displayName, richObjects}`. |
| `mapApprisePayload(array, roomToken)` | ~608-766 | Maps Apprise JSON to internal format. Handles: `body`, `title`/`subject` as message, `type` → icon (✅ success, ⚠️ warning, ❌ error; none for info/image), `attachments` (remote URL, local file, base64), `type=image` special case. Returns `{message, senderName, displayName, richObjects, typeIcon}`. |
| `getSenderName(array)` | ~588-593 | Returns `username` from Discord payload, or config default |
| `getSenderNameDefault()` | ~598-600 | Returns config `sender_name` default |
| `prependDisplayName(string, string)` | ~540-546 | Prepends `🤖 **{name}**\n\n` to message. Since Talk doesn't support per-message avatars. |
| `prependDisplayName(string, string, string)` | ~540-546 | Prepends `{typeIcon}🤖 **{name}**\n\n` to message. `typeIcon` is ✅/⚠️/❌ for success/warning/error types, empty for info/image. Since Talk doesn't support per-message avatars. |
**Apprise attachment formats handled:**
1. **Remote URL**: `attachment['url']` → download → upload → rich object
@@ -197,6 +197,12 @@ public function __construct(
3. **Base64**: `attachment['base64']` → decode → upload → rich object
4. **type=image**: special case — uses `attachment` (string URL) or `attachments` (array) as image URLs directly
**Type icon mapping:**
- `success` → ✅
- `warning` → ⚠️
- `error` → ❌
- `info` / `image` / missing → no icon (empty string)
**Base64 attachment format** (from Apprise library JSON method):
```json
{
@@ -688,13 +694,19 @@ Apprise sends webhook payloads in several formats depending on the transport:
**Content types handled:**
1. `application/json` — direct JSON parse
2. `multipart/form-data``$_POST`
2. `multipart/form-data``$_POST` (files in `$_FILES['file01']`)
3. `application/x-www-form-urlencoded``parse_str()`
**Apprise URL schemes:**
- `discord://` → uses Discord webhook format
- `apprises://` → uses Apprise format with `notify` in path: `/apprise-webhook/{room}/notify/{token}`
**Type field:** The `type` field maps to an icon displayed before the bot name:
- `success` → ✅
- `warning` → ⚠️
- `error` → ❌
- `info` / `image` / missing → no icon
### Discord Webhook API
Discord webhooks send JSON with these fields:
@@ -930,6 +942,10 @@ Each candidate is verified via `information_schema.tables` + test query.
### Functional
3. **Link preview suppression removed:** Nextcloud Talk generates link previews server-side. URL suppression via angle brackets (`<url>`) does not work. This feature was removed.
### Functional (continued)
6. **avatar_url ignored:** NCTalk doesn't support per-message avatars. `username` is embedded as sender name instead.
7. **actorDisplayName mismatch:** If bot's display name changes in the room, messages will be silently dropped. `getBotDisplayNameForRoom()` resolves this on each message.