Show
Ignore:
Timestamp:
05/10/08 23:29:47 (7 months ago)
Author:
js
Message:

Store otr_userstates at the right place and create it the right way.
This fixes the crash when creating a new account, which made Gajim
unusable on systems where it never ran before.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/common/connection.py

    r9602 r9607  
    165165                self.vcard_supported = True 
    166166                self.private_storage_supported = True 
     167 
     168                if gajim.otr_module: 
     169                        self.otr_userstates = gajim.otr_module.otrl_userstate_create() 
     170 
     171                        try: 
     172                                gajim.otr_module.otrl_privkey_read(self.otr_userstates, 
     173                                        os.path.join(gajimpaths.root, 
     174                                        '%s.key' % self.name).encode()) 
     175                        except Exception, e: 
     176                                if hasattr(e, 'os_errno') and e.os_errno == 2: 
     177                                        pass 
     178 
     179                        try: 
     180                                gajim.otr_module.otrl_privkey_read_fingerprints( 
     181                                        self.otr_userstates, os.path.join( 
     182                                        gajimpaths.root, '%s.fpr' % self.name 
     183                                        ).encode(), (add_appdata, a)) 
     184                        except Exception, e: 
     185                                if hasattr(e, 'os_errno') and e.os_errno == 2: 
     186                                        pass 
    167187        # END __init__ 
    168188