fix(P-066): Clarify-Buttons gerendert + deutsche Labels

BUG 1 — Other-Button ohne action_id (P-051): RC 6.x ignoriert gesamten
actions-Array wenn ein Button kein action_id hat → KEINE Buttons sichtbar.
Fix: action_id via hashlib.sha1(payload:0)[:12] ergänzt (konsistent mit
_build_custom_buttons in __init__.py und _make_action_id in button_builder.py).

BUG 2 — Englische Labels:
- 'Other' → 'Andere (Freitext)'
- 'Please choose an option:' → 'Bitte wähle eine Option:'

Zusätzlich: hashlib-Import ergänzt (fehlte in adapter.py).
This commit is contained in:
Bernd (Hermes)
2026-08-13 18:47:17 +02:00
parent 0ac503190b
commit 2ffb7cb3e3
+6 -3
View File
@@ -12,6 +12,7 @@ import asyncio
import concurrent.futures
import contextvars
import datetime
import hashlib
import json
import logging
import os
@@ -7254,18 +7255,20 @@ class RocketChatAdapter(BasePlatformAdapter):
buttons = _build_custom_buttons(button_labels, prefix=f"CLARIFY:{clarify_id}")
# Add "Other" button with special handling
other_payload = f"CLARIFY:{clarify_id}:other"
buttons.append({
"type": "button",
"text": "✏️ Other",
"msg": f"CLARIFY:{clarify_id}:other",
"text": "✏️ Andere (Freitext)",
"msg": other_payload,
"msg_in_chat_window": True,
"style": "default",
"action_id": hashlib.sha1(f"{other_payload}:0".encode()).hexdigest()[:12],
})
# Create attachment with buttons
attachments = [{
"color": "#1d74f5",
"title": "Please choose an option:",
"title": "Bitte wähle eine Option:",
"actions": buttons,
}]