aboutsummaryrefslogtreecommitdiff
path: root/cgi
diff options
context:
space:
mode:
authorLibravatar Renard 2019-09-23 17:52:07 -0300
committerLibravatar Renard 2019-09-24 19:11:22 -0300
commit90e8e60ca131f4366c68b9d5759f5179092e20da (patch)
treea77f80af0743f30927aa9c3c2aa0f42632b33c28 /cgi
parent3ff6f43f51d813280d54fd91121c14c4819b5b84 (diff)
downloadweabot-90e8e60ca131f4366c68b9d5759f5179092e20da.tar.gz
weabot-90e8e60ca131f4366c68b9d5759f5179092e20da.tar.xz
weabot-90e8e60ca131f4366c68b9d5759f5179092e20da.zip
API: make_post returns post id
Diffstat (limited to 'cgi')
-rw-r--r--cgi/api.py3
-rwxr-xr-xcgi/weabot.py4
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()