diff --git a/plugin/archivar/inline_commands.py b/plugin/archivar/inline_commands.py index b6e157c..2e9552d 100644 --- a/plugin/archivar/inline_commands.py +++ b/plugin/archivar/inline_commands.py @@ -325,9 +325,9 @@ def build_help_text( # P1-4: Status-Farben (Flughafen-Prinzip) β€” nur wenn PresenceEngine aktiv if presence_enabled: status_emoji = { - "online": "🟒 online (idle, verfΓΌgbar)", - "away": "🟑 away (Hintergrund-Task aktiv, Heartbeat pulsiert)", - "busy": "πŸ”΄ busy (verarbeitet Nachricht)", + "online": "🟩 online (idle, verfΓΌgbar)", + "away": "🟨 away (Hintergrund-Task aktiv, Heartbeat pulsiert)", + "busy": "πŸŸ₯ busy (verarbeitet Nachricht)", } lines.append("### 🚦 Status-Farben") lines.append("") @@ -420,9 +420,9 @@ def build_status_text( # P1-4: PresenceEngine-Info (nur wenn presence_enabled explizit gesetzt) if presence_enabled is not None: status_labels = { - "online": "🟒 online (idle, verfΓΌgbar)", - "away": "🟑 away (Hintergrund-Task aktiv)", - "busy": "πŸ”΄ busy (verarbeitet Nachricht)", + "online": "🟩 online (idle, verfΓΌgbar)", + "away": "🟨 away (Hintergrund-Task aktiv)", + "busy": "πŸŸ₯ busy (verarbeitet Nachricht)", } pulse_label = "πŸ’“ aktiv" if pulse_active else "⏸️ inaktiv" if presence_enabled: @@ -439,7 +439,44 @@ def build_status_text( lines.append("") lines.append("πŸ’‘ `::hilfe` fΓΌr alle Befehle | `::status` fΓΌr Aktualisierung") - return "\n".join(lines) + result = "\n".join(lines) + + # P2-Fix: Rocket.Chat Payload-Limit ~5000 Zeichen. + # Wenn der Status-Text > 5000 Zeichen ist, ersetze die room_map_summary + # durch eine kompakte Version (nur Raum-Name + Catch-All-Status). + MAX_STATUS_LENGTH = 5000 + if len(result) > MAX_STATUS_LENGTH and room_map_summary: + # Baue kompakte Summary: nur Raum-Name + Catch-All-Marker + compact_lines = ["**Raum-Map (kompakt):**"] + for line in room_map_summary.splitlines(): + stripped = line.strip() + if stripped.startswith(("Rocket.Chat", "Keywords", "Thema:")): + continue + # Zeilen wie " 1. Raumname (roomId) β˜… CATCH-ALL β€” Thema: ..." + if stripped and stripped[0].isdigit(): + # Extrahiere nur den Teil bis zum Catch-All-Marker + # Format: "1. Name (id) β˜… CATCH-ALL β€” Thema: ..." + # oder: "1. Name (id) β€” Thema: ..." + if "β˜… CATCH-ALL" in stripped: + idx = stripped.index("β˜… CATCH-ALL") + len("β˜… CATCH-ALL") + compact_lines.append(stripped[:idx]) + else: + # Nimm nur "1. Name (id)" β€” schneide bei " β€” " ab + dash_idx = stripped.find(" β€” ") + if dash_idx > 0: + compact_lines.append(stripped[:dash_idx]) + else: + compact_lines.append(stripped) + compact_summary = "\n".join(compact_lines) + + # Ersetze die room_map_summary in lines + for i, line in enumerate(lines): + if line == room_map_summary: + lines[i] = compact_summary + break + result = "\n".join(lines) + + return result # ── Inline-Command-Parser ───────────────────────────────────────────────