summary refs log tree commit diff
path: root/main.py
diff options
context:
space:
mode:
authormeltland <[email protected]>2025-04-03 21:20:22 -0400
committermeltland <[email protected]>2025-04-03 21:20:22 -0400
commitb33f468686f0cc2d48b2a1aff13aa7e4f16eae36 (patch)
tree2c2d5be9c9e97a9a6b005b592a052b55bd8169f4 /main.py
parent4c6b6b12ee0a50ed79a22d24a3e8ce9c471bec8f (diff)
update post replies/attachments
Diffstat (limited to 'main.py')
-rw-r--r--main.py6
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()),