diff options
author | Chimrod <contact+git@chimrod.com> | 2011-08-31 09:59:48 +0200 |
---|---|---|
committer | Chimrod <contact+git@chimrod.com> | 2011-08-31 09:59:48 +0200 |
commit | bc6519b2cef97b592b74a90ace0288310e35aed9 (patch) | |
tree | 61b5c3407ca5e3239f96e60b74bf6a81e7a8d919 /lib/feed2imap | |
parent | c5d6fdfdd493f940a455b8d3158788528573a277 (diff) | |
parent | 113b6f785488dd7eb2d5994b0112d4c653e1ac47 (diff) | |
download | feed2imap-bc6519b2cef97b592b74a90ace0288310e35aed9.tar.gz feed2imap-bc6519b2cef97b592b74a90ace0288310e35aed9.tar.bz2 feed2imap-bc6519b2cef97b592b74a90ace0288310e35aed9.zip |
Merge branch 'maildir'
Diffstat (limited to '')
-rw-r--r-- | lib/feed2imap/cache.rb | 27 | ||||
-rw-r--r-- | lib/feed2imap/maildir.rb | 3 |
2 files changed, 13 insertions, 17 deletions
diff --git a/lib/feed2imap/cache.rb b/lib/feed2imap/cache.rb index 6dc0ddf..d012910 100644 --- a/lib/feed2imap/cache.rb +++ b/lib/feed2imap/cache.rb @@ -189,26 +189,21 @@ class CachedChannel i.cacheditem.index = j.index found = true # let's put j in front of itemstemp + puts "got existing: #{j.to_s}" @itemstemp.delete(j) @itemstemp.unshift(j) break end - end - next if found - if not always_new - # Try to find an updated item - @items.each do |j| - # Do we need a better heuristic ? - if j.is_ancestor_of(i) - i.cacheditem.index = j.index - i.cacheditem.updated = true - updateditems.push(i) - found = true - # let's put j in front of itemstemp - @itemstemp.delete(j) - @itemstemp.unshift(i.cacheditem) - break - end + # If we didn't find exact match, try to check if we have an update + if j.is_ancestor_of(i) + i.cacheditem.index = j.index + i.cacheditem.updated = true + updateditems.push(i) + found = true + # let's put j in front of itemstemp + @itemstemp.delete(j) + @itemstemp.unshift(i.cacheditem) + break end end next if found diff --git a/lib/feed2imap/maildir.rb b/lib/feed2imap/maildir.rb index 317f631..89008cb 100644 --- a/lib/feed2imap/maildir.rb +++ b/lib/feed2imap/maildir.rb @@ -49,6 +49,7 @@ class MaildirAccount return end store_message(dir, date, info) { |f| f.puts(mail) } + puts info end def to_s @@ -163,7 +164,7 @@ class MaildirAccount basename = File.basename(file) colon = basename.rindex(':') - return (colon and basename.slice(colon + 1, -1)) + return (colon and basename[colon + 1 .. -1]) end # Re-written and no longer shamelessly taken from |