aboutsummaryrefslogtreecommitdiffstats
path: root/server.py
diff options
context:
space:
mode:
authorBlake DeMarcy <ofunknowndescent@gmail.com>2017-04-13 11:49:20 -0500
committerBlake DeMarcy <ofunknowndescent@gmail.com>2017-04-13 11:49:20 -0500
commit953929e5a30cc06751aa1580e2d2ea08968e9b45 (patch)
tree25d359836a5f28aa8879be0c260509d247fb0cca /server.py
parentd53b0dcf21a5bfabdfe2dffb73d9231c4842114b (diff)
downloadbbj-953929e5a30cc06751aa1580e2d2ea08968e9b45.tar.gz
message deletions now supported on all layers
Diffstat (limited to 'server.py')
-rw-r--r--server.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/server.py b/server.py
index d29ebc8..eca942a 100644
--- a/server.py
+++ b/server.py
@@ -276,6 +276,26 @@ class API(object):
@api_method
+ def delete_post(self, args, database, user, **kwargs):
+ """
+ Requires the arguments `thread_id` and `post_id`.
+
+ Delete a message from a thread. The same rules apply
+ here as `edit_post` and `edit_query`: the logged in user
+ must either be the one who posted the message within 24hrs,
+ or have admin rights. The same error descriptions and code
+ are returned on falilure. Boolean true is returned on
+ success.
+ """
+ if user == db.anon:
+ raise BBJUserError("Anons cannot delete messages.")
+ validate(args, ["thread_id", "post_id"])
+ return db.message_delete(
+ database, user["user_id"], args["thread_id"], args["post_id"])
+
+
+
+ @api_method
def is_admin(self, args, database, user, **kwargs):
"""
Requires the argument `target_user`. Returns a boolean
Un proyecto texto-plano.xyz