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>pull/21833/head
parent
022e40a127
commit
cf8ff6aed3
|
@ -26,6 +26,9 @@ export default class AccountSettingHandler extends SettingsHandler {
|
||||||
// Special case URL previews
|
// Special case URL previews
|
||||||
if (settingName === "urlPreviewsEnabled") {
|
if (settingName === "urlPreviewsEnabled") {
|
||||||
const content = this._getSettings("org.matrix.preview_urls");
|
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'];
|
return !content['disable'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,6 +25,9 @@ export default class RoomAccountSettingsHandler extends SettingsHandler {
|
||||||
// Special case URL previews
|
// Special case URL previews
|
||||||
if (settingName === "urlPreviewsEnabled") {
|
if (settingName === "urlPreviewsEnabled") {
|
||||||
const content = this._getSettings(roomId, "org.matrix.room.preview_urls");
|
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'];
|
return !content['disable'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,6 +25,9 @@ export default class RoomSettingsHandler extends SettingsHandler {
|
||||||
// Special case URL previews
|
// Special case URL previews
|
||||||
if (settingName === "urlPreviewsEnabled") {
|
if (settingName === "urlPreviewsEnabled") {
|
||||||
const content = this._getSettings(roomId, "org.matrix.room.preview_urls");
|
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'];
|
return !content['disable'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue