From 3fb8e2b204eaaa8f359d7561bee8ec8ee1cffe31 Mon Sep 17 00:00:00 2001 From: Cadence Ember Date: Sat, 9 Sep 2023 01:26:35 +1200 Subject: [PATCH] Switch from m.content_warning to town.robin.msc3725.content_warning --- src/ContentMessages.ts | 2 +- src/components/views/messages/MImageBody.tsx | 2 +- src/components/views/messages/MVideoBody.tsx | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ContentMessages.ts b/src/ContentMessages.ts index 444bcc48dac..f8fbcdfeff7 100644 --- a/src/ContentMessages.ts +++ b/src/ContentMessages.ts @@ -498,7 +498,7 @@ export default class ContentMessages { // Attach content warning if (contentWarning) { - content["m.content_warning"] = { + content["town.robin.msc3725.content_warning"] = { type: "m.spoiler" // Since the UI checkbox is labelled "Spoiler" } } diff --git a/src/components/views/messages/MImageBody.tsx b/src/components/views/messages/MImageBody.tsx index 92477ec2bfe..78640a453af 100644 --- a/src/components/views/messages/MImageBody.tsx +++ b/src/components/views/messages/MImageBody.tsx @@ -83,7 +83,7 @@ export default class MImageBody extends React.Component { imgError: false, imgLoaded: false, hover: false, - showImage: SettingsStore.getValue("showImages") && !this.props.mxEvent.getContent()["m.content_warning"], + showImage: SettingsStore.getValue("showImages") && !this.props.mxEvent.getContent()["town.robin.msc3725.content_warning"], placeholder: Placeholder.NoImage, }; } diff --git a/src/components/views/messages/MVideoBody.tsx b/src/components/views/messages/MVideoBody.tsx index a99018f2ae4..e08cae1bd83 100644 --- a/src/components/views/messages/MVideoBody.tsx +++ b/src/components/views/messages/MVideoBody.tsx @@ -177,7 +177,7 @@ export default class MVideoBody extends React.PureComponent decryptedUrl: `data:${mimetype},`, decryptedThumbnailUrl: thumbnailUrl || `data:${mimetype},`, decryptedBlob: null, - showVideo: !content?.["m.content_warning"], + showVideo: !content?.["town.robin.msc3725.content_warning"], }); } } catch (err) { @@ -190,7 +190,7 @@ export default class MVideoBody extends React.PureComponent } else { // not encrypted const content = this.props.mxEvent.getContent(); this.setState({ - showVideo: !content?.["m.content_warning"], + showVideo: !content?.["town.robin.msc3725.content_warning"], }) } }