From f63233dbb76869f2b1e271fbd83d232ffb0c2da5 Mon Sep 17 00:00:00 2001 From: magical Date: Sat, 6 Aug 2022 06:55:55 +0000 Subject: [PATCH] don't use network.request --- clients/urwid/main.py | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/clients/urwid/main.py b/clients/urwid/main.py index 6f10665..fc771d5 100644 --- a/clients/urwid/main.py +++ b/clients/urwid/main.py @@ -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"])