Commit graph

2411 commits

Author SHA1 Message Date
Jeremy Bicha
509b669532 Use GTK 3.14 rtl icon support
https://bugzilla.gnome.org/show_bug.cgi?id=769533
2016-08-06 11:40:02 +10:00
Michael James Gratton
254297cd59 Workaround Mailman/Python/others sending F=F without CRLF line endings.
Despite RFC 3676 defining format=flowed lines as ending in CRLF, some
software doesn't do that. Workaround this when parsing F=F by always
converting CRLF to just LF, then just looking for LF alone as line
endings.

Bug 769137

* src/engine/rfc822/rfc822-message.vala
  (Message::mime_part_to_memory_buffer): Unconditionally convert CRLF to
  just LF, do so before applying the F=F filter.

* src/engine/rfc822/rfc822-gmime-filter-flowed.vala: Re-write to not
  expect CRLF sequences, or treat CR any differently. As a bonus, also
  check for signature lines without requiring the whole sig line to be in
  the bufer.
2016-08-04 11:05:26 +10:00
Michael James Gratton
9c31401606 Fix critical warning when conversation web view load request URI is null.
* src/client/conversation-viewer/conversation-web-view.vala
  (ConversationWebView::on_resource_request_starting): Check that the URI
  is not null before using it.
  (ConversationWebView::is_always_loaded): Remove null check and don't
  allow the param to be null, since all uses now pass in a non-null
  param.
2016-08-04 10:51:15 +10:00
Michael James Gratton
05cfb77dca Fix critical warning when folder opening remote connection.
* src/engine/imap-engine/imap-engine-minimal-folder.vala
  (MinimalFolder::start_remote_open_timer): Set the soruce id to 0 when
  the timer callback executes, so it is not attempted to be removed in
  the future. Tidy up the source a bit.
2016-08-04 10:34:49 +10:00
Michael James Gratton
0262d32e87 Fix critical warning closing engine when search table update is running.
* src/engine/imap-db/imap-db-account.vala
  (Account::populate_search_table_batch_async): Ensure the DB is open
  before proceeding with the query.
2016-08-02 22:41:52 +10:00
Michael James Gratton
cd0aa24ba9 Fix critical warning when loading attachment-only messages.
Additional follow-up to Bug 767438.

* src/client/conversation-viewer/conversation-viewer.vala
  (ConversationViewer::set_message_html): Always call
  ::insert_html_markup since that is where we are taking care of a
  possibly null body_text.
2016-08-02 22:37:36 +10:00
Michael James Gratton
4a893e4708 Really fix (?) critical warning when changing conversations rapidly.
Commit f6518b0 relied on the load being cancelled, which only happens if
you change conversation, not folder. Changing the foldler will eventually
change the conversation, but not after a nnumber of async calls.

Bug 714509.

* src/client/conversation-viewer/conversation-viewer.vala
  (ConversationViewer::on_folder_selected): Cancel existing load before
  preceeding.
2016-08-02 22:32:50 +10:00
Michael James Gratton
f6518b056c Fix critical warning when changing conversations rapidly. Bug 714509.
* src/client/conversation-viewer/conversation-viewer.vala
  (ConversationViewer::select_conversation_async): Ensure loading
  has not been cancelled after yielding to the list_full_messages_async
  call before attempting to add the messages.
2016-08-02 13:46:25 +10:00
Michael James Gratton
0c3160779e Don't always UTF-8 as the charset, use ASCII or 8859-1 if possible.
Previously, Geary would simply assume that UTF-8 is a reasonable charset
to use when sending both plain text and HTML parts. It is, however
Mailman will re-encode content sent ast UTF-8 using Base64, and break
format=flowed in the process.

This works around the problem for messages containing US-ASCII or
ISO-8859-1 chars, at least. No solution yet for UTF-8 except maybe
getting Mailman fixed.

Bug 769137

* src/engine/rfc822/rfc822-message.vala (Message): Guess the best charset
  for a message's content rather than assuming UTF-8. Set the charset for
  both plain text and HTML parts, but only guess it and the encoding at
  max once for both.

* src/engine/rfc822/rfc822-utils.vala: Replace get_best_content_encoding
  with get_best for determing both charset and encoding, and
  get_best_encoding for just guessing encoding, both using
  GMime.FilterBest instead of our own custom code.
2016-08-01 23:21:57 +10:00
Balázs Meskó
f4d19831ee Updated Hungarian translation 2016-07-31 18:54:14 +00:00
Michael James Gratton
6aacb75e38 Fix infinite loop when sending long space-stuffed line. Bug 768642.
* src/client/util/util-webkit.vala (Util.DOM.html_to_flowed_text): If a
  line is space-stuffed, ignore the stuffing space when determining where
  to break the line.
