From 4c3dc0b092223a05a5540bfafeefe9c9eba2b656 Mon Sep 17 00:00:00 2001 From: js Date: Sat, 10 May 2008 23:42:29 +0000 Subject: [PATCH] That still was the wrong place, it was initialized too early. Fixed. --- src/common/connection.py | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/src/common/connection.py b/src/common/connection.py index ab3c337de..2652e2e07 100644 --- a/src/common/connection.py +++ b/src/common/connection.py @@ -167,19 +167,6 @@ class Connection(ConnectionHandlers): if gajim.otr_module: self.otr_userstates = gajim.otr_module.otrl_userstate_create() - - try: - gajim.otr_module.otrl_privkey_read(self.otr_userstates, - os.path.join(gajim.gajimpaths.root, - '%s.key' % self.name).encode()) - gajim.otr_module.otrl_privkey_read_fingerprints( - self.otr_userstates, os.path.join( - gajim.gajimpaths.root, '%s.fpr' % - self.name).encode(), - (gajim.otr_add_appdata, self.name)) - except Exception, e: - if not hasattr(e, 'os_errno') or e.os_errno != 2: - raise # END __init__ def put_event(self, ev): @@ -912,6 +899,20 @@ class Connection(ConnectionHandlers): self.on_connect_auth = self._init_roster self.connect_and_auth() + if gajim.otr_module: + try: + gajim.otr_module.otrl_privkey_read(self.otr_userstates, + os.path.join(gajim.gajimpaths.root, + '%s.key' % self.name).encode()) + gajim.otr_module.otrl_privkey_read_fingerprints( + self.otr_userstates, os.path.join( + gajim.gajimpaths.root, '%s.fpr' % + self.name).encode(), + (gajim.otr_add_appdata, self.name)) + except Exception, e: + if not hasattr(e, 'os_errno') or e.os_errno != 2: + raise + def _init_roster(self, con): self.connection = con if not self.connection: