diff options
author | Lucas Nussbaum <lucas@lucas-nussbaum.net> | 2012-04-26 10:21:33 +0200 |
---|---|---|
committer | Lucas Nussbaum <lucas@lucas-nussbaum.net> | 2012-04-26 10:21:33 +0200 |
commit | c8c32eea5d329773bda8ce0a073266ab498507c5 (patch) | |
tree | 1f6bd5bf62b826c51ed7912e9e7f3c3c5bf70694 /lib/feed2imap/cache.rb | |
parent | 04db76a10d2f26e124731f7601722bfa2de61dfe (diff) | |
parent | d3ac1f64a5ba90d755e58bd0f3ff2813baca510b (diff) | |
download | feed2imap-c8c32eea5d329773bda8ce0a073266ab498507c5.tar.gz feed2imap-c8c32eea5d329773bda8ce0a073266ab498507c5.tar.bz2 feed2imap-c8c32eea5d329773bda8ce0a073266ab498507c5.zip |
Merge remote-tracking branch 'chimrod/master'
Diffstat (limited to '')
-rw-r--r-- | lib/feed2imap/cache.rb | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/lib/feed2imap/cache.rb b/lib/feed2imap/cache.rb index 6dc0ddf..9fb9930 100644 --- a/lib/feed2imap/cache.rb +++ b/lib/feed2imap/cache.rb @@ -193,22 +193,16 @@ class CachedChannel @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 |