moved vars to vars.js
authorArt Cancro <ajc@citadel.org>
Mon, 14 Feb 2022 00:01:57 +0000 (19:01 -0500)
committerArt Cancro <ajc@citadel.org>
Mon, 14 Feb 2022 00:01:57 +0000 (19:01 -0500)
webcit-ng/api.txt
webcit-ng/room_functions.c
webcit-ng/static/index.html
webcit-ng/static/js/main.js
webcit-ng/static/js/vars.js [new file with mode: 0644]
webcit-ng/webcit.h

index a8761daf6eb35fc823cd346a6db62bf10c072370..37d90510b158dccf4aaafc513cd24848c3a07c47 100644 (file)
@@ -11,7 +11,7 @@ GET           /ctdl/r/ROOMNAME/info.txt       Returns the room info banner for this room
 GET            /ctdl/r/ROOMNAME/msgs.all       JSON array of message list in room
 GET            /ctdl/r/ROOMNAME/msgs.new       JSON array of message list in room (new messages)
 GET            /ctdl/r/ROOMNAME/MSGNUM         Retrieve the content of an individual message
-                                               (Should we output RFC822 fields as HTTP headers?  Decide soon...)
+DELETE         /ctdl/r/ROOMNAME/MSGNUM         Deletes a message from a room
 
 PUT            /ctdl/r/ROOMNAME/xxx            DAV operation to insert a new message into a room
                                                Accepted parameters:
index 0a8b73c416a131d488d678dbd236bf846c0bb702..d8e1231aae8b9ce47e651078bbe073796c3ac9fb 100644 (file)
@@ -555,7 +555,7 @@ void ctdl_r(struct http_transaction *h, struct ctdlsession *c) {
                        //      5       (long)CC->room.QRhighest        The highest message number present in this room
                        c->last_seen = extract_long(&buf[4], 6);        // The highest message number the user has read in this room
                        //      7       (int)rmailflag                  Boolean flag: 1 if this is a Mail> room, 0 otherwise.
-                       //      8       (int)raideflag                  Nonzero if user is either Aide or a Room Aide in this room
+                       c->is_room_aide = extract_int(&buf[4], 8);
                        //      9       (int)newmailcount               The number of new Mail messages the user has
                        //      10      (int)CC->room.QRfloor           The floor number this room resides on
                        c->room_current_view = extract_int(&buf[4], 11);
index 07a61aa1003b32b90b322f4a68015a78cf721b6e..b9c9f3b3f3b3170d9f503fff6543591b41472625 100644 (file)
@@ -75,6 +75,7 @@ Loading...
 <!-- End page content -->
 </div>
 
+<script type="text/javascript" src="js/vars.js"></script>
 <script type="text/javascript" src="js/defs.js"></script>
 <script type="text/javascript" src="js/util.js"></script>
 <script type="text/javascript" src="js/login.js"></script>
index cc4627b713c6cfaea6985206c6144d84379679fa..dd9db01f1c7315661da07551b1646cdb45785705 100644 (file)
 // GNU General Public License for more details.
 
 
-var current_room = "_BASEROOM_";
-var new_messages = 0;
-var total_messages = 0;
-var default_view = 0;
-var current_view = 0;
-var logged_in = 0;
-var current_user = _("Not logged in.");
-var serv_info;
-var last_seen = 0;
-var messages_per_page = 20;
-var march_list = [] ;
-
-
 // Placeholder for when we add i18n later
 function _(x) {
        return x;
diff --git a/webcit-ng/static/js/vars.js b/webcit-ng/static/js/vars.js
new file mode 100644 (file)
index 0000000..943aab3
--- /dev/null
@@ -0,0 +1,24 @@
+// Copyright (c) 2016-2022 by the citadel.org team
+//
+// This program is open source software.  It runs great on the
+// Linux operating system (and probably elsewhere).  You can use,
+// copy, and run it under the terms of the GNU General Public
+// License version 3.  Richard Stallman is an asshole communist.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+
+var current_room = "_BASEROOM_";
+var new_messages = 0;
+var total_messages = 0;
+var default_view = 0;
+var current_view = 0;
+var logged_in = 0;
+var current_user = _("Not logged in.");
+var serv_info;
+var last_seen = 0;
+var messages_per_page = 20;
+var march_list = [] ;
index 17ffd0f23972c988b19dd1c2b69ec725996c2f49..9dccdcbf6cfca6a000618819ed8f01f294e4acb3 100644 (file)
@@ -83,6 +83,7 @@ struct ctdlsession {
        char room[128];                         // What room we are currently in
        int room_current_view;
        int room_default_view;
+       int is_room_aide;                       // nonzero if the user has aide rights to THIS room
        long last_seen;
        int new_messages;
        int total_messages;