X-Git-Url: http://git.maemo.org/git/?p=python-purple;a=blobdiff_plain;f=account.pyx;h=cddbba736d9fc7926f966ad6a27440ca4c606e53;hp=c724094661c1f353b7595958c7640c7ca526a5d0;hb=035d2c65cd6467d6560c010a347577bca26c72eb;hpb=6de6090d402a505f5c9d7a483e0570c8c917fa27 diff --git a/account.pyx b/account.pyx index c724094..cddbba7 100644 --- a/account.pyx +++ b/account.pyx @@ -391,14 +391,25 @@ cdef class Account: if self.__exists: return False else: - # FIXME: Using purple_accounts_add(...) to save to xml - # I think we could improve this .. account.purple_accounts_add(account.purple_account_new( \ self.__username, self.__protocol.id)) self.__exists = True return True + def remove(self): + """ + Removes an existing account. + + @return True if successful, False if account doesn't exists + """ + if self.__exists: + account.purple_accounts_delete(self._get_structure()) + self__exists = False + return True + else: + return False + def connect(self): """ Connects to an account.