2016-07-30 13:23:51 +10:00
Michael James Gratton
83955b3d58 Fix crash when parsing unknown accout info service provider. Bug 713985.
* src/engine/api/geary-service-provider.vala
  (ServiceProvider::from_string): Throw an error rather than an assert
  when the provided string is not found.
2016-07-30 11:18:26 +10:00
Michael James Gratton
82faf2c332 Fix RTL email not being shown as RTL in conversation viewer. Bug 713062.
* theming/message-viewer.html: Set dir="auto" on template for email bodies.
2016-07-30 09:25:09 +10:00
Balázs Meskó
37dde520b3 Updated Hungarian translation
(cherry picked from commit ccdc94cef121ddaddbbdc29d881394b3969cace5)
2016-07-29 19:16:17 +00:00
Michael James Gratton
50a4cfd46f Add Enchant to build dependencies. 2016-07-29 10:34:33 +10:00
Michael James Gratton
557a9e75b7 Fix crash when replying to email with null from address. 2016-07-26 09:38:49 +10:00
Michael James Gratton
15e6877823 Fix critical when email without any from addresses loaded from DB.
See bbf5f07 and Bug 768468.
2016-07-25 18:01:30 +10:00
Michael James Gratton
8f7ff57c82 Fix error loading SMTP and IMAP host names introduced by a59a399. 2016-07-25 13:02:46 +10:00
Michael James Gratton
a59a3999e0 Don't try to load accounts with missing or broken config files. Bug 714044.
* src/engine/api/geary-account-information.vala (AccountInformation):
  Move settings defaults for all properties to their declarations. Add a
  new internal ctor for creating new accounts that does not attempt to
  load from the config file. Update AccountInformation.from_file to
  actually throw an error if one occurs.

* src/engine/api/geary-engine.vala (Engine::add_existing_accounts_async):
  Catch error loading config and print a warning rather than adding the
  account.
  (Engine::create_orphan_account): Use new ctor for creating a blank
  account.
2016-07-25 12:21:38 +10:00
Michael James Gratton
bbf5f073e6 RFC822 Sender header cleanup. Bug 768468.
This patch does a few things:

- Removes any notion of a sender from the Composer, since there's no UI
  for it at the moment and it doesn't do anything when multiple
  addresses are available.
- Converts Geary.Email and the DB use the RFC822 model for the Sender and
  Reply-To headers, and translates between that and the IMAP model only
  once: When dealing with IMAP ENVELOPE.
- Fixes an incorrect assumption about the Sender in the SMTP code.

* src/client/composer/composer-widget.vala (ComposerWidget): Remove all
  mentions of a sender address. Make `from` prop private for setting.

* src/client/composer/email-entry.vala (EmailEntry::validate_addresses):
  Fix crash when address list is null.

* src/engine/api/geary-email.vala (Email, Email::set_originators):
  Convert sender prop/param from a list of RFC822 addresses to a single
  address. Fix call call sites.

* src/engine/imap-db/imap-db-message-addresses.vala (MessageAddresses):
  Convert sender prop from a list of RFC822 addresses to a single
  address. Fix call call sites.
  (MessageAddresses::get_address_from_string): New method for parsing
  single addresses from the DB.

* src/engine/imap-db/imap-db-message-row.vala
  (MessageRow::flatten_address, MessageRow::unflatten_address): New
  un/marshalling methods for single addresses.

* src/engine/imap/api/imap-folder.vala (Folder::fetched_data_to_email):
  Normalise sender and reply-to IMAP ENVELOPE responses to conform with
  RFC 822's expectations.

* src/engine/imap/message/imap-envelope.vala (Envelope): Label reply_to
  prop as being non-null, to conform with IMAP spec.

* src/engine/rfc822/rfc822-mailbox-address.vala (MailboxAddress): Added
  support ctor and methods for parsing and comparing single addresses.

* src/engine/rfc822/rfc822-message.vala (Message::from_composed_email):
  Set the from and sender props directly from the ComposedEmail, set the
  GMimeMessage From and Sender headers correctly based on these.
  (Message::stock_from_gmime): Correctly set the from and sender props
  from the GMimeMessage.

* src/engine/smtp/smtp-client-session.vala
  (ClientSession::send_email_async): Don't require the email sender to be
  non-null — it isn't used and isn't required.
2016-07-25 10:40:50 +10:00
Michael James Gratton
ec60022052 Use an opaque string instead of primary email address as account id.
Bug 714643.

