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.
This commit is contained in:
Philipp Hörist 2017-12-19 21:11:41 +01:00
parent f72608234f
commit e7df2d93b6
1 changed files with 5 additions and 8 deletions

View File

@ -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)