diff options
Diffstat (limited to 'html.c')
| -rw-r--r-- | html.c | 10 |
1 files changed, 6 insertions, 4 deletions
| @@ -3105,10 +3105,6 @@ int html_post_handler(const xs_dict *req, const char *q_path, | |||
| 3105 | 3105 | ||
| 3106 | p_vars = xs_dict_get(req, "p_vars"); | 3106 | p_vars = xs_dict_get(req, "p_vars"); |
| 3107 | 3107 | ||
| 3108 | #if 0 | ||
| 3109 | xs_json_dump(p_vars, 4, stdout); | ||
| 3110 | #endif | ||
| 3111 | |||
| 3112 | if (p_path && strcmp(p_path, "admin/note") == 0) { /** **/ | 3108 | if (p_path && strcmp(p_path, "admin/note") == 0) { /** **/ |
| 3113 | /* post note */ | 3109 | /* post note */ |
| 3114 | const xs_str *content = xs_dict_get(p_vars, "content"); | 3110 | const xs_str *content = xs_dict_get(p_vars, "content"); |
| @@ -3121,6 +3117,7 @@ int html_post_handler(const xs_dict *req, const char *q_path, | |||
| 3121 | const xs_str *edit_id = xs_dict_get(p_vars, "edit_id"); | 3117 | const xs_str *edit_id = xs_dict_get(p_vars, "edit_id"); |
| 3122 | const xs_str *alt_text = xs_dict_get(p_vars, "alt_text"); | 3118 | const xs_str *alt_text = xs_dict_get(p_vars, "alt_text"); |
| 3123 | int priv = !xs_is_null(xs_dict_get(p_vars, "mentioned_only")); | 3119 | int priv = !xs_is_null(xs_dict_get(p_vars, "mentioned_only")); |
| 3120 | int is_draft = !xs_is_null(xs_dict_get(p_vars, "is_draft")); | ||
| 3124 | xs *attach_list = xs_list_new(); | 3121 | xs *attach_list = xs_list_new(); |
| 3125 | 3122 | ||
| 3126 | /* default alt text */ | 3123 | /* default alt text */ |
| @@ -3199,6 +3196,11 @@ int html_post_handler(const xs_dict *req, const char *q_path, | |||
| 3199 | msg = xs_dict_set(msg, "summary", xs_is_null(summary) ? "..." : summary); | 3196 | msg = xs_dict_set(msg, "summary", xs_is_null(summary) ? "..." : summary); |
| 3200 | } | 3197 | } |
| 3201 | 3198 | ||
| 3199 | if (is_draft) { | ||
| 3200 | /* don't send; just store for later */ | ||
| 3201 | draft_add(&snac, xs_dict_get(msg, "id"), msg); | ||
| 3202 | } | ||
| 3203 | else | ||
| 3202 | if (xs_is_null(edit_id)) { | 3204 | if (xs_is_null(edit_id)) { |
| 3203 | /* new message */ | 3205 | /* new message */ |
| 3204 | c_msg = msg_create(&snac, msg); | 3206 | c_msg = msg_create(&snac, msg); |