summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--data/rbot/plugins/rss.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/data/rbot/plugins/rss.rb b/data/rbot/plugins/rss.rb
index 7d926604..be7a3271 100644
--- a/data/rbot/plugins/rss.rb
+++ b/data/rbot/plugins/rss.rb
@@ -229,15 +229,15 @@ class RSSFeedsPlugin < Plugin
end
def itemDate(item,ex=nil)
- return item.pubDate if item.respond_to?(:pubDate)
- return item.date if item.respond_to?(:date)
+ return item.pubDate if item.respond_to?(:pubDate) and item.pubDate
+ return item.date if item.respond_to?(:date) and item.date
return ex
end
def freshness_sort(items)
notime = Time.at(0)
items.sort { |a, b|
- itemDate(b, notime) || 0 <=> itemDate(a, notime) || 0
+ itemDate(b, notime) <=> itemDate(a, notime)
}
end