MAKE WAY FOR BIFF in webcit-ng
authorArt Cancro <ajc@citadel.org>
Wed, 23 Nov 2022 21:51:06 +0000 (16:51 -0500)
committerArt Cancro <ajc@citadel.org>
Wed, 23 Nov 2022 21:51:06 +0000 (16:51 -0500)
webcit-ng/server/room_functions.c
webcit-ng/server/webcit.h
webcit-ng/static/js/main.js
webcit-ng/static/js/view_mail.js

index e18633a8be79e4d020a688b9a7f4dfee0edd87bc..f6c843b7e3336a30231a0e9d0f57de66a7ed1e8f 100644 (file)
@@ -508,7 +508,6 @@ void get_the_room_itself(struct http_transaction *h, struct ctdlsession *c) {
        JsonObjectAppend(j, NewJsonNumber(HKEY("total_messages"), c->total_messages));
        JsonObjectAppend(j, NewJsonNumber(HKEY("last_seen"), c->last_seen));
        JsonObjectAppend(j, NewJsonNumber(HKEY("room_mtime"), c->room_mtime));
-       JsonObjectAppend(j, NewJsonNumber(HKEY("new_mail"), c->new_mail));
 
        StrBuf *sj = NewStrBuf();
        SerializeJson(sj, j, 1);        // '1' == free the source array
@@ -632,7 +631,7 @@ void ctdl_r(struct http_transaction *h, struct ctdlsession *c) {
                        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.
                        c->is_room_aide = extract_int(&buf[4], 8);
-                       c->new_mail = extract_int(&buf[4], 9);          // the number of new messages in the user's INBOX
+                       //      9                                       This position is no longer used
                        //      10      (int)CC->room.QRfloor           The floor number this room resides on
                        c->room_current_view = extract_int(&buf[4], 11);
                        c->room_default_view = extract_int(&buf[4], 12);
index 9e6d069ba9752310db2bd03905105b809e0a81cd..d8321b49f0586d673d54dc2c6ad6a76ed3930bc6 100644 (file)
@@ -91,7 +91,6 @@ struct ctdlsession {
        time_t last_access;                     // Timestamp of last request that used this session
        time_t num_requests_handled;
        time_t room_mtime;                      // Timestampt of the most recent write activity in this room
-       int new_mail;                           // number of new messages in the user's INBOX
 };
 
 extern char *ssl_cipher_list;
index fd0b40767eb4089ff3d8fe2b4b4b6c0b1d901e10..0ebb577a0529521a8e649ff5ef4dd72355f8b0c3 100644 (file)
@@ -77,7 +77,6 @@ function gotoroom(roomname) {
                        is_room_aide = data.is_room_aide;
                        room_mtime = data.room_mtime;
                        can_delete_messages = data.can_delete_messages;
-                       console.log("new mail: " + data.new_mail);
                        update_banner();
                        render_room_view();
                }
index 503eedfc6fc76ba4ef4686ec2efe541783117b87..eeda88fc35ef7cdad20e0d7e87897b11f45b6859 100644 (file)
@@ -231,11 +231,9 @@ function refresh_mail_display() {
 
 
 // This is where the rendering of the message list in the mailbox view is performed.
-// Set notify to newmail_notify.NO or newmail_notify.YES depending on whether we want notifications for new mail.
+// Set notify to newmail_notify.NO or newmail_notify.YES depending on whether we are interested in the arrival of new messages.
 function render_mailbox_display(notify) {
 
-       let do_notify = 0;
-
        url = "/ctdl/r/" + escapeHTMLURI(current_room) + "/mailbox";
        fetch_mailbox = async() => {
                response = await fetch(url);
@@ -254,7 +252,6 @@ function render_mailbox_display(notify) {
                                let m = parseInt(msgs[i].msgnum);
                                if (m > highest_mailnum) {
                                        highest_mailnum = m;
-                                       do_notify += 1;
                                }
                        }
 
@@ -264,10 +261,20 @@ function render_mailbox_display(notify) {
                        if (selected_message > 0) {                     // if we had a message selected, keep it selected
                                select_message(selected_message);
                        }
+
+
+
+
+/*
                        if ( (do_notify > 0) && (notify == newmail_notify.YES) ) {
                                console.log(do_notify + " new mail");
                                new_mail_sound.play();                  // FIXME do a visual notification as well
+                                                                       // FIXME move this to BIFF
                        }
+ */
+
+
+
                }
        }
        fetch_mailbox();