Skip to content

Commit

Permalink
imip_send_sendmail: render the COMMENT field in the html+text alterna…
Browse files Browse the repository at this point in the history
…tives
  • Loading branch information
dilyanpalauzov committed Aug 13, 2023
1 parent ac50025 commit 442e5c0
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions imap/http_caldav_sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,13 @@ static int imip_send_sendmail(const char *userid, icalcomponent *ical, const cha
}
}

const char *comment = icalcomponent_get_comment(comp);
if (comment) {
buf_setcstr(&tmpbuf, comment);
buf_replace_all(&tmpbuf, "\n", "\r\n" TEXT_INDENT);
buf_printf(&plainbuf, "Comment: %s\r\n", buf_cstring(&tmpbuf));
}

mimebody = charset_qpencode_mimebody(buf_base(&plainbuf),
buf_len(&plainbuf), 0, &outlen);

Expand Down Expand Up @@ -496,6 +503,10 @@ static int imip_send_sendmail(const char *userid, icalcomponent *ical, const cha
buf_printf(&msgbuf, HTML_ROW, "Description", buf_cstring(&tmpbuf));
}
}
if (comment) {
HTMLencode(&tmpbuf, comment);
buf_printf(&msgbuf, HTML_ROW, "Comment", buf_cstring(&tmpbuf));
}
buf_printf(&msgbuf, "</table></body></html>\r\n");

/* iCalendar part */
Expand Down

0 comments on commit 442e5c0

Please sign in to comment.