don't use network.request

master
magical 2022-08-06 06:55:55 +00:00
parent ab42b4a27d
commit f63233dbb7
1 changed files with 6 additions and 11 deletions

View File

@ -1627,24 +1627,19 @@ class App(object):
body = self.overthrow_ext_edit(init_body)
if not body or re.search("^>>[0-9]+$", body):
return self.temp_footer_message("EMPTY POST DISCARDED")
params = {"body": body}
if self.mode == "thread" and not edit:
endpoint = "thread_reply"
params.update({"thread_id": self.thread["thread_id"]})
self.network.thread_reply(self.thread["thread_id"], body)
elif edit:
endpoint = "edit_post"
params.update({
"thread_id": self.thread["thread_id"],
"post_id": edit["post_id"]
})
self.network.edit_message(
thread_id=self.thread["thread_id"],
post_id=edit["post_id"],
body=body)
else:
endpoint = "thread_create"
params.update({"title": title})
self.network.thread_create(title, body)
self.network.request(endpoint, **params)
self.refresh()
if edit:
self.goto_post(edit["post_id"])