From 5e0f7219c5dc23a0798ee57198a2f10ac40e9825 Mon Sep 17 00:00:00 2001 From: ameba23 Date: Thu, 24 Feb 2022 13:12:03 +0100 Subject: [PATCH] return number of confirm messages sent --- .../remotewipe/RemoteWipeManagerImpl.java | 34 ++----------------- 1 file changed, 2 insertions(+), 32 deletions(-) diff --git a/briar-core/src/main/java/org/briarproject/briar/remotewipe/RemoteWipeManagerImpl.java b/briar-core/src/main/java/org/briarproject/briar/remotewipe/RemoteWipeManagerImpl.java index 2ef216ba8..0d2c514f9 100644 --- a/briar-core/src/main/java/org/briarproject/briar/remotewipe/RemoteWipeManagerImpl.java +++ b/briar-core/src/main/java/org/briarproject/briar/remotewipe/RemoteWipeManagerImpl.java @@ -327,33 +327,14 @@ public class RemoteWipeManagerImpl extends ConversationClientImpl messageTracker.trackOutgoingMessage(txn, m); } - public void sendConfirmMessages(Transaction txn) + public int sendConfirmMessages(Transaction txn) throws DbException, FormatException { List wipers = getWiperContactIds(txn); for (ContactId c : wipers) { Contact contact = contactManager.getContact(txn, c); sendConfirmMessage(txn, contact); } - -// boolean allSent = true; -// do { -// for (MessageId confirmMessage: confirmMessages) { -// if (db.getMessageState(txn, confirmMessage) == PENDING) allSent = false; -// } -// if (!allSent) { -// try { -// Thread.sleep(100); -// } catch (InterruptedException e) { -// allSent = true; -// } -// } -// } while(allSent == false); - } - - public void sleep() { - try { - Thread.sleep(5000); - } catch (InterruptedException ignored) {} + return wipers.size(); } private void sendConfirmMessage(Transaction txn, Contact contact) @@ -373,17 +354,6 @@ public class RemoteWipeManagerImpl extends ConversationClientImpl ); clientHelper.addLocalMessage(txn, m, meta, true, false); messageTracker.trackOutgoingMessage(txn, m); - - // Find the id of this message -// List messageIds = (List) db.getMessageIds(txn, g); -// Message newestMsg = null; -// for (MessageId id : messageIds) { -// Message msg = db.getMessage(txn, id); -// if (newestMsg == null || msg.getTimestamp() > newestMsg.getTimestamp()) { -// newestMsg = msg; -// } -// } -// return newestMsg.getId(); } public void wipe(Transaction txn, Contact contact)