Commit graph

3953 commits

Author SHA1 Message Date
Michael Gratton
288c78a93a Geary.RFC822.Message: Rework constructors and stocking from GMimeMessage
Make constructors use the Message.from_gmime where possible. Merge that
and stock_from_gmime so it's clear the stocking only happens in the
ctor. Update stocking to use high-level GMime APIs where available to
avoid re-parsing header values.
2020-05-06 14:58:56 +10:00
Michael Gratton
6e7631b8d3 Geary.RFC822: Clean up message data interfaces and classes
Split Geary.RFC822.MessageData interface up into DecodedMessageData and
EncodedMessageData so the difference between the two is clear and they
can't be used interchangeably.

Add `DecodedMessageData::to_rfc822_string` to provide a common interface
for round-tripping decoded data.

Update all classes to implement one of these and follow the same general
API patterns.
2020-05-06 14:58:56 +10:00
Michael Gratton
5b253cbee6 Geary.RFC822.MessageIdList: Update API to match MailboxAddresses
Make immutable, provide similar properties and accessors as
MailboxAddresses.
2020-05-06 14:58:56 +10:00
Michael Gratton
6aa5c2bfbd Geary.Imap.RFC822Size: Decouple from RFC822.Size
Derive directly from Int64MessageData instead and remove RFC822.Size
since the latter is not actually used or specified in RFC 822 and its
obsoletors.
2020-05-06 14:58:56 +10:00
Michael Gratton
f25892d879 Geary.RFC822.MailboxAddresses: Update API and valadocs
Add some doc comments, fix some methods to ensure the class is actually
immutable, remove some unused methods, add ctor from the GMime
equivalent object.
2020-05-06 14:58:56 +10:00
Michael Gratton
2b5e084b61 Geary.Engine.MailboxAddress: Don't force ISO-8859-1 encoding 2020-05-06 14:58:56 +10:00
Michael Gratton
27e1b5433f Geary.RFC822.MailboxAddress: Fix sense of 8-bit workaround check 2020-05-06 14:58:56 +10:00
Michael Gratton
0bbf0bfd32 Geary.RFC822.Message: Rename message_to_memory_buffer args for clarity 2020-05-06 14:58:56 +10:00
Michael Gratton
6e50c2a4c0 Geary.Mime.ContentParameters: Minor ctor API update 2020-05-06 14:58:56 +10:00
Michael Gratton
e0c1fb8a80 Geary.RFC822: Ensure various data constructors throw errors
Rather than just silently ignoring error conditions, throw RFC822
errors instead.
2020-05-06 14:58:56 +10:00
Michael Gratton
97e0093e29 Geary.ComposedEmail: Remove to_rfc822_message, it's redundant
Callers can just call the same thing that method does instead.
2020-05-05 21:57:17 +10:00
Michael Gratton
6d5f63692b Geary.Mime.ContentType: Rename ::deserialise to ::parse
Add unit tests.
2020-05-05 21:57:17 +10:00
Michael Gratton
f77bb50b5c src/engine/rfc822/rfc822-utils.vala: Updated to better match code style 2020-05-05 21:57:17 +10:00
Michael Gratton
d7e128ae72 src/engine/rfc822/rfc822.vala: Fix indentation to match style 2020-05-05 21:56:06 +10:00
Michael Gratton
b7bae46bca Merge branch 'mjog/add-label-to-label-folder-grouping' into 'mainline'
FolderList.AccountBranch: Give the label group an actual label

See merge request GNOME/geary!502
2020-05-03 07:35:21 +00:00
Michael Gratton
b75e251abe Components.PreferencesWindow: Add pref page icons
Per advice in #813 these are required by libhandy.
2020-04-26 13:35:22 +10:00
Michael Gratton
97d34b2d4b Geary.ClientService: Set as unreachable on connectivity check error
Mark the service as unreachable if a connectivity check error occurs
since if we can't determine it is reachable, we probably can't connect
to it either.
2020-04-24 15:30:04 +10:00
Michael Gratton
0e673ce5f8 Geary.ClientService: Update connectivity timeouts
Swap reachable and unreachable timeouts periods so that connections
are dropped sooner and not re-established too early.
2020-04-24 15:30:04 +10:00
Michael Gratton
530c205ce7 Geary.Util.ConnectivityManager: Fix a spurious connectivity error report
When a general error occurs checking connectivity of a remote server,
only treat it as an error if GNetworkMonitor indicates the network is
available (i.e. that a default route exists). If there is no network,
it's not surprising that the error occurred.

