mirror of
https://github.com/bisq-network/bisq.git
synced 2024-11-19 01:41:11 +01:00
Add removeMailboxMsg with MailboxMessage as argument
This commit is contained in:
parent
32aeda7468
commit
3875bd85d1
@ -266,11 +266,22 @@ public class MailboxMessageService implements SetupListener, RequestDataManager.
|
||||
* @param decryptedMessageWithPubKey The DecryptedMessageWithPubKey to be removed
|
||||
*/
|
||||
public void removeMailboxMsg(DecryptedMessageWithPubKey decryptedMessageWithPubKey) {
|
||||
NetworkEnvelope networkEnvelope = decryptedMessageWithPubKey.getNetworkEnvelope();
|
||||
if (networkEnvelope instanceof MailboxMessage) {
|
||||
removeMailboxMsg((MailboxMessage) networkEnvelope);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The mailboxMessage has been applied and we remove it from our local storage and from the network.
|
||||
*
|
||||
* @param mailboxMessage The MailboxMessage to be removed
|
||||
*/
|
||||
public void removeMailboxMsg(MailboxMessage mailboxMessage) {
|
||||
if (isBootstrapped) {
|
||||
// We need to delay a bit to not get a ConcurrentModificationException as we might iterate over
|
||||
// mailboxMessageList while getting called.
|
||||
UserThread.execute(() -> {
|
||||
MailboxMessage mailboxMessage = (MailboxMessage) decryptedMessageWithPubKey.getNetworkEnvelope();
|
||||
String uid = mailboxMessage.getUid();
|
||||
|
||||
// We called removeMailboxEntryFromNetwork at processMyMailboxItem,
|
||||
@ -287,7 +298,7 @@ public class MailboxMessageService implements SetupListener, RequestDataManager.
|
||||
});
|
||||
} else {
|
||||
// In case the network was not ready yet we try again later
|
||||
UserThread.runAfter(() -> removeMailboxMsg(decryptedMessageWithPubKey), 30);
|
||||
UserThread.runAfter(() -> removeMailboxMsg(mailboxMessage), 30);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user