diff options
author | Blake DeMarcy <ofunknowndescent@gmail.com> | 2017-04-13 11:49:20 -0500 |
---|---|---|
committer | Blake DeMarcy <ofunknowndescent@gmail.com> | 2017-04-13 11:49:20 -0500 |
commit | 953929e5a30cc06751aa1580e2d2ea08968e9b45 (patch) | |
tree | 25d359836a5f28aa8879be0c260509d247fb0cca /server.py | |
parent | d53b0dcf21a5bfabdfe2dffb73d9231c4842114b (diff) | |
download | bbj-953929e5a30cc06751aa1580e2d2ea08968e9b45.tar.gz |
message deletions now supported on all layers
Diffstat (limited to 'server.py')
-rw-r--r-- | server.py | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -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 |