Add message quoting
This commit is contained in:
parent
0b987b2e41
commit
32fa822e6d
62
www_email.c
62
www_email.c
@ -227,6 +227,7 @@ char *www_email_display(struct user_record *user, int email) {
|
|||||||
char *body;
|
char *body;
|
||||||
int id;
|
int id;
|
||||||
int i;
|
int i;
|
||||||
|
int chars;
|
||||||
char *err_msg = 0;
|
char *err_msg = 0;
|
||||||
char *email_create_sql = "CREATE TABLE IF NOT EXISTS email ("
|
char *email_create_sql = "CREATE TABLE IF NOT EXISTS email ("
|
||||||
"id INTEGER PRIMARY KEY,"
|
"id INTEGER PRIMARY KEY,"
|
||||||
@ -328,6 +329,13 @@ char *www_email_display(struct user_record *user, int email) {
|
|||||||
}
|
}
|
||||||
strcat(page, buffer);
|
strcat(page, buffer);
|
||||||
len += strlen(buffer);
|
len += strlen(buffer);
|
||||||
|
sprintf(buffer, "<div id=\"msgbody\">\n");
|
||||||
|
if (len + strlen(buffer) > max_len - 1) {
|
||||||
|
max_len += 4096;
|
||||||
|
page = (char *)realloc(page, max_len);
|
||||||
|
}
|
||||||
|
strcat(page, buffer);
|
||||||
|
len += strlen(buffer);
|
||||||
|
|
||||||
for (i=0;i<strlen(body);i++) {
|
for (i=0;i<strlen(body);i++) {
|
||||||
if (body[i] == '\r') {
|
if (body[i] == '\r') {
|
||||||
@ -342,6 +350,13 @@ char *www_email_display(struct user_record *user, int email) {
|
|||||||
strcat(page, buffer);
|
strcat(page, buffer);
|
||||||
len += strlen(buffer);
|
len += strlen(buffer);
|
||||||
}
|
}
|
||||||
|
sprintf(buffer, "</div>\n");
|
||||||
|
if (len + strlen(buffer) > max_len - 1) {
|
||||||
|
max_len += 4096;
|
||||||
|
page = (char *)realloc(page, max_len);
|
||||||
|
}
|
||||||
|
strcat(page, buffer);
|
||||||
|
len += strlen(buffer);
|
||||||
|
|
||||||
sprintf(buffer, "<div class=\"email-reply-form\">\n");
|
sprintf(buffer, "<div class=\"email-reply-form\">\n");
|
||||||
if (len + strlen(buffer) > max_len - 1) {
|
if (len + strlen(buffer) > max_len - 1) {
|
||||||
@ -386,7 +401,52 @@ char *www_email_display(struct user_record *user, int email) {
|
|||||||
strcat(page, buffer);
|
strcat(page, buffer);
|
||||||
len += strlen(buffer);
|
len += strlen(buffer);
|
||||||
|
|
||||||
sprintf(buffer, "<textarea name=\"body\" rows=25 cols=80></textarea>\n<br />");
|
sprintf(buffer, "<textarea name=\"body\" rows=25 cols=80 id=\"replybody\">");
|
||||||
|
if (len + strlen(buffer) > max_len - 1) {
|
||||||
|
max_len += 4096;
|
||||||
|
page = (char *)realloc(page, max_len);
|
||||||
|
}
|
||||||
|
strcat(page, buffer);
|
||||||
|
len += strlen(buffer);
|
||||||
|
|
||||||
|
sprintf(buffer, "%s said....\n\n", from);
|
||||||
|
if (len + strlen(buffer) > max_len - 1) {
|
||||||
|
max_len += 4096;
|
||||||
|
page = (char *)realloc(page, max_len);
|
||||||
|
}
|
||||||
|
strcat(page, buffer);
|
||||||
|
len += strlen(buffer);
|
||||||
|
|
||||||
|
sprintf(buffer, "> ");
|
||||||
|
if (len + strlen(buffer) > max_len - 1) {
|
||||||
|
max_len += 4096;
|
||||||
|
page = (char *)realloc(page, max_len);
|
||||||
|
}
|
||||||
|
strcat(page, buffer);
|
||||||
|
len += strlen(buffer);
|
||||||
|
|
||||||
|
chars = 0;
|
||||||
|
|
||||||
|
for (i=0;i<strlen(body);i++) {
|
||||||
|
if (body[i] == '\r' || chars == 78) {
|
||||||
|
sprintf(buffer, "\n> ");
|
||||||
|
if (chars == 78) {
|
||||||
|
sprintf(buffer, "%c", body[i]);
|
||||||
|
chars = 1;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
sprintf(buffer, "%c", body[i]);
|
||||||
|
chars ++;
|
||||||
|
}
|
||||||
|
if (len + strlen(buffer) > max_len - 1) {
|
||||||
|
max_len += 4096;
|
||||||
|
page = (char *)realloc(page, max_len);
|
||||||
|
}
|
||||||
|
strcat(page, buffer);
|
||||||
|
len += strlen(buffer);
|
||||||
|
}
|
||||||
|
|
||||||
|
sprintf(buffer, "</textarea>\n<br />");
|
||||||
if (len + strlen(buffer) > max_len - 1) {
|
if (len + strlen(buffer) > max_len - 1) {
|
||||||
max_len += 4096;
|
max_len += 4096;
|
||||||
page = (char *)realloc(page, max_len);
|
page = (char *)realloc(page, max_len);
|
||||||
|
67
www_msgs.c
67
www_msgs.c
@ -205,7 +205,8 @@ char *www_msgs_messageview(struct user_record *user, int conference, int area, i
|
|||||||
int max_len;
|
int max_len;
|
||||||
int len;
|
int len;
|
||||||
char buffer[4096];
|
char buffer[4096];
|
||||||
|
int chars;
|
||||||
|
int i;
|
||||||
if (conference < 0 || conference >= conf.mail_conference_count || area < 0 || area >= conf.mail_conferences[conference]->mail_area_count) {
|
if (conference < 0 || conference >= conf.mail_conference_count || area < 0 || area >= conf.mail_conferences[conference]->mail_area_count) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@ -384,6 +385,13 @@ char *www_msgs_messageview(struct user_record *user, int conference, int area, i
|
|||||||
}
|
}
|
||||||
strcat(page, buffer);
|
strcat(page, buffer);
|
||||||
len += strlen(buffer);
|
len += strlen(buffer);
|
||||||
|
sprintf(buffer, "<div id=\"msgbody\">\n");
|
||||||
|
if (len + strlen(buffer) > max_len - 1) {
|
||||||
|
max_len += 4096;
|
||||||
|
page = (char *)realloc(page, max_len);
|
||||||
|
}
|
||||||
|
strcat(page, buffer);
|
||||||
|
len += strlen(buffer);
|
||||||
|
|
||||||
|
|
||||||
for (z=0;z<jmh.TxtLen;z++) {
|
for (z=0;z<jmh.TxtLen;z++) {
|
||||||
@ -399,6 +407,15 @@ char *www_msgs_messageview(struct user_record *user, int conference, int area, i
|
|||||||
strcat(page, buffer);
|
strcat(page, buffer);
|
||||||
len += strlen(buffer);
|
len += strlen(buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sprintf(buffer, "</div>\n");
|
||||||
|
if (len + strlen(buffer) > max_len - 1) {
|
||||||
|
max_len += 4096;
|
||||||
|
page = (char *)realloc(page, max_len);
|
||||||
|
}
|
||||||
|
strcat(page, buffer);
|
||||||
|
len += strlen(buffer);
|
||||||
|
|
||||||
free(body);
|
free(body);
|
||||||
|
|
||||||
sprintf(buffer, "<div class=\"msg-reply-form\">\n");
|
sprintf(buffer, "<div class=\"msg-reply-form\">\n");
|
||||||
@ -468,7 +485,7 @@ char *www_msgs_messageview(struct user_record *user, int conference, int area, i
|
|||||||
strcat(page, buffer);
|
strcat(page, buffer);
|
||||||
len += strlen(buffer);
|
len += strlen(buffer);
|
||||||
|
|
||||||
sprintf(buffer, "<textarea name=\"body\" rows=25 cols=80></textarea>\n<br />");
|
sprintf(buffer, "<textarea name=\"body\" rows=25 cols=80 id=\"replybody\">");
|
||||||
if (len + strlen(buffer) > max_len - 1) {
|
if (len + strlen(buffer) > max_len - 1) {
|
||||||
max_len += 4096;
|
max_len += 4096;
|
||||||
page = (char *)realloc(page, max_len);
|
page = (char *)realloc(page, max_len);
|
||||||
@ -476,6 +493,52 @@ char *www_msgs_messageview(struct user_record *user, int conference, int area, i
|
|||||||
strcat(page, buffer);
|
strcat(page, buffer);
|
||||||
len += strlen(buffer);
|
len += strlen(buffer);
|
||||||
|
|
||||||
|
sprintf(buffer, "%s said....\n\n", from);
|
||||||
|
if (len + strlen(buffer) > max_len - 1) {
|
||||||
|
max_len += 4096;
|
||||||
|
page = (char *)realloc(page, max_len);
|
||||||
|
}
|
||||||
|
strcat(page, buffer);
|
||||||
|
len += strlen(buffer);
|
||||||
|
|
||||||
|
sprintf(buffer, "> ");
|
||||||
|
if (len + strlen(buffer) > max_len - 1) {
|
||||||
|
max_len += 4096;
|
||||||
|
page = (char *)realloc(page, max_len);
|
||||||
|
}
|
||||||
|
strcat(page, buffer);
|
||||||
|
len += strlen(buffer);
|
||||||
|
|
||||||
|
chars = 0;
|
||||||
|
|
||||||
|
for (i=0;i<strlen(body);i++) {
|
||||||
|
if (body[i] == '\r' || chars == 78) {
|
||||||
|
sprintf(buffer, "\n> ");
|
||||||
|
if (chars == 78) {
|
||||||
|
sprintf(buffer, "%c", body[i]);
|
||||||
|
chars = 1;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
sprintf(buffer, "%c", body[i]);
|
||||||
|
chars ++;
|
||||||
|
}
|
||||||
|
if (len + strlen(buffer) > max_len - 1) {
|
||||||
|
max_len += 4096;
|
||||||
|
page = (char *)realloc(page, max_len);
|
||||||
|
}
|
||||||
|
strcat(page, buffer);
|
||||||
|
len += strlen(buffer);
|
||||||
|
}
|
||||||
|
|
||||||
|
sprintf(buffer, "</textarea>\n<br />");
|
||||||
|
if (len + strlen(buffer) > max_len - 1) {
|
||||||
|
max_len += 4096;
|
||||||
|
page = (char *)realloc(page, max_len);
|
||||||
|
}
|
||||||
|
strcat(page, buffer);
|
||||||
|
len += strlen(buffer);
|
||||||
|
|
||||||
|
|
||||||
sprintf(buffer, "<input type=\"submit\" name=\"submit\" value=\"Reply\" />\n<br />");
|
sprintf(buffer, "<input type=\"submit\" name=\"submit\" value=\"Reply\" />\n<br />");
|
||||||
if (len + strlen(buffer) > max_len - 1) {
|
if (len + strlen(buffer) > max_len - 1) {
|
||||||
max_len += 4096;
|
max_len += 4096;
|
||||||
|
Reference in New Issue
Block a user