diff --git a/README.md b/README.md index 4579c0f..75fc60d 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ By popular demand, I'm building a better anonkun. It doesn't do much right now t ## Requirements Python 3.6+ MariaDB 10.2+ -Python packages: `flask flask_socketio flask-paranoid passlib argon2_cffi bleach flask-session requests python-magic` +Python packages: `flask flask_socketio flask-paranoid passlib argon2_cffi bleach flask-session requests python-magic gunicorn eventlet` ## Install ``` diff --git a/events.py b/events.py index 651364e..8879417 100644 --- a/events.py +++ b/events.py @@ -132,6 +132,7 @@ def new_post(data, internal=False): data["post_type"] = "text" data["date"] = int(time.time()) post_id = db.insert_quest_post(room, "text", post, data["date"]) + db.set_dice_call_closed(room); data["post_id"] = post_id emit("new_post", data, room=room) @@ -248,6 +249,7 @@ def open_dice_call(data): if session.get("user_id") != res[3]: return + # TODO: enforce only open if last post post_id = data.get("post_id") db.set_dice_call_open(post_id, room) diff --git a/templates/quest.html b/templates/quest.html index 7c8ff45..d312029 100644 --- a/templates/quest.html +++ b/templates/quest.html @@ -24,14 +24,20 @@ mbox.scrollTop = mbox.scrollHeight; }); socket.on('new_post', function(data) { + deactivate_post(); let qposts = document.getElementById('questPosts'); - let post_str = '