From: Art Cancro Date: Sat, 2 Jul 2022 02:17:06 +0000 (-0400) Subject: Beginnings of mailbox view X-Git-Tag: v958~64 X-Git-Url: https://code.citadel.org/?a=commitdiff_plain;h=139f0df2fc1067e0dcf0aa14a0cf079313ef7d40;p=citadel.git Beginnings of mailbox view --- diff --git a/webcit-ng/room_functions.c b/webcit-ng/room_functions.c index 888a94045..48701159d 100644 --- a/webcit-ng/room_functions.c +++ b/webcit-ng/room_functions.c @@ -83,7 +83,6 @@ void json_mailbox(struct http_transaction *h, struct ctdlsession *c) { ctdl_readline(c, buf, sizeof(buf)); if (buf[0] == '1') { while (ctdl_readline(c, buf, sizeof(buf)), (strcmp(buf, "000"))) { - syslog(LOG_DEBUG, "msg: %s", buf); JsonValue *jmsg = NewJsonObject(HKEY("message")); JsonObjectAppend(jmsg, NewJsonNumber(HKEY("msgnum"), extract_long(buf, 0))); JsonObjectAppend(jmsg, NewJsonNumber(HKEY("time"), extract_long(buf, 1))); @@ -356,7 +355,7 @@ void propfind_the_room_itself(struct http_transaction *h, struct ctdlsession *c) case VIEW_ADDRESSBOOK: // FIXME put some sort of CardDAV crapola here when we implement it enumerate_by_euid = 1; break; - case VIEW_WIKI: // FIXME invent "WikiDAV" ? + case VIEW_WIKI: // FIXME invent "WikiDAV" ? The versioning stuff in DAV could be useful. enumerate_by_euid = 1; break; } diff --git a/webcit-ng/static/js/view_mail.js b/webcit-ng/static/js/view_mail.js index 415d5c267..38245621b 100644 --- a/webcit-ng/static/js/view_mail.js +++ b/webcit-ng/static/js/view_mail.js @@ -7,5 +7,38 @@ // Set up the mailbox view function mail_display() { target_div = document.getElementById("ctdl-main"); - target_div.innerHTML = "haah h0h00 wowowozers"; + target_div.innerHTML = "
mailbox pane
reading pane
"; + mailbox_pane = document.getElementById("ctdl-mailbox-pane"); + reading_pane = document.getElementById("ctdl-reading-pane"); + + activate_loading_modal(); + url = "/ctdl/r/" + escapeHTMLURI(current_room) + "/mailbox"; + fetch_mailbox = async() => { + response = await fetch(url); + msgs = await(response.json()); + if (response.ok) { + + box = "" + + "" + + "" + + "" + + "" + + ""; + + + for (var i=0; i" + + "" + + "" + + "" + + "" + + ""; + } + + box += "
" + _("Subject") + "" + _("Sender") + "" + _("Date") + "#
" + msgs[i]["subject"] + "" + msgs[i]["author"] + " <" + msgs[i]["addr"] + ">" + convertTimestamp(msgs[i]["time"]) + "" + msgs[i]["msgnum"] + "
"; + mailbox_pane.innerHTML = box; + } + } + fetch_mailbox(); + deactivate_loading_modal(); }