From 10a0286646116f4933d6156a66aa9578e2938e90 Mon Sep 17 00:00:00 2001 From: Ragner Magalhaes Date: Tue, 2 Dec 2008 21:18:08 +0000 Subject: [PATCH 1/1] Added accounts_get_all_active. FIXES: - Added accounts_get_all_active. Signed-off-by: Bruno Abinader Acked-by: Ragner Magalhaes git-svn-id: https://garage.maemo.org/svn/carman/branches/carman-0.7-beta2/python-purple@1439 596f6dd7-e928-0410-a184-9e12fd12cf7e --- purple.pyx | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/purple.pyx b/purple.pyx index 55e72c9..3686593 100644 --- a/purple.pyx +++ b/purple.pyx @@ -337,6 +337,29 @@ cdef class Purple: 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 + def protocols_get_all(self): cdef glib.GList *iter cdef plugin.PurplePlugin *pp -- 1.7.9.5