comparison sat/plugins/plugin_xep_0384.py @ 2823:11afbbce40d1

plugin XEP-0384: removed _purgeOldData temporary hack, it should not be useful anymore
author Goffi <goffi@goffi.org>
date Fri, 01 Mar 2019 12:17:34 +0100
parents 0ab62dd3cf05
children 88f10630d5ea
comparison
equal deleted inserted replaced
2822:5284be4c601b 2823:11afbbce40d1
536 xmlui.addEmpty() 536 xmlui.addEmpty()
537 537
538 defer.returnValue(xmlui) 538 defer.returnValue(xmlui)
539 539
540 @defer.inlineCallbacks 540 @defer.inlineCallbacks
541 def _purgeOldData(self, client, persistent_dict):
542 # FIXME: temporary method to deal with data change in omemo module
543 # We remove the old data, which is acceptable as
544 # no release of SàT (beside alpha versions) has been done
545 # since this data has been used.
546 # /!\ this method must be removed before 0.7 release /!\
547 log.warning(u"FIXME: Using temporary purgeOldData code, to be removed before 0.7 release.")
548
549 state = yield persistent_dict.get(KEY_STATE)
550 if state and "version" not in state:
551 log.info(u"Old data found, purging it")
552 self.host.memory.storage.delPrivateNamespace("XEP-0384", binary=True,
553 profile=client.profile)
554
555 @defer.inlineCallbacks
556 def profileConnected(self, client): 541 def profileConnected(self, client):
557 client._xep_0384_ready = defer.Deferred() 542 client._xep_0384_ready = defer.Deferred()
558 # we first need to get devices ids (including our own) 543 # we first need to get devices ids (including our own)
559 persistent_dict = persistent.LazyPersistentBinaryDict("XEP-0384", client.profile) 544 persistent_dict = persistent.LazyPersistentBinaryDict("XEP-0384", client.profile)
560 yield self._purgeOldData(client, persistent_dict)
561 # all known devices of profile 545 # all known devices of profile
562 devices = yield self.getDevices(client) 546 devices = yield self.getDevices(client)
563 # and our own device id 547 # and our own device id
564 device_id = yield persistent_dict.get(KEY_DEVICE_ID) 548 device_id = yield persistent_dict.get(KEY_DEVICE_ID)
565 if device_id is None: 549 if device_id is None: