iter_unread_messages: get new threads even if there is no comment
This commit is contained in:
parent
8cb2bf07db
commit
b6a7d21fb9
1 changed files with 13 additions and 11 deletions
|
|
@ -105,12 +105,6 @@ class DLFPBackend(BaseBackend, ICapMessages, ICapMessagesPost, ICapContent):
|
||||||
thread = id
|
thread = id
|
||||||
id = thread.id
|
id = thread.id
|
||||||
|
|
||||||
# Check if we have seen all comments of this thread.
|
|
||||||
oldhash = self.storage.get('hash', id, default="")
|
|
||||||
newhash = self.browser.get_hash(thread._rsscomment)
|
|
||||||
if not getseen and (oldhash == newhash or newhash is None):
|
|
||||||
return None
|
|
||||||
self.storage.set('hash', id, newhash)
|
|
||||||
if thread.date:
|
if thread.date:
|
||||||
self.storage.set('date', id, thread.date)
|
self.storage.set('date', id, thread.date)
|
||||||
self.storage.save()
|
self.storage.save()
|
||||||
|
|
@ -183,7 +177,15 @@ class DLFPBackend(BaseBackend, ICapMessages, ICapMessagesPost, ICapContent):
|
||||||
|
|
||||||
def iter_unread_messages(self):
|
def iter_unread_messages(self):
|
||||||
for thread in self.iter_threads():
|
for thread in self.iter_threads():
|
||||||
self.fill_thread(thread, 'root', False)
|
# Check if we have seen all comments of this thread.
|
||||||
|
with self.browser:
|
||||||
|
oldhash = self.storage.get('hash', thread.id, default="")
|
||||||
|
newhash = self.browser.get_hash(thread._rsscomment)
|
||||||
|
if oldhash != newhash:
|
||||||
|
self.storage.set('hash', thread.id, newhash)
|
||||||
|
self.storage.save()
|
||||||
|
|
||||||
|
self.fill_thread(thread, 'root', getseen=False)
|
||||||
for m in thread.iter_all_messages():
|
for m in thread.iter_all_messages():
|
||||||
if m.flags & m.IS_UNREAD:
|
if m.flags & m.IS_UNREAD:
|
||||||
yield m
|
yield m
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue