mu: add "modified" fields

Add a new "modified" field for checking the last modification time of the
message.
This commit is contained in:
Dirk-Jan C. Binnema
2022-04-30 01:17:31 +03:00
parent 9e0173f387
commit a864616110
4 changed files with 185 additions and 178 deletions

View File

@ -596,6 +596,9 @@ fill_document(Message::Private& priv)
for (auto&& part: priv.parts)
doc.add(field.id, part.mime_type());
break;
case Field::Id::Modified:
doc.add(field.id, priv.mtime);
break;
case Field::Id::Path: /* already */
break;
case Field::Id::Priority:
@ -708,8 +711,10 @@ Message::update_after_move(const std::string& new_path,
return Err(statbuf.error());
priv_->doc.add(Field::Id::Path, new_path);
priv_->doc.add(Field::Id::Modified, statbuf->st_mtime);
priv_->doc.add(new_flags);
if (const auto res = set_maildir(new_maildir); !res)
return res;