Add revoke remote wipe method

This commit is contained in:
ameba23
2021-08-31 12:40:24 +02:00
parent 6e67c1dfbf
commit 7119771c6e
2 changed files with 14 additions and 8 deletions

View File

@@ -47,6 +47,8 @@ public interface RemoteWipeManager extends ConversationManager.ConversationClien
boolean amWiper(Transaction txn, ContactId contactId);
boolean isWiper(Transaction txn, ContactId contactId);
void revoke(Transaction txn, ContactId contactId)
throws DbException, FormatException;

View File

@@ -318,16 +318,20 @@ public class RemoteWipeManagerImpl extends ConversationClientImpl
messageTracker.trackOutgoingMessage(txn, m);
}
private boolean isWiper(Transaction txn, ContactId contactId)
throws DbException {
Author author = contactManager.getContact(txn, contactId).getAuthor();
List<Author> currentWipers = getWipers(txn);
for (Author a : currentWipers) {
if (a.getId().equals(author.getId())) {
return true;
public boolean isWiper(Transaction txn, ContactId contactId) {
try {
Author author =
contactManager.getContact(txn, contactId).getAuthor();
List<Author> currentWipers = getWipers(txn);
for (Author a : currentWipers) {
if (a.getId().equals(author.getId())) {
return true;
}
}
return false;
} catch (DbException e) {
return false;
}
return false;
}
public boolean amWiper(Transaction txn, ContactId contactId) {