mirror of
https://github.com/bisq-network/bisq.git
synced 2024-11-19 18:03:12 +01:00
Pass trade if available and use peers keyring
This commit is contained in:
parent
0e7dd21745
commit
d7a95fed03
@ -104,7 +104,7 @@ public class PeerInfoIcon extends Group {
|
||||
role,
|
||||
numTrades,
|
||||
privateNotificationManager,
|
||||
null,
|
||||
trade.getOffer(),
|
||||
trade,
|
||||
preferences,
|
||||
accountAgeWitnessService,
|
||||
@ -246,7 +246,7 @@ public class PeerInfoIcon extends Group {
|
||||
|
||||
getChildren().addAll(outerBackground, innerBackground, avatarImageView, tagPane, numTradesPane);
|
||||
|
||||
addMouseListener(numTrades, privateNotificationManager, offer, preferences, useDevPrivilegeKeys,
|
||||
addMouseListener(numTrades, privateNotificationManager, trade, offer, preferences, useDevPrivilegeKeys,
|
||||
isFiatCurrency, accountAge, signAge, peersAccount.third, peersAccount.fourth, peersAccount.fifth);
|
||||
}
|
||||
|
||||
@ -297,6 +297,7 @@ public class PeerInfoIcon extends Group {
|
||||
|
||||
protected void addMouseListener(int numTrades,
|
||||
PrivateNotificationManager privateNotificationManager,
|
||||
@Nullable Trade trade,
|
||||
Offer offer,
|
||||
Preferences preferences,
|
||||
boolean useDevPrivilegeKeys,
|
||||
@ -319,7 +320,7 @@ public class PeerInfoIcon extends Group {
|
||||
Res.get("peerInfo.unknownAge") :
|
||||
null;
|
||||
|
||||
setOnMouseClicked(e -> new PeerInfoWithTagEditor(privateNotificationManager, offer, preferences, useDevPrivilegeKeys)
|
||||
setOnMouseClicked(e -> new PeerInfoWithTagEditor(privateNotificationManager, trade, offer, preferences, useDevPrivilegeKeys)
|
||||
.fullAddress(fullAddress)
|
||||
.numTrades(numTrades)
|
||||
.accountAge(accountAgeFormatted)
|
||||
|
@ -3,13 +3,17 @@ package bisq.desktop.components;
|
||||
import bisq.core.account.witness.AccountAgeWitnessService;
|
||||
import bisq.core.alert.PrivateNotificationManager;
|
||||
import bisq.core.offer.Offer;
|
||||
import bisq.core.trade.Trade;
|
||||
import bisq.core.user.Preferences;
|
||||
|
||||
import bisq.network.p2p.NodeAddress;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public class PeerInfoIconSmall extends PeerInfoIcon {
|
||||
public PeerInfoIconSmall(NodeAddress nodeAddress,
|
||||
String role, Offer offer,
|
||||
String role,
|
||||
Offer offer,
|
||||
Preferences preferences,
|
||||
AccountAgeWitnessService accountAgeWitnessService,
|
||||
boolean useDevPrivilegeKeys) {
|
||||
@ -32,6 +36,7 @@ public class PeerInfoIconSmall extends PeerInfoIcon {
|
||||
@Override
|
||||
protected void addMouseListener(int numTrades,
|
||||
PrivateNotificationManager privateNotificationManager,
|
||||
@Nullable Trade trade,
|
||||
Offer offer,
|
||||
Preferences preferences,
|
||||
boolean useDevPrivilegeKeys,
|
||||
|
@ -25,6 +25,7 @@ import bisq.core.alert.PrivateNotificationManager;
|
||||
import bisq.core.locale.GlobalSettings;
|
||||
import bisq.core.locale.Res;
|
||||
import bisq.core.offer.Offer;
|
||||
import bisq.core.trade.Trade;
|
||||
import bisq.core.user.Preferences;
|
||||
|
||||
import bisq.common.UserThread;
|
||||
@ -85,6 +86,8 @@ public class PeerInfoWithTagEditor extends Overlay<PeerInfoWithTagEditor> {
|
||||
private int numTrades;
|
||||
private ChangeListener<Boolean> focusListener;
|
||||
private final PrivateNotificationManager privateNotificationManager;
|
||||
@Nullable
|
||||
private final Trade trade;
|
||||
private final Offer offer;
|
||||
private final Preferences preferences;
|
||||
private EventHandler<KeyEvent> keyEventEventHandler;
|
||||
@ -99,10 +102,12 @@ public class PeerInfoWithTagEditor extends Overlay<PeerInfoWithTagEditor> {
|
||||
private String signAgeInfo;
|
||||
|
||||
public PeerInfoWithTagEditor(PrivateNotificationManager privateNotificationManager,
|
||||
@Nullable Trade trade,
|
||||
Offer offer,
|
||||
Preferences preferences,
|
||||
boolean useDevPrivilegeKeys) {
|
||||
this.privateNotificationManager = privateNotificationManager;
|
||||
this.trade = trade;
|
||||
this.offer = offer;
|
||||
this.preferences = preferences;
|
||||
this.useDevPrivilegeKeys = useDevPrivilegeKeys;
|
||||
@ -244,13 +249,20 @@ public class PeerInfoWithTagEditor extends Overlay<PeerInfoWithTagEditor> {
|
||||
// otherwise the text input handler does not work.
|
||||
doClose();
|
||||
UserThread.runAfter(() -> {
|
||||
//TODO only taker could send msg as maker would use its own key from offer....
|
||||
new SendPrivateNotificationWindow(
|
||||
privateNotificationManager,
|
||||
offer.getPubKeyRing(),
|
||||
offer.getMakerNodeAddress(),
|
||||
useDevPrivilegeKeys
|
||||
).show();
|
||||
PubKeyRing peersPubKeyRing = null;
|
||||
if (trade != null) {
|
||||
peersPubKeyRing = trade.getProcessModel().getTradingPeer().getPubKeyRing();
|
||||
} else if (offer != null) {
|
||||
peersPubKeyRing = offer.getPubKeyRing();
|
||||
}
|
||||
if (peersPubKeyRing != null) {
|
||||
new SendPrivateNotificationWindow(
|
||||
privateNotificationManager,
|
||||
peersPubKeyRing,
|
||||
offer.getMakerNodeAddress(),
|
||||
useDevPrivilegeKeys
|
||||
).show();
|
||||
}
|
||||
}, 100, TimeUnit.MILLISECONDS);
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user