This fixes a spurious error when the delayed check runs but the host
is offline.
2020-04-24 15:30:04 +10:00
Michael Gratton
991c9ef5d7 Geary.App.ConversationMonitor: Fix more races when starting/stopping
Ensure that if stopping the conversation monitor while it is waiting
for the folder to open that the folder isn't closed, and if an error
is thrown when opening the folder that it gets thrown by
::start_monitoring anyway.

Hopefully fixes #741
2020-04-24 15:30:04 +10:00
Michael Gratton
a385ce8fc2 Geary.App.ConversationMonitor: Throw error closing folder when possible 2020-04-24 15:30:04 +10:00
Michael Gratton
51dfc11946 FolderList.AccountBranch: Give the label group an actual label 2020-04-23 12:07:25 +10:00
Michael Gratton
ee3f3c9930 Merge branch 'mjog/folder-order' into 'mainline'
FolderList.AccountBranch: Fix ordering of special-use folders

See merge request GNOME/geary!501
2020-04-23 02:02:51 +00:00
Michael Gratton
9e0acad23d FolderList.AccountBranch: Fix ordering of special-use folders
Don't rely on the special-use enum ordinal, there's no reason to
expect the engine lists uses in an order people would file helpful.
2020-04-23 11:45:11 +10:00
Michael Gratton
df2bce4eb8 Geary.ImapEngine.GenericAccount: Fix duplicate folders on first load
When loading an account for the first time, folders may not be processed
such that parents are handled first, leading to phantom folders created
for them.

This is particularly noticeable for GMail accounts, where the `[GMail]`
folder would typically show up, since it was created twice.
2020-04-23 11:17:01 +10:00
Michael Gratton
e94ce67605 Geary.Imap.MailboxAttributes: Fix missing SPECIAL-USE \All case
This was causing GMail's All Mail folder to not show up as a special-use
folder.
2020-04-23 10:41:09 +10:00
Michael Gratton
1986633351 Plugin.EmailTemplate: Create templates folder if it does not exist 2020-04-23 09:35:19 +10:00
Michael Gratton
1b529d2195 Minor doc comment update 2020-04-23 09:35:19 +10:00
Michael Gratton
13e339f009 Plugin.Account: Support creating folders in the personal name space
Add `create_personal_folder` method and implement it in
Application.FolderStoreImpl.
2020-04-23 09:35:19 +10:00
Michael Gratton
48ed8d9fe3 Geary.Account: Support creating folders in the personal name space
Add `create_personal_folder` method, implement it in
ImapEngine.GenericAccount. Use this when creating required special
folders to reduce code duplication.
2020-04-23 09:35:19 +10:00
Michael Gratton
e0dc785240 Geary.ImapEngine: Don't add local folders then update their special use
Set local folder special use when they are loaded rather than doing it
in two steps, so that when client code is notified of the folders
being available, they will already have the correct special type.
2020-04-23 09:35:19 +10:00
Michael Gratton
400850cc44 Geary.AccountInformation: Rework how special use folder paths are stored
Use a simple list of strings to store path steps, since we don't know
what the root will be in advance, and this leads to errors if callers
try to compare the info's paths to (say) an actual IMAP path.

