Re: [Evolution-hackers] Mailing lista actions bounty patch



On Mon, 01 Dec 2003 14:58:57 +1100
Not Zed <notzed ximian com> wrote:

> Hi Jorge,
> 
> Put the "list-post" case in em-format.c:efh_format_header below all the
> address stuff, i.e. after the 'bcc' check.  Its a hell of a lot neater
> to look at.
> 

Done

> em-format-html can't output any buttons (i.e. <object>/s) they have to
> be done in em-format-html-display.  But since this is a lot of work
> (need to virtualise some of the header output methods and move stuff
> around), and since i think this might not be the right approach anyway,
> it should probably be done via a url link instead of an object.
> 

Almost done

> - When we output the list-post header, we parse the address ourselves
> (rather than sending text to the text->html filter) , and output a
> mailto: uri, but add extra args, all of the list-post stuff we need
> later.  Do this using a CamelURL.  like
> 

Done

> 
> Then create the anchor and embed the image reference too, hook the image
> in using similar code to the other image code.
> 
> 
> This way you get the same default behaviour - click on the link it sends
> to the list, but right-click will put up a merged menu suitable for
> mailto AND list addresses.  And we dont need em-mailing-list-info.[ch]
> anymore at all, and re-use the popup setup code.
> 

em-mailing-list-info.[ch] removed :)

> Another (there's always another possibility) possibility from doing it
> this way is that you could do it 'implicitly' for other addresses
> displayed, e.g. if you have a cc to an address which matches list-post
> in the current message, you could add the icon and menu stuff to that
> mailto: link too.
> 

This is what I would like to do because in the most of the mails I have tested
appears the To or CC header with the list address and under this, the mailing
list header with the same address, and this is IMHO quite confusing/annoying

I'd rather to detect the list address in the To|Cc header and add it the mlist
icon to handle the list options but I don't know very well how to hook the
addresses

> And perhaps some suggestions for the menu names:
> 

Accepted

> And finally, the list-post parsing code needs to be more robust, it
> assumes the address is in a proper format (i.e. searhces for < followed
> by > and doesn't check if its not).  Needs to check all returns from
> calls to strchr, etc.  You also leak the url string!
> 

I don't send a patch because I have to clean it a bit more and improve some
things but check this:

static void
emp_load_url_from_header (CamelMedium *msg, char *header)
{
        char *url, *head, *tail;

        if ((head = (char *)camel_medium_get_header(msg, header)) == NULL)
                return; 
        if ((head = strchr(head,'<')) == NULL)
                return; 
        if ((tail = strchr(++head, '>')) == NULL)
                return; 
        url = g_strndup (head, tail - head);
        g_free(head);
        g_free(tail);

        if (!strncmp (url, "mailto:";, 7)) {
                em_utils_compose_new_message_with_mailto (url);
        } else {
                gnome_url_show (url, NULL);
        }       
        g_free(url);
}

If the string is not valid, the function just exits and there's no action

-- 
"Dios es real, a no ser que sea declarado como entero"

Jorge Bernal "Koke" http://sindominio.net/~koke/
Jabber-ID: koke zgzjabber ath cx
<koke sindominio net> || <kokecillo eresmas com>
.: www.augustux.org   ::	pulsar.gotdns.org	 :.

Attachment: pgp8lhCauYQOm.pgp
Description: PGP signature



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