Keep first dispute chat msg when clearing sensitive data.

Fixes https://github.com/bisq-network/bisq/pull/6001#issuecomment-1049710029
This commit is contained in:
jmacxx 2022-02-24 11:44:36 -06:00
parent 70752a1ffd
commit f430243b5e
No known key found for this signature in database
GPG Key ID: 155297BABFE94A1B

View File

@ -352,8 +352,10 @@ public final class Dispute implements NetworkPayload, PersistablePayload {
}
public boolean removeAllChatMessages() {
if (chatMessages.size() > 0) {
chatMessages.clear();
if (chatMessages.size() > 1) {
// removes all chat except the initial guidelines message.
String firstMessageUid = chatMessages.get(0).getUid();
chatMessages.removeIf((msg) -> !msg.getUid().equals(firstMessageUid));
return true;
}
return false;