fix: chat links in finished and failed webhook notifications open a 404 (#31572)

The link in "chat finished" and "chat failed" webhook notifications was missing the `/c/` part of the chat address, so clicking it opened a 404 page. The link is sent as `/c/<chat id>` again and opens the chat.

Fixes #31565
This commit is contained in:
Classic298 2026-09-30 17:05:45 +02:00 • committed by GitHub
parent c488f60e8b
commit b6dfa3799d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -268,9 +268,6 @@ def _notification_webhook_content(event: Any) -> tuple[str, str, dict[str, Any],
title = str(data.get('title') or event.message or 'Chat finished')
content = str(data.get('message') or '')
url = str(data.get('url') or '')
chat_id = str(data.get('chat_id') or '')
if chat_id and url.endswith(f'/c/{chat_id}'):
url = f'{url[: -len(f"/c/{chat_id}")].rstrip("/")}/{chat_id}'
body = '\n'.join(part for part in (content, url) if part)
return (
f'**{title}**',
@ -288,9 +285,6 @@ def _notification_webhook_content(event: Any) -> tuple[str, str, dict[str, Any],
title = str(event.message or 'Chat failed')
content = str(data.get('message') or '')
url = str(data.get('url') or '')
chat_id = str(data.get('chat_id') or '')
if chat_id and url.endswith(f'/c/{chat_id}'):
url = f'{url[: -len(f"/c/{chat_id}")].rstrip("/")}/{chat_id}'
body = '\n'.join(part for part in (content, url) if part)
return (
f'**{title}**',