sup

A curses threads-with-tags style email client

sup.git

git clone https://supmua.dev/git/sup/
commit f7a497c1fb31214bdb24df2c42bb4c5a502019ba
parent 485ac2cf7eafe82116f1e8d3faee0aee616dc264
Author: wmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Date:   Sun,  1 Apr 2007 22:59:22 +0000

added pre checks for maildir and imap

git-svn-id: svn://rubyforge.org/var/svn/sup/trunk@362 5c8cc53c-5e98-4d25-b20a-d8db53a31250

Diffstat:
M lib/sup/imap.rb | 2 ++
M lib/sup/maildir.rb | 5 +++++
2 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/lib/sup/imap.rb b/lib/sup/imap.rb
@@ -64,6 +64,8 @@ class IMAP < Source
   end
   def ssl?; @parsed_uri.scheme == 'imaps' end
 
+  def check; scan_mailbox; end
+
   ## is this necessary? TODO: remove maybe
   def == o; o.is_a?(IMAP) && o.uri == self.uri && o.username == self.username; end
 
diff --git a/lib/sup/maildir.rb b/lib/sup/maildir.rb
@@ -25,6 +25,11 @@ class Maildir < Source
     @mutex = Mutex.new
   end
 
+  def check
+    scan_mailbox
+    start = @ids.index(cur_offset || start_offset) or raise OutOfSyncSourceError, "Unknown message id #{cur_offset || start_offset}." # couldn't find the most recent email
+  end
+
   def load_header id
     scan_mailbox
     with_file_for(id) { |f| MBox::read_header f }