* src/engine/api/geary-engine.vala (Engine::create_orphan_account):
  Remove id param, just generate a new id as needed. Fix call site.
2016-07-20 16:43:01 +10:00
Michael James Gratton
4f90409a29 Remove AccountInformation.real_name, use primary_mailbox.name instead. 2016-07-19 17:28:24 +10:00
Michael James Gratton
295a14243c Convert from using AccountInformation.email to an id - client changes.
* src/engine/api/geary-account-information.vala (AccountInformation):
  Add a display_name property, use that in the client wherever a unique
  name for an account has to be shown to the user. Update all other cases
  to use `id` or `primary_mailbox`.

* src/client/accounts/add-edit-page.vala: Add id property, use that when
  determining if an account is new or is being edited.

* src/client/accounts/account-dialog-account-list-pane.vala
  (AccountDialogAccountListPane): Add the account's id to the list model,
  use that instead of the email address as the primary key.
2016-07-19 17:28:24 +10:00
Michael James Gratton
cbe5316a70 Convert from using AccountInformation.email to an id - engine changes.
* src/engine/api/geary-account-information.vala (AccountInformation): Add
  an id property, replace the string email prop with a
  RFC822.MailboxAddress primary_mailbox property. Fix all uses of `email`
  to use either id or primary_mailbox instead. Tidy up the source a bit
  while I'm here.

* src/engine/api/geary-engine.vala (Engine): Add ::get_account method
  that throws an error when the account is not found.
  (Engine::create_orphan_account): Updated to us `id` rather than `email`
  to referr to an account.
2016-07-19 17:28:24 +10:00
Michael James Gratton
8c22ce6727 Fix warning/crash when libnotify enabled and server is not present. Bug 768911.
* src/client/notification/libnotify.vala (Libnotify): Allow for the
  server capabilities being null.
2016-07-18 22:13:32 +10:00
Piotr Drąg
bcfb0716d5 Add Language headers to po files
Future versions of gettext will fail if this header is missing.
2016-07-16 20:21:20 +02:00
Piotr Drąg
da348c7460 Updated Polish translation
Reported by Grzegorz Szymaszek <grzegorz.szymaszek@short.pl>.
2016-07-14 14:50:43 +02:00
Piotr Drąg
ecd51ceb38 Updated Polish translation
Fixes suggested by Grzegorz Szymaszek <grzegorz.szymaszek@short.pl>.
2016-07-14 14:05:40 +02:00
Michael James Gratton
c9a29ebb3c Remove now-unused mail-spam-symbolic icon. Bug 737862. 2016-07-14 13:06:52 +10:00
Federico Bruni
f87a29283d change spam icon (bug 737862) 2016-07-14 12:18:28 +10:00
Michael James Gratton
095049f849 Don't rely on a the GEdit app icon for the draft folder. Bug 753672.
Themes may change the app icon, which would also change the draft folder
icon in Geary. Import Adawaita's to match current use, install, use, and
update copyright.
2016-07-13 22:45:37 +10:00
Michael James Gratton
a81cc78bb0 Fix some build issues arising from user config/data dir split. Bug 741883. 2016-07-12 15:55:27 +10:00
Oskar Viljasaar
7b5473cc69 Make use of the "primary_email" field in the config file 2016-07-12 15:47:43 +10:00
Oskar Viljasaar
d389102127 Use geary.ini in ~/.config/geary. Bug 741883
Untangle the configuration and storage directory variables by doing so.
2016-07-12 15:45:15 +10:00
Oskar Viljasaar
b3b2d58c76 Add a helper function to copy over configuration and use it. Bug 741883
The function is called just before the engine gets started, so
hopefully just before any files are read by Geary.
2016-07-12 15:45:11 +10:00
Andika Triwidada
34f216ece6 Updated Indonesian translation 2016-07-08 12:27:35 +00:00
Rico Tzschichholz
f2d392bed5 Fix compile warnings with vala git 2016-07-08 09:56:42 +02:00
Michael James Gratton
6a15b0ca4c Don't munge from header when restoring composer from a draft. Bug 768419.
* src/client/composer/composer-widget.vala
  (ComposerWidget::ComposerWidget): Set the from property for
  ComposeType.NEW_MESSAGE when the referred email is not null - i.e. it's
  a draft, call ::update_from_field afterwards so that is taken into
  account.
  (ComposerWidget::add_recipients_and_ids): Merge body of
  ::set_preferred_from_address here since it's the only call site, update
  that to only munge the from property only if not composing a new email
  - i.e. a draft, so that ::restore_draft_state_async does not clobber it
  when calling this method with referred messages that aren't the draft.
