This repository was archived by the owner on Sep 11, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ import EMOJIBASE_REGEX from 'emojibase-regex';
2929import url from 'url' ;
3030
3131import { MatrixClientPeg } from './MatrixClientPeg' ;
32+ import SettingsStore from './settings/SettingsStore' ;
3233import { tryTransformPermalinkToLocalHref } from "./utils/permalinks/Permalinks" ;
3334import { SHORTCODE_TO_EMOJI , getEmojiFromUnicode } from "./emoji" ;
3435import ReplyThread from "./components/views/elements/ReplyThread" ;
@@ -171,7 +172,10 @@ const transformTags: IExtendedSanitizeOptions["transformTags"] = { // custom to
171172 // Strip out imgs that aren't `mxc` here instead of using allowedSchemesByTag
172173 // because transformTags is used _before_ we filter by allowedSchemesByTag and
173174 // we don't want to allow images with `https?` `src`s.
174- if ( ! attribs . src || ! attribs . src . startsWith ( 'mxc://' ) ) {
175+ // We also drop inline images (as if they were not present at all) when the "show
176+ // images" preference is disabled. Future work might expose some UI to reveal them
177+ // like standalone image events have.
178+ if ( ! attribs . src || ! attribs . src . startsWith ( 'mxc://' ) || ! SettingsStore . getValue ( "showImages" ) ) {
175179 return { tagName, attribs : { } } ;
176180 }
177181 attribs . src = MatrixClientPeg . get ( ) . mxcUrlToHttp (
You can’t perform that action at this time.
0 commit comments