From da6390f9b0429c2ca984c7d95a9c06c0cb2fd1e4 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Sun, 13 Feb 2022 19:01:57 -0500 Subject: [PATCH] moved vars to vars.js --- webcit-ng/api.txt | 2 +- webcit-ng/room_functions.c | 2 +- webcit-ng/static/index.html | 1 + webcit-ng/static/js/main.js | 13 ------------- webcit-ng/static/js/vars.js | 24 ++++++++++++++++++++++++ webcit-ng/webcit.h | 1 + 6 files changed, 28 insertions(+), 15 deletions(-) create mode 100644 webcit-ng/static/js/vars.js diff --git a/webcit-ng/api.txt b/webcit-ng/api.txt index a8761daf6..37d90510b 100644 --- a/webcit-ng/api.txt +++ b/webcit-ng/api.txt @@ -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: diff --git a/webcit-ng/room_functions.c b/webcit-ng/room_functions.c index 0a8b73c41..d8e1231aa 100644 --- a/webcit-ng/room_functions.c +++ b/webcit-ng/room_functions.c @@ -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); diff --git a/webcit-ng/static/index.html b/webcit-ng/static/index.html index 07a61aa10..b9c9f3b3f 100644 --- a/webcit-ng/static/index.html +++ b/webcit-ng/static/index.html @@ -75,6 +75,7 @@ Loading... + diff --git a/webcit-ng/static/js/main.js b/webcit-ng/static/js/main.js index cc4627b71..dd9db01f1 100644 --- a/webcit-ng/static/js/main.js +++ b/webcit-ng/static/js/main.js @@ -11,19 +11,6 @@ // 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 index 000000000..943aab331 --- /dev/null +++ b/webcit-ng/static/js/vars.js @@ -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 = [] ; diff --git a/webcit-ng/webcit.h b/webcit-ng/webcit.h index 17ffd0f23..9dccdcbf6 100644 --- a/webcit-ng/webcit.h +++ b/webcit-ng/webcit.h @@ -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; -- 2.39.2