Passing flags to write_im callback
[python-purple] / purple.pyx
index 61cc9f2..3686593 100644 (file)
@@ -331,7 +331,31 @@ cdef class Purple:
                 protocol_id = <char *> account.purple_account_get_protocol_id(acc)
 
                 if username != NULL and protocol_id != NULL:
-                    account_list.append(Account(username, protocol_id, self))
+                    account_list.append(Account(username, \
+                            Protocol(protocol_id), self))
+            iter = iter.next
+
+        return account_list
+
+    def accounts_get_all_active(self):
+        cdef glib.GList *iter
+        cdef account.PurpleAccount *acc
+        cdef char *username
+        cdef char *protocol_id
+
+        iter = account.purple_accounts_get_all_active()
+        account_list = []
+
+        while iter:
+            acc = <account.PurpleAccount *> iter.data
+
+            if <account.PurpleAccount *>acc:
+                username = <char *> account.purple_account_get_username(acc)
+                protocol_id = <char *> account.purple_account_get_protocol_id(acc)
+
+                if username != NULL and protocol_id != NULL:
+                    account_list.append(Account(username, \
+                            Protocol(protocol_id), self))
             iter = iter.next
 
         return account_list