From cf5740fbd337eb3c1887922e4a266ddee12ddbd8 Mon Sep 17 00:00:00 2001 From: Romain Bignon Date: Sat, 11 Oct 2014 20:04:20 +0200 Subject: [PATCH] fix order of messages --- modules/playme/module.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/modules/playme/module.py b/modules/playme/module.py index 548972b3..c8087382 100644 --- a/modules/playme/module.py +++ b/modules/playme/module.py @@ -79,7 +79,7 @@ class PlayMeModule(Module, CapMessages, CapMessagesPost, CapDating): 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']]) - parent = None + child = None for msg in self.browser.get_thread_messages(thread.id): flags = 0 @@ -105,14 +105,15 @@ class PlayMeModule(Module, CapMessages, CapMessagesPost, CapDating): date=utc2local(datetime.datetime.fromtimestamp(msg['utc_timestamp'])), content=content, children=[], - parent=parent, + parent=None, signature=signature if msg['from'] != self.browser.my_id else u'', flags=flags) - if parent: - msg.children.append(parent) - parent = msg - thread.root = parent + if child: + msg.children.append(child) + child.parent = msg + child = msg + thread.root = child return thread