diff options
Diffstat (limited to 'main.py')
-rw-r--r-- | main.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/main.py b/main.py index 7102a40..f4e1be3 100644 --- a/main.py +++ b/main.py @@ -463,7 +463,7 @@ async def handler(websocket): data = db.inbox.get_recent() await websocket.send(json.dumps({"error": False, "inbox": data, "listener": listener})) elif r["command"] == "post_inbox": - fc = util.field_check({"content": range(0,3001), "attachments": range(0,4)}, r) + fc = util.field_check({"content": range(0,3001), "attachments": range(0,6)}, r) if fc != True: await websocket.send(util.error(fc, listener)) continue @@ -494,7 +494,7 @@ async def handler(websocket): await websocket.send(json.dumps({"error": False, "listener": listener})) continue elif r["command"] == "post": - fc = util.field_check({"content": range(0,3001), "replies": range(0,4), "attachments": range(0,4)}, r) + fc = util.field_check({"content": range(0,3001), "replies": range(0,6), "attachments": range(0,6)}, r) if fc != True: await websocket.send(util.error(fc, listener)) continue @@ -513,7 +513,7 @@ async def handler(websocket): replies = [] for i in r["replies"]: post = db.posts.get_by_id(i) - if type(post) == dict: + if type(post) == dict and i not in replies: replies.append(post) data = { "_id": str(uuid.uuid4()), |