Index attachment filenames properly; fix #7575
This commit is contained in:
parent
ec032d5b2f
commit
64dd643760
3 changed files with 20 additions and 7 deletions
|
|
@ -15,3 +15,4 @@ install(FILES version-012.sql DESTINATION ${SQL_DEST})
|
|||
install(FILES version-013.sql DESTINATION ${SQL_DEST})
|
||||
install(FILES version-014.sql DESTINATION ${SQL_DEST})
|
||||
install(FILES version-015.sql DESTINATION ${SQL_DEST})
|
||||
install(FILES version-016.sql DESTINATION ${SQL_DEST})
|
||||
|
|
|
|||
9
sql/version-016.sql
Normal file
9
sql/version-016.sql
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
--
|
||||
-- For a while there, we weren't properly indexing attachment filenames in the
|
||||
-- search table. To be proper (and since this is right before a major release)
|
||||
-- we want to make sure anyone who's been running the dailies has a good
|
||||
-- database, which unfortunately means ditching the search table and letting
|
||||
-- Geary recreate it properly.
|
||||
--
|
||||
|
||||
DELETE FROM MessageSearchTable
|
||||
|
|
@ -1821,17 +1821,12 @@ private class Geary.ImapDB.Folder : BaseObject, Geary.ReferenceSemantics {
|
|||
if (email.fields == Geary.Email.Field.NONE)
|
||||
return;
|
||||
|
||||
// Build the combined email from the merge, which will be used to save the attachments
|
||||
Geary.Email combined_email = row.to_email(location.email_id);
|
||||
do_add_attachments(cx, combined_email, location.message_id, cancellable);
|
||||
|
||||
// Merge in any fields in the submitted email that aren't already in the database or are mutable
|
||||
int new_unread_count = 0;
|
||||
if (((fetched_fields & email.fields) != email.fields) ||
|
||||
email.fields.is_any_set(Geary.Email.MUTABLE_FIELDS)) {
|
||||
Geary.Email.Field new_fields;
|
||||
do_merge_message_row(cx, row, out new_fields, out updated_contacts,
|
||||
ref new_unread_count, cancellable);
|
||||
// Build the combined email from the merge, which will be used to save the attachments
|
||||
Geary.Email combined_email = row.to_email(location.email_id);
|
||||
|
||||
// Update attachments if not already in the database
|
||||
if (!fetched_fields.fulfills(Attachment.REQUIRED_FIELDS)
|
||||
|
|
@ -1840,6 +1835,14 @@ private class Geary.ImapDB.Folder : BaseObject, Geary.ReferenceSemantics {
|
|||
cancellable);
|
||||
}
|
||||
|
||||
// Must add attachments to the email object after they're saved to
|
||||
// the database.
|
||||
do_add_attachments(cx, combined_email, location.message_id, cancellable);
|
||||
|
||||
Geary.Email.Field new_fields;
|
||||
do_merge_message_row(cx, row, out new_fields, out updated_contacts,
|
||||
ref new_unread_count, cancellable);
|
||||
|
||||
if (do_check_for_message_search_row(cx, location.message_id, cancellable))
|
||||
do_merge_email_in_search_table(cx, location.message_id, new_fields, combined_email, cancellable);
|
||||
else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue