The ListParameter.parent property only existed to make the deserialier's
life easier, but is also why sketchy code was needed for appending search
criteria from a ServerSearchEmail replay op to the actual IMAP search
command sent to the server.
This removes the property altogether, and replaces its only use in
Deserialier with a stack, as nature intended. This means lists can be
added to more than one other list, and e.g. when a search is executed,
the search critera can be used for multiple requests.
Since MailboxParameter inherited from StringParameter directly, it meant
that we could never send mailbox names as quoted strings. Also, the
modified-UTF-7 encoding used for mailbox names does not encode
atom-specials such as "\", so if a mailbox name contained one or more of
these, it would be sent to the mail server unquoted.
This removes the MailboxParameter class altogether, and does the
parameter conversion to/from appropriate StringParameter subclasses as
needed. Also adds unit tests for param conversion for ASCII,
atom-specials, and non-ASCII mailbox names.
Fixes issue #40
ConfigFile is a GLib.KeyFile-like class (and is backed by a KeyFile) that
nonetheless provides convenient a high-level API for getting and setting
grouped config values and asynchronous loading and saving.
* src/engine/util/util-config-file.vala: New ConfigFile class.
* src/engine/api/geary-service-information.vala (ServiceInformation):
Require ConfigFile groups rather than KeyFile instances for loading and
saving. Update subclasses and unit tests.
* src/client/accounts/account-manager.vala (AccountManager): Move generic
account key consts here from Config. Instead of using KeyFile directly,
use ConfigFile groups for loading and saving settings. Rename load and
save methods to be a bit more consistent with the class's role, and
make save_account() throw its errors so they can be reported to the
user. Update call sites.
* src/client/accounts/local-service-information.vala
(LocalServiceInformation): Move service-specific config key consts
here, use new ConfigFile groups for loading and saving.
* src/engine/api/geary-config.vala: Removed, all config consts have been
moved to the classes using them and KeyFile convenience methods
subsumed by ConfigFile.
Reverting commit 1d8c4aea broke the mailbox class a bit. This fixes the
issue, introduces Ascii.last_index_of which is needed by Mailbox anyway,
and adds some test for it. Also 'optimises' Ascii.index_of bit as well.
This introduces the Geary.RFC822.Part class, which provides a place to
MIME entity body decoding code so it can be reused when needed. It also
provides a place to put common GMime to Geary object conversion, and
apply some common policy decisions, such as what is the default content
type if none is specified.
* src/engine/rfc822/rfc822-part.vala: New Part class that represents a
MIME entity. Move code for both decoding entity body from
RFC822.Message and code for cleaning content filename from RFC822.Util
to here. Convert GMime entity header objects into their Geary
equivalents and make available as properties. Provide a common means of
determining the content type of the part if not explicitly set.
* src/engine/rfc822/rfc822-message-data.vala (PreviewText.with_header):
Construct a RFC822.Part and use that for decoding preview text. Swap
args to make some more sense and update call sites.
* src/engine/rfc822/rfc822-message.vala (InlinePartReplacer): Simply pass
through an instance of a RFC822.Part rather than the multi-arg list,
since that has all the data needed by replacers.
* src/engine/imap-db/imap-db-attachment.vala (Attachment): Require and
use RFC822.Part instances for obtaining attachment bodies rather than
GMime.Part instances. Update call sites.
* src/engine/rfc822/rfc822-message.vala (Message): Fix has_plain_body(),
handle the case where displayed MIME entities (as opposed to attached
ones) with no Content-Type default to US-ASCII, per the RFC.
* test/engine/rfc822-message-test.vala (MessageTest): Add tests for
testing and accessing body content as both plain text and HTML. Use
GResources for accessing test message bodies rather than extremely long
const strings.
This makes both the open() and open_connection() methods on
Geary.DB.Database asynchronous, which allows the VersionedDatabase
open_background() and its hackery to be removed, and upgrades to be
performed asynchronously as well. It also adds a
exec_transaction_async() method to Connection, allowing an existing
object to also be used to establish an async transaction.
* src/engine/db/db-connection.vala (Connection): Add
exec_transaction_async method, update doc comments.
* src/engine/db/db-database.vala (Database): Make open and
open_connection async by executing SQLite code in a background thread,
update call sites. Move job management code out of
exec_transaction_async into a new internal add_async_job() method so it
can be used by Connection. Add unit tests.
* src/engine/db/db-transaction-async-job.vala (TransactionAsyncJob): Add
an optional internal connection method and make the job's cancellable
an internal property so a Connection instance can specify itself for
the transaction.
* src/engine/db/db-versioned-database.vala (VersionedDatabase): Remove
open_background() hack since open() is now async. Make version upgrade
hooks for derived classes async and update call sites. Use a
Nonblocking.Mutex rather than GLib mutex so upgrade exclusion works
asynchronously. Add unit tests.
* src/engine/imap-db/imap-db-database.vala (Database): Make database
upgrade methods async and execute SQL in async instructions now that
the bases classes support it. Add unit tests.
* src/engine/app/app-conversation-monitor.vala (ConversationMonitor):
Don't check the folder blacklist for external folder signals when the
signal is received, do it when the operation is executed so it's fresh.
* src/engine/app/conversation-monitor/app-fill-window-operation.vala
(FillWindowOperation): Only re-fill the conversation if we get a full
load, anything else means we hit the end of the folder.
* test/engine/app/app-conversation-monitor-test.vala: New unit tests
for ConversationMonitor.
* test/engine/api/geary-account-mock.vala,
test/engine/api/geary-folder-mock.vala: Mix in MockObject mock up all
method calls.
* test/engine/api/geary-email-identifier-mock.vala: Fix the comparator
method when the other instance is null.
* test/api/*.vala: Renamed files that contained mock objects to *-mock.vala,
not *-test.vala.
* test/testcase.vala: Renamed to test-case.vala for consistency, remove
TestCase class from Gee package since that's really not true. Clean up
code for consistency.
* test/meson.build, test/CMakeLists.txt: Split TestCase compilation out
into a separate test lib.
* test/engine/api/geary-email-properties-test.vala: Add new mock
EmailProperties object.
* test/engine/app/app-conversation-test.vala (ConversationTest): Set
email sent and received dates to suppress warnings adding them to
Conversation instances.
* test/engine/app/app-conversation-set-test.vala (ConversationSetTest):
Set email sent and received dates to suppress warnings adding them to
Conversation instances, handle both casees when merging two
conversations, that the first was merged to the second and vice versa.
This adds a check for malware spoofing of RFC 822 mailbox addresses such
as those found in Mailsploit, and if found only displays the email
address part and not the mailbox name part.
Part 1 of Mailsploit mitigation.
* src/engine/rfc822/rfc822-mailbox-address.vala (MailboxAddress): Add new
is_spoofed method to check if the mailbox address looks like it has
been spoofed. Add is_distinct method to determine if the name and the
label is the same. Do whitespace and non-printing character stripping
when generating display versions of the mailbox address, rename methods
to make it more obvious what they do and update call sites. Add unit
tests to cover all this.
* src/client/conversation-viewer/conversation-message.vala
(ConversationMessage): Check name is distinct and is not valid before
displaying it. Use new MailboxAddress methods for getting display
versions of the address, to ensure we get the stripped versions of the
addresses.
* src/client/conversation-list/formatted-conversation-data.vala
(ParticipantDisplay): Ensure full addresses are always HTML-markup
escaped before displaying them as markup, to avoid dropping "<address>"
values as invalid HTML. Always show the full address if an address is
invalid.
* src/engine/util/util-string.vala (reduce_whitespace): Strip not only
whitespace but also non-printing characters. Add unit tests.
* src/engine/meson.build: Add some ugly hacks to both build the internal
VAPI and work around a valac bug to ensure the internal VAPI correctly
references the internal header, not the public header.
* test/meson.build: Split the test suite build into test-engine and
test-client.
Some remarks:
* Note that Meson adds a hard dependency on Python 3.
* All dependencies and defines are now listed together.
* Some build files were put in their respective subdirectories, e.g. the Geary
engine library will be built from the Meson file in `src/engine`.
* `--fatal-warnings` is no longer an explicit flag, as Meson provides
`-Dwerror=true` for this.
* An explicit resource file needs to be used. The issue to support this from
Meson itself can be found at https://github.com/mesonbuild/meson/issues/706 .
* The `gnome.yelp()` function parses a LINGUAS file so we no longer need to keep
track of all languages in our build system.
* There are no Debian scripts defined in the meson.build files to keep them
clean, but they can be kept as separate scripts in `build-aux`.
* Left out the `dist` target as there is now `ninja dist`
* `geary-docs` is disabled by default, as valadoc-0.38.3 returns errors.
https://bugzilla.gnome.org/show_bug.cgi?id=777044