fix typo and raise an error when trying to post a news or telegrams
This commit is contained in:
parent
9e01185b1a
commit
87cd2bebec
1 changed files with 7 additions and 2 deletions
|
|
@ -18,7 +18,7 @@
|
||||||
from __future__ import with_statement
|
from __future__ import with_statement
|
||||||
|
|
||||||
from weboob.tools.backend import BaseBackend
|
from weboob.tools.backend import BaseBackend
|
||||||
from weboob.capabilities.messages import ICapMessages, ICapMessagesPost, Message, Thread
|
from weboob.capabilities.messages import ICapMessages, ICapMessagesPost, Message, Thread, CantSendMessage
|
||||||
|
|
||||||
from .feeds import ArticlesList
|
from .feeds import ArticlesList
|
||||||
from .browser import DLFP
|
from .browser import DLFP
|
||||||
|
|
@ -129,7 +129,12 @@ class DLFPBackend(BaseBackend, ICapMessages, ICapMessagesPost):
|
||||||
self.storage.set('seen', message.thread.id, 'comments', self.storage.get('seen', message.thread.id, 'comments', default=[]) + [message.id])
|
self.storage.set('seen', message.thread.id, 'comments', self.storage.get('seen', message.thread.id, 'comments', default=[]) + [message.id])
|
||||||
self.storage.save()
|
self.storage.save()
|
||||||
|
|
||||||
def post_mesage(self, message):
|
def post_message(self, message):
|
||||||
|
if not message.parent:
|
||||||
|
raise CantSendMessage('Posting news and telegrams on DLFP is not supported yet')
|
||||||
|
|
||||||
|
assert message.thread
|
||||||
|
|
||||||
with self.browser:
|
with self.browser:
|
||||||
return self.browser.post_reply(message.thread.id, message.parent.id, message.title, message.content)
|
return self.browser.post_reply(message.thread.id, message.parent.id, message.title, message.content)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue