Change struct Callbacks
[python-purple] / purple.pyx
index 00ce7fc..889a509 100644 (file)
@@ -80,6 +80,7 @@ cdef class Purple:
         # adds glib iteration inside ecore main loop
         ecore.timer_add(0.001, self.__glib_iteration_when_idle)
 
+
     def destroy(self):
         core.c_purple_core_quit()
 
@@ -141,14 +142,14 @@ cdef class Purple:
         """ Initializes libpurple """
 
         if callbacks_dict is not None:
-            global account_cbs
+            # global account_cbs
             global blist_cbs
             global connection_cbs
             global conversation_cbs
             global notify_cbs
             global request_cbs
 
-            account_cbs = callbacks_dict["account"]
+            # account_cbs = callbacks_dict["account"]
             blist_cbs = callbacks_dict["blist"]
             connection_cbs = callbacks_dict["connection"]
             conversation_cbs = callbacks_dict["conversation"]
@@ -252,6 +253,10 @@ cdef class Purple:
 
         return ret
 
+    def add_account_cb(self, name, func):
+        global account_cbs
+        account_cbs[name] = func
+
     def connect(self):
         conn = Connection()
         conn.connect()