&log_seq, &log_offset)) {
/* scan the view only up to end of the current view.
if there are more changes, we don't care about them until
- the next sync. the modseq may however already point to
- beyond the current view's end (FIXME: why?) */
- if (log_seq > end_seq ||
- (log_seq == end_seq && log_offset > end_offset)) {
- end_seq = log_seq;
- end_offset = log_offset;
- }
+ the next sync. */
ret = mail_transaction_log_view_set(log_view,
log_seq, log_offset,
end_seq, end_offset,
}
*log_seq_r = prev_file->hdr.file_seq;
- return mail_transaction_log_file_get_modseq_next_offset(
- prev_file, modseq, log_offset_r) == 0;
+ if (mail_transaction_log_file_get_modseq_next_offset(prev_file, modseq,
+ log_offset_r) < 0)
+ return FALSE;
+
+ if (*log_seq_r > view->log_file_head_seq ||
+ (*log_seq_r == view->log_file_head_seq &&
+ *log_offset_r > view->log_file_head_offset)) {
+ /* modseq is already beyond our view. move it back so the
+ caller won't be confused. */
+ *log_seq_r = view->log_file_head_seq;
+ *log_offset_r = view->log_file_head_offset;
+ }
+ return TRUE;
}