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
Apply new linting rules
This commit is contained in:
@@ -133,7 +133,6 @@ TestClient.prototype.expectDeviceKeyUpload = function() {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If one-time keys have already been uploaded, return them. Otherwise,
|
* If one-time keys have already been uploaded, return them. Otherwise,
|
||||||
* set up an expectation that the keys will be uploaded, and wait for
|
* set up an expectation that the keys will be uploaded, and wait for
|
||||||
@@ -197,7 +196,6 @@ TestClient.prototype.expectKeyQuery = function(response) {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* get the uploaded curve25519 device key
|
* get the uploaded curve25519 device key
|
||||||
*
|
*
|
||||||
@@ -208,7 +206,6 @@ TestClient.prototype.getDeviceKey = function() {
|
|||||||
return this.deviceKeys.keys[keyId];
|
return this.deviceKeys.keys[keyId];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* get the uploaded ed25519 device key
|
* get the uploaded ed25519 device key
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -67,7 +67,6 @@ function getSyncResponse(roomMembers) {
|
|||||||
return syncResponse;
|
return syncResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
describe("DeviceList management:", function() {
|
describe("DeviceList management:", function() {
|
||||||
if (!global.Olm) {
|
if (!global.Olm) {
|
||||||
logger.warn('not running deviceList tests: Olm not present');
|
logger.warn('not running deviceList tests: Olm not present');
|
||||||
@@ -137,7 +136,6 @@ describe("DeviceList management:", function() {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
it("We should not get confused by out-of-order device query responses",
|
it("We should not get confused by out-of-order device query responses",
|
||||||
() => {
|
() => {
|
||||||
// https://github.com/vector-im/element-web/issues/3126
|
// https://github.com/vector-im/element-web/issues/3126
|
||||||
@@ -323,7 +321,6 @@ describe("DeviceList management:", function() {
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
await aliceTestClient.flushSync();
|
await aliceTestClient.flushSync();
|
||||||
await aliceTestClient.client._crypto._deviceList.saveIfDirty();
|
await aliceTestClient.client._crypto._deviceList.saveIfDirty();
|
||||||
|
|
||||||
|
|||||||
@@ -145,7 +145,6 @@ function expectAliClaimKeys() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function aliDownloadsKeys() {
|
function aliDownloadsKeys() {
|
||||||
// can't query keys before bob has uploaded them
|
// can't query keys before bob has uploaded them
|
||||||
expect(bobTestClient.getSigningKey()).toBeTruthy();
|
expect(bobTestClient.getSigningKey()).toBeTruthy();
|
||||||
@@ -358,7 +357,6 @@ function recvMessage(httpBackend, client, sender, message) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Send an initial sync response to the client (which just includes the member
|
* Send an initial sync response to the client (which just includes the member
|
||||||
* list for our test room).
|
* list for our test room).
|
||||||
@@ -396,7 +394,6 @@ function firstSync(testClient) {
|
|||||||
return testClient.flushSync();
|
return testClient.flushSync();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
describe("MatrixClient crypto", function() {
|
describe("MatrixClient crypto", function() {
|
||||||
if (!CRYPTO_ENABLED) {
|
if (!CRYPTO_ENABLED) {
|
||||||
return;
|
return;
|
||||||
@@ -534,7 +531,6 @@ describe("MatrixClient crypto", function() {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
it("Bob starts his client and uploads device keys and one-time keys", function() {
|
it("Bob starts his client and uploads device keys and one-time keys", function() {
|
||||||
return Promise.resolve()
|
return Promise.resolve()
|
||||||
.then(() => bobTestClient.start())
|
.then(() => bobTestClient.start())
|
||||||
|
|||||||
@@ -141,7 +141,6 @@ describe("getEventTimeline support", function() {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
it("scrollback should be able to scroll back to before a gappy /sync",
|
it("scrollback should be able to scroll back to before a gappy /sync",
|
||||||
function() {
|
function() {
|
||||||
// need a client with timelineSupport disabled to make this work
|
// need a client with timelineSupport disabled to make this work
|
||||||
@@ -532,7 +531,6 @@ describe("MatrixClient event timelines", function() {
|
|||||||
]);
|
]);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
it("should allow you to paginate forwards", function() {
|
it("should allow you to paginate forwards", function() {
|
||||||
const room = client.getRoom(roomId);
|
const room = client.getRoom(roomId);
|
||||||
const timelineSet = room.getTimelineSets()[0];
|
const timelineSet = room.getTimelineSets()[0];
|
||||||
@@ -680,7 +678,6 @@ describe("MatrixClient event timelines", function() {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
it("should handle gappy syncs after redactions", function() {
|
it("should handle gappy syncs after redactions", function() {
|
||||||
// https://github.com/vector-im/vector-web/issues/1389
|
// https://github.com/vector-im/vector-web/issues/1389
|
||||||
|
|
||||||
|
|||||||
@@ -285,7 +285,6 @@ describe("MatrixClient", function() {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
describe("downloadKeys", function() {
|
describe("downloadKeys", function() {
|
||||||
if (!CRYPTO_ENABLED) {
|
if (!CRYPTO_ENABLED) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ import * as utils from "../test-utils";
|
|||||||
import { EventStatus } from "../../src/models/event";
|
import { EventStatus } from "../../src/models/event";
|
||||||
import { TestClient } from "../TestClient";
|
import { TestClient } from "../TestClient";
|
||||||
|
|
||||||
|
|
||||||
describe("MatrixClient room timelines", function() {
|
describe("MatrixClient room timelines", function() {
|
||||||
let client = null;
|
let client = null;
|
||||||
let httpBackend = null;
|
let httpBackend = null;
|
||||||
|
|||||||
@@ -122,7 +122,6 @@ describe("MatrixClient syncing", function() {
|
|||||||
resolveInvitesToProfiles: true,
|
resolveInvitesToProfiles: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
return Promise.all([
|
return Promise.all([
|
||||||
httpBackend.flushAllExpected(),
|
httpBackend.flushAllExpected(),
|
||||||
awaitSyncEvent(),
|
awaitSyncEvent(),
|
||||||
|
|||||||
@@ -197,7 +197,6 @@ function getSyncResponse(roomMembers) {
|
|||||||
return syncResponse;
|
return syncResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
describe("megolm", function() {
|
describe("megolm", function() {
|
||||||
if (!global.Olm) {
|
if (!global.Olm) {
|
||||||
logger.warn('not running megolm tests: Olm not present');
|
logger.warn('not running megolm tests: Olm not present');
|
||||||
@@ -841,7 +840,6 @@ describe("megolm", function() {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
it('Alice should wait for device list to complete when sending a megolm message',
|
it('Alice should wait for device list to complete when sending a megolm message',
|
||||||
function() {
|
function() {
|
||||||
let downloadPromise;
|
let downloadPromise;
|
||||||
@@ -887,7 +885,6 @@ describe("megolm", function() {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
it("Alice exports megolm keys and imports them to a new device", function() {
|
it("Alice exports megolm keys and imports them to a new device", function() {
|
||||||
let messageEncrypted;
|
let messageEncrypted;
|
||||||
|
|
||||||
|
|||||||
@@ -177,7 +177,6 @@ export function mkMessage(opts) {
|
|||||||
return mkEvent(opts);
|
return mkEvent(opts);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A mock implementation of webstorage
|
* A mock implementation of webstorage
|
||||||
*
|
*
|
||||||
@@ -204,7 +203,6 @@ MockStorageApi.prototype = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If an event is being decrypted, wait for it to finish being decrypted.
|
* If an event is being decrypted, wait for it to finish being decrypted.
|
||||||
*
|
*
|
||||||
@@ -226,7 +224,6 @@ export function awaitDecryption(event) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
export function HttpResponse(
|
export function HttpResponse(
|
||||||
httpLookups, acceptKeepalives, ignoreUnhandledSync,
|
httpLookups, acceptKeepalives, ignoreUnhandledSync,
|
||||||
) {
|
) {
|
||||||
|
|||||||
@@ -50,7 +50,6 @@ describe("MegolmDecryption", function() {
|
|||||||
roomId: ROOM_ID,
|
roomId: ROOM_ID,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
// we stub out the olm encryption bits
|
// we stub out the olm encryption bits
|
||||||
mockOlmLib = {};
|
mockOlmLib = {};
|
||||||
mockOlmLib.ensureOlmSessionsForDevices = jest.fn();
|
mockOlmLib.ensureOlmSessionsForDevices = jest.fn();
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import { IndexedDBCryptoStore } from '../../../src/crypto/store/indexeddb-crypto-store';
|
import { IndexedDBCryptoStore } from '../../../src/crypto/store/indexeddb-crypto-store';
|
||||||
|
|
||||||
|
|
||||||
// needs to be phased out and replaced with bootstrapSecretStorage,
|
// needs to be phased out and replaced with bootstrapSecretStorage,
|
||||||
// but that is doing too much extra stuff for it to be an easy transition.
|
// but that is doing too much extra stuff for it to be an easy transition.
|
||||||
export async function resetCrossSigningKeys(client, {
|
export async function resetCrossSigningKeys(client, {
|
||||||
|
|||||||
@@ -94,7 +94,6 @@ describe("EventTimeline", function() {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
describe("neighbouringTimelines", function() {
|
describe("neighbouringTimelines", function() {
|
||||||
it("neighbouring timelines should start null", function() {
|
it("neighbouring timelines should start null", function() {
|
||||||
expect(timeline.getNeighbouringTimeline(EventTimeline.BACKWARDS)).toBe(null);
|
expect(timeline.getNeighbouringTimeline(EventTimeline.BACKWARDS)).toBe(null);
|
||||||
@@ -278,7 +277,6 @@ describe("EventTimeline", function() {
|
|||||||
not.toHaveBeenCalled();
|
not.toHaveBeenCalled();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
it("should call setStateEvents on the right RoomState with the right " +
|
it("should call setStateEvents on the right RoomState with the right " +
|
||||||
"forwardLooking value for old events", function() {
|
"forwardLooking value for old events", function() {
|
||||||
const events = [
|
const events = [
|
||||||
|
|||||||
@@ -1267,7 +1267,6 @@ describe("Room", function() {
|
|||||||
expect(callCount).toEqual(1);
|
expect(callCount).toEqual(1);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
it("should remove cancelled events from the timeline", function() {
|
it("should remove cancelled events from the timeline", function() {
|
||||||
const room = new Room(roomId, null, userA);
|
const room = new Room(roomId, null, userA);
|
||||||
const eventA = utils.mkMessage({
|
const eventA = utils.mkMessage({
|
||||||
|
|||||||
@@ -46,7 +46,6 @@ function addEventsToTimeline(timeline, numEvents, atStart) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* create a pair of linked timelines
|
* create a pair of linked timelines
|
||||||
*/
|
*/
|
||||||
@@ -58,7 +57,6 @@ function createLinkedTimelines() {
|
|||||||
return [tl1, tl2];
|
return [tl1, tl2];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
describe("TimelineIndex", function() {
|
describe("TimelineIndex", function() {
|
||||||
describe("minIndex", function() {
|
describe("minIndex", function() {
|
||||||
it("should return the min index relative to BaseIndex", function() {
|
it("should return the min index relative to BaseIndex", function() {
|
||||||
@@ -133,7 +131,6 @@ describe("TimelineIndex", function() {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
describe("TimelineWindow", function() {
|
describe("TimelineWindow", function() {
|
||||||
/**
|
/**
|
||||||
* create a dummy eventTimelineSet and client, and a TimelineWindow
|
* create a dummy eventTimelineSet and client, and a TimelineWindow
|
||||||
@@ -385,7 +382,6 @@ describe("TimelineWindow", function() {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
it("should make backward pagination requests", function() {
|
it("should make backward pagination requests", function() {
|
||||||
const timeline = createTimeline();
|
const timeline = createTimeline();
|
||||||
timeline.setPaginationToken("toktok", EventTimeline.BACKWARDS);
|
timeline.setPaginationToken("toktok", EventTimeline.BACKWARDS);
|
||||||
|
|||||||
@@ -223,7 +223,6 @@ describe("utils", function() {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
describe("extend", function() {
|
describe("extend", function() {
|
||||||
const SOURCE = { "prop2": 1, "string2": "x", "newprop": "new" };
|
const SOURCE = { "prop2": 1, "string2": "x", "newprop": "new" };
|
||||||
|
|
||||||
|
|||||||
@@ -158,7 +158,6 @@ MatrixBaseApis.prototype.makeTxnId = function() {
|
|||||||
return "m" + new Date().getTime() + "." + (this._txnCtr++);
|
return "m" + new Date().getTime() + "." + (this._txnCtr++);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// Registration/Login operations
|
// Registration/Login operations
|
||||||
// =============================
|
// =============================
|
||||||
|
|
||||||
@@ -401,7 +400,6 @@ MatrixBaseApis.prototype.loginWithToken = function(token, callback) {
|
|||||||
}, callback);
|
}, callback);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Logs out the current session.
|
* Logs out the current session.
|
||||||
* Obviously, further calls that require authorisation should fail after this
|
* Obviously, further calls that require authorisation should fail after this
|
||||||
@@ -613,7 +611,6 @@ MatrixBaseApis.prototype.upgradeRoom = function(roomId, newVersion) {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string} groupId
|
* @param {string} groupId
|
||||||
* @return {Promise} Resolves: Group summary object
|
* @return {Promise} Resolves: Group summary object
|
||||||
@@ -1278,7 +1275,6 @@ MatrixBaseApis.prototype.searchUserDirectory = function(opts) {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// Media operations
|
// Media operations
|
||||||
// ================
|
// ================
|
||||||
|
|
||||||
@@ -1347,7 +1343,6 @@ MatrixBaseApis.prototype.getCurrentUploads = function() {
|
|||||||
return this._http.getCurrentUploads();
|
return this._http.getCurrentUploads();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// Profile operations
|
// Profile operations
|
||||||
// ==================
|
// ==================
|
||||||
|
|
||||||
@@ -1372,7 +1367,6 @@ MatrixBaseApis.prototype.getProfileInfo = function(userId, info, callback) {
|
|||||||
return this._http.authedRequest(callback, "GET", path);
|
return this._http.authedRequest(callback, "GET", path);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// Account operations
|
// Account operations
|
||||||
// ==================
|
// ==================
|
||||||
|
|
||||||
@@ -1518,7 +1512,6 @@ MatrixBaseApis.prototype.setPassword = function(authDict, newPassword, callback)
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// Device operations
|
// Device operations
|
||||||
// =================
|
// =================
|
||||||
|
|
||||||
@@ -1605,7 +1598,6 @@ MatrixBaseApis.prototype.deleteMultipleDevices = function(devices, auth) {
|
|||||||
return this._http.authedRequest(undefined, "POST", path, undefined, body);
|
return this._http.authedRequest(undefined, "POST", path, undefined, body);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// Push operations
|
// Push operations
|
||||||
// ===============
|
// ===============
|
||||||
|
|
||||||
@@ -1728,7 +1720,6 @@ MatrixBaseApis.prototype.setPushRuleActions = function(scope, kind,
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// Search
|
// Search
|
||||||
// ======
|
// ======
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ See the License for the specific language governing permissions and
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is an internal module. See {@link MatrixClient} for the public class.
|
* This is an internal module. See {@link MatrixClient} for the public class.
|
||||||
* @module client
|
* @module client
|
||||||
@@ -702,7 +701,6 @@ MatrixClient.prototype.getDeviceId = function() {
|
|||||||
return this.deviceId;
|
return this.deviceId;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if the runtime environment supports VoIP calling.
|
* Check if the runtime environment supports VoIP calling.
|
||||||
* @return {boolean} True if VoIP is supported.
|
* @return {boolean} True if VoIP is supported.
|
||||||
@@ -965,14 +963,12 @@ MatrixClient.prototype.initCrypto = async function() {
|
|||||||
|
|
||||||
this.olmVersion = Crypto.getOlmVersion();
|
this.olmVersion = Crypto.getOlmVersion();
|
||||||
|
|
||||||
|
|
||||||
// if crypto initialisation was successful, tell it to attach its event
|
// if crypto initialisation was successful, tell it to attach its event
|
||||||
// handlers.
|
// handlers.
|
||||||
crypto.registerEventHandlers(this);
|
crypto.registerEventHandlers(this);
|
||||||
this._crypto = crypto;
|
this._crypto = crypto;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Is end-to-end crypto enabled for this client.
|
* Is end-to-end crypto enabled for this client.
|
||||||
* @return {boolean} True if end-to-end is enabled.
|
* @return {boolean} True if end-to-end is enabled.
|
||||||
@@ -2878,7 +2874,6 @@ MatrixClient.prototype._sendCompleteEvent = function(roomId, eventObject, txnId,
|
|||||||
return _sendEvent(this, room, localEvent, callback);
|
return _sendEvent(this, room, localEvent, callback);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// encrypts the event if necessary
|
// encrypts the event if necessary
|
||||||
// adds the event to the queue, or sends it
|
// adds the event to the queue, or sends it
|
||||||
// marks the event as sent/unsent
|
// marks the event as sent/unsent
|
||||||
@@ -4562,7 +4557,6 @@ MatrixClient.prototype._requestTokenFromEndpoint = async function(endpoint, para
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// Push operations
|
// Push operations
|
||||||
// ===============
|
// ===============
|
||||||
|
|
||||||
@@ -4818,7 +4812,6 @@ MatrixClient.prototype._processRoomEventsSearch = function(searchResults, respon
|
|||||||
return searchResults;
|
return searchResults;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Populate the store with rooms the user has left.
|
* Populate the store with rooms the user has left.
|
||||||
* @return {Promise} Resolves: TODO - Resolved when the rooms have
|
* @return {Promise} Resolves: TODO - Resolved when the rooms have
|
||||||
@@ -4964,7 +4957,6 @@ MatrixClient.prototype.getOrCreateFilter = async function(filterName, filter) {
|
|||||||
return createdFilter.filterId;
|
return createdFilter.filterId;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets a bearer token from the Home Server that the user can
|
* Gets a bearer token from the Home Server that the user can
|
||||||
* present to a third party in order to prove their ownership
|
* present to a third party in order to prove their ownership
|
||||||
@@ -4982,7 +4974,6 @@ MatrixClient.prototype.getOpenIdToken = function() {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// VoIP operations
|
// VoIP operations
|
||||||
// ===============
|
// ===============
|
||||||
|
|
||||||
@@ -5143,7 +5134,6 @@ MatrixClient.prototype.deactivateSynapseUser = function(userId) {
|
|||||||
// due to ambiguity (or should this be on a chat-specific layer)?
|
// due to ambiguity (or should this be on a chat-specific layer)?
|
||||||
// reconnect after connectivity outages
|
// reconnect after connectivity outages
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* High level helper method to begin syncing and poll for new events. To listen for these
|
* High level helper method to begin syncing and poll for new events. To listen for these
|
||||||
* events, add a listener for {@link module:client~MatrixClient#event:"event"}
|
* events, add a listener for {@link module:client~MatrixClient#event:"event"}
|
||||||
|
|||||||
@@ -30,7 +30,6 @@ import * as olmlib from './olmlib';
|
|||||||
import { IndexedDBCryptoStore } from './store/indexeddb-crypto-store';
|
import { IndexedDBCryptoStore } from './store/indexeddb-crypto-store';
|
||||||
import { chunkPromises, defer, sleep } from '../utils';
|
import { chunkPromises, defer, sleep } from '../utils';
|
||||||
|
|
||||||
|
|
||||||
/* State transition diagram for DeviceList._deviceTrackingStatus
|
/* State transition diagram for DeviceList._deviceTrackingStatus
|
||||||
*
|
*
|
||||||
* |
|
* |
|
||||||
@@ -51,7 +50,6 @@ import {chunkPromises, defer, sleep} from '../utils';
|
|||||||
* +----------------------- UP_TO_DATE ------------------------+
|
* +----------------------- UP_TO_DATE ------------------------+
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
// constants for DeviceList._deviceTrackingStatus
|
// constants for DeviceList._deviceTrackingStatus
|
||||||
const TRACKING_STATUS_NOT_TRACKED = 0;
|
const TRACKING_STATUS_NOT_TRACKED = 0;
|
||||||
const TRACKING_STATUS_PENDING_DOWNLOAD = 1;
|
const TRACKING_STATUS_PENDING_DOWNLOAD = 1;
|
||||||
@@ -892,7 +890,6 @@ class DeviceListUpdateSerialiser {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
async function _updateStoredDeviceKeysForUser(
|
async function _updateStoredDeviceKeysForUser(
|
||||||
_olmDevice, userId, userStore, userResult, localUserId, localDeviceId,
|
_olmDevice, userId, userStore, userResult, localUserId, localDeviceId,
|
||||||
) {
|
) {
|
||||||
|
|||||||
@@ -86,7 +86,6 @@ export class EncryptionSetupBuilder {
|
|||||||
userSignatures[deviceId] = signature;
|
userSignatures[deviceId] = signature;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {String} type
|
* @param {String} type
|
||||||
* @param {Object} content
|
* @param {Object} content
|
||||||
@@ -225,7 +224,6 @@ export class EncryptionSetupOperation {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Catches account data set by SecretStorage during bootstrapping by
|
* Catches account data set by SecretStorage during bootstrapping by
|
||||||
* implementing the methods related to account data in MatrixClient
|
* implementing the methods related to account data in MatrixClient
|
||||||
|
|||||||
@@ -48,7 +48,6 @@ function checkPayloadLength(payloadString) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The type of object we use for importing and exporting megolm session data.
|
* The type of object we use for importing and exporting megolm session data.
|
||||||
*
|
*
|
||||||
@@ -62,7 +61,6 @@ function checkPayloadLength(payloadString) {
|
|||||||
* @property {String} session_key Base64'ed key data
|
* @property {String} session_key Base64'ed key data
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Manages the olm cryptography functions. Each OlmDevice has a single
|
* Manages the olm cryptography functions. Each OlmDevice has a single
|
||||||
* OlmAccount and a number of OlmSessions.
|
* OlmAccount and a number of OlmSessions.
|
||||||
@@ -376,7 +374,6 @@ OlmDevice.prototype._saveSession = function(deviceKey, sessionInfo, txn) {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* get an OlmUtility and call the given function
|
* get an OlmUtility and call the given function
|
||||||
*
|
*
|
||||||
@@ -393,7 +390,6 @@ OlmDevice.prototype._getUtility = function(func) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Signs a message with the ed25519 key for this account.
|
* Signs a message with the ed25519 key for this account.
|
||||||
*
|
*
|
||||||
@@ -434,7 +430,6 @@ OlmDevice.prototype.getOneTimeKeys = async function() {
|
|||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the maximum number of one-time keys we can store.
|
* Get the maximum number of one-time keys we can store.
|
||||||
*
|
*
|
||||||
@@ -550,7 +545,6 @@ OlmDevice.prototype.createOutboundSession = async function(
|
|||||||
return newSessionId;
|
return newSessionId;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generate a new inbound session, given an incoming message
|
* Generate a new inbound session, given an incoming message
|
||||||
*
|
*
|
||||||
@@ -612,7 +606,6 @@ OlmDevice.prototype.createInboundSession = async function(
|
|||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get a list of known session IDs for the given device
|
* Get a list of known session IDs for the given device
|
||||||
*
|
*
|
||||||
@@ -856,7 +849,6 @@ OlmDevice.prototype.filterOutNotifiedErrorDevices = async function(devices) {
|
|||||||
return await this._cryptoStore.filterOutNotifiedErrorDevices(devices);
|
return await this._cryptoStore.filterOutNotifiedErrorDevices(devices);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// Outbound group session
|
// Outbound group session
|
||||||
// ======================
|
// ======================
|
||||||
|
|
||||||
@@ -871,7 +863,6 @@ OlmDevice.prototype._saveOutboundGroupSession = function(session) {
|
|||||||
this._outboundGroupSessionStore[session.session_id()] = pickledSession;
|
this._outboundGroupSessionStore[session.session_id()] = pickledSession;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* extract an OutboundGroupSession from _outboundGroupSessionStore and call the
|
* extract an OutboundGroupSession from _outboundGroupSessionStore and call the
|
||||||
* given function
|
* given function
|
||||||
@@ -896,7 +887,6 @@ OlmDevice.prototype._getOutboundGroupSession = function(sessionId, func) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generate a new outbound group session
|
* Generate a new outbound group session
|
||||||
*
|
*
|
||||||
@@ -913,7 +903,6 @@ OlmDevice.prototype.createOutboundGroupSession = function() {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Encrypt an outgoing message with an outbound group session
|
* Encrypt an outgoing message with an outbound group session
|
||||||
*
|
*
|
||||||
@@ -953,7 +942,6 @@ OlmDevice.prototype.getOutboundGroupSessionKey = function(sessionId) {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// Inbound group session
|
// Inbound group session
|
||||||
// =====================
|
// =====================
|
||||||
|
|
||||||
|
|||||||
@@ -75,7 +75,6 @@ function OutboundSessionInfo(sessionId, sharedHistory = false) {
|
|||||||
this.sharedHistory = sharedHistory;
|
this.sharedHistory = sharedHistory;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if it's time to rotate the session
|
* Check if it's time to rotate the session
|
||||||
*
|
*
|
||||||
@@ -158,7 +157,6 @@ OutboundSessionInfo.prototype.sharedWithTooManyDevices = function(
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Megolm encryption implementation
|
* Megolm encryption implementation
|
||||||
*
|
*
|
||||||
@@ -1341,7 +1339,6 @@ MegolmDecryption.prototype._removeEventFromPendingList = function(event) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @inheritdoc
|
* @inheritdoc
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -358,5 +358,4 @@ OlmDecryption.prototype._reallyDecryptMessage = async function(
|
|||||||
return res.payload;
|
return res.payload;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
registerAlgorithm(olmlib.OLM_ALGORITHM, OlmEncryption, OlmDecryption);
|
registerAlgorithm(olmlib.OLM_ALGORITHM, OlmEncryption, OlmDecryption);
|
||||||
|
|||||||
@@ -1774,7 +1774,6 @@ Crypto.prototype.registerEventHandlers = function(eventEmitter) {
|
|||||||
eventEmitter.on("Event.decrypted", timelineHandler);
|
eventEmitter.on("Event.decrypted", timelineHandler);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/** Start background processes related to crypto */
|
/** Start background processes related to crypto */
|
||||||
Crypto.prototype.start = function() {
|
Crypto.prototype.start = function() {
|
||||||
this._outgoingRoomKeyRequestManager.start();
|
this._outgoingRoomKeyRequestManager.start();
|
||||||
@@ -2368,7 +2367,6 @@ Crypto.prototype.legacyDeviceVerification = async function(
|
|||||||
return request;
|
return request;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get information on the active olm sessions with a user
|
* Get information on the active olm sessions with a user
|
||||||
* <p>
|
* <p>
|
||||||
@@ -2399,7 +2397,6 @@ Crypto.prototype.getOlmSessionsForUser = async function(userId) {
|
|||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the device which sent an event
|
* Get the device which sent an event
|
||||||
*
|
*
|
||||||
@@ -2644,7 +2641,6 @@ Crypto.prototype.setRoomEncryption = async function(roomId, config, inhibitDevic
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Make sure we are tracking the device lists for all users in this room.
|
* Make sure we are tracking the device lists for all users in this room.
|
||||||
*
|
*
|
||||||
@@ -3301,7 +3297,6 @@ Crypto.prototype._getTrackedE2eRooms = function() {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
Crypto.prototype._onToDeviceEvent = function(event) {
|
Crypto.prototype._onToDeviceEvent = function(event) {
|
||||||
try {
|
try {
|
||||||
logger.log(`received to_device ${event.getType()} from: ` +
|
logger.log(`received to_device ${event.getType()} from: ` +
|
||||||
@@ -3589,7 +3584,6 @@ Crypto.prototype._onToDeviceBadEncrypted = async function(event) {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
// Most of the time this probably won't be necessary since we'll have queued up a key request when
|
// Most of the time this probably won't be necessary since we'll have queued up a key request when
|
||||||
// we failed to decrypt the message and will be waiting a bit for the key to arrive before sending
|
// we failed to decrypt the message and will be waiting a bit for the key to arrive before sending
|
||||||
// it. This won't always be the case though so we need to re-send any that have already been sent
|
// it. This won't always be the case though so we need to re-send any that have already been sent
|
||||||
@@ -3646,7 +3640,6 @@ Crypto.prototype._onRoomMembership = function(event, member, oldMembership) {
|
|||||||
alg.onRoomMembership(event, member, oldMembership);
|
alg.onRoomMembership(event, member, oldMembership);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when we get an m.room_key_request event.
|
* Called when we get an m.room_key_request event.
|
||||||
*
|
*
|
||||||
@@ -3799,7 +3792,6 @@ Crypto.prototype._processReceivedRoomKeyRequest = async function(req) {
|
|||||||
this.emit("crypto.roomKeyRequest", req);
|
this.emit("crypto.roomKeyRequest", req);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Helper for processReceivedRoomKeyRequests
|
* Helper for processReceivedRoomKeyRequests
|
||||||
*
|
*
|
||||||
@@ -3875,7 +3867,6 @@ Crypto.prototype._getRoomDecryptor = function(roomId, algorithm) {
|
|||||||
return alg;
|
return alg;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get all the room decryptors for a given encryption algorithm.
|
* Get all the room decryptors for a given encryption algorithm.
|
||||||
*
|
*
|
||||||
@@ -3893,7 +3884,6 @@ Crypto.prototype._getRoomDecryptors = function(algorithm) {
|
|||||||
return decryptors;
|
return decryptors;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* sign the given object with our ed25519 key
|
* sign the given object with our ed25519 key
|
||||||
*
|
*
|
||||||
@@ -3913,7 +3903,6 @@ Crypto.prototype._signObject = async function(obj) {
|
|||||||
if (unsigned !== undefined) obj.unsigned = unsigned;
|
if (unsigned !== undefined) obj.unsigned = unsigned;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The parameters of a room key request. The details of the request may
|
* The parameters of a room key request. The details of the request may
|
||||||
* vary with the crypto algorithm, but the management and storage layers for
|
* vary with the crypto algorithm, but the management and storage layers for
|
||||||
|
|||||||
@@ -41,7 +41,6 @@ export const MEGOLM_ALGORITHM = "m.megolm.v1.aes-sha2";
|
|||||||
*/
|
*/
|
||||||
export const MEGOLM_BACKUP_ALGORITHM = "m.megolm_backup.v1.curve25519-aes-sha2";
|
export const MEGOLM_BACKUP_ALGORITHM = "m.megolm_backup.v1.curve25519-aes-sha2";
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Encrypt an event payload for an Olm device
|
* Encrypt an event payload for an Olm device
|
||||||
*
|
*
|
||||||
@@ -408,7 +407,6 @@ async function _verifyKeyAndStartSession(olmDevice, oneTimeKey, userId, deviceIn
|
|||||||
return sid;
|
return sid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Verify the signature on an object
|
* Verify the signature on an object
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -323,7 +323,6 @@ export class SAS extends Base {
|
|||||||
key: this.ourSASPubKey,
|
key: this.ourSASPubKey,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
e = await this._waitForEvent("m.key.verification.key");
|
e = await this._waitForEvent("m.key.verification.key");
|
||||||
// FIXME: make sure event is properly formed
|
// FIXME: make sure event is properly formed
|
||||||
content = e.getContent();
|
content = e.getContent();
|
||||||
@@ -353,7 +352,6 @@ export class SAS extends Base {
|
|||||||
this.emit("show_sas", this.sasEvent);
|
this.emit("show_sas", this.sasEvent);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
[e] = await Promise.all([
|
[e] = await Promise.all([
|
||||||
this._waitForEvent("m.key.verification.mac")
|
this._waitForEvent("m.key.verification.mac")
|
||||||
.then((e) => {
|
.then((e) => {
|
||||||
@@ -411,7 +409,6 @@ export class SAS extends Base {
|
|||||||
commitment: olmutil.sha256(commitmentStr),
|
commitment: olmutil.sha256(commitmentStr),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
let e = await this._waitForEvent("m.key.verification.key");
|
let e = await this._waitForEvent("m.key.verification.key");
|
||||||
// FIXME: make sure event is properly formed
|
// FIXME: make sure event is properly formed
|
||||||
content = e.getContent();
|
content = e.getContent();
|
||||||
@@ -440,7 +437,6 @@ export class SAS extends Base {
|
|||||||
this.emit("show_sas", this.sasEvent);
|
this.emit("show_sas", this.sasEvent);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
[e] = await Promise.all([
|
[e] = await Promise.all([
|
||||||
this._waitForEvent("m.key.verification.mac")
|
this._waitForEvent("m.key.verification.mac")
|
||||||
.then((e) => {
|
.then((e) => {
|
||||||
|
|||||||
@@ -292,7 +292,6 @@ export class ToDeviceChannel {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
export class ToDeviceRequests {
|
export class ToDeviceRequests {
|
||||||
constructor() {
|
constructor() {
|
||||||
this._requestsByUserId = new Map();
|
this._requestsByUserId = new Map();
|
||||||
|
|||||||
@@ -37,7 +37,6 @@ const TIMEOUT_FROM_EVENT_RECEIPT = 2 * 60 * 1000; // 2 minutes
|
|||||||
// are this amount of time away from expiring.
|
// are this amount of time away from expiring.
|
||||||
const VERIFICATION_REQUEST_MARGIN = 3 * 1000; // 3 seconds
|
const VERIFICATION_REQUEST_MARGIN = 3 * 1000; // 3 seconds
|
||||||
|
|
||||||
|
|
||||||
export const EVENT_PREFIX = "m.key.verification.";
|
export const EVENT_PREFIX = "m.key.verification.";
|
||||||
export const REQUEST_TYPE = EVENT_PREFIX + "request";
|
export const REQUEST_TYPE = EVENT_PREFIX + "request";
|
||||||
export const START_TYPE = EVENT_PREFIX + "start";
|
export const START_TYPE = EVENT_PREFIX + "start";
|
||||||
@@ -52,7 +51,6 @@ export const PHASE_STARTED = 4;
|
|||||||
export const PHASE_CANCELLED = 5;
|
export const PHASE_CANCELLED = 5;
|
||||||
export const PHASE_DONE = 6;
|
export const PHASE_DONE = 6;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* State machine for verification requests.
|
* State machine for verification requests.
|
||||||
* Things that differ based on what channel is used to
|
* Things that differ based on what channel is used to
|
||||||
@@ -98,7 +96,6 @@ export class VerificationRequest extends EventEmitter {
|
|||||||
static validateEvent(type, event, client) {
|
static validateEvent(type, event, client) {
|
||||||
const content = event.getContent();
|
const content = event.getContent();
|
||||||
|
|
||||||
|
|
||||||
if (!type || !type.startsWith(EVENT_PREFIX)) {
|
if (!type || !type.startsWith(EVENT_PREFIX)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -355,7 +352,6 @@ export class VerificationRequest extends EventEmitter {
|
|||||||
return this._observeOnly;
|
return this._observeOnly;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets which device the verification should be started with
|
* Gets which device the verification should be started with
|
||||||
* given the events sent so far in the verification. This is the
|
* given the events sent so far in the verification. This is the
|
||||||
|
|||||||
@@ -22,7 +22,6 @@ InvalidStoreError.prototype = Object.create(Error.prototype, {
|
|||||||
});
|
});
|
||||||
Reflect.setPrototypeOf(InvalidStoreError, Error);
|
Reflect.setPrototypeOf(InvalidStoreError, Error);
|
||||||
|
|
||||||
|
|
||||||
export function InvalidCryptoStoreError(reason) {
|
export function InvalidCryptoStoreError(reason) {
|
||||||
const message = `Crypto store is invalid because ${reason}, ` +
|
const message = `Crypto store is invalid because ${reason}, ` +
|
||||||
`please stop the client, delete all data and start the client again`;
|
`please stop the client, delete all data and start the client again`;
|
||||||
|
|||||||
@@ -862,7 +862,6 @@ function parseErrorResponse(response, body) {
|
|||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* extract the Content-Type header from the response object, and
|
* extract the Content-Type header from the response object, and
|
||||||
* parse it to a `{type, parameters}` object.
|
* parse it to a `{type, parameters}` object.
|
||||||
|
|||||||
@@ -59,7 +59,6 @@ export {
|
|||||||
setVideoInput as setMatrixCallVideoInput,
|
setVideoInput as setMatrixCallVideoInput,
|
||||||
} from "./webrtc/call";
|
} from "./webrtc/call";
|
||||||
|
|
||||||
|
|
||||||
// expose the underlying request object so different environments can use
|
// expose the underlying request object so different environments can use
|
||||||
// different request libs (e.g. request or browser-request)
|
// different request libs (e.g. request or browser-request)
|
||||||
let requestInstance;
|
let requestInstance;
|
||||||
|
|||||||
@@ -271,7 +271,6 @@ EventTimelineSet.prototype.addTimeline = function() {
|
|||||||
return timeline;
|
return timeline;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add events to a timeline
|
* Add events to a timeline
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -180,7 +180,6 @@ export const MatrixEvent = function(
|
|||||||
};
|
};
|
||||||
utils.inherits(MatrixEvent, EventEmitter);
|
utils.inherits(MatrixEvent, EventEmitter);
|
||||||
|
|
||||||
|
|
||||||
utils.extend(MatrixEvent.prototype, {
|
utils.extend(MatrixEvent.prototype, {
|
||||||
/**
|
/**
|
||||||
* Get the event_id for this event.
|
* Get the event_id for this event.
|
||||||
@@ -1128,7 +1127,6 @@ utils.extend(MatrixEvent.prototype, {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
/* _REDACT_KEEP_KEY_MAP gives the keys we keep when an event is redacted
|
/* _REDACT_KEEP_KEY_MAP gives the keys we keep when an event is redacted
|
||||||
*
|
*
|
||||||
* This is specified here:
|
* This is specified here:
|
||||||
@@ -1157,7 +1155,6 @@ const _REDACT_KEEP_CONTENT_MAP = {
|
|||||||
'm.room.aliases': { 'aliases': 1 },
|
'm.room.aliases': { 'aliases': 1 },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fires when an event is decrypted
|
* Fires when an event is decrypted
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -202,7 +202,6 @@ RoomMember.prototype.getLastModifiedTime = function() {
|
|||||||
return this._modified;
|
return this._modified;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
RoomMember.prototype.isKicked = function() {
|
RoomMember.prototype.isKicked = function() {
|
||||||
return this.membership === "leave" &&
|
return this.membership === "leave" &&
|
||||||
this.events.member.getSender() !== this.events.member.getStateKey();
|
this.events.member.getSender() !== this.events.member.getStateKey();
|
||||||
@@ -239,7 +238,6 @@ RoomMember.prototype.getDMInviter = function() {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the avatar URL for a room member.
|
* Get the avatar URL for a room member.
|
||||||
* @param {string} baseUrl The base homeserver URL See
|
* @param {string} baseUrl The base homeserver URL See
|
||||||
|
|||||||
@@ -735,7 +735,6 @@ RoomState.prototype.getJoinRule = function() {
|
|||||||
return joinRuleContent["join_rule"] || "invite";
|
return joinRuleContent["join_rule"] || "invite";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
function _updateThirdPartyTokenCache(roomState, memberEvent) {
|
function _updateThirdPartyTokenCache(roomState, memberEvent) {
|
||||||
if (!memberEvent.getContent().third_party_invite) {
|
if (!memberEvent.getContent().third_party_invite) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -58,7 +58,6 @@ function synthesizeReceipt(userId, event, receiptType) {
|
|||||||
return new MatrixEvent(fakeReceipt);
|
return new MatrixEvent(fakeReceipt);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Construct a new Room.
|
* Construct a new Room.
|
||||||
*
|
*
|
||||||
@@ -441,7 +440,6 @@ Room.prototype.getLiveTimeline = function() {
|
|||||||
return this.getUnfilteredTimelineSet().getLiveTimeline();
|
return this.getUnfilteredTimelineSet().getLiveTimeline();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the timestamp of the last message in the room
|
* Get the timestamp of the last message in the room
|
||||||
*
|
*
|
||||||
@@ -586,7 +584,6 @@ Room.prototype._loadMembersFromServer = async function() {
|
|||||||
return response.chunk;
|
return response.chunk;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
Room.prototype._loadMembers = async function() {
|
Room.prototype._loadMembers = async function() {
|
||||||
// were the members loaded from the server?
|
// were the members loaded from the server?
|
||||||
let fromServer = false;
|
let fromServer = false;
|
||||||
@@ -1071,7 +1068,6 @@ Room.prototype.getInvitedAndJoinedMemberCount = function() {
|
|||||||
return calculateRoomName(this, userId, true);
|
return calculateRoomName(this, userId, true);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if the given user_id has the given membership state.
|
* Check if the given user_id has the given membership state.
|
||||||
* @param {string} userId The user ID to check.
|
* @param {string} userId The user ID to check.
|
||||||
@@ -1228,7 +1224,6 @@ Room.prototype._addLiveEvent = function(event, duplicateStrategy, fromCache) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add a pending outgoing event to this room.
|
* Add a pending outgoing event to this room.
|
||||||
*
|
*
|
||||||
@@ -1639,7 +1634,6 @@ Room.prototype.removeEvent = function(eventId) {
|
|||||||
return removedAny;
|
return removedAny;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Recalculate various aspects of the room, including the room name and
|
* Recalculate various aspects of the room, including the room name and
|
||||||
* room summary. Call this any time the room's current state is modified.
|
* room summary. Call this any time the room's current state is modified.
|
||||||
@@ -1863,7 +1857,6 @@ Room.prototype._buildReceiptCache = function(receipts) {
|
|||||||
return receiptCacheByEventId;
|
return receiptCacheByEventId;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add a temporary local-echo receipt to the room to reflect in the
|
* Add a temporary local-echo receipt to the room to reflect in the
|
||||||
* client the fact that we've sent one.
|
* client the fact that we've sent one.
|
||||||
@@ -1921,7 +1914,6 @@ Room.prototype.getAccountData = function(type) {
|
|||||||
return this.accountData[type];
|
return this.accountData[type];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns whether the syncing user has permission to send a message in the room
|
* Returns whether the syncing user has permission to send a message in the room
|
||||||
* @return {boolean} true if the user should be permitted to send
|
* @return {boolean} true if the user should be permitted to send
|
||||||
|
|||||||
@@ -139,7 +139,6 @@ User.prototype.setDisplayName = function(name) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Manually set this user's non-disambiguated display name. No event is emitted
|
* Manually set this user's non-disambiguated display name. No event is emitted
|
||||||
* in response to this as there is no underlying MatrixEvent to emit with.
|
* in response to this as there is no underlying MatrixEvent to emit with.
|
||||||
@@ -153,7 +152,6 @@ User.prototype.setRawDisplayName = function(name) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Manually set this user's avatar URL. No event is emitted in response to this
|
* Manually set this user's avatar URL. No event is emitted in response to this
|
||||||
* as there is no underlying MatrixEvent to emit with.
|
* as there is no underlying MatrixEvent to emit with.
|
||||||
|
|||||||
@@ -360,7 +360,6 @@ export function PushProcessor(client) {
|
|||||||
return ret;
|
return ret;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the user's push actions for the given event
|
* Get the user's push actions for the given event
|
||||||
*
|
*
|
||||||
@@ -468,4 +467,3 @@ PushProcessor.rewriteDefaultRules = function(incomingRules) {
|
|||||||
* noise.
|
* noise.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -177,7 +177,6 @@ function _runCallbacks() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* search in a sorted array.
|
/* search in a sorted array.
|
||||||
*
|
*
|
||||||
* returns the index of the last element for which func returns
|
* returns the index of the last element for which func returns
|
||||||
|
|||||||
@@ -93,7 +93,6 @@ MatrixScheduler.prototype.removeEventFromQueue = function(event) {
|
|||||||
return removed;
|
return removed;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the process function. Required for events in the queue to be processed.
|
* Set the process function. Required for events in the queue to be processed.
|
||||||
* If set after events have been added to the queue, this will immediately start
|
* If set after events have been added to the queue, this will immediately start
|
||||||
|
|||||||
@@ -48,7 +48,6 @@ function upgradeSchemaV3(db) {
|
|||||||
{ keyPath: ["clobber"] });
|
{ keyPath: ["clobber"] });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Helper method to collect results from a Cursor and promiseify it.
|
* Helper method to collect results from a Cursor and promiseify it.
|
||||||
* @param {ObjectStore|Index} store The store to perform openCursor on.
|
* @param {ObjectStore|Index} store The store to perform openCursor on.
|
||||||
|
|||||||
@@ -48,7 +48,6 @@ export function RemoteIndexedDBStoreBackend(
|
|||||||
this._startPromise = null;
|
this._startPromise = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
RemoteIndexedDBStoreBackend.prototype = {
|
RemoteIndexedDBStoreBackend.prototype = {
|
||||||
/**
|
/**
|
||||||
* Attempt to connect to the database. This can fail if the user does not
|
* Attempt to connect to the database. This can fail if the user does not
|
||||||
|
|||||||
@@ -39,7 +39,6 @@ import {logger} from '../logger';
|
|||||||
// response is persisted each time.
|
// response is persisted each time.
|
||||||
const WRITE_DELAY_MS = 1000 * 60 * 5; // once every 5 minutes
|
const WRITE_DELAY_MS = 1000 * 60 * 5; // once every 5 minutes
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Construct a new Indexed Database store, which extends MemoryStore.
|
* Construct a new Indexed Database store, which extends MemoryStore.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -62,7 +62,6 @@ function debuglog(...params) {
|
|||||||
logger.log(...params);
|
logger.log(...params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <b>Internal class - unstable.</b>
|
* <b>Internal class - unstable.</b>
|
||||||
* Construct an entity which is able to sync with a homeserver.
|
* Construct an entity which is able to sync with a homeserver.
|
||||||
@@ -188,7 +187,6 @@ SyncApi.prototype._deregisterStateListeners = function(room) {
|
|||||||
room.currentState.removeAllListeners("RoomState.newMember");
|
room.currentState.removeAllListeners("RoomState.newMember");
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sync rooms the user has left.
|
* Sync rooms the user has left.
|
||||||
* @return {Promise} Resolved when they've been added to the store.
|
* @return {Promise} Resolved when they've been added to the store.
|
||||||
|
|||||||
@@ -335,7 +335,6 @@ TimelineWindow.prototype.paginate = function(direction, size, makeRequest,
|
|||||||
return prom;
|
return prom;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Remove `delta` events from the start or end of the timeline.
|
* Remove `delta` events from the start or end of the timeline.
|
||||||
*
|
*
|
||||||
@@ -368,7 +367,6 @@ TimelineWindow.prototype.unpaginate = function(delta, startOfTimeline) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get a list of the events currently in the window
|
* Get a list of the events currently in the window
|
||||||
*
|
*
|
||||||
@@ -420,7 +418,6 @@ TimelineWindow.prototype.getEvents = function() {
|
|||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* a thing which contains a timeline reference, and an index into it.
|
* a thing which contains a timeline reference, and an index into it.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -37,7 +37,6 @@ import {
|
|||||||
} from './callEventTypes';
|
} from './callEventTypes';
|
||||||
import { CallFeed } from './callFeed';
|
import { CallFeed } from './callFeed';
|
||||||
|
|
||||||
|
|
||||||
// events: hangup, error(err), replaced(call), state(state, oldState)
|
// events: hangup, error(err), replaced(call), state(state, oldState)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user