fix in case get_thread() is called with a numerical ID (and not a Thread instance)
This commit is contained in:
parent
d12877fe55
commit
93a0d25f71
1 changed files with 11 additions and 9 deletions
|
|
@ -92,18 +92,20 @@ class DLFPBackend(BaseBackend, ICapMessages, ICapMessagesPost, ICapContent):
|
||||||
yield thread
|
yield thread
|
||||||
|
|
||||||
def get_thread(self, id, getseen=True):
|
def get_thread(self, id, getseen=True):
|
||||||
if isinstance(id, Thread):
|
if not isinstance(id, Thread):
|
||||||
|
thread = None
|
||||||
|
else:
|
||||||
thread = id
|
thread = id
|
||||||
id = thread.id
|
id = thread.id
|
||||||
else:
|
|
||||||
thread = None
|
|
||||||
|
|
||||||
oldhash = self.storage.get('hash', id, default="")
|
# Check if we have seen all comments of this thread.
|
||||||
newhash = self.browser.get_hash(thread._rsscomment)
|
oldhash = self.storage.get('hash', id, default="")
|
||||||
if not getseen and oldhash == newhash:
|
newhash = self.browser.get_hash(thread._rsscomment)
|
||||||
return None
|
if not getseen and oldhash == newhash:
|
||||||
self.storage.set('hash', id, newhash)
|
return None
|
||||||
self.storage.save()
|
self.storage.set('hash', id, newhash)
|
||||||
|
self.storage.save()
|
||||||
|
|
||||||
with self.browser:
|
with self.browser:
|
||||||
content = self.browser.get_content(id)
|
content = self.browser.get_content(id)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue