comparison sat/plugins/plugin_sec_otr.py @ 2812:ba2e03ee7c4f

plugin OTR: do profile session init in profileConnecting, so it is done before receiving any stanza
author Goffi <goffi@goffi.org>
date Mon, 25 Feb 2019 08:07:00 +0100
parents a26b1ad2d3a4
children 7ab8684784c6
comparison
equal deleted inserted replaced
2811:a26b1ad2d3a4 2812:ba2e03ee7c4f
366 # for message received, profile wide hook may be need, but client 366 # for message received, profile wide hook may be need, but client
367 # should be used anyway instead of a class attribute 367 # should be used anyway instead of a class attribute
368 self.skipped_profiles.add(profile) 368 self.skipped_profiles.add(profile)
369 369
370 @defer.inlineCallbacks 370 @defer.inlineCallbacks
371 def profileConnected(self, client): 371 def profileConnecting(self, client):
372 if client.profile in self.skipped_profiles: 372 if client.profile in self.skipped_profiles:
373 return 373 return
374 ctxMng = client._otr_context_manager = ContextManager(self, client) 374 ctxMng = client._otr_context_manager = ContextManager(self, client)
375 client._otr_data = persistent.PersistentBinaryDict(NS_OTR, client.profile) 375 client._otr_data = persistent.PersistentBinaryDict(NS_OTR, client.profile)
376 yield client._otr_data.load() 376 yield client._otr_data.load()