feat(talk): prepend display name to messages

- Add `prependDisplayName` method to `TalkService` to format the name line
- Update `WebhookController` to prepend display name for Talk messages
- Update `mapApprisePayload` to extract and pass display name from Apprise title or config
- Add `displayName` to return array in `mapApprisePayload`
This commit is contained in:
kyle
2026-06-12 16:53:16 -07:00
parent 42fa70491d
commit 88ad358eef
2 changed files with 26 additions and 8 deletions
+7 -1
View File
@@ -88,6 +88,8 @@ class WebhookController extends Controller {
}
$senderName = $this->talkService->getSenderName($data);
// Prepend display name since Talk doesn't support per-message avatars
$message = $this->talkService->prependDisplayName($senderName, $message);
// Handle images
$richObjects = [];
@@ -249,8 +251,12 @@ class WebhookController extends Controller {
$senderName = $mapped['senderName'] ?? $this->talkService->getSenderNameDefault();
$richObjects = $mapped['richObjects'] ?? [];
// Prepend display name since Talk doesn't support per-message avatars
$displayName = $mapped['displayName'] ?? $senderName;
$message = $this->talkService->prependDisplayName($displayName, $mapped['message']);
// Post to Talk via Chat API
$success = $this->talkService->postToRoom($roomToken, $mapped['message'], $senderName, $richObjects);
$success = $this->talkService->postToRoom($roomToken, $message, $senderName, $richObjects);
if ($success) {
$this->logger->info('NCdiscordhook: apprise webhook processed successfully', [