Fixes off-by-one error and bitfield issue when fetching an email.

In prior revision, the email message that appeared didn't always match the header selected.  This fixes that problem.
This commit is contained in:
Jim Nelson 2011-07-15 14:29:33 -07:00
parent e06690a526
commit 8e62435dec
3 changed files with 10 additions and 4 deletions

View file

@ -199,14 +199,16 @@ public class Geary.Sqlite.Folder : Geary.AbstractFolder, Geary.LocalFolder, Gear
to_string());
}
if (!message_row.fields.fulfills(required_fields)) {
// see if the message row fulfills everything but properties, which are held in
// separate table
if (!message_row.fields.fulfills(required_fields.clear(Geary.Email.Field.PROPERTIES))) {
throw new EngineError.INCOMPLETE_MESSAGE(
"Message at position %d in folder %s only fulfills %Xh fields", position, to_string(),
message_row.fields);
}
ImapMessagePropertiesRow? properties = null;
if (required_fields.fulfills(Geary.Email.Field.PROPERTIES)) {
if (required_fields.require(Geary.Email.Field.PROPERTIES)) {
properties = yield imap_message_properties_table.fetch_async(location_row.message_id,
cancellable);
}