char content_transfer_encoding[1024] = { 0 };
char content_type[1024] = { 0 };
char datetime[128] = { 0 };
- char author[1024] = { 0 };
- char emailaddr[1024] = { 0 };
int message_originated_locally = 0;
setup_for_forum_view(c);
// citadel header parsing here
if (!strncasecmp(buf, "from=", 5)) {
- safestrncpy(author, &buf[5], sizeof author);
+ JsonObjectAppend(j, NewJsonPlainString(HKEY("from"), &buf[5], -1));
}
else if (!strncasecmp(buf, "rfca=", 5)) {
- safestrncpy(emailaddr, &buf[5], sizeof emailaddr);
+ JsonObjectAppend(j, NewJsonPlainString(HKEY("rfca"), &buf[5], -1));
}
else if (!strncasecmp(buf, "time=", 5)) {
JsonObjectAppend(j, NewJsonNumber(HKEY("time"), atol(&buf[5])));
}
}
- if (message_originated_locally) {
- JsonObjectAppend(j, NewJsonPlainString(HKEY("from"), author, -1));
- }
- else {
- JsonObjectAppend(j, NewJsonPlainString(HKEY("from"), emailaddr, -1)); // FIXME do compound address string
- }
+ JsonObjectAppend(j, NewJsonNumber(HKEY("locl"), message_originated_locally));
if (!strcmp(buf, "text")) {
while ((ctdl_readline(c, buf, sizeof(buf)) >= 0) && (strcmp(buf, "")) && (strcmp(buf, "000"))) {
// Render a message into the mailbox view
function mail_render_one(msg, target_div) {
let div = "FIXME";
+ console.log(msg);
try {
outmsg =
"<div class=\"ctdl-mmsg-wrapper\">" // begin message wrapper
//+ "onmouseenter=\"console.log('mouse in');\" "
//+ "onmouseleave=\"console.log('mouse out');\""
+ ">"
- + "<td>" + msg["subject"] + "</td>"
- + "<td>" + msg["author"] + " <" + msg["addr"] + "></td>"
- + "<td style=\"white-space: nowrap\">" + string_timestamp(msg["time"],1) + "</td>"
- + "<td>" + msg["msgnum"] + "</td>"
+ + "<td class=\"ctdl-mail-subject\">" + msg["subject"] + "</td>"
+ + "<td class=\"ctdl-mail-sender\">" + msg["author"] + "</td>"
+ + "<td class=\"ctdl-mail-date\">" + string_timestamp(msg["time"],1) + "</td>"
+ + "<td class=\"ctdl-mail-msgnum\">" + msg["msgnum"] + "</td>"
+ "</tr>";
return(row);
}