Re: Patch: Multipart support for reply/quote message



On 2001.10.10 13:11 Pawel Salek wrote:
> 
> On 2001.10.10 12:43 Toralf Lund wrote:
>> Here is another patch that is somewhat related to the ones for 
>> inclusion of messages. It updates the "quote message" logic so that it 
>> will do (at least nearly) the right thing for multi-part messages, i.e.:
> 
> 1. I understand that this patch partially deprecates
> http://bugzilla.gnome.org/show_bug.cgi?id=58915
> right?
Yes.
> 
> 2. I would rather use a function similar to following for 
> html_entity_to_char conversion:
> 
> --- cut here ----------
> const struct {
>   const char * entity;
>   int character;
> } entity_table[] = {
>  {"lt", '<'},
>  {"gt", '>'},
>  ....
> };
> 
>    for(i=0; i<ELEMENTS(entity_table); i++)
>       if(g_strcasecmp(entity_table[i].entity, char_ref) ==0)
>           return entity_table[i].character;
> ...
> }

> ----- cut here ------------
> This is much less error-prone and more cache-friendly.
I consider the "internal" HTML conversion to be a crude hack only, so any 
improvements are welcome. I really wanted a HTML-to-text library routine 
instead of external application + internal fall-back, but couldn't find 
one anywhere.

Apart from that, note that we might want to remove the following lines 
from process_mime_part()

  	/* don't return text/html stuff... */
	if (ignore_html && body->mutt_body->subtype &&
	    !strcmp("html", body->mutt_body->subtype))
	    break;

without that, HTML parts are is ignored even when there is no plain-text 
alternative (refer to part 2 of description), if "ignore HTML" flag is on. 
That's the way the original version behaves, too, of course, but I don't 
think that's what we really want.

And we should consider looking for "multipart/related" in preferred_part() 
- such a part is likely to contain HTML code and related images etc.

--
- Toralf





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]