aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-format.c
Commit message (Collapse)AuthorAgeFilesLines
* Deal with having multiple selected messages.Dan Winship2000-07-091-45/+0
| | | | | | | | | | * mail-ops.c (forward_msg): Deal with having multiple selected messages. * mail-format.c (mail_generate_forward): Removed. (Integrated into forward_msg) svn path=/trunk/; revision=3982
* Use the gnomevfs sniff buffer interface to try to identify the MIME typeDan Winship2000-07-061-5/+6
| | | | | | | | | | | | | | * mail-identify.c (mail_identify_mime_part): Use the gnomevfs sniff buffer interface to try to identify the MIME type when everything else fails. * mail-display.c (on_object_requested): * mail-format.c (lookup_handler, handle_undisplayable, handle_audio): s/gnome_mime/gnome_vfs_mime/ * Makefile.am: Add gnomevfs stuff svn path=/trunk/; revision=3893
* add default subjectsDan Winship2000-06-291-1/+16
| | | | | | * mail-format.c (mail_generate_forward): add default subjects svn path=/trunk/; revision=3784
* Get evolution-dir the right way in e-setup.hPeter Williams2000-06-221-2/+1
| | | | svn path=/trunk/; revision=3675
* Add missing declaration of `evolution_dir' to get it to compile.Ettore Perazzoli2000-06-211-0/+1
| | | | svn path=/trunk/; revision=3645
* add an option to prefer text/plain. (reply_body): add an option to preferDan Winship2000-06-201-13/+20
| | | | | | | | | | | * mail-format.c (find_preferred_alternative): add an option to prefer text/plain. (reply_body): add an option to prefer text/plain (mail_generate_reply): Check the mail sending preferences, and generate a text/plain reply if the user prefers to send plain text (and we have a text/plain part to generate a reply from). svn path=/trunk/; revision=3641
* Fix the subject generation so we don't get "Re: Re:". This is workingDan Winship2000-06-131-4/+9
| | | | | | | | * mail-format.c (mail_generate_reply): Fix the subject generation so we don't get "Re: Re:". This is working around something that may later be declared a misfeature in Camel. svn path=/trunk/; revision=3531
* Redo things a bit so that whitespace-only text parts aren't displayed. (InDan Winship2000-06-101-112/+136
| | | | | | | | | * mail-format.c: Redo things a bit so that whitespace-only text parts aren't displayed. (In particular, so that whitespace-only subparts of multipart/mixed aren't displayed as separate (empty) parts.) svn path=/trunk/; revision=3488
* Update for new composer attachment interface.Dan Winship2000-06-061-35/+10
| | | | | | | * mail-format.c (mail_generate_forward): Update for new composer attachment interface. svn path=/trunk/; revision=3431
* Fix forwarding to work for people other than me. :) [Although apparentlyDan Winship2000-06-021-1/+1
| | | | | | | | * mail-format.c (mail_generate_forward): Fix forwarding to work for people other than me. :) [Although apparently it doesn't really.] svn path=/trunk/; revision=3357
* use <blockquote> rather than <center><table border=1 width=95%> to frameDan Winship2000-06-021-3/+2
| | | | | | | | | | | * mail-format.c (handle_message_rfc822): use <blockquote> rather than <center><table border=1 width=95%> to frame the embedded message. If <pre> text in the subtable won't fit in the 95% width, GtkHTML will write past the border of the table (and <blockquote><table border=1> causes creeping updates so it's not usable for now). svn path=/trunk/; revision=3352
* Oops. This needs to take a message argument because we might be writingDan Winship2000-06-021-9/+10
| | | | | | | | * mail-format.c (write_headers): Oops. This needs to take a message argument because we might be writing headers for an embedded message/rfc822 subpart rather than the root document. svn path=/trunk/; revision=3343
* Fix up memory management of x-evolution-data URLs so the URLs and/or theirDan Winship2000-06-011-30/+26
| | | | | | | | | | | | | * mail-format.c (free_url, handle_text_enriched, get_url_for_icon): Fix up memory management of x-evolution-data URLs so the URLs and/or their data don't get freed while there are still references to them. * message-list.c (message_list_init_header): redo the (unused) online status column to no longer refer to pixmaps that no longer exist. svn path=/trunk/; revision=3320
* Initialize the "urls" hash table stored on the message and store cid andDan Winship2000-06-011-84/+122
| | | | | | | | | | | | | | | | | | | | | | | | | | | * mail-format.c (mail_format_mime_message): Initialize the "urls" hash table stored on the message and store cid and other URLs there rather than as object data on the message. (get_cid): rewrite this a bunch (handle_text_enriched): move the code from write_iframe_string() into here, since it's the only place that actually needs it. (handle_text_html): simplify this a lot. We can use a cid: URL here rather than x-evolution-data. (get_url_for_icon): New routine to return URLs for icons, and cache the results, so we don't have to keep re-reading the icon files (and so we can't be spoofed into reading non-icon files). (handle_mystery, handle_audio): use get_url_for_icon. * mail-display.c (save_data): move the CamelMimePart filename extracting code from get_cid to here. (on_link_clicked, on_object_requested): Update for cid: changes. (on_url_requested): Kill off the kludgy, exploitable x-gnome-icon URL schema, update cid and x-evolution-data to match mail-format.c. It should now be easier to implement RFC 2557 (Content-Location, etc), but that RFC still pretty much sucks. svn path=/trunk/; revision=3314
* Redo this back to the old way: a single GtkHTML with various things inlineDan Winship2000-05-311-301/+192
| | | | | | | | | | | | | | | | | | | | * mail-format.c: Redo this back to the old way: a single GtkHTML with various things inline in it. (Gets rid of flicker, simplifies some scrolling, selecting, and printing issues.) (handle_text_enriched, handle_text_html): Use <iframe>s for these, to protect the rest of the document from their possibily invalid HTML. (handle_via_bonobo): Use (new-and-improved) <object> tags for this, moving most of the work back into mail-display.c * mail-display.c (on_object_requested): Move the Bonobo embedding code back here again (reorganized a bit). (on_url_requested): add x-evolution-data handler, for iframe bodies. (mail_html_new, mail_html_end): removed (mail_display_set_message, mail_display_new): Update for NWO. svn path=/trunk/; revision=3312
* Use `foo@bar' rather than `<foo@bar>' for recipient with no name.Dan Winship2000-05-291-6/+12
| | | | | | | * mail-format.c (write_recipients_to_stream): Use `foo@bar' rather than `<foo@bar>' for recipient with no name. svn path=/trunk/; revision=3247
* Various improvements:Dan Winship2000-05-281-74/+262
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * mail-format.c: Various improvements: (call_handler_function, etc): Add a "mime_type" argument to the handlers, so that if a part is tagged as "application/octet-stream", and we figure out that it's really something else, the handler we call can know what that something else is. (handle_text_enriched): Small fixes to make this not do text/enriched-specific syntax in text/richtext or vice versa. (handle_mystery): Allow for mystery data that can't even be saved to disk. (ie, unrecognized external-body). Let the caller specify the URL to use. (handle_message_external_body): New function to deal with message/external-body parts. Generates URLs for anon-ftp, local-file, and URL access-types, and a more-useful-than-before descriptive message for other types. (handle_audio, handle_undisplayable): Use gnome_mime_get_value to try to get a description of the MIME type to display to the user rather than the raw form. (This will only work if the user has recent gnome-vfs installed. [If they don't, it works just like it used to.]) svn path=/trunk/; revision=3234
* Fix a bug (security/stability) in its usage of mail_html_write.Dan Winship2000-05-271-1/+1
| | | | | | | * mail-format.c (handle_text_html): Fix a bug (security/stability) in its usage of mail_html_write. svn path=/trunk/; revision=3227
* Update for PersistStream changesDan Winship2000-05-261-2/+5
| | | | | | | * mail-format.c (handle_via_bonobo): Update for PersistStream changes svn path=/trunk/; revision=3216
* Updated for the GtkHTML API changes. Also fixed some compilerEttore Perazzoli2000-05-211-9/+9
| | | | | | warnings here and there. svn path=/trunk/; revision=3145
* Fixes for stream stuff.NotZed2000-05-201-6/+5
| | | | | | | | | | 2000-05-19 NotZed <NotZed@HelixCode.com> * mail-format.c: Fixes for stream stuff. * mail-display.c (save_data_cb): Remove exception stuff on streams. svn path=/trunk/; revision=3143
* Use camel_data_wrapper_write_to_stream rather thanDan Winship2000-05-181-42/+15
| | | | | | | | | * mail-display.c (save_data_cb, save_data, on_url_requested): * mail-format.c (handle_text_plain_flowed, handle_text_html): Use camel_data_wrapper_write_to_stream rather than camel_data_wrapper_get_output_stream. svn path=/trunk/; revision=3113
* Removed usage of bonobo_object_destroy.Christopher James Lahey2000-05-171-3/+2
| | | | | | | | 2000-05-16 Christopher James Lahey <clahey@helixcode.com> * mail-format.c: Removed usage of bonobo_object_destroy. svn path=/trunk/; revision=3094
* Update for CamelStream CamelException changes.Dan Winship2000-05-091-9/+9
| | | | | | | | | | | | * mail-display.c (save_data_cb): (on_url_requested): Update for CamelStream CamelException changes. * mail-format.c: Pass NULL for a CamelException in a bunch of places... the user will see that the data is not being displayed, and there's not a lot we can do, and none of these things should be failing anyway. Maybe fix this later. svn path=/trunk/; revision=2925
* unref the message after displaying it.Dan Winship2000-05-081-4/+5
| | | | | | | | | | | * message-list.c (select_msg): unref the message after displaying it. * mail-format.c (get_data_wrapper_text): (handle_text_plain_flowed): (handle_via_bonobo): Replace camel_stream_close calls. svn path=/trunk/; revision=2883
* consolidate mail-format.h, mail-identify.h, mail-ops.h, main.h andDan Winship2000-05-071-3/+1
| | | | | | | | * mail.h: consolidate mail-format.h, mail-identify.h, mail-ops.h, main.h and session.h into this new file. There's no reason to have a .h for every .c. svn path=/trunk/; revision=2830
* Make the "Cc:" field optional again. (Before, we could check ifDan Winship2000-05-041-7/+9
| | | | | | | | | * mail-format.c (write_recipients_to_stream, write_headers): Make the "Cc:" field optional again. (Before, we could check if camel_mime_message_get_recipients returned NULL, but now we need to actually look into the returned CamelInternetAddress object.) svn path=/trunk/; revision=2783
* s/strcasecmp/g_strcasecamp/ everywhere except intl/, per michael'sJacob Leach2000-05-031-7/+7
| | | | | | request. svn path=/trunk/; revision=2776
* Handle clicks on "cid" URLs by popping up a "Save Attachment" dialog.Dan Winship2000-04-301-1/+25
| | | | | | | | | | | | | * mail-display.c (on_link_clicked): Handle clicks on "cid" URLs by popping up a "Save Attachment" dialog. * mail-format.c (get_cid): if the part has a Content-Disposition with a filename specified, record (a sanitized version of) that on the wrapper when creating the cid reference, so the "save attachment" code can use it later. (handle_mystery): fix a bug in the cid generation here. svn path=/trunk/; revision=2685
* Improve the builtin vs bonobo selection code. (handle_mystery): IncludeDan Winship2000-04-301-110/+94
| | | | | | | | | | | | | | | | | | | | | | * mail-format.c (lookup_handler, etc): Improve the builtin vs bonobo selection code. (handle_mystery): Include name and Content-Description in the "mystery data" info, when available (handle_unknown_type): Call mail_identify_mime_part before giving up. (handle_undisplayable): Split out of handle_unknown_type now that handle_unknown_type can try alternate viewers. (handle_via_bonobo): Fall back to handle_undisplayable if the bonobo control fails. * mail-identify.c (mail_identify_mime_part): New function to attempt to identify a MIME part that we can't identify based on Content-Type alone. * mail-display.c (on_url_requested): redo the mystery data icon display stuff less kludgily. svn path=/trunk/; revision=2684
* update for Camel recipient changes. (Just to make it build, not to takeDan Winship2000-04-291-17/+32
| | | | | | advantage of new features, or do things cleanly.) svn path=/trunk/; revision=2677
* Move text_to_html to e-util.Dan Winship2000-04-281-207/+15
| | | | | | | | | | | | | * mail-format.c: Move text_to_html to e-util. * mail-ops.c (send_to_url): New routine. Thin wrapper for e_msg_composer_new_from_url. * mail-display.c (on_link_clicked): print a warning for news or nntp URLs (which we'll deal with some day), and call send_to_url for mailto URLs. svn path=/trunk/; revision=2664
* Improve URL converstion code. Recognize https, recognize "www\..*" withoutDan Winship2000-04-281-14/+48
| | | | | | | | | * mail-format.c (text_to_html): Improve URL converstion code. Recognize https, recognize "www\..*" without a prefixed "http://". Properly escape &, <, >, etc in URL strings. Don't be fooled by "mailto:", "http://", etc with no following data. svn path=/trunk/; revision=2660
* Reorganize a bit and add a new flag, TEXT_TO_HTML_CONVERT_URLS toDan Winship2000-04-271-95/+130
| | | | | | | | | | | | | * mail-format.c (text_to_html): Reorganize a bit and add a new flag, TEXT_TO_HTML_CONVERT_URLS to recognize and wrap URLs in text. * mail-display.c (mail_html_new): Add link_clicked signal handler. (on_link_clicked): Use gnome_url_show to launch a browser. The Dingus has landed. svn path=/trunk/; revision=2653
* Remove. We weren't using the fields that made this different fromDan Winship2000-04-271-13/+9
| | | | | | | | | | | | | * camel-mime-body-part.[ch]: Remove. We weren't using the fields that made this different from camel-mime-part, so it basically just forced us to do lots of gratuitous typecasting. * camel-multipart.[ch]: Use CamelMimePart. Remove the multipart parent stuff, since we weren't using that either. * etc: update for CamelMimeBodyPart -> CamelMimePart svn path=/trunk/; revision=2645
* update for CamelStream changes.Dan Winship2000-04-261-5/+4
| | | | | | * mail-format.c: update for CamelStream changes. svn path=/trunk/; revision=2631
* add a convert_space_hack flag, which turns N spaces into N-1 &nbsp;s and aDan Winship2000-04-261-5/+106
| | | | | | | | | | | | | * mail-format.c (text_to_html): add a convert_space_hack flag, which turns N spaces into N-1 &nbsp;s and a space. (handle_text_plain): Check for "format=flowed" in the Content-Type. (handle_text_plain_flowed): Spinoff of handle_text_plain to deal with RFC 2646 flowed text. (All the examples I can find of it are generated by Eudora, but it's a pretty cool idea that ought to be used more widely.) svn path=/trunk/; revision=2618
* Now that we're not limited to a single GtkHTML for the display, there's noDan Winship2000-04-261-79/+178
| | | | | | | | | | | | | | | | | * mail-format.c, mail-display.c: Now that we're not limited to a single GtkHTML for the display, there's no reason to embed Bonobo objects for unrecognized content-types in GtkHTML rather than embedded them into the vbox directly. So do that. Meanwhile, fix up the handler-selection code so that we can declare which built-in handlers are more desirable than external handlers and which are less. (Of course, eventually we'll want this to be customizable.) Add some cleverness to handle_multipart_alternative as well so it doesn't accept an alternative which we can display generically over one we can display specifically. svn path=/trunk/; revision=2616
* (reply_body): Make this deal better with multiparts.Dan Winship2000-04-261-40/+29
| | | | svn path=/trunk/; revision=2612
* (setup_function_table): pass unknown text subtypes toDan Winship2000-04-261-3/+27
| | | | | | | | | | | handle_text_plain. (handle_multipart_appledouble): new handler. Just ignores the first (application/applefile) part and tries to display the second part. Since the second part is usually application/octet-stream, this doesn't work very well still usually. svn path=/trunk/; revision=2611
* Fix some bugs that crept into reply generation. This needs a lot more workDan Winship2000-04-251-5/+17
| | | | | | | | * mail-format.c (reply_body): Fix some bugs that crept into reply generation. This needs a lot more work to deal correctly with complicated bodies. svn path=/trunk/; revision=2602
* Redo large chunks of this. The mail display now consists of a vbox in aDan Winship2000-04-251-448/+573
| | | | | | | | | | | | | | | | | | * mail-display.c, mail-format.c: Redo large chunks of this. The mail display now consists of a vbox in a scrolled window, in which we put multiple GtkHTML objects. This means broken HTML in one part can't corrupt other parts. The headers now scroll with the body. Unrecognized attachments look prettier, but still don't do anything, and will probably be changed later. We can also now display nested message/rfc822 parts and multipart/alternatives with multipart subparts. Oh, and text/{richtext,enriched}, since we had all these ancient sample messages that use it and the lack of support annoyed me. :) Bonobo embeddables are broken right now, but I don't think that's my fault. svn path=/trunk/; revision=2601
* rename "send" to "send_msg", to avoid name clash with the tcp function.Dan Winship2000-04-241-0/+56
| | | | | | | | | | | | | | * folder-browser-factory.c: rename "send" to "send_msg", to avoid name clash with the tcp function. Connect the "forward" button. * mail-ops.c: rename "send" to "send_msg", to avoid name clash with the tcp function. Add forward_msg function. * mail-format.c (mail_generate_forward): support function for forward_msg. Pretty much a big kludge right now, pending the attachment/attachment-bar changes. svn path=/trunk/; revision=2562
* move msg_composer_cb and msg_composer_send_cb to mail-ops. Attach send,Dan Winship2000-04-231-13/+238
| | | | | | | | | | | | | | | | | * folder-browser-factory.c: move msg_composer_cb and msg_composer_send_cb to mail-ops. Attach send, reply, and "reply to all" buttons. * mail-ops.c (composer_send_cb, send): moved from folder-browser-factory.c. (reply_to_sender, reply_to_all): new functions to do replies. * mail-format.c (text_to_html): Add an "add_pre" flag, to make it wrap the output in <pre></pre>. (mail_generate_reply): New function to create a composer and build a reply in it. svn path=/trunk/; revision=2554
* deal with cid: URLs. (find_cid): helper routine for above. (This could beDan Winship2000-04-211-21/+65
| | | | | | | | | | * mail-display.c (on_url_requested): deal with cid: URLs. (find_cid): helper routine for above. (This could be much better.) (mail_display_init): connect url_requested signal * mail-format.c (handle_multipart_related): Make this work. svn path=/trunk/; revision=2542
* Moved from camel/camel-formatter, and changed slightly. (More to come.)Dan Winship2000-04-151-0/+793
2000-04-14 Dan Winship <danw@helixcode.com> * mail-format.[ch]: Moved from camel/camel-formatter, and changed slightly. (More to come.) * html-stream.[ch]: No longer necessary. mail-format uses GtkHTMLStreamHandles directly. * mail-display.[ch]: update for new message formatting code. svn path=/trunk/; revision=2438