monboob wants an utc date...

This commit is contained in:
Romain Bignon 2014-10-12 01:42:21 +02:00
commit 44190f3f29

View file

@ -24,6 +24,7 @@ from weboob.capabilities.messages import CapMessages, CapMessagesPost, Thread, M
from weboob.capabilities.dating import CapDating
from weboob.tools.backend import Module, BackendConfig
from weboob.tools.value import Value, ValueBackendPassword
from weboob.tools.date import local2utc
from .browser import PlayMeBrowser, FacebookBrowser
@ -61,7 +62,7 @@ class PlayMeModule(Module, CapMessages, CapMessagesPost, CapDating):
t = Thread(thread['id'])
t.flags = Thread.IS_DISCUSSION
t.title = u'Discussion with %s' % thread['name']
t.date = datetime.datetime.fromtimestamp(thread['last_message']['utc_timestamp'])
t.date = local2utc(datetime.datetime.fromtimestamp(thread['last_message']['utc_timestamp']))
yield t
def get_thread(self, thread):
@ -101,7 +102,7 @@ class PlayMeModule(Module, CapMessages, CapMessagesPost, CapDating):
title=thread.title,
sender=unicode(self.browser.my_name if msg['from'] == self.browser.my_id else user['name']),
receivers=[unicode(self.browser.my_name if msg['from'] != self.browser.my_id else user['name'])],
date=datetime.datetime.fromtimestamp(msg['utc_timestamp']),
date=local2utc(datetime.datetime.fromtimestamp(msg['utc_timestamp'])),
content=content,
children=[],
parent=None,