2016-07-07 12:34:08 +10:00
Michael James Gratton
cc8b79ba35 Fix ConversationViewer crit assertion displaying messages with no body.
Bug 767438

* src/client/conversation-viewer/conversation-viewer.vala
  (::set_message_html): Body text may be null if there's no HTML or plain
  body parts, so allow for it and check before passing to
  ::insert_html_markup.
2016-07-06 17:31:44 +10:00
Michael James Gratton
e9a0b2aa77 Don't crash when LIST on the INBOX returns a NIL delim. Bug 766509.
* src/engine/imap/api/imap-account.vala (Account::list_inbox): Check
  hierarchy_delimiter after doing a LIST on INBOX, if null then list its
  siblings and use the first returned by it.

* src/engine/imap/api/imap-folder.vala (Folder): Add delim property,
  set it via the constructors, so we don't need to use the possibly-
  null MailboxInformation.delim property. Update ctor call sites.
2016-07-05 10:22:53 +10:00
Oskar Viljasaar
f80f52fbe6 Use built-in GTK signals for the search bar
- Make use of the "search-changed" signal to handle user input, this
lets us get rid of the built-in timeout mechanism. This reduces the
timeout from 250ms to 150ms after user input before doing the search
though.

- Use the "activate" and "stop-search" signals for the entry. This
lets us remove our handling of key events.

https://bugzilla.gnome.org/show_bug.cgi?id=720993
2016-07-05 01:08:08 +10:00
Piotr Drąg
6d4ce9af98 Updated Polish help translation 2016-07-04 02:48:56 +02:00
Michael James Gratton
da96e96c70 Fix format=flowed when sending Base64 encoded text/plain. Bug 753528.
Sending a message with a text/plain body containing many wide chars will
usually result in it being encoded as Base64. This was breaking
format=flowed since Geary was doing the LF=>CRLF conversion only when
serialisaing for transmission, so the LF's in the unencoded text were not
getting converted to CRLF, and hence all the line breaks were interpreted
as hard breaks under F=F.

* src/engine/rfc822/rfc822-message.vala (Message.from_composed_email):
  When setting the RFC822 message body/body part from the composed
  message, apply a CRLF filter first iff it will be encoded with Base64.
2016-06-30 17:35:16 +10:00
Michael James Gratton
f10f898ab0 Always use UTF-8 for encoding non-ASCII/ISO-8859-1 headers. Bug 753870.
While message bodies are always sent as UTF-8, non ASCII/ISO-8859-1
headers were being encoded using GMime's default heuristics. This
uses some less-well-supported charsets and causing some rendering
issues in other less tolerant client.

Since we assume UTF-8 support for the body, assume it for headers as
well.

* src/engine/rfc822/rfc822.vala (Geary.RFC822.init): Set GMime user
  charsets to UTF-8.

* bindings/vapi/gmime-2.6.vapi (GMime): Fix binding for
  g_mime_set_user_charsets.
2016-06-30 15:29:39 +10:00
Heiko Becker
7166c15ea3 Use PKG_CONFIG_EXECUTABLE provided by find_package(PkgConfig)
find_package(PkgConfig} respects the PKG_CONFIG environment variable
when trying to find pkg-config. This is helpful with a differently
named pkg-config executable, for example an arch-prefixed one.
2016-06-29 10:56:53 +10:00
Timo Kluck
5045ff0443 Composer address bar: prevent doubling spaces after address autocomplete
The composer splits addresses on "," and later joins them on ", ". This means
that separating spaces are doubled after every autocomplete. This patch fixes
that by stripping whitespace after splitting. We do this in a separate loop at
the end of the function as opposed to directly after splitting in order not to
upset the cursor positioning logic.

This does not fix the problem that an address like

    "Kluck, Timo" <tkluck@infty.nl>

are split on the comma. Before this patch, the space would be doubled.  After
this patch, it will always be reduced to a single space. A better solution
would ideally leave the quoted part as-is. I think this will also lead to
better auto-complete behaviour when the cursor is in the quoted part.  Better
parsing of the quoted part is beyond the scope of this patch.
2016-06-29 10:33:33 +10:00
Michael James Gratton
a2519ff30e Enable fatal warnings for valac.
Doesn't catch anything at the moment, but good to have in case it does in
the future.
2016-06-27 21:19:35 +10:00
Federico Bruni
99283d4ec9 Updated Italian translation 2016-06-26 16:22:51 +00:00
Daniel Șerbănescu
d5e060547d Updated Romanian translation 2016-06-24 16:34:30 +00:00
Mario Blättermann
fda7efdf58 Updated German translation 2016-06-23 18:28:24 +00:00