minor fixes re filtering
This commit is contained in:
parent
3d59903562
commit
26b0508487
|
@ -750,11 +750,7 @@ static int add_msg_part(MIMEEntity *res, xmlNodePtr node, Octstr *base_url,
|
|||
|
||||
if (mt_filter && mmc_id)
|
||||
mt_filter->filter(&x, curl, mmc_id);
|
||||
#if 1
|
||||
/* show it. */
|
||||
Octstr *_x = mime_entity_to_octstr(x);
|
||||
octstr_dump(_x,0);
|
||||
#endif
|
||||
|
||||
mime_entity_add_part(res, x);
|
||||
mime_entity_destroy(x);
|
||||
|
||||
|
@ -956,6 +952,20 @@ static int make_and_queue_msg(Octstr *data, Octstr *ctype, List *reply_headers,
|
|||
}
|
||||
} else { /* all others, make the message as-is and hope for the best! */
|
||||
List *xh = http_create_empty_headers();
|
||||
|
||||
if (mt_multipart) { /* if its going to be multi-part, add some nice headers. */
|
||||
static int cntr = 0;
|
||||
char *fext = content_type2file_ext(ctype);
|
||||
Octstr *attr = octstr_format("%06d.%s", ++cntr,fext);
|
||||
Octstr *cid_header_val = octstr_format("<%S>", attr);
|
||||
|
||||
http_header_add(xh, "Content-ID", octstr_get_cstr(cid_header_val));
|
||||
http_header_add(xh, "Content-Location", octstr_get_cstr(attr));
|
||||
|
||||
octstr_destroy(attr);
|
||||
octstr_destroy(cid_header_val);
|
||||
}
|
||||
|
||||
http_header_add(xh, "Content-Type", octstr_get_cstr(ctype));
|
||||
mime_replace_headers(me, xh);
|
||||
|
||||
|
|
Loading…
Reference in New Issue