You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-11-25 05:23:13 +03:00
Fix whitespace issues
This commit is contained in:
@@ -90,7 +90,7 @@ describe("MatrixClient retrying", function() {
|
|||||||
// wait for the localecho of ev1 to be updated
|
// wait for the localecho of ev1 to be updated
|
||||||
const p3 = new Promise((resolve, reject) => {
|
const p3 = new Promise((resolve, reject) => {
|
||||||
room.on("Room.localEchoUpdated", (ev0) => {
|
room.on("Room.localEchoUpdated", (ev0) => {
|
||||||
if(ev0 === ev1) {
|
if (ev0 === ev1) {
|
||||||
resolve();
|
resolve();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1379,7 +1379,7 @@ describe("Room", function() {
|
|||||||
let hasThrown = false;
|
let hasThrown = false;
|
||||||
try {
|
try {
|
||||||
await room.loadMembersIfNeeded();
|
await room.loadMembersIfNeeded();
|
||||||
} catch(err) {
|
} catch (err) {
|
||||||
hasThrown = true;
|
hasThrown = true;
|
||||||
}
|
}
|
||||||
expect(hasThrown).toEqual(true);
|
expect(hasThrown).toEqual(true);
|
||||||
|
|||||||
@@ -143,7 +143,7 @@ describe("MatrixScheduler", function() {
|
|||||||
deferA.reject({});
|
deferA.reject({});
|
||||||
try {
|
try {
|
||||||
await globalA;
|
await globalA;
|
||||||
} catch(err) {
|
} catch (err) {
|
||||||
await Promise.resolve();
|
await Promise.resolve();
|
||||||
expect(procCount).toEqual(2);
|
expect(procCount).toEqual(2);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ matrixcs.request(function(opts, fn) {
|
|||||||
let indexedDB;
|
let indexedDB;
|
||||||
try {
|
try {
|
||||||
indexedDB = global.indexedDB;
|
indexedDB = global.indexedDB;
|
||||||
} catch(e) {}
|
} catch (e) {}
|
||||||
|
|
||||||
// if our browser (appears to) support indexeddb, use an indexeddb crypto store.
|
// if our browser (appears to) support indexeddb, use an indexeddb crypto store.
|
||||||
if (indexedDB) {
|
if (indexedDB) {
|
||||||
|
|||||||
@@ -1925,7 +1925,7 @@ MatrixClient.prototype._restoreKeyBackup = function(
|
|||||||
let backupPubKey;
|
let backupPubKey;
|
||||||
try {
|
try {
|
||||||
backupPubKey = decryption.init_with_private_key(privKey);
|
backupPubKey = decryption.init_with_private_key(privKey);
|
||||||
} catch(e) {
|
} catch (e) {
|
||||||
decryption.free();
|
decryption.free();
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
@@ -3797,7 +3797,7 @@ MatrixClient.prototype.paginateEventTimeline = function(eventTimeline, opts) {
|
|||||||
return pendingRequest;
|
return pendingRequest;
|
||||||
}
|
}
|
||||||
|
|
||||||
let path, params, promise;
|
let path; let params; let promise;
|
||||||
const self = this;
|
const self = this;
|
||||||
|
|
||||||
if (isNotifTimeline) {
|
if (isNotifTimeline) {
|
||||||
@@ -4217,7 +4217,7 @@ MatrixClient.prototype.getRoomPushRule = function(scope, roomId) {
|
|||||||
*/
|
*/
|
||||||
MatrixClient.prototype.setRoomMutePushRule = function(scope, roomId, mute) {
|
MatrixClient.prototype.setRoomMutePushRule = function(scope, roomId, mute) {
|
||||||
const self = this;
|
const self = this;
|
||||||
let deferred, hasDontNotifyRule;
|
let deferred; let hasDontNotifyRule;
|
||||||
|
|
||||||
// Get the existing room-kind push rule if any
|
// Get the existing room-kind push rule if any
|
||||||
const roomPushRule = this.getRoomPushRule(scope, roomId);
|
const roomPushRule = this.getRoomPushRule(scope, roomId);
|
||||||
|
|||||||
@@ -2374,7 +2374,7 @@ Crypto.prototype.setRoomEncryption = async function(roomId, config, inhibitDevic
|
|||||||
// after all the in-memory state (_roomEncryptors and _roomList) has been updated
|
// after all the in-memory state (_roomEncryptors and _roomList) has been updated
|
||||||
// to avoid races when calling this method multiple times. Hence keep a hold of the promise.
|
// to avoid races when calling this method multiple times. Hence keep a hold of the promise.
|
||||||
let storeConfigPromise = null;
|
let storeConfigPromise = null;
|
||||||
if(!existingConfig) {
|
if (!existingConfig) {
|
||||||
storeConfigPromise = this._roomList.setRoomEncryption(roomId, config);
|
storeConfigPromise = this._roomList.setRoomEncryption(roomId, config);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2407,7 +2407,7 @@ Crypto.prototype.setRoomEncryption = async function(roomId, config, inhibitDevic
|
|||||||
// which is never used (inside riot at least)
|
// which is never used (inside riot at least)
|
||||||
// but didn't want to remove it as it technically would
|
// but didn't want to remove it as it technically would
|
||||||
// be a breaking change.
|
// be a breaking change.
|
||||||
if(!this.inhibitDeviceQuery) {
|
if (!this.inhibitDeviceQuery) {
|
||||||
this._deviceList.refreshOutdatedDeviceLists();
|
this._deviceList.refreshOutdatedDeviceLists();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -131,7 +131,7 @@ export class Backend {
|
|||||||
|
|
||||||
cursorReq.onsuccess = (ev) => {
|
cursorReq.onsuccess = (ev) => {
|
||||||
const cursor = ev.target.result;
|
const cursor = ev.target.result;
|
||||||
if(!cursor) {
|
if (!cursor) {
|
||||||
// no match found
|
// no match found
|
||||||
callback(null);
|
callback(null);
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -430,7 +430,7 @@ export class SAS extends Base {
|
|||||||
try {
|
try {
|
||||||
await this._sendMAC(olmSAS, macMethod);
|
await this._sendMAC(olmSAS, macMethod);
|
||||||
resolve();
|
resolve();
|
||||||
} catch(err) {
|
} catch (err) {
|
||||||
reject(err);
|
reject(err);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -890,7 +890,7 @@ function getResponseContentType(response) {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
return parseContentType(contentType);
|
return parseContentType(contentType);
|
||||||
} catch(e) {
|
} catch (e) {
|
||||||
throw new Error(`Error parsing Content-Type '${contentType}': ${e}`);
|
throw new Error(`Error parsing Content-Type '${contentType}': ${e}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -647,7 +647,7 @@ EventTimelineSet.prototype.compareEventOrdering = function(eventId1, eventId2) {
|
|||||||
if (timeline1 === timeline2) {
|
if (timeline1 === timeline2) {
|
||||||
// both events are in the same timeline - figure out their
|
// both events are in the same timeline - figure out their
|
||||||
// relative indices
|
// relative indices
|
||||||
let idx1, idx2;
|
let idx1; let idx2;
|
||||||
const events = timeline1.getEvents();
|
const events = timeline1.getEvents();
|
||||||
for (let idx = 0; idx < events.length &&
|
for (let idx = 0; idx < events.length &&
|
||||||
(idx1 === undefined || idx2 === undefined); idx++) {
|
(idx1 === undefined || idx2 === undefined); idx++) {
|
||||||
|
|||||||
@@ -286,9 +286,9 @@ RoomMember.prototype.getAvatarUrl =
|
|||||||
* @return {string} the mxc avatar url
|
* @return {string} the mxc avatar url
|
||||||
*/
|
*/
|
||||||
RoomMember.prototype.getMxcAvatarUrl = function() {
|
RoomMember.prototype.getMxcAvatarUrl = function() {
|
||||||
if(this.events.member) {
|
if (this.events.member) {
|
||||||
return this.events.member.getDirectionalContent().avatar_url;
|
return this.events.member.getDirectionalContent().avatar_url;
|
||||||
} else if(this.user) {
|
} else if (this.user) {
|
||||||
return this.user.avatarUrl;
|
return this.user.avatarUrl;
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@@ -673,7 +673,7 @@ RoomState.prototype._maySendEventOfType = function(eventType, userId, state) {
|
|||||||
const userPowerLevel = power_levels.users && power_levels.users[userId];
|
const userPowerLevel = power_levels.users && power_levels.users[userId];
|
||||||
if (Number.isFinite(userPowerLevel)) {
|
if (Number.isFinite(userPowerLevel)) {
|
||||||
powerLevel = userPowerLevel;
|
powerLevel = userPowerLevel;
|
||||||
} else if(Number.isFinite(power_levels.users_default)) {
|
} else if (Number.isFinite(power_levels.users_default)) {
|
||||||
powerLevel = power_levels.users_default;
|
powerLevel = power_levels.users_default;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1904,14 +1904,14 @@ function calculateRoomName(room, userId, ignoreRoomNameEvent) {
|
|||||||
// let's try to figure out who was here before
|
// let's try to figure out who was here before
|
||||||
let leftNames = otherNames;
|
let leftNames = otherNames;
|
||||||
// if we didn't have heroes, try finding them in the room state
|
// if we didn't have heroes, try finding them in the room state
|
||||||
if(!leftNames.length) {
|
if (!leftNames.length) {
|
||||||
leftNames = room.currentState.getMembers().filter((m) => {
|
leftNames = room.currentState.getMembers().filter((m) => {
|
||||||
return m.userId !== userId &&
|
return m.userId !== userId &&
|
||||||
m.membership !== "invite" &&
|
m.membership !== "invite" &&
|
||||||
m.membership !== "join";
|
m.membership !== "join";
|
||||||
}).map((m) => m.name);
|
}).map((m) => m.name);
|
||||||
}
|
}
|
||||||
if(leftNames.length) {
|
if (leftNames.length) {
|
||||||
return `Empty room (was ${memberNamesToRoomName(leftNames)})`;
|
return `Empty room (was ${memberNamesToRoomName(leftNames)})`;
|
||||||
} else {
|
} else {
|
||||||
return "Empty room";
|
return "Empty room";
|
||||||
|
|||||||
@@ -185,8 +185,8 @@ function _runCallbacks() {
|
|||||||
*/
|
*/
|
||||||
function binarySearch(array, func) {
|
function binarySearch(array, func) {
|
||||||
// min is inclusive, max exclusive.
|
// min is inclusive, max exclusive.
|
||||||
let min = 0,
|
let min = 0;
|
||||||
max = array.length;
|
let max = array.length;
|
||||||
|
|
||||||
while (min < max) {
|
while (min < max) {
|
||||||
const mid = (min + max) >> 1;
|
const mid = (min + max) >> 1;
|
||||||
|
|||||||
@@ -701,7 +701,7 @@ SyncApi.prototype._syncFromCache = async function(savedSync) {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
await this._processSyncResponse(syncEventData, data);
|
await this._processSyncResponse(syncEventData, data);
|
||||||
} catch(e) {
|
} catch (e) {
|
||||||
logger.error("Error processing cached sync", e.stack || e);
|
logger.error("Error processing cached sync", e.stack || e);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -774,7 +774,7 @@ SyncApi.prototype._sync = async function(syncOptions) {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
await this._processSyncResponse(syncEventData, data);
|
await this._processSyncResponse(syncEventData, data);
|
||||||
} catch(e) {
|
} catch (e) {
|
||||||
// log the exception with stack if we have it, else fall back
|
// log the exception with stack if we have it, else fall back
|
||||||
// to the plain description
|
// to the plain description
|
||||||
logger.error("Caught /sync error", e.stack || e);
|
logger.error("Caught /sync error", e.stack || e);
|
||||||
@@ -894,7 +894,7 @@ SyncApi.prototype._onSyncError = function(err, syncOptions) {
|
|||||||
logger.error("/sync error %s", err);
|
logger.error("/sync error %s", err);
|
||||||
logger.error(err);
|
logger.error(err);
|
||||||
|
|
||||||
if(this._shouldAbortSync(err)) {
|
if (this._shouldAbortSync(err)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -396,7 +396,7 @@ TimelineWindow.prototype.getEvents = function() {
|
|||||||
// (Note that both this._start.index and this._end.index are relative
|
// (Note that both this._start.index and this._end.index are relative
|
||||||
// to their respective timelines' BaseIndex).
|
// to their respective timelines' BaseIndex).
|
||||||
//
|
//
|
||||||
let startIndex = 0, endIndex = events.length;
|
let startIndex = 0; let endIndex = events.length;
|
||||||
if (timeline === this._start.timeline) {
|
if (timeline === this._start.timeline) {
|
||||||
startIndex = this._start.index + timeline.getBaseIndex();
|
startIndex = this._start.index + timeline.getBaseIndex();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -176,7 +176,7 @@ MatrixCall.prototype.placeScreenSharingCall =
|
|||||||
debuglog("Got screen stream, requesting audio stream...");
|
debuglog("Got screen stream, requesting audio stream...");
|
||||||
const audioConstraints = _getUserMediaVideoContraints('voice');
|
const audioConstraints = _getUserMediaVideoContraints('voice');
|
||||||
_placeCallWithConstraints(self, audioConstraints);
|
_placeCallWithConstraints(self, audioConstraints);
|
||||||
} catch(err) {
|
} catch (err) {
|
||||||
self.emit("error",
|
self.emit("error",
|
||||||
callError(
|
callError(
|
||||||
MatrixCall.ERR_NO_USER_MEDIA,
|
MatrixCall.ERR_NO_USER_MEDIA,
|
||||||
|
|||||||
Reference in New Issue
Block a user