Merge branches 'develop' and 't3chguy/app_load4' of github.com:matrix-org/matrix-react-sdk into t3chguy/app_load4
Conflicts: src/components/structures/MatrixChat.tsx
This commit is contained in:
commit
9c916cc544
90 changed files with 2032 additions and 445 deletions
|
@ -7,7 +7,7 @@ interface Client {
|
|||
isCrossSigningVerified: () => boolean
|
||||
wasCrossSigningVerified: () => boolean
|
||||
};
|
||||
getStoredDevicesForUser: (userId: string) => Promise<[{ deviceId: string }]>;
|
||||
getStoredDevicesForUser: (userId: string) => [{ deviceId: string }];
|
||||
checkDeviceTrust: (userId: string, deviceId: string) => {
|
||||
isVerified: () => boolean
|
||||
}
|
||||
|
@ -45,7 +45,7 @@ export async function shieldStatusForRoom(client: Client, room: Room): Promise<s
|
|||
(members.length === 1); // Do alarm for self if we're alone in a room
|
||||
const targets = includeUser ? [...verified, client.getUserId()] : verified;
|
||||
for (const userId of targets) {
|
||||
const devices = await client.getStoredDevicesForUser(userId);
|
||||
const devices = client.getStoredDevicesForUser(userId);
|
||||
const anyDeviceNotVerified = devices.some(({deviceId}) => {
|
||||
return !client.checkDeviceTrust(userId, deviceId).isVerified();
|
||||
});
|
||||
|
|
|
@ -72,6 +72,7 @@ export default class WidgetUtils {
|
|||
return room.currentState.maySendStateEvent('im.vector.modular.widgets', me);
|
||||
}
|
||||
|
||||
// TODO: Generify the name of this function. It's not just scalar.
|
||||
/**
|
||||
* Returns true if specified url is a scalar URL, typically https://scalar.vector.im/api
|
||||
* @param {[type]} testUrlString URL to check
|
||||
|
@ -210,9 +211,9 @@ export default class WidgetUtils {
|
|||
});
|
||||
}
|
||||
|
||||
static setUserWidget(widgetId, widgetType, widgetUrl, widgetName, widgetData) {
|
||||
static setUserWidget(widgetId, widgetType: WidgetType, widgetUrl, widgetName, widgetData) {
|
||||
const content = {
|
||||
type: widgetType,
|
||||
type: widgetType.preferred,
|
||||
url: widgetUrl,
|
||||
name: widgetName,
|
||||
data: widgetData,
|
||||
|
@ -369,7 +370,7 @@ export default class WidgetUtils {
|
|||
static addIntegrationManagerWidget(name: string, uiUrl: string, apiUrl: string) {
|
||||
return WidgetUtils.setUserWidget(
|
||||
"integration_manager_" + (new Date().getTime()),
|
||||
"m.integration_manager",
|
||||
WidgetType.INTEGRATION_MANAGER,
|
||||
uiUrl,
|
||||
"Integration Manager: " + name,
|
||||
{"api_url": apiUrl},
|
||||
|
|
20
src/utils/rem.js
Normal file
20
src/utils/rem.js
Normal file
|
@ -0,0 +1,20 @@
|
|||
/*
|
||||
Copyright 2020 The Matrix.org Foundation C.I.C.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// converts a pixel value to rem.
|
||||
export default function(pixelVal) {
|
||||
return pixelVal / 15 + "rem";
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue