From cf0e642122b728ca9f1a7de8c63b54b913b84976 Mon Sep 17 00:00:00 2001 From: delvh Date: Sat, 18 Jul 2020 09:48:08 +0200 Subject: [PATCH] Fixed bug not copying attachment when using copy and send --- .../src/main/java/envoy/client/ui/controller/ChatScene.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/client/src/main/java/envoy/client/ui/controller/ChatScene.java b/client/src/main/java/envoy/client/ui/controller/ChatScene.java index 83e64fe..d598d4e 100644 --- a/client/src/main/java/envoy/client/ui/controller/ChatScene.java +++ b/client/src/main/java/envoy/client/ui/controller/ChatScene.java @@ -560,9 +560,14 @@ public final class ChatScene implements Restorable { private void copyAndPostMessage() { final var messageText = messageTextArea.getText(); Toolkit.getDefaultToolkit().getSystemClipboard().setContents(new StringSelection(messageText), null); + final var image = attachmentView.getImage(); + final var messageAttachment = pendingAttachment; postMessage(); messageTextArea.setText(messageText); updateRemainingCharsLabel(); postButton.setDisable(messageText.isBlank()); + attachmentView.setImage(image); + if (attachmentView.getImage() != null) attachmentView.setVisible(true); + pendingAttachment = messageAttachment; } }