From 629a16f16325b75ce1b860a055b282f6964c61e2 Mon Sep 17 00:00:00 2001 From: chimp1984 Date: Mon, 2 Sep 2019 14:10:54 +0200 Subject: [PATCH 1/2] Change DisputeCommunicationMessage.Type enum To support future mediation chats --- common/src/main/proto/pb.proto | 5 +++-- .../main/java/bisq/core/arbitration/DisputeChatSession.java | 4 ++-- .../arbitration/messages/DisputeCommunicationMessage.java | 3 ++- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/common/src/main/proto/pb.proto b/common/src/main/proto/pb.proto index d5f3d0ee003..7742774b490 100644 --- a/common/src/main/proto/pb.proto +++ b/common/src/main/proto/pb.proto @@ -283,8 +283,9 @@ message PeerOpenedDisputeMessage { message DisputeCommunicationMessage { enum Type { - DISPUTE = 0; - TRADE = 1; + MEDIATION = 0; + ARBITRATION = 1; + TRADE = 2; } int64 date = 1; string trade_id = 2; diff --git a/core/src/main/java/bisq/core/arbitration/DisputeChatSession.java b/core/src/main/java/bisq/core/arbitration/DisputeChatSession.java index 2f943dfc758..faf6a5c6c18 100644 --- a/core/src/main/java/bisq/core/arbitration/DisputeChatSession.java +++ b/core/src/main/java/bisq/core/arbitration/DisputeChatSession.java @@ -50,7 +50,7 @@ public class DisputeChatSession extends ChatSession { public DisputeChatSession(@Nullable Dispute dispute, DisputeManager disputeManager) { - super(DisputeCommunicationMessage.Type.DISPUTE); + super(DisputeCommunicationMessage.Type.MEDIATION); this.dispute = dispute; this.disputeManager = disputeManager; } @@ -136,7 +136,7 @@ public void dispatchMessage(DisputeMessage message) { } else if (message instanceof PeerOpenedDisputeMessage) { disputeManager.onPeerOpenedDisputeMessage((PeerOpenedDisputeMessage) message); } else if (message instanceof DisputeCommunicationMessage) { - if (((DisputeCommunicationMessage) message).getType() != DisputeCommunicationMessage.Type.DISPUTE) { + if (((DisputeCommunicationMessage) message).getType() != DisputeCommunicationMessage.Type.MEDIATION) { log.debug("Ignore non dispute type communication message"); return; } diff --git a/core/src/main/java/bisq/core/arbitration/messages/DisputeCommunicationMessage.java b/core/src/main/java/bisq/core/arbitration/messages/DisputeCommunicationMessage.java index 18a4cca3c83..c198c64f8ec 100644 --- a/core/src/main/java/bisq/core/arbitration/messages/DisputeCommunicationMessage.java +++ b/core/src/main/java/bisq/core/arbitration/messages/DisputeCommunicationMessage.java @@ -61,7 +61,8 @@ public final class DisputeCommunicationMessage extends DisputeMessage { public enum Type { - DISPUTE, + MEDIATION, + ARBITRATION, TRADE; public static DisputeCommunicationMessage.Type fromProto( From 3f885c21e5ae4c5a2ac6a0a6c2a737ded28e97c9 Mon Sep 17 00:00:00 2001 From: chimp1984 Date: Mon, 2 Sep 2019 14:15:15 +0200 Subject: [PATCH 2/2] Use ARBITRATION instead of MEDIATION --- .../main/java/bisq/core/arbitration/DisputeChatSession.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/bisq/core/arbitration/DisputeChatSession.java b/core/src/main/java/bisq/core/arbitration/DisputeChatSession.java index faf6a5c6c18..1f5d7213377 100644 --- a/core/src/main/java/bisq/core/arbitration/DisputeChatSession.java +++ b/core/src/main/java/bisq/core/arbitration/DisputeChatSession.java @@ -50,7 +50,7 @@ public class DisputeChatSession extends ChatSession { public DisputeChatSession(@Nullable Dispute dispute, DisputeManager disputeManager) { - super(DisputeCommunicationMessage.Type.MEDIATION); + super(DisputeCommunicationMessage.Type.ARBITRATION); this.dispute = dispute; this.disputeManager = disputeManager; } @@ -136,7 +136,7 @@ public void dispatchMessage(DisputeMessage message) { } else if (message instanceof PeerOpenedDisputeMessage) { disputeManager.onPeerOpenedDisputeMessage((PeerOpenedDisputeMessage) message); } else if (message instanceof DisputeCommunicationMessage) { - if (((DisputeCommunicationMessage) message).getType() != DisputeCommunicationMessage.Type.MEDIATION) { + if (((DisputeCommunicationMessage) message).getType() != DisputeCommunicationMessage.Type.ARBITRATION) { log.debug("Ignore non dispute type communication message"); return; }