X-Git-Url: https://git.nmode.ca/signal-cli/blobdiff_plain/55dde93811ac137741b49d3fab2483e689592038..22add1cbee357e988ca9c85d9d161fc783fd5fa3:/lib/src/main/java/org/asamk/signal/manager/AccountFileUpdaterImpl.java diff --git a/lib/src/main/java/org/asamk/signal/manager/AccountFileUpdaterImpl.java b/lib/src/main/java/org/asamk/signal/manager/AccountFileUpdaterImpl.java new file mode 100644 index 00000000..af0008c3 --- /dev/null +++ b/lib/src/main/java/org/asamk/signal/manager/AccountFileUpdaterImpl.java @@ -0,0 +1,26 @@ +package org.asamk.signal.manager; + +import org.asamk.signal.manager.helper.AccountFileUpdater; +import org.asamk.signal.manager.storage.accounts.AccountsStore; +import org.whispersystems.signalservice.api.push.ACI; + +class AccountFileUpdaterImpl implements AccountFileUpdater { + + private final AccountsStore accountsStore; + private final String accountPath; + + public AccountFileUpdaterImpl(final AccountsStore accountsStore, final String accountPath) { + this.accountsStore = accountsStore; + this.accountPath = accountPath; + } + + @Override + public void updateAccountIdentifiers(final String newNumber, final ACI newAci) { + accountsStore.updateAccount(accountPath, newNumber, newAci); + } + + @Override + public void removeAccount() { + accountsStore.removeAccount(accountPath); + } +}