fix iter_unread_threads() to correctly set the UNREAD flag
This commit is contained in:
parent
6ed925ec50
commit
ae4b77df44
1 changed files with 6 additions and 7 deletions
|
|
@ -38,19 +38,18 @@ class NewsfeedBackend(BaseBackend, ICapMessages):
|
||||||
|
|
||||||
def iter_threads(self):
|
def iter_threads(self):
|
||||||
for article in Newsfeed(self.config["url"]).iter_entries():
|
for article in Newsfeed(self.config["url"]).iter_entries():
|
||||||
thread = Thread(article.id)
|
yield self.get_thread(article.id, article)
|
||||||
thread.title = article.title
|
|
||||||
yield thread
|
|
||||||
|
|
||||||
|
def get_thread(self, id, entry=None):
|
||||||
|
|
||||||
def get_thread(self, id):
|
|
||||||
if isinstance(id, Thread):
|
if isinstance(id, Thread):
|
||||||
thread = id
|
thread = id
|
||||||
id = thread.id
|
id = thread.id
|
||||||
else:
|
else:
|
||||||
thread = Thread(id)
|
thread = Thread(id)
|
||||||
entry = Newsfeed(self.config["url"]).get_entry(id)
|
|
||||||
|
if entry is None:
|
||||||
|
entry = Newsfeed(self.config["url"]).get_entry(id)
|
||||||
|
|
||||||
flags = Message.IS_HTML
|
flags = Message.IS_HTML
|
||||||
if not thread.id in self.storage.get('seen', default=[]):
|
if not thread.id in self.storage.get('seen', default=[]):
|
||||||
flags |= Message.IS_UNREAD
|
flags |= Message.IS_UNREAD
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue