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,16 +318,20 @@ 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 =
List<Author> currentWipers = getWipers(txn); contactManager.getContact(txn, contactId).getAuthor();
for (Author a : currentWipers) { List<Author> currentWipers = getWipers(txn);
if (a.getId().equals(author.getId())) { for (Author a : currentWipers) {
return true; if (a.getId().equals(author.getId())) {
return true;
}
} }
return false;
} catch (DbException e) {
return false;
} }
return false;
} }
public boolean amWiper(Transaction txn, ContactId contactId) { public boolean amWiper(Transaction txn, ContactId contactId) {