Merge branch 'develop' into gsouquet/message-bubbles-4635
This commit is contained in:
commit
06c9a060b4
171 changed files with 3649 additions and 2694 deletions
|
@ -820,7 +820,7 @@ export const SETTINGS: {[setting: string]: ISetting} = {
|
|||
[UIFeature.IdentityServer]: {
|
||||
supportedLevels: LEVELS_UI_FEATURE,
|
||||
default: true,
|
||||
// Identity Server (Discovery) Settings make no sense if 3PIDs in general are hidden
|
||||
// Identity server (discovery) settings make no sense if 3PIDs in general are hidden
|
||||
controller: new UIFeatureController(UIFeature.ThirdPartyID),
|
||||
},
|
||||
[UIFeature.ThirdPartyID]: {
|
||||
|
|
|
@ -123,12 +123,13 @@ export default class AccountSettingsHandler extends MatrixClientBackedSettingsHa
|
|||
return preferredValue;
|
||||
}
|
||||
|
||||
public setValue(settingName: string, roomId: string, newValue: any): Promise<void> {
|
||||
public async setValue(settingName: string, roomId: string, newValue: any): Promise<void> {
|
||||
// Special case URL previews
|
||||
if (settingName === "urlPreviewsEnabled") {
|
||||
const content = this.getSettings("org.matrix.preview_urls") || {};
|
||||
content['disable'] = !newValue;
|
||||
return MatrixClientPeg.get().setAccountData("org.matrix.preview_urls", content);
|
||||
await MatrixClientPeg.get().setAccountData("org.matrix.preview_urls", content);
|
||||
return;
|
||||
}
|
||||
|
||||
// Special case for breadcrumbs
|
||||
|
@ -141,26 +142,29 @@ export default class AccountSettingsHandler extends MatrixClientBackedSettingsHa
|
|||
if (!content) content = {}; // If we still don't have content, make some
|
||||
|
||||
content['recent_rooms'] = newValue;
|
||||
return MatrixClientPeg.get().setAccountData(BREADCRUMBS_EVENT_TYPE, content);
|
||||
await MatrixClientPeg.get().setAccountData(BREADCRUMBS_EVENT_TYPE, content);
|
||||
return;
|
||||
}
|
||||
|
||||
// Special case recent emoji
|
||||
if (settingName === "recent_emoji") {
|
||||
const content = this.getSettings(RECENT_EMOJI_EVENT_TYPE) || {};
|
||||
content["recent_emoji"] = newValue;
|
||||
return MatrixClientPeg.get().setAccountData(RECENT_EMOJI_EVENT_TYPE, content);
|
||||
await MatrixClientPeg.get().setAccountData(RECENT_EMOJI_EVENT_TYPE, content);
|
||||
return;
|
||||
}
|
||||
|
||||
// Special case integration manager provisioning
|
||||
if (settingName === "integrationProvisioning") {
|
||||
const content = this.getSettings(INTEG_PROVISIONING_EVENT_TYPE) || {};
|
||||
content['enabled'] = newValue;
|
||||
return MatrixClientPeg.get().setAccountData(INTEG_PROVISIONING_EVENT_TYPE, content);
|
||||
await MatrixClientPeg.get().setAccountData(INTEG_PROVISIONING_EVENT_TYPE, content);
|
||||
return;
|
||||
}
|
||||
|
||||
const content = this.getSettings() || {};
|
||||
content[settingName] = newValue;
|
||||
return MatrixClientPeg.get().setAccountData("im.vector.web.settings", content);
|
||||
await MatrixClientPeg.get().setAccountData("im.vector.web.settings", content);
|
||||
}
|
||||
|
||||
public canSetValue(settingName: string, roomId: string): boolean {
|
||||
|
|
|
@ -86,22 +86,24 @@ export default class RoomAccountSettingsHandler extends MatrixClientBackedSettin
|
|||
return settings[settingName];
|
||||
}
|
||||
|
||||
public setValue(settingName: string, roomId: string, newValue: any): Promise<void> {
|
||||
public async setValue(settingName: string, roomId: string, newValue: any): Promise<void> {
|
||||
// Special case URL previews
|
||||
if (settingName === "urlPreviewsEnabled") {
|
||||
const content = this.getSettings(roomId, "org.matrix.room.preview_urls") || {};
|
||||
content['disable'] = !newValue;
|
||||
return MatrixClientPeg.get().setRoomAccountData(roomId, "org.matrix.room.preview_urls", content);
|
||||
await MatrixClientPeg.get().setRoomAccountData(roomId, "org.matrix.room.preview_urls", content);
|
||||
return;
|
||||
}
|
||||
|
||||
// Special case allowed widgets
|
||||
if (settingName === "allowedWidgets") {
|
||||
return MatrixClientPeg.get().setRoomAccountData(roomId, ALLOWED_WIDGETS_EVENT_TYPE, newValue);
|
||||
await MatrixClientPeg.get().setRoomAccountData(roomId, ALLOWED_WIDGETS_EVENT_TYPE, newValue);
|
||||
return;
|
||||
}
|
||||
|
||||
const content = this.getSettings(roomId) || {};
|
||||
content[settingName] = newValue;
|
||||
return MatrixClientPeg.get().setRoomAccountData(roomId, "im.vector.web.settings", content);
|
||||
await MatrixClientPeg.get().setRoomAccountData(roomId, "im.vector.web.settings", content);
|
||||
}
|
||||
|
||||
public canSetValue(settingName: string, roomId: string): boolean {
|
||||
|
|
|
@ -87,17 +87,18 @@ export default class RoomSettingsHandler extends MatrixClientBackedSettingsHandl
|
|||
return settings[settingName];
|
||||
}
|
||||
|
||||
public setValue(settingName: string, roomId: string, newValue: any): Promise<void> {
|
||||
public async setValue(settingName: string, roomId: string, newValue: any): Promise<void> {
|
||||
// Special case URL previews
|
||||
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);
|
||||
await MatrixClientPeg.get().sendStateEvent(roomId, "org.matrix.room.preview_urls", content);
|
||||
return;
|
||||
}
|
||||
|
||||
const content = this.getSettings(roomId) || {};
|
||||
content[settingName] = newValue;
|
||||
return MatrixClientPeg.get().sendStateEvent(roomId, "im.vector.web.settings", content, "");
|
||||
await MatrixClientPeg.get().sendStateEvent(roomId, "im.vector.web.settings", content, "");
|
||||
}
|
||||
|
||||
public canSetValue(settingName: string, roomId: string): boolean {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue