Fix #4: Don't broadcast PM invite when target is Violet

- Only emit pm_invite when target_sid exists (real user)
- Violet has no socket session, so emitting to None would broadcast
  to all connected clients, leaking who is chatting with the AI
This commit is contained in:
3nd3r 2026-04-12 12:51:55 -05:00
parent be3503b31b
commit a0a96addb6
1 changed files with 1 additions and 1 deletions

2
app.py
View File

@ -530,7 +530,7 @@ def on_pm_open(data):
join_room(room)
if target_sid:
pending_pm_invites.setdefault(target_sid, set()).add(room)
socketio.emit("pm_invite", {"from": user["username"], "room": room}, to=target_sid)
socketio.emit("pm_invite", {"from": user["username"], "room": room}, to=target_sid)
emit("pm_ready", {"with": target, "room": room})