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