When sending MSGS commands, unescape the command being sent to the server
authorArt Cancro <ajc@citadel.org>
Fri, 5 Nov 2021 21:54:06 +0000 (17:54 -0400)
committerArt Cancro <ajc@citadel.org>
Fri, 5 Nov 2021 21:54:06 +0000 (17:54 -0400)
webcit-ng/room_functions.c
webcit-ng/static/js/views.js

index 416066a859a30fbbf9ab7ffeab6ae6ad47673c3d..338f034ad04d9fc69437a3e66f86c225dc060c41 100644 (file)
@@ -113,20 +113,18 @@ void object_in_room(struct http_transaction *h, struct ctdlsession *c) {
 
        extract_token(buf, h->uri, 4, '/', sizeof buf);
 
-       if (!strncasecmp(buf, "msgs.", 5))      // Client is requesting a list of message numbers
-       {
+       if (!strncasecmp(buf, "msgs.", 5)) {    // Client is requesting a list of message numbers
+               unescape_input(&buf[5]);
                json_msglist(h, c, &buf[5]);
                return;
        }
 #if 0
-       if (!strncasecmp(buf, "threads", 5))    // Client is requesting a threaded view (still kind of fuzzy here)
-       {
+       if (!strncasecmp(buf, "threads", 5)) {  // Client is requesting a threaded view (still kind of fuzzy here)
                threaded_view(h, c, &buf[5]);
                return;
        }
 
-       if (!strncasecmp(buf, "flat", 5))       // Client is requesting a flat view (still kind of fuzzy here)
-       {
+       if (!strncasecmp(buf, "flat", 5)) {     // Client is requesting a flat view (still kind of fuzzy here)
                flat_view(h, c, &buf[5]);
                return;
        }
index 6abac8251c558f0c1e4c7ce783f0d8eae4cfa977..f4d8e220d46035b52c152b83936f3d34c80aeeb6 100644 (file)
@@ -167,7 +167,6 @@ function forum_render_one(div, msgnum, scroll_to) {
                        + "</div>"                                                      // end avatar
                        + "<div class=\"ctdl-msg-content\">"                            // begin content
                        + "<div class=\"ctdl-msg-header\">"                             // begin header
-
                        + "<span class=\"ctdl-msg-header-info\">"                       // begin header info on left side
                        + "<span class=\"ctdl-username\"><a href=\"#\">"                // FIXME link to user profile
                        + msg.from
@@ -176,22 +175,17 @@ function forum_render_one(div, msgnum, scroll_to) {
                        + msg.time
                        + "</span>"                                                     // end msgdate
                        + "</span>"                                                     // end header info on left side
-
-
                        + "<span class=\"ctdl-msg-header-buttons\">"                    // begin buttons on right side
                        + "<span class=\"ctdl-msg-button\">Reply</span>"
                        + "<span class=\"ctdl-msg-button\">Delete</span>"
                        + "<span class=\"ctdl-msg-button\">Flame</span>"
                        + "</span>";                                                    // end buttons on right side
-
                        if (msg.subj) {
                                outmsg +=
                                "<br><span class=\"ctdl-msgsubject\">" + msg.subj + "</span>";
                        }
-
                        outmsg +=
                          "</div><br>"                                                  // end header
-
                        + "<div class=\"ctdl-msg-body\">"                               // begin body
                        + msg.text
                        + "</div>"                                                      // end body
@@ -210,4 +204,3 @@ function forum_render_one(div, msgnum, scroll_to) {
        }
        fetch_message();
 }
-