Philipp Hörist pushed to branch master at gajim / gajim

Commits:
e7df2d93 by Philipp Hörist at 2017-12-19T21:12:07+01:00
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.

- - - - -


1 changed file:

- gajim/history_sync.py


Changes:

=====================================
gajim/history_sync.py
=====================================
--- 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()
-        archive = app.logger.get_archive_timestamp(own_jid)
 
-        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')
+        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 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)



View it on GitLab: 
https://dev.gajim.org/gajim/gajim/commit/e7df2d93b6bb10cab7ec1558f0782c6709b81fac

---
View it on GitLab: 
https://dev.gajim.org/gajim/gajim/commit/e7df2d93b6bb10cab7ec1558f0782c6709b81fac
You're receiving this email because of your account on dev.gajim.org.
_______________________________________________
Commits mailing list
[email protected]
https://lists.gajim.org/cgi-bin/listinfo/commits

Reply via email to