Rename uploadCanvas to a more appropriate removeImageMetadata

Including backwards compatibility
This commit is contained in:
Nachtalb 2021-04-01 18:23:54 +02:00
parent 3a6ac4e5ec
commit 846da41b01
No known key found for this signature in database
GPG Key ID: E48DF13C07055D92
4 changed files with 21 additions and 8 deletions

View File

@ -242,15 +242,14 @@
<div>
<label class="opt">
<input
:checked="$store.state.settings.uploadCanvas"
:checked="$store.state.settings.removeImageMetadata"
type="checkbox"
name="uploadCanvas"
name="removeImageMetadata"
/>
Attempt to remove metadata from images before uploading
<span
class="tooltipped tooltipped-n tooltipped-no-delay"
aria-label="This option renders the image into a canvas element to remove metadata from the image.
This may break orientation if your browser does not support that."
aria-label="This option will removes metadata from images and animated wepb files. This may break the images orientation."
>
<button class="extra-help" />
</span>
@ -359,7 +358,7 @@ This may break orientation if your browser does not support that."
Custom highlights
<span
class="tooltipped tooltipped-n tooltipped-no-delay"
aria-label="If a message contains any of these comma-separated
aria-label="If a message contains any of these comma-separated
expressions, it will trigger a highlight."
>
<button class="extra-help" />
@ -382,8 +381,8 @@ expressions, it will trigger a highlight."
Highlight exceptions
<span
class="tooltipped tooltipped-n tooltipped-no-delay"
aria-label="If a message contains any of these comma-separated
expressions, it will not trigger a highlight even if it contains
aria-label="If a message contains any of these comma-separated
expressions, it will not trigger a highlight even if it contains
your nickname or expressions defined in custom highlights."
>
<button class="extra-help" />

View File

@ -98,7 +98,7 @@ export const config = normalizeConfig({
media: {
default: true,
},
uploadCanvas: {
removeImageMetadata: {
default: true,
},
userStyles: {

View File

@ -86,6 +86,15 @@ function loadFromLocalStorage() {
storedSettings.highlights = storedSettings.highlights.join(", ");
}
// Convert deprecated uploadCanvas to removeImageMetadata
if (
storedSettings.uploadCanvas !== undefined &&
storedSettings.removeImageMetadata === undefined
) {
storedSettings.removeImageMetadata = storedSettings.uploadCanvas;
delete storedSettings.uploadCanvas;
}
return storedSettings;
}

View File

@ -102,6 +102,11 @@ function Client(manager, name, config = {}) {
delete client.config.awayMessage;
}
if (client.config.uploadCanvas) {
client.config.clientSettings.removeImageMetadata = client.config.uploadCanvas;
delete client.config.uploadCanvas;
}
if (client.config.clientSettings.awayMessage) {
client.awayMessage = client.config.clientSettings.awayMessage;
}