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 amWiper(Transaction txn, ContactId contactId);
boolean isWiper(Transaction txn, ContactId contactId);
void revoke(Transaction txn, ContactId contactId) void revoke(Transaction txn, ContactId contactId)
throws DbException, FormatException; throws DbException, FormatException;

View File

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