fix(P1-4): Status-Farben und Flughafen-Prinzip in ::hilfe und ::status

This commit is contained in:
Bernd (Hermes)
2026-07-24 05:08:43 +02:00
parent 573335cc8d
commit d964d7d5b5
3 changed files with 212 additions and 1 deletions
+24
View File
@@ -3173,9 +3173,20 @@ class RocketChatAdapter(BasePlatformAdapter):
async def _cmd_hilfe(self, room_id: str, args: str) -> str:
"""::hilfe — Zeigt die Hilfeseite mit allen Befehlen."""
from archivar.inline_commands import build_help_text
# P1-4: PresenceEngine-Werte lesen (mit _has_presence-Guard)
presence_enabled = None
current_status = "online"
_has_presence = hasattr(self, '_presence_engine') and self._presence_engine is not None
if _has_presence:
presence_enabled = self._presence_engine.is_enabled()
current_status = getattr(self._presence_engine, '_last_sent_status', 'online') or 'online'
return build_help_text(
self._inline_commands,
room_map_summary=self._room_map_summary,
presence_enabled=presence_enabled,
current_status=current_status,
)
async def _cmd_status(self, room_id: str, args: str) -> str:
@@ -3195,12 +3206,25 @@ class RocketChatAdapter(BasePlatformAdapter):
butler_mode = getattr(room_map, 'butler_mode', 'unknown')
onboarding_active = self.archivar._stats.get("onboarding_active", False)
# P1-4: PresenceEngine-Werte lesen (mit _has_presence-Guard)
presence_enabled = None
current_status = "online"
pulse_active = False
_has_presence = hasattr(self, '_presence_engine') and self._presence_engine is not None
if _has_presence:
presence_enabled = self._presence_engine.is_enabled()
current_status = getattr(self._presence_engine, '_last_sent_status', 'online') or 'online'
pulse_active = self._presence_engine._pulse_controller.is_running()
return build_status_text(
room_count=room_count,
archivar_active=archivar_active,
butler_mode=butler_mode,
onboarding_active=onboarding_active,
room_map_summary=self._room_map_summary,
presence_enabled=presence_enabled,
current_status=current_status,
pulse_active=pulse_active,
)
async def _cmd_reset(self, room_id: str, args: str) -> str: