X-Git-Url: http://git.maemo.org/git/?p=python-purple;a=blobdiff_plain;f=purple.pyx;h=36865933c0d361916a909d4c704a925349ae7595;hp=61cc9f22d5ea8558861781c4f4d9cd0877fa9458;hb=83612fdb793155a5c800a226f8a719b04dfd41ab;hpb=c69c87b25d72312cca3709a82f38cd5c8fe2592b diff --git a/purple.pyx b/purple.pyx index 61cc9f2..3686593 100644 --- a/purple.pyx +++ b/purple.pyx @@ -331,7 +331,31 @@ cdef class Purple: protocol_id = 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 = iter.data + + if acc: + username = account.purple_account_get_username(acc) + protocol_id = 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