Tweak behaviour of setting restricted join rule

This commit is contained in:
Michael Telatynski 2021-07-02 15:18:27 +01:00
parent e8f0412fe3
commit 912e192dc6
4 changed files with 63 additions and 41 deletions

View file

@ -92,12 +92,12 @@ export default class RoomSettingsHandler extends MatrixClientBackedSettingsHandl
if (settingName === "urlPreviewsEnabled") {
const content = this.getSettings(roomId, "org.matrix.room.preview_urls") || {};
content['disable'] = !newValue;
return MatrixClientPeg.get().sendStateEvent(roomId, "org.matrix.room.preview_urls", content);
return MatrixClientPeg.get().sendStateEvent(roomId, "org.matrix.room.preview_urls", content).then();
}
const content = this.getSettings(roomId) || {};
content[settingName] = newValue;
return MatrixClientPeg.get().sendStateEvent(roomId, "im.vector.web.settings", content, "");
return MatrixClientPeg.get().sendStateEvent(roomId, "im.vector.web.settings", content, "").then();
}
public canSetValue(settingName: string, roomId: string): boolean {