Store path steps in a SpecialUse to path step map property, rather than
as individual properties for each special use, to reduce repetition.
2020-04-23 09:35:19 +10:00
Michael Gratton
9a2fe63a5f Application.Controller: Ensure outboxes appear in the folder list 2020-04-21 23:36:24 +10:00
Michael Gratton
47d4056010 Plugins: Add EmailTemplate plugin 2020-04-21 23:36:24 +10:00
Michael Gratton
10510727b6 Plugin.Composer: Support disabling sending a composer
Allow disabling send in the composer for editing templates.
2020-04-21 23:36:24 +10:00
Michael Gratton
33a6134864 Plugin.Composer: Support specifying a folder to save email 2020-04-21 23:36:24 +10:00
Michael Gratton
4f92c2b548 Plugin.InfoBar: Allow secondary buttons to be specified. 2020-04-21 23:36:24 +10:00
Michael Gratton
14f3dd0c36 Application.Controller: Allow creating composers with alt save folders
Allow a non-draft folder to be specified as the location to save
email being composed.
2020-04-21 23:36:24 +10:00
Michael Gratton
085ed9a6a3 Geary.App.DraftManaager: Update API to something more RAII-like
Replace open method with an async ctor, so we can make a few properties
non-null by default, and callers need to call one less call. Make
destination folder configurable, and require email flags passed in
via the ctor, not every time when saving.
2020-04-21 23:36:24 +10:00
Michael Gratton
924231d103 Plugins.SpecialFolders: Actually implement the edit draft action
Fixes #803
2020-04-21 16:22:55 +10:00
Michael Gratton
6fd3f36551 Plugin.Composer: Add support for editing an email in the composer
Add `edit_email` method, and implement in the underlying implementation.
2020-04-21 16:22:55 +10:00
Michael Gratton
2cd43de8ee ConversationViewer: Avoid re-enabling kinetic scrolling if disabled 2020-04-21 16:22:55 +10:00
Michael Gratton
480277e9c2 Application.MainWindow: Email not found error when discarding a draft
When the drafts folder is selected, and a draft is being edited, and
that dis discarded, there is a race between the composer disappearing
(and hence the draft being shown again) and the draft itself being
removed from the folder. Attempt to check for this and avoid reporting
the problem.
2020-04-21 16:22:55 +10:00
Michael Gratton
a67f1b2157 Application.{Controller,MainWindow}: Clean up displaying composers
When displaying a new empty composer, only consider those attached to
the current main window. Ensure that when re-using an existing composer,
that no composers in the undo buffer are used. Ensure drafts are
displayed full-pane when appropriate. Clean up redundant parts of
the `show_composer` API a bit.
2020-04-21 16:22:55 +10:00
Michael Gratton
6a33266cfb Composer.Widget: Re-load a context email with missing fields if needed
Rather than just throwing an error, try re-loading context emails in
`load_context` from the store.
2020-04-21 16:22:55 +10:00
Michael Gratton
fc4bc926c3 Composer.Widget: Convert to using AccountContext objects
Use AccountContext objects so the composer can access the account's
cancellable, contacts, etc. Simplify cancellable handling as a result.
2020-04-21 16:22:55 +10:00
Michael Gratton
96ddd5aee0 ConversationListBox: Remove obsolete action and signal 2020-04-21 16:22:55 +10:00
Michael Gratton
aac59ec53b Application.Controller, Composer.Widget: Clean up composer construction
Clean up and simplify how composers are constructed. Ensure all
composers are constructed via Application.Composer. Provide a set of
APIs for constructing different kinds of composers with minimal
parameters, rather than having one method with eleventy different
parameters.

Mirror API changes in Composer.Widget by splitting `load` method up
into a method for each different composer type. Clean up internals a
bit as a result. Rename `ComposeType` enum and its values to
`ContextType` to better reflect what it does.
2020-04-21 16:22:55 +10:00
Michael Gratton
a98f953237 Application.Client: Use plugin variant formats for app actions
Expect the same variant format for the `show-folder` and `show-email`
application actions. Use existing email and folder store factory
lookup methods for these. Update DesktopNotifications plugin to simply
pass variant values from plugin classes through to notifications.
2020-04-20 10:53:27 +10:00
Michael Gratton
0b0efd026a Application.FolderStoreFactory: Move get_folder_from_variant to factory
Make the from variant method accessible to the client as per email
factory, so the client can reuse it.
2020-04-20 10:53:27 +10:00