mirror of
https://github.com/element-hq/element-web
synced 2024-11-25 02:35:48 +03:00
Validate that URL previews are explicitly enabled/disabled
Otherwise `!null` ends up being "true", therefore forcing URL previews on for everyone. Fixes https://github.com/vector-im/riot-web/issues/5607 Signed-off-by: Travis Ralston <travpc@gmail.com>
This commit is contained in:
parent
022e40a127
commit
cf8ff6aed3
3 changed files with 9 additions and 0 deletions
|
@ -26,6 +26,9 @@ export default class AccountSettingHandler extends SettingsHandler {
|
|||
// Special case URL previews
|
||||
if (settingName === "urlPreviewsEnabled") {
|
||||
const content = this._getSettings("org.matrix.preview_urls");
|
||||
|
||||
// Check to make sure that we actually got a boolean
|
||||
if (typeof(content['disable']) !== "boolean") return null;
|
||||
return !content['disable'];
|
||||
}
|
||||
|
||||
|
|
|
@ -25,6 +25,9 @@ export default class RoomAccountSettingsHandler extends SettingsHandler {
|
|||
// Special case URL previews
|
||||
if (settingName === "urlPreviewsEnabled") {
|
||||
const content = this._getSettings(roomId, "org.matrix.room.preview_urls");
|
||||
|
||||
// Check to make sure that we actually got a boolean
|
||||
if (typeof(content['disable']) !== "boolean") return null;
|
||||
return !content['disable'];
|
||||
}
|
||||
|
||||
|
|
|
@ -25,6 +25,9 @@ export default class RoomSettingsHandler extends SettingsHandler {
|
|||
// Special case URL previews
|
||||
if (settingName === "urlPreviewsEnabled") {
|
||||
const content = this._getSettings(roomId, "org.matrix.room.preview_urls");
|
||||
|
||||
// Check to make sure that we actually got a boolean
|
||||
if (typeof(content['disable']) !== "boolean") return null;
|
||||
return !content['disable'];
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue