From 410bb78d1e2ff3b0e40ab77cb3bd3a7ea9207690 Mon Sep 17 00:00:00 2001 From: Blake DeMarcy Date: Fri, 3 Mar 2017 17:16:11 -0600 Subject: [PATCH] silly formatting changes --- bbj.el | 2 ++ src/endpoints.py | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/bbj.el b/bbj.el index a526ad2..0f82362 100644 --- a/bbj.el +++ b/bbj.el @@ -472,6 +472,7 @@ it worked on emacs 24." (bbj-enter) (unless (eql buffer (current-buffer)) (bbj-edit-post)))) + (let* ((post (alist-get 'post_id (bbj-post-prop 'data))) (adminp (bbj-request "is_admin" 'target_user bbj-username)) (message (alist-get 'body (bbj-post-prop 'data))) @@ -485,6 +486,7 @@ it worked on emacs 24." (message bbj-descend request 'error 'description) (message "post edited") (bbj-enter-thread ,thread-id)))))) + (cond ((numberp (bbj-descend query 'error 'code)) (message (bbj-descend query 'error 'description))) diff --git a/src/endpoints.py b/src/endpoints.py index 35a38dc..9317ac3 100644 --- a/src/endpoints.py +++ b/src/endpoints.py @@ -166,8 +166,13 @@ def edit_post(json): ok, obj = db.edit_handler(json, thread) if ok: + + if json.get("reformat"): + json["body"] = formatting.parse(json["body"]) + obj["body"] = json["body"] obj["lastmod"] = time() obj["edited"] = True db.thread_dump(json["thread_id"], thread) + return obj