Fixing set_protocol_options(...) to verify key
[python-purple] / account.pyx
index 8973bfe..9af451e 100644 (file)
@@ -283,6 +283,10 @@ cdef class Account:
 
             sett = str(<char *> setting)
 
+            if not po.has_key(sett):
+                iter = iter.next
+                continue
+
             if type == prefs.PURPLE_PREF_STRING:
 
                 str_value = <char *> po[sett]
@@ -387,7 +391,11 @@ cdef class Account:
         if self.__exists:
             return False
         else:
-            account.purple_account_new(self.__username, self.__protocol.id)
+            # FIXME: Using purple_accounts_add(...) to save to xml
+            #   I think we could improve this ..
+            account.purple_accounts_add(account.purple_account_new( \
+                    self.__username, self.__protocol.id))
+
             self.__exists = True
             return True