Handle posting errors a little more elegantly.
authorArt Cancro <ajc@citadel.org>
Wed, 24 Nov 2021 01:09:23 +0000 (20:09 -0500)
committerArt Cancro <ajc@citadel.org>
Wed, 24 Nov 2021 01:09:23 +0000 (20:09 -0500)
webcit-ng/messages.c
webcit-ng/static/js/view_forum.js

index b33cdf0c34b1e68616b830bc5eeb31274e0a499a..a910b1f6abb781ee1de03c2ca0a63faa6e41e086 100644 (file)
@@ -136,7 +136,7 @@ void dav_put_message(struct http_transaction *h, struct ctdlsession *c, char *eu
        char response_string[1024];
 
        if ((h->request_body == NULL) || (h->request_body_length < 1)) {
-               do_404(h);      // Refuse to post a null message
+               do_404(h);                      // Refuse to post a null message
                return;
        }
 
index 0e8f36c2284d5061c086b5cfe1c9bb5226fc2dc8..edf0a971ba269b3004fffe0695a7f8fa0950e6fc 100644 (file)
@@ -237,13 +237,8 @@ function open_reply_box(prefix, msgnum, is_quoted) {
        + _("Cancel")
        + "</a></span>"
 
-       + "</span>";                                                    // end buttons on right side
-       if (msg.subj) {
-               replybox +=
-               "<br><span class=\"ctdl-msgsubject\">" + "FIXME subject" + "</span>";
-       }
-       replybox +=
-         "</div><br>"                                                  // end footer
+       + "</span>"                                                     // end buttons on right side
+       + "</div><br>"                                                  // end footer
 
 
        + "</div>"                                                      // end content
@@ -285,7 +280,11 @@ function save_message(div_name, reply_to_msgnum) {
                                document.getElementById(div_name).outerHTML = "";               // close the editor
                        }
                        else {
-                               alert(_("An error has occurred."));     // inelegant but hopefully infrequent
+                               error_message = request.responseText;
+                               if (error_message.length == 0) {
+                                       error_message = _("An error has occurred.");
+                               }
+                               alert(error_message);                                           // FIXME make this pretty
                        }
                }
        };