From e7df2d93b6bb10cab7ec1558f0782c6709b81fac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20H=C3=B6rist?= Date: Tue, 19 Dec 2017 21:11:41 +0100 Subject: [PATCH] HistorySync: Fix first time sync Fixes #8810 Also remove mam_start_date migration. mam_start_date didnt exist in Gajim 0.16.x and it doesnt hurt if people who used the dev version download some extra messages. Our deduplication algorithm should take care of it. --- gajim/history_sync.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/gajim/history_sync.py b/gajim/history_sync.py index 248339e55..c8f47aff2 100644 --- a/gajim/history_sync.py +++ b/gajim/history_sync.py @@ -58,16 +58,13 @@ class HistorySyncAssistant(Gtk.Assistant): self.event_id = id(self) own_jid = self.con.get_own_jid().getStripped() + + mam_start = ArchiveState.NEVER archive = app.logger.get_archive_timestamp(own_jid) + if archive is not None and archive.oldest_mam_timestamp is not None: + mam_start = int(float(archive.oldest_mam_timestamp)) - if archive is not None: - mam_start = float(archive.oldest_mam_timestamp) - else: - # Migration from old config value - mam_start = app.config.get_per( - 'accounts', account, 'mam_start_date') - - if not mam_start or mam_start == ArchiveState.NEVER: + if mam_start == ArchiveState.NEVER: self.current_start = self.now elif mam_start == ArchiveState.ALL: self.current_start = datetime.utcfromtimestamp(0)