From d63c4dbba3df2925e725590a9f1dba1d23ba6b98 Mon Sep 17 00:00:00 2001
From: brtbr <contact@jsmg.de>
Date: Sat, 1 Jun 2024 23:16:41 +0200
Subject: [PATCH] fix: copy to clipboard as plain/text

The default behavior for CopyToClipboard is to choose the output format
text/html. This causes issues when pasting into HTML messages in
Thunderbird. Therefore this commit changes the output format to
text/plain which seems to solve the issue.
---
 ts/Manager/EditRoomDialog.tsx | 2 +-
 ts/Manager/RecordingRow.tsx   | 2 +-
 ts/Manager/RoomRow.tsx        | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/ts/Manager/EditRoomDialog.tsx b/ts/Manager/EditRoomDialog.tsx
index a0b1bde..67c67af 100644
--- a/ts/Manager/EditRoomDialog.tsx
+++ b/ts/Manager/EditRoomDialog.tsx
@@ -89,7 +89,7 @@ const EditRoomDialog: React.FC<Props> = ({ room, restriction, updateProperty, op
 						return <option key={key} value={key}>{label}</option>;
 					})}
 				</select>
-				{(value === Access.Password && room.password) && <CopyToClipboard text={room.password}><input type="text" readOnly={true} className="icon-clippy" value={room.password} /></CopyToClipboard>}
+				{(value === Access.Password && room.password) && <CopyToClipboard text={room.password} options={{format:'text/plain'}}><input type="text" readOnly={true} className="icon-clippy" value={room.password} /></CopyToClipboard>}
 				{descriptions[field] && <em>{descriptions[field]}</em>}
 			</div>
 		);
diff --git a/ts/Manager/RecordingRow.tsx b/ts/Manager/RecordingRow.tsx
index 3b89d0e..f9be4ff 100644
--- a/ts/Manager/RecordingRow.tsx
+++ b/ts/Manager/RecordingRow.tsx
@@ -17,7 +17,7 @@ const RecordingRow: React.FC<Props> = ({recording, deleteRecording, storeRecordi
 				</a>
 			</td>
 			<td className="share icon-col">
-				<CopyToClipboard text={recording.url}>
+				<CopyToClipboard text={recording.url} options={{format:'text/plain'}}>
 					<button className="action-item copy-to-clipboard" title={t('bbb', 'Copy to clipboard')}>
 						<span className="icon icon-clippy icon-visible" ></span>
 					</button>
diff --git a/ts/Manager/RoomRow.tsx b/ts/Manager/RoomRow.tsx
index bc6808a..38979fa 100644
--- a/ts/Manager/RoomRow.tsx
+++ b/ts/Manager/RoomRow.tsx
@@ -198,7 +198,7 @@ const RoomRow: React.FC<Props> = (props) => {
 					</a>
 				</td>
 				<td className="share icon-col">
-					<CopyToClipboard text={api.getRoomUrl(room)}>
+					<CopyToClipboard text={api.getRoomUrl(room)} options={{format:'text/plain'}}>
 						<button className="action-item copy-to-clipboard" title={t('bbb', 'Copy to clipboard')}>
 							<span className="icon icon-clippy icon-visible" ></span>
 						</button>