mirror of https://github.com/vector-im/riot-web
Merge pull request #8522 from matrix-org/travis/widget-screenshots
Move widget screenshots labs flag to devtoolspull/28217/head
commit
eca8494c66
|
@ -110,7 +110,8 @@ const WidgetContextMenu: React.FC<IProps> = ({
|
||||||
}
|
}
|
||||||
|
|
||||||
let snapshotButton;
|
let snapshotButton;
|
||||||
if (widgetMessaging?.hasCapability(MatrixCapabilities.Screenshots)) {
|
const screenshotsEnabled = SettingsStore.getValue("enableWidgetScreenshots");
|
||||||
|
if (screenshotsEnabled && widgetMessaging?.hasCapability(MatrixCapabilities.Screenshots)) {
|
||||||
const onSnapshotClick = () => {
|
const onSnapshotClick = () => {
|
||||||
widgetMessaging?.takeScreenshot().then(data => {
|
widgetMessaging?.takeScreenshot().then(data => {
|
||||||
dis.dispatch({
|
dis.dispatch({
|
||||||
|
|
|
@ -101,6 +101,7 @@ const DevtoolsDialog: React.FC<IProps> = ({ roomId, onFinished }) => {
|
||||||
<h3>{ _t("Options") }</h3>
|
<h3>{ _t("Options") }</h3>
|
||||||
<SettingsFlag name="developerMode" level={SettingLevel.ACCOUNT} />
|
<SettingsFlag name="developerMode" level={SettingLevel.ACCOUNT} />
|
||||||
<SettingsFlag name="showHiddenEventsInTimeline" level={SettingLevel.DEVICE} />
|
<SettingsFlag name="showHiddenEventsInTimeline" level={SettingLevel.DEVICE} />
|
||||||
|
<SettingsFlag name="enableWidgetScreenshots" level={SettingLevel.ACCOUNT} />
|
||||||
</div>
|
</div>
|
||||||
</BaseTool>;
|
</BaseTool>;
|
||||||
}
|
}
|
||||||
|
|
|
@ -92,14 +92,6 @@ export default class LabsUserSettingsTab extends React.Component<{}, IState> {
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
groups.getOrCreate(LabGroup.Widgets, []).push(
|
|
||||||
<SettingsFlag
|
|
||||||
key="enableWidgetScreenshots"
|
|
||||||
name="enableWidgetScreenshots"
|
|
||||||
level={SettingLevel.ACCOUNT}
|
|
||||||
/>,
|
|
||||||
);
|
|
||||||
|
|
||||||
groups.getOrCreate(LabGroup.Experimental, []).push(
|
groups.getOrCreate(LabGroup.Experimental, []).push(
|
||||||
<SettingsFlag
|
<SettingsFlag
|
||||||
key="lowBandwidth"
|
key="lowBandwidth"
|
||||||
|
|
|
@ -17,7 +17,7 @@ limitations under the License.
|
||||||
|
|
||||||
import * as url from "url";
|
import * as url from "url";
|
||||||
import { base32 } from "rfc4648";
|
import { base32 } from "rfc4648";
|
||||||
import { Capability, IWidget, IWidgetData, MatrixCapabilities } from "matrix-widget-api";
|
import { IWidget, IWidgetData } from "matrix-widget-api";
|
||||||
import { Room } from "matrix-js-sdk/src/models/room";
|
import { Room } from "matrix-js-sdk/src/models/room";
|
||||||
import { MatrixEvent } from "matrix-js-sdk/src/models/event";
|
import { MatrixEvent } from "matrix-js-sdk/src/models/event";
|
||||||
import { logger } from "matrix-js-sdk/src/logger";
|
import { logger } from "matrix-js-sdk/src/logger";
|
||||||
|
@ -496,21 +496,6 @@ export default class WidgetUtils {
|
||||||
return app as IApp;
|
return app as IApp;
|
||||||
}
|
}
|
||||||
|
|
||||||
static getCapWhitelistForAppTypeInRoomId(appType: string, roomId: string): Capability[] {
|
|
||||||
const enableScreenshots = SettingsStore.getValue("enableWidgetScreenshots", roomId);
|
|
||||||
|
|
||||||
const capWhitelist = enableScreenshots ? [MatrixCapabilities.Screenshots] : [];
|
|
||||||
|
|
||||||
// Obviously anyone that can add a widget can claim it's a jitsi widget,
|
|
||||||
// so this doesn't really offer much over the set of domains we load
|
|
||||||
// widgets from at all, but it probably makes sense for sanity.
|
|
||||||
if (WidgetType.JITSI.matches(appType)) {
|
|
||||||
capWhitelist.push(MatrixCapabilities.AlwaysOnScreen);
|
|
||||||
}
|
|
||||||
|
|
||||||
return capWhitelist;
|
|
||||||
}
|
|
||||||
|
|
||||||
static getLocalJitsiWrapperUrl(opts: {forLocalRender?: boolean, auth?: string} = {}) {
|
static getLocalJitsiWrapperUrl(opts: {forLocalRender?: boolean, auth?: string} = {}) {
|
||||||
// NB. we can't just encodeURIComponent all of these because the $ signs need to be there
|
// NB. we can't just encodeURIComponent all of these because the $ signs need to be there
|
||||||
const queryStringParts = [
|
const queryStringParts = [
|
||||||
|
|
Loading…
Reference in New Issue