fix order of messages
This commit is contained in:
parent
c16bfd7dc8
commit
cf5740fbd3
1 changed files with 7 additions and 6 deletions
|
|
@ -79,7 +79,7 @@ class PlayMeModule(Module, CapMessages, CapMessagesPost, CapDating):
|
||||||
signature += u'\nLast online: %s' % user['last_online']
|
signature += u'\nLast online: %s' % user['last_online']
|
||||||
signature += u'\nPhotos:\n\t%s' % '\n\t'.join([user['photo_host'] + photo['large'] for photo in user['photos']])
|
signature += u'\nPhotos:\n\t%s' % '\n\t'.join([user['photo_host'] + photo['large'] for photo in user['photos']])
|
||||||
|
|
||||||
parent = None
|
child = None
|
||||||
|
|
||||||
for msg in self.browser.get_thread_messages(thread.id):
|
for msg in self.browser.get_thread_messages(thread.id):
|
||||||
flags = 0
|
flags = 0
|
||||||
|
|
@ -105,14 +105,15 @@ class PlayMeModule(Module, CapMessages, CapMessagesPost, CapDating):
|
||||||
date=utc2local(datetime.datetime.fromtimestamp(msg['utc_timestamp'])),
|
date=utc2local(datetime.datetime.fromtimestamp(msg['utc_timestamp'])),
|
||||||
content=content,
|
content=content,
|
||||||
children=[],
|
children=[],
|
||||||
parent=parent,
|
parent=None,
|
||||||
signature=signature if msg['from'] != self.browser.my_id else u'',
|
signature=signature if msg['from'] != self.browser.my_id else u'',
|
||||||
flags=flags)
|
flags=flags)
|
||||||
|
|
||||||
if parent:
|
if child:
|
||||||
msg.children.append(parent)
|
msg.children.append(child)
|
||||||
parent = msg
|
child.parent = msg
|
||||||
thread.root = parent
|
child = msg
|
||||||
|
thread.root = child
|
||||||
|
|
||||||
return thread
|
return thread
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue