auto-create per_option config when trying to write in a non-existing one. Fixes #4370
This commit is contained in:
parent
b4e30ff003
commit
feab799c3e
|
@ -1554,10 +1554,6 @@ class ChatControl(ChatControlBase):
|
||||||
ChatControlBase.print_conversation_line(self, msg,
|
ChatControlBase.print_conversation_line(self, msg,
|
||||||
'status', '', None)
|
'status', '', None)
|
||||||
|
|
||||||
gpg_pref = gajim.config.get_per('contacts', self.contact.jid,
|
|
||||||
'gpg_enabled')
|
|
||||||
if gpg_pref is None:
|
|
||||||
gajim.config.add_per('contacts', self.contact.jid)
|
|
||||||
gajim.config.set_per('contacts', self.contact.jid,
|
gajim.config.set_per('contacts', self.contact.jid,
|
||||||
'gpg_enabled', self.gpg_is_active)
|
'gpg_enabled', self.gpg_is_active)
|
||||||
|
|
||||||
|
|
|
@ -578,7 +578,7 @@ class Config:
|
||||||
dict = self.__options_per_key[optname][1]
|
dict = self.__options_per_key[optname][1]
|
||||||
if not dict.has_key(key):
|
if not dict.has_key(key):
|
||||||
# raise RuntimeError, '%s is not a key of %s' % (key, dict)
|
# raise RuntimeError, '%s is not a key of %s' % (key, dict)
|
||||||
return
|
self.add_per(optname, key)
|
||||||
obj = dict[key]
|
obj = dict[key]
|
||||||
if not obj.has_key(subname):
|
if not obj.has_key(subname):
|
||||||
# raise RuntimeError, '%s is not a key of %s' % (subname, obj)
|
# raise RuntimeError, '%s is not a key of %s' % (subname, obj)
|
||||||
|
|
Loading…
Reference in New Issue