Commit Graph

273 Commits

Author SHA1 Message Date
570c637480 Fix/mute issues found by Coverity scan
This makes the code free of Coverity scan issues.
It is sometimes quite pedantic and expects/suggests some
coding habits, thus certain changes may look weird, but for a good
thing, I hope. The code is also tagged with Coverity scan
suppressions, to keep the code as is and hide the warning too.
Also note that Coverity treats g_return_if_fail(), g_assert() and
similar macros as unreliable, and it's true these can be disabled
during the compile time, thus it brings in other set of 'weird'
changes.
2013-11-15 09:06:57 +01:00
3c30fb1747 Convert libemail-engine to a single-include model.
Use: #include <libemail-engine/libemail-engine.h>
2013-11-11 12:07:43 -05:00
4ea43b34a8 Move EMailImageLoadingPolicy to e-mail-formatter-enums.h.
libemail-engine doesn't need to know about this enum.
2013-11-11 08:29:20 -05:00
4c2233114d Rename e-mail-enums.h to e-mail-engine-enums.h. 2013-11-11 08:29:20 -05:00
e8f7f03ed2 Follow-up fix for bug 711532.
Content-Disposition of the test case is honored now, but still not the
Content-Transfer-Encoding.
2013-11-06 13:01:49 -05:00
465050f57e Bug 711532 - Infinite recursion from message/news attachment
This is only a partial solution for the test case the bug report.
The message/news part of the test case is also Base64-encoded, but
Evolution (or Camel) is not decoding it properly.  Still digging.
2013-11-06 11:24:41 -05:00
7a6be11ea6 Miscellaeous cleanups. 2013-10-20 11:15:41 -04:00
bf757a668a Signature/encryption bar may not inherit text color from theme
The "signature bar" overrides background color, thus it should
override also text color, to make sure the text will be always
readable. This could break with dark theme, which uses light
text color.
2013-10-11 10:04:57 +02:00
e16d918af5 EMailParserMultipartSigned: Rework obtaining the signature protocol.
CamelMultipartSigned no longer has a public 'protocol' member.  Obtain
it instead by checking the CamelContentType for a 'protocol' parameter.
2013-10-02 15:16:46 -04:00
6a65912679 Bug #699997 - Show unreferenced images in multipart/related parser 2013-09-30 14:09:45 +02:00
6d68c41da7 Bug #689787 - Prefer-plain can hide message body for composer 2013-09-27 15:05:59 +02:00
969d801553 Bug #707392 - Only very first Collapse/Expand button in message header pane works
When we were collecting the elements for adding the onclick event
listeners, we were using the webkit_dom_document_get_element_by_id
method, but when email had multiple TO, CC or BCC headers it was
returning just the first elements with given id. To fix this we moved
to webkit_dom_*_query_selector methods that give us more powerfull
element extraction from document.

When toggling the visibility of header row, we are now operating just
in the row that contains the clicked element.

This patch also remove the suffixes from all  __evo-moreaddr ids.
2013-09-13 11:23:14 +02:00
68f27ce0c8 Bug #706008 - Workaround gnome-shell style change on focus change
Avoid redrawing (thus loosing the selection and scroll position) of
preview window on style change by defining the colors through CSS styles.
On style change we just update the CSS color definitions and preview will
update itself without redraw.
2013-09-12 15:29:58 +02:00
ca67414c22 Bug 705194 - Failure to decrypt inline encrypted GPG messages
Commit 514736f27e in 3.9.5 broke inline
PGP encrypted messages, because the parser was treating the encrypted
message content as an attachment even though the content type is just
text/plain.  This ensures the message content is treated correctly.
2013-08-01 14:12:03 +02:00
524a5dd1a8 empe_text_plain_parse() cleanups.
Return type is a boolean, not an integer count.
2013-07-19 12:39:57 -04:00
514736f27e EMailParserMessage: Better handle message bodies as attachments.
Simo Sorce sent me an interesting case where the MIME type of the
message itself was image/gif, but the image was not being shown.

If the EMailPart representing the message body is marked as an
attachment, wrap it as such so it gets added to the attachment
bar but also set the "force_inline" flag since it doesn't make
sense to collapse the message body if we can render it. */
2013-07-08 17:57:19 -04:00
a260d79633 EMailFormatterQuoteExtension: Don't be cute with struct declarations.
Declare the instance and class structs normally so Gtk-Doc can make
sense of it.
2013-07-07 09:28:50 -04:00
3774c9c4c1 EMailFormatterPrintExtension: Don't be cute with struct declarations.
Declare the instance and class structs normally so Gtk-Doc can make
sense of it.
2013-07-07 09:26:25 -04:00
0cb0dc0ddd Bug #699576 - Mail reader frame is black (in the mail view) 2013-06-27 20:57:41 +02:00
7b8a8a6a24 EMailFormatter: Remove the header API.
Use the EMailPartHeaders API instead.
2013-06-08 00:25:15 -04:00
06e391117a EMailFormatterQuoteHeaders: Avoid EMailFormatter header API.
Use e_mail_part_headers_dup_default_headers() to extract specific
headers to show in the desired order.
2013-06-08 00:25:15 -04:00
93d5cdd57a EMailFormatterHeaders: Avoid EMailFormatter header API.
Use e_mail_part_headers_dup_default_headers() to extract specific
headers to show in the desired order.
2013-06-08 00:25:15 -04:00
27c92e7f3d Add EMailPrintConfigHeaders.
This splits the print dialog's "Headers" tab into a separate widget.

EMailPrintConfigHeaders takes an EMailPartHeaders and displays its print
model, which is a representation of all message headers (except subject)
with an on/off flag for each.  The headers can be toggled and reordered,
and the changes are written back to the print model.

During printing, EMailFormatterPrintHeaders uses the same print model
to determine which headers to show and in what order (except subject).

This approach is much saner than the old method, which was trying to
manipulate WebKitWebView DOM directly to toggle and reorder headers.
This approach also happens to work, whereas the old method did not.
2013-06-08 00:25:15 -04:00
64388b6b82 Add e_mail_part_headers_ref_print_model().
Returns a GtkTreeModel of header names and values and visibility flags,
built from the CamelMimeMessage.  The tree model rows can be reordered
and toggled prior to printing.

Also add e_mail_part_headers_is_default() as a handy helper.
2013-06-08 00:25:15 -04:00
c5313b3614 EMailPartHeaders: Add a "default-headers" property.
This will replace the headers API in EMailFormatter.  Need a more
permanent place for headers since EMailFormatter is too disposable.

Also add an ESettingsMailPartHeaders class, which binds the new property
to the "show-headers" setting with a suitable mapping function to filter
out disabled header names.
2013-06-08 00:25:11 -04:00
bcfd1a9257 Make EMailPart and its subclasses extensible. 2013-06-07 15:47:14 -04:00
9a1265ea24 EMailFormatterQuoteHeaders cleanups. 2013-06-07 15:47:03 -04:00
257286b6ce EMailFormatterHeaders cleanups. 2013-06-07 15:47:03 -04:00
863fee6479 e_mail_formatter_format_header: Split the header param.
Split the _camel_header_raw struct parameter into separate "header_name"
and "header_value" string parameters, which is all the function actually
needs to work.
2013-06-06 14:08:21 -04:00
312d230cd2 e_mail_formatter_format_header: Remove unused CamelMedium param. 2013-06-06 13:54:42 -04:00
6be4901bae EMailPart: Add "part-list" property.
This is a weak reference to the EMailPartList to which the EMailPart
has been added.  The property is set by e_mail_part_list_add_part().

New functions:

  e_mail_part_ref_part_list()
  e_mail_part_set_part_list()
2013-06-05 16:38:31 -04:00
552952d2cc Define GEnumClass types for mail formatter/parser enums. 2013-06-04 13:10:02 -04:00
9b9d1935d7 Remove Evolution icon from header section.
We don't show an icon for other mailers, and the tiny 16x16 pixel
icon looks stupid next to the much larger contact/gravatar image.
2013-05-29 13:09:36 -04:00
2d251a9597 Distinguish "attachment-wrapper" elements from attachments.
The HTML for attachments always has the following form:

<div class="attachment-wrapper" id="something" style="display: block;">
  <actual attachment element>
</div>

The <div> element controls attachment visibility through its "display"
style attribute, which is either "block" or "none".

Problem is the <actual attachment element> was getting the same ID as
its parent <div> element.  So when either element was requested by ID,
in certain cases the wrong element was returned and caused misbehavior
and console warnings.

Solve this by adding a "wrapper" suffix to the <div> element ID.  So in
the example above, id="something" gets the <actual attachment element>,
whereas id="something.wrapper" gets the <div> element.
2013-05-29 07:09:20 -04:00
fa39ba7c5d EMailFormatterAttachment cleanups. 2013-05-29 07:09:20 -04:00
04aa0fba1f Rename libemformat to libevolution-mail-formatter.
To make Evolution's shared libraries more consistent.

Also add an evolution-mail-formatter documentation module.
2013-05-28 09:56:30 -04:00
70a9fcdf9c Rename libeshell to libevolution-shell.
To make Evolution's shared libraries more consistent.

Also rename the documentation module to evolution-shell.
2013-05-28 09:56:30 -04:00
6c9a3243c9 Rename libeutil to libevolution-util.
To make Evolution's shared libraries more consistent.

Also rename the documentation module to evolution-util.
2013-05-28 09:56:30 -04:00
9058c6f85d Make EAttachment a little more thread-safe.
EAttachment is now used from worker threads by EMailFormatterAttachment,
so add some thread-safe accessor functions to eliminate potential races.

Added thread-safe functions:

    e_attachment_dup_disposition()
    e_attachment_ref_file()
    e_attachment_ref_file_info()
    e_attachment_ref_icon()
    e_attachment_ref_mime_part()
    e_attachment_dup_description()
    e_attachment_dup_thumbnail_path()

Renamed functions:

    e_attachment_get_mime_type() -> e_attachment_dup_mime_type()

Removed non-thread-safe functions:

    e_attachment_get_file()
    e_attachment_get_file_info()
    e_attachment_get_icon()
    e_attachment_get_mime_part()
    e_attachment_get_description()
    e_attachment_get_thumbnail_path()
2013-05-23 16:36:02 -04:00
256422cab2 Attachment-related cleanups. 2013-05-23 16:36:01 -04:00
f9ffe64723 Convert EMailPart to a GObject.
EMailPart is reference-counted, subclassed, and allows a custom
finalize function.  There's no excuse for it not to use GObject.
2013-05-19 13:07:22 -04:00
62daae00eb Add e_mail_part_attachment_ref_attachment(). 2013-05-19 13:07:21 -04:00
67227b428b Add e_mail_part_get_validity_flags(). 2013-05-19 13:07:21 -04:00
543b4d9321 Add e_mail_part_has_validity(). 2013-05-19 13:07:21 -04:00
42d1e89f02 Add e_mail_part_set_is_attachment(). 2013-05-19 13:07:21 -04:00
ca09edf8fa Add e_mail_part_get_is_attachment(). 2013-05-19 13:07:21 -04:00
875746e0ef Add e_mail_part_set_mime_type(). 2013-05-19 13:07:21 -04:00
0ee556d346 Add e_mail_part_get_mime_type(). 2013-05-19 13:07:21 -04:00
f19058ea7a Add e_mail_part_ref_mime_part(). 2013-05-19 13:07:20 -04:00
5ad0b6d8f7 Add e_mail_part_id_has_substr(). 2013-05-19 13:07:20 -04:00