From 90e8e60ca131f4366c68b9d5759f5179092e20da Mon Sep 17 00:00:00 2001 From: Renard Date: Mon, 23 Sep 2019 17:52:07 -0300 Subject: API: make_post returns post id --- cgi/api.py | 3 ++- cgi/weabot.py | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/cgi/api.py b/cgi/api.py index 40fb5c6..462c2c2 100644 --- a/cgi/api.py +++ b/cgi/api.py @@ -367,10 +367,11 @@ def api_process(self, path_split): mobile = ("mobile" in formdata.keys()) # call post function - (post_url, ttaken) = self.make_post(ip, boarddir, parent, trap1, trap2, name, email, subject, message, file, file_original, spoil, oek_file, password, noimage, mobile) + (post_url, ttaken, postid) = self.make_post(ip, boarddir, parent, trap1, trap2, name, email, subject, message, file, file_original, spoil, oek_file, password, noimage, mobile) values['post_url'] = post_url values['time_taken'] = ttaken + values['post_id'] = postid elif method == 'newThreads': data_limit = formdata.get('limit') limit = 30 diff --git a/cgi/weabot.py b/cgi/weabot.py index 64cb890..29770f4 100755 --- a/cgi/weabot.py +++ b/cgi/weabot.py @@ -150,7 +150,7 @@ class weabot(object): mobile = ("mobile" in self.formdata.keys()) # call post function - (post_url, ttaken) = self.make_post(ip, boarddir, parent, trap1, trap2, name, email, subject, message, file, file_original, spoil, oek_file, password, noimage, mobile) + (post_url, ttaken, unused) = self.make_post(ip, boarddir, parent, trap1, trap2, name, email, subject, message, file, file_original, spoil, oek_file, password, noimage, mobile) # make redirect self.output += make_redirect(post_url, ttaken) @@ -793,7 +793,7 @@ class weabot(object): hook_url = make_url(postid, post, parent_post or post, True, False) discord_hook(post, hook_url) - return (post_url, ttaken) + return (post_url, ttaken, postid) def delete_post(self, boarddir, postid, imageonly, password, mobile=False): OpenDb() -- cgit v1.2.1-18-gbd029