1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-26 17:03:12 +03:00

Merge branch 'develop' into feed

This commit is contained in:
Šimon Brandner
2021-04-07 19:14:17 +02:00
2 changed files with 20 additions and 4 deletions

View File

@@ -1330,12 +1330,14 @@ Crypto.prototype.checkOwnCrossSigningTrust = async function({
const seenPubkey = newCrossSigning.getId();
const masterChanged = this._crossSigningInfo.getId() !== seenPubkey;
const masterExistsNotLocallyCached =
newCrossSigning.getId() && !crossSigningPrivateKeys.has("master");
if (masterChanged) {
logger.info("Got new master public key", seenPubkey);
}
if (
allowPrivateKeyRequests &&
(masterChanged || !crossSigningPrivateKeys.has("master"))
(masterChanged || masterExistsNotLocallyCached)
) {
logger.info("Attempting to retrieve cross-signing master private key");
let signing = null;
@@ -1362,6 +1364,15 @@ Crypto.prototype.checkOwnCrossSigningTrust = async function({
const selfSigningChanged = oldSelfSigningId !== newCrossSigning.getId("self_signing");
const userSigningChanged = oldUserSigningId !== newCrossSigning.getId("user_signing");
const selfSigningExistsNotLocallyCached = (
newCrossSigning.getId("self_signing") &&
!crossSigningPrivateKeys.has("self_signing")
);
const userSigningExistsNotLocallyCached = (
newCrossSigning.getId("user_signing") &&
!crossSigningPrivateKeys.has("user_signing")
);
const keySignatures = {};
if (selfSigningChanged) {
@@ -1369,7 +1380,7 @@ Crypto.prototype.checkOwnCrossSigningTrust = async function({
}
if (
allowPrivateKeyRequests &&
(selfSigningChanged || !crossSigningPrivateKeys.has("self_signing"))
(selfSigningChanged || selfSigningExistsNotLocallyCached)
) {
logger.info("Attempting to retrieve cross-signing self-signing private key");
let signing = null;
@@ -1394,7 +1405,7 @@ Crypto.prototype.checkOwnCrossSigningTrust = async function({
}
if (
allowPrivateKeyRequests &&
(userSigningChanged || !crossSigningPrivateKeys.has("user_signing"))
(userSigningChanged || userSigningExistsNotLocallyCached)
) {
logger.info("Attempting to retrieve cross-signing user-signing private key");
let signing = null;

View File

@@ -367,7 +367,11 @@ export class MatrixCall extends EventEmitter {
this.checkForErrorListener();
try {
const screenshareConstraints = await getScreenshareContraints(selectDesktopCapturerSource);
if (!screenshareConstraints) return;
if (!screenshareConstraints) {
this.terminate(CallParty.Local, CallErrorCode.NoUserMedia, false);
return;
}
if (window.electron?.getDesktopCapturerSources) {
// We are using Electron
logger.debug("Getting screen stream using getUserMedia()...");
@@ -388,6 +392,7 @@ export class MatrixCall extends EventEmitter {
"Failed to get screen-sharing stream: ", err,
),
);
this.terminate(CallParty.Local, CallErrorCode.NoUserMedia, false);
}
this.type = CallType.Video;
}