From b81a85360c67a5721e59458aeec5d7b9280a290e Mon Sep 17 00:00:00 2001 From: Ragner Magalhaes Date: Tue, 2 Dec 2008 21:19:47 +0000 Subject: [PATCH 1/1] Added remove_account: - Bind for removing an account at libpurple. - New Method , remove_account(self, username, protocol_id). Signed-off-by: Frederico Simas Duarte git-svn-id: https://garage.maemo.org/svn/carman/branches/carman-0.7-beta2/python-purple@1444 596f6dd7-e928-0410-a184-9e12fd12cf7e --- account.pyx | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/account.pyx b/account.pyx index c724094..427d2bd 100644 --- a/account.pyx +++ b/account.pyx @@ -398,6 +398,20 @@ cdef class Account: self.__exists = True return True + + def remove_account(self, username, protocol_id): + """ + Removes as existing account. + + @return True if successful, False if account doesnt exists + """ + who = account.purple_accounts_find(username, protocol_id) + + if who == NULL: + return False + else + account.purple_accounts_remove( who ) + return True def connect(self): """ -- 1.7.9.5