mu: add user-agent property to msg plist

Add a user-agent property to the full message sexps (i.e., the ones
available in mu4e-view). This property contains either the User-Agent or
X-Mailer string (and is absent otherwise)
This commit is contained in:
djcb
2016-03-14 22:53:42 +02:00
parent 68f5dc3973
commit acd00a0b3f
2 changed files with 17 additions and 4 deletions

View File

@ -415,11 +415,12 @@ append_sexp_thread_info (GString *gstr, const MuMsgIterThreadInfo *ti)
" :has-child t" : "");
}
static void
append_message_file_parts (GString *gstr, MuMsg *msg, MuMsgOptions opts)
{
GError *err;
const char *str;
GError *err;
err = NULL;
if (!mu_msg_load_msg_file (msg, &err)) {
@ -431,7 +432,12 @@ append_message_file_parts (GString *gstr, MuMsg *msg, MuMsgOptions opts)
append_sexp_parts (gstr, msg, opts);
append_sexp_contacts (gstr, msg);
/* add the user-agent / x-mailer */
str = mu_msg_get_header (msg, "User-Agent");
if (str || (str = mu_msg_get_header (msg, "X-Mailer")))
append_sexp_attr (gstr, "user-agent", str);
append_sexp_body_attr (gstr, "body-txt",
mu_msg_get_body_text(msg, opts));
append_sexp_body_attr (gstr, "body-html",