Bug 6: Onboarding Catch-All-Auswahl zeigt jetzt DM als Option an
_finish_onboarding: DM-Raum aus _room_info wird immer in die Catch-All-Auswahlliste aufgenommen (auch wenn nicht in room_map). DM bekommt '(aktuell)'-Marker statt '(Catch-All)'. _get_onboarding_room_list: Gleiche Logik — DM immer inkludiert, mit echtem Namen statt 'Catch-All (legacy)'. catch_all_change-Phase: DM-Auswahl ist no-op (bleibt Catch-All), andere Raum-Auswahl setzt _set_catch_all() wie bisher.
This commit is contained in:
+43
-4
@@ -1433,8 +1433,16 @@ class RocketChatAdapter(BasePlatformAdapter):
|
|||||||
all_rooms = self._get_onboarding_room_list()
|
all_rooms = self._get_onboarding_room_list()
|
||||||
if 0 <= index < len(all_rooms):
|
if 0 <= index < len(all_rooms):
|
||||||
rid, name = all_rooms[index]
|
rid, name = all_rooms[index]
|
||||||
|
dm_room_id = state.get("operator_room_id", "")
|
||||||
|
# Bug 6: DM auswählen → kein Wechsel nötig (ist bereits Catch-All)
|
||||||
|
if rid == dm_room_id:
|
||||||
|
await self._post_message_with_retry(operator_room_id,
|
||||||
|
f"👍 {name} ist bereits der Catch-All-Raum — bleibt unverändert.")
|
||||||
|
logger.info("[rocketchat] Catch-All bleibt DM (kein Wechsel nötig)")
|
||||||
|
else:
|
||||||
self._set_catch_all(rid)
|
self._set_catch_all(rid)
|
||||||
await self._post_message_with_retry(operator_room_id, f"🎯 {name} ist jetzt der Catch-All-Raum.")
|
await self._post_message_with_retry(operator_room_id,
|
||||||
|
f"🎯 {name} ist jetzt der Catch-All-Raum.")
|
||||||
logger.info("[rocketchat] Catch-All geändert zu: %s", name)
|
logger.info("[rocketchat] Catch-All geändert zu: %s", name)
|
||||||
else:
|
else:
|
||||||
await self._post_message_with_retry(operator_room_id, f"❌ Ungültige Nummer. Bitte 1–{len(all_rooms)} wählen.")
|
await self._post_message_with_retry(operator_room_id, f"❌ Ungültige Nummer. Bitte 1–{len(all_rooms)} wählen.")
|
||||||
@@ -1726,19 +1734,37 @@ class RocketChatAdapter(BasePlatformAdapter):
|
|||||||
else:
|
else:
|
||||||
logger.warning("[rocketchat] B9: FAISS-Index-Rebuild fehlgeschlagen: %s", e)
|
logger.warning("[rocketchat] B9: FAISS-Index-Rebuild fehlgeschlagen: %s", e)
|
||||||
|
|
||||||
# Baue nummerierte Raumliste
|
# Baue nummerierte Raumliste (inkl. Operator-DM als Catch-All-Option)
|
||||||
all_rooms = []
|
all_rooms = []
|
||||||
|
dm_room_id = operator_room_id
|
||||||
|
dm_room_name = self._room_info.get(dm_room_id, {}).get("name", "DM")
|
||||||
|
dm_already_in_map = dm_room_id in self.archivar._room_map.rooms
|
||||||
|
|
||||||
for rid, entry in self.archivar._room_map.rooms.items():
|
for rid, entry in self.archivar._room_map.rooms.items():
|
||||||
if rid in self.archivar._room_map._excluded_room_ids:
|
if rid in self.archivar._room_map._excluded_room_ids:
|
||||||
continue
|
continue
|
||||||
|
# Bug 6: DM-Raum mit echtem Namen anzeigen, nicht "Catch-All (legacy)"
|
||||||
|
if rid == dm_room_id:
|
||||||
|
all_rooms.append((rid, dm_room_name, True))
|
||||||
|
else:
|
||||||
all_rooms.append((rid, entry.name, entry.catch_all))
|
all_rooms.append((rid, entry.name, entry.catch_all))
|
||||||
|
|
||||||
|
# Bug 6: DM-Raum immer als Option anbieten, auch wenn nicht in room_map
|
||||||
|
if not dm_already_in_map:
|
||||||
|
all_rooms.insert(0, (dm_room_id, dm_room_name, True))
|
||||||
|
|
||||||
all_rooms.sort(key=lambda x: (not x[2], x[1]))
|
all_rooms.sort(key=lambda x: (not x[2], x[1]))
|
||||||
|
|
||||||
lines = ["✅ Alle Räume zur Map hinzugefügt.",
|
lines = ["✅ Alle Räume zur Map hinzugefügt.",
|
||||||
"",
|
"",
|
||||||
"**Aktuelle Raum-Übersicht:**"]
|
"**Aktuelle Raum-Übersicht:**"]
|
||||||
for i, (rid, name, is_catch) in enumerate(all_rooms, 1):
|
for i, (rid, name, is_catch) in enumerate(all_rooms, 1):
|
||||||
marker = " 🎯 (Catch-All)" if is_catch else ""
|
if rid == dm_room_id:
|
||||||
|
marker = " 🎯 (aktuell)"
|
||||||
|
elif is_catch:
|
||||||
|
marker = " 🎯 (Catch-All)"
|
||||||
|
else:
|
||||||
|
marker = ""
|
||||||
lines.append(f"{i}. {name}{marker}")
|
lines.append(f"{i}. {name}{marker}")
|
||||||
lines.append("")
|
lines.append("")
|
||||||
lines.append("Möchtest du den Catch-All-Raum ändern? Antworte mit der Raumnummer, oder **überspringen** zum Behalten.")
|
lines.append("Möchtest du den Catch-All-Raum ändern? Antworte mit der Raumnummer, oder **überspringen** zum Behalten.")
|
||||||
@@ -1778,12 +1804,25 @@ class RocketChatAdapter(BasePlatformAdapter):
|
|||||||
return keywords[:10]
|
return keywords[:10]
|
||||||
|
|
||||||
def _get_onboarding_room_list(self) -> list:
|
def _get_onboarding_room_list(self) -> list:
|
||||||
"""Erstellt eine nummerierte Liste aller Räume (ohne excluded)."""
|
"""Erstellt eine nummerierte Liste aller Räume (ohne excluded), inkl. DM."""
|
||||||
rooms = []
|
rooms = []
|
||||||
|
dm_room_id = self._onboarding_state.get("operator_room_id", "")
|
||||||
|
dm_room_name = self._room_info.get(dm_room_id, {}).get("name", "DM")
|
||||||
|
dm_already_in_map = dm_room_id in self.archivar._room_map.rooms
|
||||||
|
|
||||||
for rid, entry in self.archivar._room_map.rooms.items():
|
for rid, entry in self.archivar._room_map.rooms.items():
|
||||||
if rid in self.archivar._room_map._excluded_room_ids:
|
if rid in self.archivar._room_map._excluded_room_ids:
|
||||||
continue
|
continue
|
||||||
|
# Bug 6: DM-Raum mit echtem Namen anzeigen
|
||||||
|
if rid == dm_room_id:
|
||||||
|
rooms.append((rid, dm_room_name))
|
||||||
|
else:
|
||||||
rooms.append((rid, entry.name))
|
rooms.append((rid, entry.name))
|
||||||
|
|
||||||
|
# Bug 6: DM-Raum immer als Option anbieten, auch wenn nicht in room_map
|
||||||
|
if not dm_already_in_map:
|
||||||
|
rooms.insert(0, (dm_room_id, dm_room_name))
|
||||||
|
|
||||||
rooms.sort(key=lambda x: x[1]) # alphabetisch
|
rooms.sort(key=lambda x: x[1]) # alphabetisch
|
||||||
return rooms
|
return rooms
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user