From c165d7a633e989df22fbfeac64915aa43bfc70ad Mon Sep 17 00:00:00 2001 From: Paul Schaub Date: Sun, 22 Dec 2019 02:21:19 +0100 Subject: [PATCH] deleteAccount(uuid) --- .../messenger/data/repository/XmppAccountRepository.java | 4 ++-- .../messenger/data/repository/AccountRepository.java | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/data/src/main/java/org/mercury_im/messenger/data/repository/XmppAccountRepository.java b/data/src/main/java/org/mercury_im/messenger/data/repository/XmppAccountRepository.java index 5774bbb..8ef730c 100644 --- a/data/src/main/java/org/mercury_im/messenger/data/repository/XmppAccountRepository.java +++ b/data/src/main/java/org/mercury_im/messenger/data/repository/XmppAccountRepository.java @@ -132,8 +132,8 @@ public class XmppAccountRepository } @Override - public Completable deleteAccount(Account account) { - return dao.delete(account.getId()).ignoreElement() + public Completable deleteAccount(UUID accountId) { + return dao.delete(accountId).ignoreElement() .subscribeOn(subscriberScheduler()) .observeOn(observerScheduler()); } diff --git a/domain/src/main/java/org/mercury_im/messenger/data/repository/AccountRepository.java b/domain/src/main/java/org/mercury_im/messenger/data/repository/AccountRepository.java index 5524d0a..c8c87b0 100644 --- a/domain/src/main/java/org/mercury_im/messenger/data/repository/AccountRepository.java +++ b/domain/src/main/java/org/mercury_im/messenger/data/repository/AccountRepository.java @@ -31,6 +31,10 @@ public interface AccountRepository { Single upsertAccount(Account account); - Completable deleteAccount(Account account); + default Completable deleteAccount(Account account) { + return deleteAccount(account.getId()); + } + + Completable deleteAccount(UUID accountId); }