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
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);
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;
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();
}
// 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);
let m = parseInt(msgs[i].msgnum);
if (m > highest_mailnum) {
highest_mailnum = m;
- do_notify += 1;
}
}
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();