mirror of
https://github.com/bisq-network/bisq.git
synced 2025-03-04 03:03:48 +01:00
Bugfix: dispute ticket reopened by mailbox message
This commit is contained in:
parent
4893be23cd
commit
cb1998db05
1 changed files with 6 additions and 2 deletions
|
@ -35,6 +35,8 @@ import javax.inject.Singleton;
|
||||||
import javafx.collections.ListChangeListener;
|
import javafx.collections.ListChangeListener;
|
||||||
import javafx.collections.ObservableList;
|
import javafx.collections.ObservableList;
|
||||||
|
|
||||||
|
import java.util.Comparator;
|
||||||
|
import java.util.Optional;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
@ -119,10 +121,12 @@ public class DisputeMsgEvents {
|
||||||
// We check at every new message if it might be a message sent after the dispute had been closed. If that is the
|
// We check at every new message if it might be a message sent after the dispute had been closed. If that is the
|
||||||
// case we revert the isClosed flag so that the UI can reopen the dispute and indicate that a new dispute
|
// case we revert the isClosed flag so that the UI can reopen the dispute and indicate that a new dispute
|
||||||
// message arrived.
|
// message arrived.
|
||||||
ObservableList<ChatMessage> chatMessages = dispute.getChatMessages();
|
Optional<ChatMessage> newestChatMessage = dispute.getChatMessages().stream().
|
||||||
|
sorted(Comparator.comparingLong(ChatMessage::getDate).reversed()).findFirst();
|
||||||
// If last message is not a result message we re-open as we might have received a new message from the
|
// If last message is not a result message we re-open as we might have received a new message from the
|
||||||
// trader/mediator/arbitrator who has reopened the case
|
// trader/mediator/arbitrator who has reopened the case
|
||||||
if (dispute.isClosed() && !chatMessages.isEmpty() && !chatMessages.get(chatMessages.size() - 1).isResultMessage(dispute)) {
|
if (dispute.isClosed() && newestChatMessage.isPresent() && !newestChatMessage.get().isResultMessage(dispute)) {
|
||||||
|
log.info("Reopening dispute {} due to new chat message received {}", dispute.getTradeId(), newestChatMessage.get().getUid());
|
||||||
dispute.reOpen();
|
dispute.reOpen();
|
||||||
if (dispute.getSupportType() == SupportType.MEDIATION) {
|
if (dispute.getSupportType() == SupportType.MEDIATION) {
|
||||||
mediationManager.requestPersistence();
|
mediationManager.requestPersistence();
|
||||||
|
|
Loading…
Add table
Reference in a new issue