Fix for broken msgs?

This commit is contained in:
Andrew Pamment 2018-01-22 12:48:43 +10:00
parent 69897e7955
commit c5b754e135
2 changed files with 15 additions and 2 deletions

View File

@ -301,7 +301,12 @@ struct msg_headers *read_message_headers(int msgconf, int msgarea, struct user_r
if (jamm->subject == NULL) {
jamm->subject = strdup("(No Subject)");
}
if (jamm->from == NULL) {
jamm->from = strdup("(No Sender)");
}
if (jamm->to == NULL) {
jamm->to = strdup("(No Recipient)");
}
if (jmh.Attribute & JAM_MSG_PRIVATE) {
if (!msg_is_to(user, jamm->to, jamm->daddress, conf.mail_conferences[msgconf]->nettype, conf.mail_conferences[msgconf]->realnames, msgconf) &&
!msg_is_from(user, jamm->from, jamm->oaddress, conf.mail_conferences[msgconf]->nettype, conf.mail_conferences[msgconf]->realnames, msgconf) &&

View File

@ -402,6 +402,14 @@ char *www_msgs_messageview(struct user_record *user, int conference, int area, i
if (subject == NULL) {
subject = strdup("(No Subject)");
}
if (from == NULL) {
from = strdup("(No Sender)");
}
if (to == NULL) {
to = strdup("(No Recipient)");
}
if (jmh.Attribute & JAM_MSG_PRIVATE) {
if (!msg_is_to(user, to, daddress, conf.mail_conferences[conference]->nettype, conf.mail_conferences[conference]->realnames, conference) &&
@ -485,7 +493,7 @@ char *www_msgs_messageview(struct user_record *user, int conference, int area, i
len += strlen(buffer);
from_s = www_sanitize(from);
if (conf.mail_conferences[conference]->mail_areas[area]->type != TYPE_LOCAL_AREA) {
if (conf.mail_conferences[conference]->mail_areas[area]->type != TYPE_LOCAL_AREA && oaddress != NULL) {
sprintf(buffer, "<div class=\"msg-view-from\">From: %s (%s)</div>\n", from_s, oaddress);
} else {
sprintf(buffer, "<div class=\"msg-view-from\">From: %s</div>\n", from_s);