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.
* 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.
* 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.
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.
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.
* 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.
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.
* 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.
* src/engine/api/geary-service-provider.vala
(ServiceProvider::from_string): Throw an error rather than an assert
when the provided string is not found.
* 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.
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.
* 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.
* 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.
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.
* 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.
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.
* 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.
- 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
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.
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.
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.
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.