mike23415 commited on
Commit
edea802
·
verified ·
1 Parent(s): 5e6839e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -6
app.py CHANGED
@@ -535,13 +535,13 @@ def cleanup_expired():
535
  def create_chat_room():
536
  try:
537
  form = request.form
538
- ttl = int(form.get("ttl", 3600)) # Default 1 hour
539
  max_receivers = int(form.get("max_receivers", 5))
540
  password = form.get("password", "")
541
  allow_files = form.get("allow_files", "true").lower() == "true"
542
 
543
  room_id = str(uuid.uuid4())
544
- admin_session = str(uuid.uuid4()) # Generate admin session
545
 
546
  CHAT_ROOMS[room_id] = {
547
  "admin_session": admin_session,
@@ -559,13 +559,10 @@ def create_chat_room():
559
 
560
  CHAT_MESSAGES[room_id] = []
561
 
562
- base_url = request.host_url.rstrip('/')
563
- chat_url = f"{base_url}/tools/sharelock?chat={room_id}&admin={admin_session}"
564
-
565
  return jsonify({
566
  "room_id": room_id,
567
  "admin_session": admin_session,
568
- "chat_url": chat_url,
569
  "expires_at": CHAT_ROOMS[room_id]["expires_at"]
570
  })
571
 
 
535
  def create_chat_room():
536
  try:
537
  form = request.form
538
+ ttl = int(form.get("ttl", 3600))
539
  max_receivers = int(form.get("max_receivers", 5))
540
  password = form.get("password", "")
541
  allow_files = form.get("allow_files", "true").lower() == "true"
542
 
543
  room_id = str(uuid.uuid4())
544
+ admin_session = str(uuid.uuid4())
545
 
546
  CHAT_ROOMS[room_id] = {
547
  "admin_session": admin_session,
 
559
 
560
  CHAT_MESSAGES[room_id] = []
561
 
562
+ # Return only IDs - let frontend create URLs
 
 
563
  return jsonify({
564
  "room_id": room_id,
565
  "admin_session": admin_session,
 
566
  "expires_at": CHAT_ROOMS[room_id]["expires_at"]
567
  })
568