return dbox_file_open_full(file, FALSE, notfound_r);
}
-int dbox_file_stat(struct dbox_file *file, struct stat *st_r)
+int dbox_file_stat(struct dbox_file *file, struct event *event, struct stat *st_r)
{
const char *path;
bool alt = FALSE;
}
return 0;
}
+ mail_metadata_accessed_event(event);
/* try the primary path first */
path = file->primary_path;
/* fstat() or stat() the file. If file is already deleted, fails with
errno=ENOENT. */
-int dbox_file_stat(struct dbox_file *file, struct stat *st_r);
+int dbox_file_stat(struct dbox_file *file, struct event *event, struct stat *st_r);
/* Try to lock the dbox file. Returns 1 if ok, 0 if already locked by someone
else, -1 if error. */
/* we just messed up mail's input stream by reading metadata */
i_stream_seek((*file_r)->input, offset);
i_stream_sync(mail->imail.data.stream);
- }
+ } else
+ mail_metadata_accessed_event(mail_event(&mail->imail.mail.mail));
+
return 0;
}
return -1;
_mail->transaction->stats.stat_lookup_count++;
- if (dbox_file_stat(mail->open_file, &st) < 0) {
+ if (dbox_file_stat(mail->open_file,
+ mail_event(&mail->imail.mail.mail), &st) < 0) {
if (errno == ENOENT)
mail_set_expunged(_mail);
return -1;
return -1;
_mail->transaction->stats.fstat_lookup_count++;
- if (dbox_file_stat(mail->open_file, &st) < 0) {
+ if (dbox_file_stat(mail->open_file,
+ mail_event(&mail->imail.mail.mail), &st) < 0) {
if (errno == ENOENT)
mail_set_expunged(_mail);
return -1;
return -1;
_mail->transaction->stats.fstat_lookup_count++;
- if (dbox_file_stat(mail->open_file, &st) < 0) {
+ if (dbox_file_stat(mail->open_file,
+ mail_event(&mail->imail.mail.mail), &st) < 0) {
if (errno == ENOENT)
mail_set_expunged(_mail);
return -1;
#define SDBOX_REBUILD_COUNT 3
static void
-dbox_sync_file_move_if_needed(struct dbox_file *file,
+dbox_sync_file_move_if_needed(struct dbox_file *file, struct event *event,
enum sdbox_sync_entry_type type)
{
struct stat st;
!move_to_alt) {
/* unopened dbox files default to primary dir.
stat the file to update its location. */
- (void)dbox_file_stat(file, &st);
+ (void)dbox_file_stat(file, event, &st);
}
if (move_to_alt != dbox_file_is_in_alt(file)) {
mail_index_update_flags(ctx->trans, seq, modify_type,
(enum mail_flags)DBOX_INDEX_FLAG_ALT);
file = sdbox_file_init(ctx->mbox, uid);
- dbox_sync_file_move_if_needed(file, type);
+ dbox_sync_file_move_if_needed(file, ctx->mbox->box.event, type);
dbox_file_unref(&file);
break;
}