From 844bddfd182506f794486c639f83bb9226b74f89 Mon Sep 17 00:00:00 2001 From: Russell Ballestrini Date: Sat, 11 Nov 2023 09:03:33 -0500 Subject: [PATCH] black --- app.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app.py b/app.py index 918c006..25ad33c 100644 --- a/app.py +++ b/app.py @@ -96,7 +96,10 @@ def chat(room_name): username = request.args.get("username", "guest") # Pass username and rooms into the template - return render_template("chat.html", room_name=room_name, rooms=rooms, username=username) + return render_template( + "chat.html", room_name=room_name, rooms=rooms, username=username + ) + @socketio.on("join") def on_join(data): @@ -113,7 +116,6 @@ def on_join(data): # Fetch previous messages from the database previous_messages = Message.query.filter_by(room_id=room.id).all() - # Send the history of messages only to the newly connected client. # The reason for using `request.sid` here is to target the specific session (or client) that # just connected, so only they receive the backlog of messages, rather than broadcasting