From cc7eb26d7c83c7fb28e92944197cfacf35aa9928 Mon Sep 17 00:00:00 2001 From: Robert Long Date: Tue, 31 Aug 2021 16:12:42 -0700 Subject: [PATCH] Update matrix --- public/browser-matrix.js | 3306 ++++++++++++++++++---------------- public/browser-matrix.js.map | 54 +- 2 files changed, 1790 insertions(+), 1570 deletions(-) diff --git a/public/browser-matrix.js b/public/browser-matrix.js index 770448e..9dba98f 100644 --- a/public/browser-matrix.js +++ b/public/browser-matrix.js @@ -275,6 +275,8 @@ var assertThisInitialized = require("./assertThisInitialized.js"); function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; + } else if (call !== void 0) { + throw new TypeError("Derived constructors may only return object or undefined"); } return assertThisInitialized(self); @@ -7077,9 +7079,9 @@ var runtime = (function (exports) { // This is a polyfill for %IteratorPrototype% for environments that // don't natively support it. var IteratorPrototype = {}; - IteratorPrototype[iteratorSymbol] = function () { + define(IteratorPrototype, iteratorSymbol, function () { return this; - }; + }); var getProto = Object.getPrototypeOf; var NativeIteratorPrototype = getProto && getProto(getProto(values([]))); @@ -7093,8 +7095,9 @@ var runtime = (function (exports) { var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); - GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype; - GeneratorFunctionPrototype.constructor = GeneratorFunction; + GeneratorFunction.prototype = GeneratorFunctionPrototype; + define(Gp, "constructor", GeneratorFunctionPrototype); + define(GeneratorFunctionPrototype, "constructor", GeneratorFunction); GeneratorFunction.displayName = define( GeneratorFunctionPrototype, toStringTagSymbol, @@ -7208,9 +7211,9 @@ var runtime = (function (exports) { } defineIteratorMethods(AsyncIterator.prototype); - AsyncIterator.prototype[asyncIteratorSymbol] = function () { + define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; - }; + }); exports.AsyncIterator = AsyncIterator; // Note that simple async functions are implemented on top of @@ -7403,13 +7406,13 @@ var runtime = (function (exports) { // iterator prototype chain incorrectly implement this, causing the Generator // object to not be returned from this call. This ensures that doesn't happen. // See https://github.com/facebook/regenerator/issues/274 for more details. - Gp[iteratorSymbol] = function() { + define(Gp, iteratorSymbol, function() { return this; - }; + }); - Gp.toString = function() { + define(Gp, "toString", function() { return "[object Generator]"; - }; + }); function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; @@ -7728,14 +7731,19 @@ try { } catch (accidentalStrictMode) { // This module should not be running in strict mode, so the above // assignment should always work unless something is misconfigured. Just - // in case runtime.js accidentally runs in strict mode, we can escape + // in case runtime.js accidentally runs in strict mode, in modern engines + // we can explicitly access globalThis. In older engines we can escape // strict mode using a global Function call. This could conceivably fail // if a Content Security Policy forbids using Function, but in that case // the proper solution is to fix the accidental strict mode problem. If // you've misconfigured your bundler to force strict mode and applied a // CSP to forbid Function, and you're not willing to fix either of those // problems, please detail your unique predicament in a GitHub issue. - Function("r", "regeneratorRuntime = r")(runtime); + if (typeof globalThis === "object") { + globalThis.regeneratorRuntime = runtime; + } else { + Function("r", "regeneratorRuntime = r")(runtime); + } } },{}],59:[function(require,module,exports){ @@ -9287,7 +9295,7 @@ module.exports={ "𝐴": "A", "𝑨": "A", "𝒜": "A", - "���": "A", + "𝓐": "A", "𝔄": "A", "𝔸": "A", "𝕬": "A", @@ -18689,6 +18697,7 @@ class MatrixClient extends events_1.EventEmitter { * has been emitted. * @param {string} groupId The group ID * @return {Group} The Group or null if the group is not known or there is no data store. + * @deprecated groups/communities never made it to the spec and support for them is being discontinued. */ getGroup(groupId) { return this.store.getGroup(groupId); @@ -18696,6 +18705,7 @@ class MatrixClient extends events_1.EventEmitter { /** * Retrieve all known groups. * @return {Group[]} A list of groups, or an empty list if there is no data store. + * @deprecated groups/communities never made it to the spec and support for them is being discontinued. */ getGroups() { return this.store.getGroups(); @@ -22935,14 +22945,15 @@ class MatrixClient extends events_1.EventEmitter { return this.http.authedRequest(undefined, "POST", path, null, { score, reason }); } /** - * Fetches or paginates a summary of a space as defined by MSC2946 + * Fetches or paginates a summary of a space as defined by an initial version of MSC2946 * @param {string} roomId The ID of the space-room to use as the root of the summary. * @param {number?} maxRoomsPerSpace The maximum number of rooms to return per subspace. * @param {boolean?} suggestedOnly Whether to only return rooms with suggested=true. * @param {boolean?} autoJoinOnly Whether to only return rooms with auto_join=true. * @param {number?} limit The maximum number of rooms to return in total. * @param {string?} batch The opaque token to paginate a previous summary request. - * @returns {Promise} the response, with next_batch, rooms, events fields. + * @returns {Promise} the response, with next_token, rooms fields. + * @deprecated in favour of `getRoomHierarchy` due to the MSC changing paths. */ getSpaceSummary(roomId, maxRoomsPerSpace, suggestedOnly, autoJoinOnly, limit, batch) { const path = utils.encodeUri("/rooms/$roomId/spaces", { @@ -22958,6 +22969,48 @@ class MatrixClient extends events_1.EventEmitter { prefix: "/_matrix/client/unstable/org.matrix.msc2946", }); } + /** + * Fetches or paginates a room hierarchy as defined by MSC2946. + * Falls back gracefully to sourcing its data from `getSpaceSummary` if this API is not yet supported by the server. + * @param {string} roomId The ID of the space-room to use as the root of the summary. + * @param {number?} limit The maximum number of rooms to return per page. + * @param {number?} maxDepth The maximum depth in the tree from the root room to return. + * @param {boolean?} suggestedOnly Whether to only return rooms with suggested=true. + * @param {string?} fromToken The opaque token to paginate a previous request. + * @returns {Promise} the response, with next_batch & rooms fields. + */ + getRoomHierarchy(roomId, limit, maxDepth, suggestedOnly = false, fromToken) { + const path = utils.encodeUri("/rooms/$roomId/hierarchy", { + $roomId: roomId, + }); + return this.http.authedRequest(undefined, "GET", path, { + suggested_only: suggestedOnly, + max_depth: maxDepth, + from: fromToken, + limit, + }, undefined, { + prefix: "/_matrix/client/unstable/org.matrix.msc2946", + }).catch(e => { + if (e.errcode === "M_UNRECOGNIZED") { + // fall back to the older space summary API as it exposes the same data just in a different shape. + return this.getSpaceSummary(roomId, undefined, suggestedOnly, undefined, limit) + .then(({ rooms, events }) => { + // Translate response from `/spaces` to that we expect in this API. + const roomMap = new Map(rooms.map(r => { + return [r.room_id, Object.assign(Object.assign({}, r), { children_state: [] })]; + })); + events.forEach(e => { + var _a; + (_a = roomMap.get(e.room_id)) === null || _a === void 0 ? void 0 : _a.children_state.push(e); + }); + return { + rooms: Array.from(roomMap.values()), + }; + }); + } + throw e; + }); + } /** * Creates a new file tree space with the given name. The client will pick * defaults for how it expects to be able to support the remaining API offered @@ -23009,7 +23062,7 @@ class MatrixClient extends events_1.EventEmitter { unstableGetFileTreeSpace(roomId) { var _a, _b; const room = this.getRoom(roomId); - if (!room) + if ((room === null || room === void 0 ? void 0 : room.getMyMembership()) !== 'join') return null; const createEvent = room.currentState.getStateEvents(event_2.EventType.RoomCreate, ""); const purposeEvent = room.currentState.getStateEvents(event_2.UNSTABLE_MSC3088_PURPOSE.name, event_2.UNSTABLE_MSC3089_TREE_SUBTYPE.name); @@ -23030,6 +23083,7 @@ class MatrixClient extends events_1.EventEmitter { * @param {string} groupId * @return {Promise} Resolves: Group summary object * @return {module:http-api.MatrixError} Rejects: with an error response. + * @deprecated groups/communities never made it to the spec and support for them is being discontinued. */ getGroupSummary(groupId) { const path = utils.encodeUri("/groups/$groupId/summary", { $groupId: groupId }); @@ -23039,6 +23093,7 @@ class MatrixClient extends events_1.EventEmitter { * @param {string} groupId * @return {Promise} Resolves: Group profile object * @return {module:http-api.MatrixError} Rejects: with an error response. + * @deprecated groups/communities never made it to the spec and support for them is being discontinued. */ getGroupProfile(groupId) { const path = utils.encodeUri("/groups/$groupId/profile", { $groupId: groupId }); @@ -23053,6 +23108,7 @@ class MatrixClient extends events_1.EventEmitter { * @param {string=} profile.long_description A longer HTML description of the room * @return {Promise} Resolves: Empty object * @return {module:http-api.MatrixError} Rejects: with an error response. + * @deprecated groups/communities never made it to the spec and support for them is being discontinued. */ setGroupProfile(groupId, profile) { const path = utils.encodeUri("/groups/$groupId/profile", { $groupId: groupId }); @@ -23066,6 +23122,7 @@ class MatrixClient extends events_1.EventEmitter { * required to join. * @return {Promise} Resolves: Empty object * @return {module:http-api.MatrixError} Rejects: with an error response. + * @deprecated groups/communities never made it to the spec and support for them is being discontinued. */ setGroupJoinPolicy(groupId, policy) { const path = utils.encodeUri("/groups/$groupId/settings/m.join_policy", { $groupId: groupId }); @@ -23077,6 +23134,7 @@ class MatrixClient extends events_1.EventEmitter { * @param {string} groupId * @return {Promise} Resolves: Group users list object * @return {module:http-api.MatrixError} Rejects: with an error response. + * @deprecated groups/communities never made it to the spec and support for them is being discontinued. */ getGroupUsers(groupId) { const path = utils.encodeUri("/groups/$groupId/users", { $groupId: groupId }); @@ -23086,6 +23144,7 @@ class MatrixClient extends events_1.EventEmitter { * @param {string} groupId * @return {Promise} Resolves: Group users list object * @return {module:http-api.MatrixError} Rejects: with an error response. + * @deprecated groups/communities never made it to the spec and support for them is being discontinued. */ getGroupInvitedUsers(groupId) { const path = utils.encodeUri("/groups/$groupId/invited_users", { $groupId: groupId }); @@ -23095,6 +23154,7 @@ class MatrixClient extends events_1.EventEmitter { * @param {string} groupId * @return {Promise} Resolves: Group rooms list object * @return {module:http-api.MatrixError} Rejects: with an error response. + * @deprecated groups/communities never made it to the spec and support for them is being discontinued. */ getGroupRooms(groupId) { const path = utils.encodeUri("/groups/$groupId/rooms", { $groupId: groupId }); @@ -23105,6 +23165,7 @@ class MatrixClient extends events_1.EventEmitter { * @param {string} userId * @return {Promise} Resolves: Empty object * @return {module:http-api.MatrixError} Rejects: with an error response. + * @deprecated groups/communities never made it to the spec and support for them is being discontinued. */ inviteUserToGroup(groupId, userId) { const path = utils.encodeUri("/groups/$groupId/admin/users/invite/$userId", { $groupId: groupId, $userId: userId }); @@ -23115,6 +23176,7 @@ class MatrixClient extends events_1.EventEmitter { * @param {string} userId * @return {Promise} Resolves: Empty object * @return {module:http-api.MatrixError} Rejects: with an error response. + * @deprecated groups/communities never made it to the spec and support for them is being discontinued. */ removeUserFromGroup(groupId, userId) { const path = utils.encodeUri("/groups/$groupId/admin/users/remove/$userId", { $groupId: groupId, $userId: userId }); @@ -23126,6 +23188,7 @@ class MatrixClient extends events_1.EventEmitter { * @param {string} roleId Optional. * @return {Promise} Resolves: Empty object * @return {module:http-api.MatrixError} Rejects: with an error response. + * @deprecated groups/communities never made it to the spec and support for them is being discontinued. */ addUserToGroupSummary(groupId, userId, roleId) { const path = utils.encodeUri(roleId ? @@ -23138,6 +23201,7 @@ class MatrixClient extends events_1.EventEmitter { * @param {string} userId * @return {Promise} Resolves: Empty object * @return {module:http-api.MatrixError} Rejects: with an error response. + * @deprecated groups/communities never made it to the spec and support for them is being discontinued. */ removeUserFromGroupSummary(groupId, userId) { const path = utils.encodeUri("/groups/$groupId/summary/users/$userId", { $groupId: groupId, $userId: userId }); @@ -23149,6 +23213,7 @@ class MatrixClient extends events_1.EventEmitter { * @param {string} categoryId Optional. * @return {Promise} Resolves: Empty object * @return {module:http-api.MatrixError} Rejects: with an error response. + * @deprecated groups/communities never made it to the spec and support for them is being discontinued. */ addRoomToGroupSummary(groupId, roomId, categoryId) { const path = utils.encodeUri(categoryId ? @@ -23161,6 +23226,7 @@ class MatrixClient extends events_1.EventEmitter { * @param {string} roomId * @return {Promise} Resolves: Empty object * @return {module:http-api.MatrixError} Rejects: with an error response. + * @deprecated groups/communities never made it to the spec and support for them is being discontinued. */ removeRoomFromGroupSummary(groupId, roomId) { const path = utils.encodeUri("/groups/$groupId/summary/rooms/$roomId", { $groupId: groupId, $roomId: roomId }); @@ -23172,6 +23238,7 @@ class MatrixClient extends events_1.EventEmitter { * @param {boolean} isPublic Whether the room-group association is visible to non-members * @return {Promise} Resolves: Empty object * @return {module:http-api.MatrixError} Rejects: with an error response. + * @deprecated groups/communities never made it to the spec and support for them is being discontinued. */ addRoomToGroup(groupId, roomId, isPublic) { if (isPublic === undefined) { @@ -23187,6 +23254,7 @@ class MatrixClient extends events_1.EventEmitter { * @param {boolean} isPublic Whether the room-group association is visible to non-members * @return {Promise} Resolves: Empty object * @return {module:http-api.MatrixError} Rejects: with an error response. + * @deprecated groups/communities never made it to the spec and support for them is being discontinued. */ updateGroupRoomVisibility(groupId, roomId, isPublic) { // NB: The /config API is generic but there's not much point in exposing this yet as synapse @@ -23200,6 +23268,7 @@ class MatrixClient extends events_1.EventEmitter { * @param {string} roomId * @return {Promise} Resolves: Empty object * @return {module:http-api.MatrixError} Rejects: with an error response. + * @deprecated groups/communities never made it to the spec and support for them is being discontinued. */ removeRoomFromGroup(groupId, roomId) { const path = utils.encodeUri("/groups/$groupId/admin/rooms/$roomId", { $groupId: groupId, $roomId: roomId }); @@ -23210,6 +23279,7 @@ class MatrixClient extends events_1.EventEmitter { * @param {Object} opts Additional options to send alongside the acceptance. * @return {Promise} Resolves: Empty object * @return {module:http-api.MatrixError} Rejects: with an error response. + * @deprecated groups/communities never made it to the spec and support for them is being discontinued. */ acceptGroupInvite(groupId, opts = null) { const path = utils.encodeUri("/groups/$groupId/self/accept_invite", { $groupId: groupId }); @@ -23219,6 +23289,7 @@ class MatrixClient extends events_1.EventEmitter { * @param {string} groupId * @return {Promise} Resolves: Empty object * @return {module:http-api.MatrixError} Rejects: with an error response. + * @deprecated groups/communities never made it to the spec and support for them is being discontinued. */ joinGroup(groupId) { const path = utils.encodeUri("/groups/$groupId/self/join", { $groupId: groupId }); @@ -23228,6 +23299,7 @@ class MatrixClient extends events_1.EventEmitter { * @param {string} groupId * @return {Promise} Resolves: Empty object * @return {module:http-api.MatrixError} Rejects: with an error response. + * @deprecated groups/communities never made it to the spec and support for them is being discontinued. */ leaveGroup(groupId) { const path = utils.encodeUri("/groups/$groupId/self/leave", { $groupId: groupId }); @@ -23236,6 +23308,7 @@ class MatrixClient extends events_1.EventEmitter { /** * @return {Promise} Resolves: The groups to which the user is joined * @return {module:http-api.MatrixError} Rejects: with an error response. + * @deprecated groups/communities never made it to the spec and support for them is being discontinued. */ getJoinedGroups() { const path = utils.encodeUri("/joined_groups", {}); @@ -23247,6 +23320,7 @@ class MatrixClient extends events_1.EventEmitter { * @param {Object} content.profile Group profile object * @return {Promise} Resolves: Object with key group_id: id of the created group * @return {module:http-api.MatrixError} Rejects: with an error response. + * @deprecated groups/communities never made it to the spec and support for them is being discontinued. */ createGroup(content) { const path = utils.encodeUri("/create_group", {}); @@ -23264,6 +23338,7 @@ class MatrixClient extends events_1.EventEmitter { * } * } * @return {module:http-api.MatrixError} Rejects: with an error response. + * @deprecated groups/communities never made it to the spec and support for them is being discontinued. */ getPublicisedGroups(userIds) { const path = utils.encodeUri("/publicised_groups", {}); @@ -23274,6 +23349,7 @@ class MatrixClient extends events_1.EventEmitter { * @param {boolean} isPublic Whether the user's membership of this group is made public * @return {Promise} Resolves: Empty object * @return {module:http-api.MatrixError} Rejects: with an error response. + * @deprecated groups/communities never made it to the spec and support for them is being discontinued. */ setGroupPublicity(groupId, isPublic) { const path = utils.encodeUri("/groups/$groupId/self/update_publicity", { $groupId: groupId }); @@ -23433,6 +23509,7 @@ MatrixClient.RESTORE_BACKUP_ERROR_BAD_KEY = 'RESTORE_BACKUP_ERROR_BAD_KEY'; * is experimental and may change. * @event module:client~MatrixClient#"Group" * @param {Group} group The newly created, fully populated group. + * @deprecated groups/communities never made it to the spec and support for them is being discontinued. * @example * matrixClient.on("Group", function(group){ * var groupId = group.groupId; @@ -23607,7 +23684,7 @@ MatrixClient.RESTORE_BACKUP_ERROR_BAD_KEY = 'RESTORE_BACKUP_ERROR_BAD_KEY'; }).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"./@types/PushRules":68,"./@types/event":69,"./@types/partials":70,"./@types/search":71,"./ReEmitter":73,"./autodiscovery":74,"./content-helpers":77,"./content-repo":78,"./crypto":95,"./crypto/RoomList":84,"./crypto/api":91,"./crypto/backup":92,"./crypto/dehydration":93,"./crypto/key_passphrase":96,"./crypto/olmlib":97,"./crypto/recoverykey":98,"./event-mapper":112,"./filter":114,"./http-api":115,"./logger":118,"./matrix":119,"./models/MSC3089TreeSpace":121,"./models/event":125,"./models/event-timeline":124,"./models/search-result":132,"./models/user":133,"./pushprocessor":134,"./randomstring":135,"./service-types":138,"./store/stub":144,"./sync":147,"./sync.api":146,"./utils":149,"./webrtc/call":150,"./webrtc/callEventHandler":151,"events":38}],77:[function(require,module,exports){ +},{"./@types/PushRules":68,"./@types/event":69,"./@types/partials":70,"./@types/search":71,"./ReEmitter":73,"./autodiscovery":74,"./content-helpers":77,"./content-repo":78,"./crypto":95,"./crypto/RoomList":84,"./crypto/api":91,"./crypto/backup":92,"./crypto/dehydration":93,"./crypto/key_passphrase":96,"./crypto/olmlib":97,"./crypto/recoverykey":98,"./event-mapper":112,"./filter":114,"./http-api":115,"./logger":118,"./matrix":119,"./models/MSC3089TreeSpace":121,"./models/event":125,"./models/event-timeline":124,"./models/search-result":132,"./models/user":134,"./pushprocessor":135,"./randomstring":136,"./service-types":139,"./store/stub":145,"./sync":148,"./sync.api":147,"./utils":150,"./webrtc/call":151,"./webrtc/callEventHandler":152,"events":38}],77:[function(require,module,exports){ "use strict"; /* Copyright 2018 New Vector Ltd @@ -23807,7 +23884,7 @@ function getHttpUriForMxc(baseUrl, mxc, width, height, resizeMethod, allowDirect } exports.getHttpUriForMxc = getHttpUriForMxc; -},{"./utils":149}],79:[function(require,module,exports){ +},{"./utils":150}],79:[function(require,module,exports){ (function (global,Buffer){(function (){ "use strict"; /* @@ -25432,7 +25509,7 @@ function storeDeviceKeys(olmDevice, userStore, deviceResult) { }); } -},{"../logger":118,"../utils":149,"./CrossSigning":79,"./deviceinfo":94,"./olmlib":97,"./store/indexeddb-crypto-store":100,"events":38}],81:[function(require,module,exports){ +},{"../logger":118,"../utils":150,"./CrossSigning":79,"./deviceinfo":94,"./olmlib":97,"./store/indexeddb-crypto-store":100,"events":38}],81:[function(require,module,exports){ "use strict"; /* Copyright 2021 The Matrix.org Foundation C.I.C. @@ -25751,6 +25828,7 @@ class SSSSCryptoCallbacks { this.privateKeys = new Map(); } getSecretStorageKey({ keys }, name) { + var _a; return __awaiter(this, void 0, void 0, function* () { for (const keyId of Object.keys(keys)) { const privateKey = this.privateKeys.get(keyId); @@ -25760,7 +25838,7 @@ class SSSSCryptoCallbacks { } // if we don't have the key cached yet, ask // for it to the general crypto callbacks and cache it - if (this.delegateCryptoCallbacks) { + if ((_a = this === null || this === void 0 ? void 0 : this.delegateCryptoCallbacks) === null || _a === void 0 ? void 0 : _a.getSecretStorageKey) { const result = yield this.delegateCryptoCallbacks. getSecretStorageKey({ keys }, name); if (result) { @@ -25769,6 +25847,7 @@ class SSSSCryptoCallbacks { } return result; } + return null; }); } addPrivateKey(keyId, keyInfo, privKey) { @@ -28688,7 +28767,7 @@ class SecretStorage { } exports.SecretStorage = SecretStorage; -},{"../logger":118,"../randomstring":135,"./aes":86,"./olmlib":97}],86:[function(require,module,exports){ +},{"../logger":118,"../randomstring":136,"./aes":86,"./olmlib":97}],86:[function(require,module,exports){ (function (Buffer){(function (){ "use strict"; /* @@ -28909,7 +28988,7 @@ exports.calculateKeyCheck = calculateKeyCheck; }).call(this)}).call(this,require("buffer").Buffer) -},{"../utils":149,"./olmlib":97,"buffer":34}],87:[function(require,module,exports){ +},{"../utils":150,"./olmlib":97,"buffer":34}],87:[function(require,module,exports){ "use strict"; /* Copyright 2016 - 2021 The Matrix.org Foundation C.I.C. @@ -31625,7 +31704,7 @@ exports.DefaultAlgorithm = Curve25519; }).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"../NamespacedValue":72,"../client":76,"../logger":118,"../utils":149,"./aes":86,"./key_passphrase":96,"./olmlib":97,"./recoverykey":98,"./store/indexeddb-crypto-store":100}],93:[function(require,module,exports){ +},{"../NamespacedValue":72,"../client":76,"../logger":118,"../utils":150,"./aes":86,"./key_passphrase":96,"./olmlib":97,"./recoverykey":98,"./store/indexeddb-crypto-store":100}],93:[function(require,module,exports){ (function (global,Buffer){(function (){ "use strict"; /* @@ -35219,7 +35298,7 @@ exports.deriveKey = deriveKey; }).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"../randomstring":135}],97:[function(require,module,exports){ +},{"../randomstring":136}],97:[function(require,module,exports){ (function (global,Buffer){(function (){ "use strict"; /* @@ -35748,7 +35827,7 @@ exports.decodeBase64 = decodeBase64; }).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {},require("buffer").Buffer) -},{"../logger":118,"../utils":149,"another-json":27,"buffer":34}],98:[function(require,module,exports){ +},{"../logger":118,"../utils":150,"another-json":27,"buffer":34}],98:[function(require,module,exports){ (function (global,Buffer){(function (){ "use strict"; /* @@ -36715,7 +36794,7 @@ function promiseifyTxn(txn) { }); } -},{"../../logger":118,"../../utils":149}],100:[function(require,module,exports){ +},{"../../logger":118,"../../utils":150}],100:[function(require,module,exports){ (function (global){(function (){ "use strict"; /* @@ -38054,7 +38133,7 @@ class MemoryCryptoStore { } exports.MemoryCryptoStore = MemoryCryptoStore; -},{"../../logger":118,"../../utils":149}],103:[function(require,module,exports){ +},{"../../logger":118,"../../utils":150}],103:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); @@ -40780,7 +40859,7 @@ var ToDeviceChannel = /*#__PURE__*/function () { while (1) { switch (_context2.prev = _context2.next) { case 0: - if (!(type === _VerificationRequest.REQUEST_TYPE)) { + if (!(type === _VerificationRequest.REQUEST_TYPE || type === _VerificationRequest.CANCEL_TYPE && !this.__deviceId)) { _context2.next = 6; break; } @@ -41062,7 +41141,7 @@ var ToDeviceRequests = /*#__PURE__*/function () { exports.ToDeviceRequests = ToDeviceRequests; -},{"../../../logger":118,"../../../models/event":125,"../../../randomstring":135,"../Error":104,"./VerificationRequest":110,"@babel/runtime/helpers/asyncToGenerator":5,"@babel/runtime/helpers/classCallCheck":6,"@babel/runtime/helpers/createClass":8,"@babel/runtime/helpers/defineProperty":9,"@babel/runtime/helpers/interopRequireDefault":12,"@babel/runtime/helpers/typeof":23,"@babel/runtime/regenerator":26}],110:[function(require,module,exports){ +},{"../../../logger":118,"../../../models/event":125,"../../../randomstring":136,"../Error":104,"./VerificationRequest":110,"@babel/runtime/helpers/asyncToGenerator":5,"@babel/runtime/helpers/classCallCheck":6,"@babel/runtime/helpers/createClass":8,"@babel/runtime/helpers/defineProperty":9,"@babel/runtime/helpers/interopRequireDefault":12,"@babel/runtime/helpers/typeof":23,"@babel/runtime/regenerator":26}],110:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); @@ -43948,7 +44027,7 @@ function _retryNetworkOperation() { }).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"./logger":118,"./realtime-callbacks":136,"./utils":149,"@babel/runtime/helpers/asyncToGenerator":5,"@babel/runtime/helpers/classCallCheck":6,"@babel/runtime/helpers/createClass":8,"@babel/runtime/helpers/defineProperty":9,"@babel/runtime/helpers/getPrototypeOf":10,"@babel/runtime/helpers/inherits":11,"@babel/runtime/helpers/interopRequireDefault":12,"@babel/runtime/helpers/possibleConstructorReturn":19,"@babel/runtime/helpers/typeof":23,"@babel/runtime/helpers/wrapNativeSuper":25,"@babel/runtime/regenerator":26,"content-type":37}],116:[function(require,module,exports){ +},{"./logger":118,"./realtime-callbacks":137,"./utils":150,"@babel/runtime/helpers/asyncToGenerator":5,"@babel/runtime/helpers/classCallCheck":6,"@babel/runtime/helpers/createClass":8,"@babel/runtime/helpers/defineProperty":9,"@babel/runtime/helpers/getPrototypeOf":10,"@babel/runtime/helpers/inherits":11,"@babel/runtime/helpers/interopRequireDefault":12,"@babel/runtime/helpers/possibleConstructorReturn":19,"@babel/runtime/helpers/typeof":23,"@babel/runtime/helpers/wrapNativeSuper":25,"@babel/runtime/regenerator":26,"content-type":37}],116:[function(require,module,exports){ "use strict"; /* Copyright 2019 New Vector Ltd @@ -44005,36 +44084,79 @@ exports.exists = exists; },{}],117:[function(require,module,exports){ "use strict"; +/* +Copyright 2016 OpenMarket Ltd +Copyright 2017 Vector Creations Ltd +Copyright 2019 The Matrix.org Foundation C.I.C. -var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); +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 -var _typeof = require("@babel/runtime/helpers/typeof"); + http://www.apache.org/licenses/LICENSE-2.0 -Object.defineProperty(exports, "__esModule", { - value: true +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. +*/ +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; }); -exports.InteractiveAuth = InteractiveAuth; - -var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); - -var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); - -var utils = _interopRequireWildcard(require("./utils")); - -var _logger = require("./logger"); - -function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } - -function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; } - -function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; } - -function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } - -function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } - -var EMAIL_STAGE_TYPE = "m.login.email.identity"; -var MSISDN_STAGE_TYPE = "m.login.msisdn"; +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.InteractiveAuth = exports.AuthType = void 0; +/** @module interactive-auth */ +const utils = __importStar(require("./utils")); +const logger_1 = require("./logger"); +const utils_1 = require("./utils"); +const EMAIL_STAGE_TYPE = "m.login.email.identity"; +const MSISDN_STAGE_TYPE = "m.login.msisdn"; +var AuthType; +(function (AuthType) { + AuthType["Password"] = "m.login.password"; + AuthType["Recaptcha"] = "m.login.recaptcha"; + AuthType["Terms"] = "m.login.terms"; + AuthType["Email"] = "m.login.email.identity"; + AuthType["Msisdn"] = "m.login.msisdn"; + AuthType["Sso"] = "m.login.sso"; + AuthType["SsoUnstable"] = "org.matrix.login.sso"; + AuthType["Dummy"] = "m.login.dummy"; +})(AuthType = exports.AuthType || (exports.AuthType = {})); +class NoAuthFlowFoundError extends Error { + // eslint-disable-next-line @typescript-eslint/naming-convention, camelcase + constructor(m, required_stages, flows) { + super(m); + this.required_stages = required_stages; + this.flows = flows; + this.name = "NoAuthFlowFoundError"; + } +} /** * Abstracts the logic used to drive the interactive auth process. * @@ -44061,12 +44183,12 @@ var MSISDN_STAGE_TYPE = "m.login.msisdn"; * called with the new auth dict to submit the request. Also passes a * second deprecated arg which is a flag set to true if this request * is a background request. The busyChanged callback should be used - * instead of the backfround flag. Should return a promise which resolves + * instead of the background flag. Should return a promise which resolves * to the successful response or rejects with a MatrixError. * - * @param {function(bool): Promise} opts.busyChanged + * @param {function(boolean): Promise} opts.busyChanged * called whenever the interactive auth logic becomes busy submitting - * information provided by the user or finsihes. After this has been + * information provided by the user or finishes. After this has been * called with true the UI should indicate that a request is in progress * until it is called again with false. * @@ -44112,607 +44234,414 @@ var MSISDN_STAGE_TYPE = "m.login.msisdn"; * attemptAuth promise. * */ - -function InteractiveAuth(opts) { - this._matrixClient = opts.matrixClient; - this._data = opts.authData || {}; - this._requestCallback = opts.doRequest; - this._busyChangedCallback = opts.busyChanged; // startAuthStage included for backwards compat - - this._stateUpdatedCallback = opts.stateUpdated || opts.startAuthStage; - this._resolveFunc = null; - this._rejectFunc = null; - this._inputs = opts.inputs || {}; - this._requestEmailTokenCallback = opts.requestEmailToken; - if (opts.sessionId) this._data.session = opts.sessionId; - this._clientSecret = opts.clientSecret || this._matrixClient.generateClientSecret(); - this._emailSid = opts.emailSid; - if (this._emailSid === undefined) this._emailSid = null; - this._requestingEmailToken = false; - this._chosenFlow = null; - this._currentStage = null; // if we are currently trying to submit an auth dict (which includes polling) - // the promise the will resolve/reject when it completes - - this._submitPromise = null; -} - -InteractiveAuth.prototype = { - /** - * begin the authentication process. - * - * @return {Promise} which resolves to the response on success, - * or rejects with the error on failure. Rejects with NoAuthFlowFoundError if - * no suitable authentication flow can be found - */ - attemptAuth: function attemptAuth() { - var _this = this; - - // This promise will be quite long-lived and will resolve when the - // request is authenticated and completes successfully. - return new Promise(function (resolve, reject) { - _this._resolveFunc = resolve; - _this._rejectFunc = reject; - var hasFlows = _this._data && _this._data.flows; // if we have no flows, try a request to acquire the flows - - if (!hasFlows) { - if (_this._busyChangedCallback) _this._busyChangedCallback(true); // use the existing sessionid, if one is present. - - var auth = null; - - if (_this._data.session) { - auth = { - session: _this._data.session - }; - } - - _this._doRequest(auth)["finally"](function () { - if (_this._busyChangedCallback) _this._busyChangedCallback(false); - }); - } else { - _this._startNextAuthStage(); - } - }); - }, - - /** - * Poll to check if the auth session or current stage has been - * completed out-of-band. If so, the attemptAuth promise will - * be resolved. - */ - poll: function () { - var _poll = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() { - var authDict, creds, idServerParsedUrl; - return _regenerator["default"].wrap(function _callee$(_context) { - while (1) { - switch (_context.prev = _context.next) { - case 0: - if (this._data.session) { - _context.next = 2; - break; - } - - return _context.abrupt("return"); - - case 2: - if (this._resolveFunc) { - _context.next = 4; - break; - } - - return _context.abrupt("return"); - - case 4: - if (!this._submitPromise) { - _context.next = 6; - break; - } - - return _context.abrupt("return"); - - case 6: - authDict = {}; - - if (!(this._currentStage == EMAIL_STAGE_TYPE)) { - _context.next = 16; - break; - } - - if (!this._emailSid) { - _context.next = 16; - break; - } - - creds = { - sid: this._emailSid, - client_secret: this._clientSecret - }; - _context.next = 12; - return this._matrixClient.doesServerRequireIdServerParam(); - - case 12: - if (!_context.sent) { - _context.next = 15; - break; - } - - idServerParsedUrl = new URL(this._matrixClient.getIdentityServerUrl()); - creds.id_server = idServerParsedUrl.host; - - case 15: - authDict = { - type: EMAIL_STAGE_TYPE, - // TODO: Remove `threepid_creds` once servers support proper UIA - // See https://github.com/matrix-org/synapse/issues/5665 - // See https://github.com/matrix-org/matrix-doc/issues/2220 - threepid_creds: creds, - threepidCreds: creds - }; - - case 16: - this.submitAuthDict(authDict, true); - - case 17: - case "end": - return _context.stop(); - } - } - }, _callee, this); - })); - - function poll() { - return _poll.apply(this, arguments); +class InteractiveAuth { + constructor(opts) { + var _a; + this.requestingEmailToken = false; + this.attemptAuthDeferred = null; + this.chosenFlow = null; + this.currentStage = null; + // if we are currently trying to submit an auth dict (which includes polling) + // the promise the will resolve/reject when it completes + this.submitPromise = null; + this.matrixClient = opts.matrixClient; + this.data = opts.authData || {}; + this.requestCallback = opts.doRequest; + this.busyChangedCallback = opts.busyChanged; + // startAuthStage included for backwards compat + this.stateUpdatedCallback = opts.stateUpdated || opts.startAuthStage; + this.requestEmailTokenCallback = opts.requestEmailToken; + this.inputs = opts.inputs || {}; + if (opts.sessionId) + this.data.session = opts.sessionId; + this.clientSecret = opts.clientSecret || this.matrixClient.generateClientSecret(); + this.emailSid = (_a = opts.emailSid) !== null && _a !== void 0 ? _a : null; } - - return poll; - }(), - - /** - * get the auth session ID - * - * @return {string} session id - */ - getSessionId: function getSessionId() { - return this._data ? this._data.session : undefined; - }, - - /** - * get the client secret used for validation sessions - * with the identity server. - * - * @return {string} client secret - */ - getClientSecret: function getClientSecret() { - return this._clientSecret; - }, - - /** - * get the server params for a given stage - * - * @param {string} loginType login type for the stage - * @return {object?} any parameters from the server for this stage - */ - getStageParams: function getStageParams(loginType) { - var params = {}; - - if (this._data && this._data.params) { - params = this._data.params; - } - - return params[loginType]; - }, - getChosenFlow: function getChosenFlow() { - return this._chosenFlow; - }, - - /** - * submit a new auth dict and fire off the request. This will either - * make attemptAuth resolve/reject, or cause the startAuthStage callback - * to be called for a new stage. - * - * @param {object} authData new auth dict to send to the server. Should - * include a `type` propterty denoting the login type, as well as any - * other params for that stage. - * @param {bool} background If true, this request failing will not result - * in the attemptAuth promise being rejected. This can be set to true - * for requests that just poll to see if auth has been completed elsewhere. - */ - submitAuthDict: function () { - var _submitAuthDict = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(authData, background) { - var auth; - return _regenerator["default"].wrap(function _callee2$(_context2) { - while (1) { - switch (_context2.prev = _context2.next) { - case 0: - if (this._resolveFunc) { - _context2.next = 2; - break; - } - - throw new Error("submitAuthDict() called before attemptAuth()"); - - case 2: - if (!background && this._busyChangedCallback) { - this._busyChangedCallback(true); - } // if we're currently trying a request, wait for it to finish - // as otherwise we can get multiple 200 responses which can mean - // things like multiple logins for register requests. - // (but discard any expections as we only care when its done, - // not whether it worked or not) - - - case 3: - if (!this._submitPromise) { - _context2.next = 13; - break; - } - - _context2.prev = 4; - _context2.next = 7; - return this._submitPromise; - - case 7: - _context2.next = 11; - break; - - case 9: - _context2.prev = 9; - _context2.t0 = _context2["catch"](4); - - case 11: - _context2.next = 3; - break; - - case 13: - if (this._data.session) { + /** + * begin the authentication process. + * + * @return {Promise} which resolves to the response on success, + * or rejects with the error on failure. Rejects with NoAuthFlowFoundError if + * no suitable authentication flow can be found + */ + attemptAuth() { + var _a, _b; + // This promise will be quite long-lived and will resolve when the + // request is authenticated and completes successfully. + this.attemptAuthDeferred = utils_1.defer(); + // pluck the promise out now, as doRequest may clear before we return + const promise = this.attemptAuthDeferred.promise; + // if we have no flows, try a request to acquire the flows + if (!((_a = this.data) === null || _a === void 0 ? void 0 : _a.flows)) { + (_b = this.busyChangedCallback) === null || _b === void 0 ? void 0 : _b.call(this, true); + // use the existing sessionId, if one is present. + let auth = null; + if (this.data.session) { auth = { - session: this._data.session + session: this.data.session, + }; + } + this.doRequest(auth).finally(() => { + var _a; + (_a = this.busyChangedCallback) === null || _a === void 0 ? void 0 : _a.call(this, false); + }); + } + else { + this.startNextAuthStage(); + } + return promise; + } + /** + * Poll to check if the auth session or current stage has been + * completed out-of-band. If so, the attemptAuth promise will + * be resolved. + */ + poll() { + return __awaiter(this, void 0, void 0, function* () { + if (!this.data.session) + return; + // likewise don't poll if there is no auth session in progress + if (!this.attemptAuthDeferred) + return; + // if we currently have a request in flight, there's no point making + // another just to check what the status is + if (this.submitPromise) + return; + let authDict = {}; + if (this.currentStage == EMAIL_STAGE_TYPE) { + // The email can be validated out-of-band, but we need to provide the + // creds so the HS can go & check it. + if (this.emailSid) { + const creds = { + sid: this.emailSid, + client_secret: this.clientSecret, + }; + if (yield this.matrixClient.doesServerRequireIdServerParam()) { + const idServerParsedUrl = new URL(this.matrixClient.getIdentityServerUrl()); + creds.id_server = idServerParsedUrl.host; + } + authDict = { + type: EMAIL_STAGE_TYPE, + // TODO: Remove `threepid_creds` once servers support proper UIA + // See https://github.com/matrix-org/synapse/issues/5665 + // See https://github.com/matrix-org/matrix-doc/issues/2220 + threepid_creds: creds, + threepidCreds: creds, + }; + } + } + this.submitAuthDict(authDict, true); + }); + } + /** + * get the auth session ID + * + * @return {string} session id + */ + getSessionId() { + return this.data ? this.data.session : undefined; + } + /** + * get the client secret used for validation sessions + * with the identity server. + * + * @return {string} client secret + */ + getClientSecret() { + return this.clientSecret; + } + /** + * get the server params for a given stage + * + * @param {string} loginType login type for the stage + * @return {object?} any parameters from the server for this stage + */ + getStageParams(loginType) { + var _a; + return (_a = this.data.params) === null || _a === void 0 ? void 0 : _a[loginType]; + } + getChosenFlow() { + return this.chosenFlow; + } + /** + * submit a new auth dict and fire off the request. This will either + * make attemptAuth resolve/reject, or cause the startAuthStage callback + * to be called for a new stage. + * + * @param {object} authData new auth dict to send to the server. Should + * include a `type` property denoting the login type, as well as any + * other params for that stage. + * @param {boolean} background If true, this request failing will not result + * in the attemptAuth promise being rejected. This can be set to true + * for requests that just poll to see if auth has been completed elsewhere. + */ + submitAuthDict(authData, background = false) { + var _a, _b; + return __awaiter(this, void 0, void 0, function* () { + if (!this.attemptAuthDeferred) { + throw new Error("submitAuthDict() called before attemptAuth()"); + } + if (!background) { + (_a = this.busyChangedCallback) === null || _a === void 0 ? void 0 : _a.call(this, true); + } + // if we're currently trying a request, wait for it to finish + // as otherwise we can get multiple 200 responses which can mean + // things like multiple logins for register requests. + // (but discard any exceptions as we only care when its done, + // not whether it worked or not) + while (this.submitPromise) { + try { + yield this.submitPromise; + } + catch (e) { + } + } + // use the sessionid from the last request, if one is present. + let auth; + if (this.data.session) { + auth = { + session: this.data.session, }; utils.extend(auth, authData); - } else { - auth = authData; - } - - _context2.prev = 14; - // NB. the 'background' flag is deprecated by the busyChanged - // callback and is here for backwards compat - this._submitPromise = this._doRequest(auth, background); - _context2.next = 18; - return this._submitPromise; - - case 18: - _context2.prev = 18; - this._submitPromise = null; - - if (!background && this._busyChangedCallback) { - this._busyChangedCallback(false); - } - - return _context2.finish(18); - - case 22: - case "end": - return _context2.stop(); - } - } - }, _callee2, this, [[4, 9], [14,, 18, 22]]); - })); - - function submitAuthDict(_x, _x2) { - return _submitAuthDict.apply(this, arguments); - } - - return submitAuthDict; - }(), - - /** - * Gets the sid for the email validation session - * Specific to m.login.email.identity - * - * @returns {string} The sid of the email auth session - */ - getEmailSid: function getEmailSid() { - return this._emailSid; - }, - - /** - * Sets the sid for the email validation session - * This must be set in order to successfully poll for completion - * of the email validation. - * Specific to m.login.email.identity - * - * @param {string} sid The sid for the email validation session - */ - setEmailSid: function setEmailSid(sid) { - this._emailSid = sid; - }, - - /** - * Fire off a request, and either resolve the promise, or call - * startAuthStage. - * - * @private - * @param {object?} auth new auth dict, including session id - * @param {bool?} background If true, this request is a background poll, so it - * failing will not result in the attemptAuth promise being rejected. - * This can be set to true for requests that just poll to see if auth has - * been completed elsewhere. - */ - _doRequest: function () { - var _doRequest2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(auth, background) { - var result, errorFlows, haveFlows, requestTokenResult; - return _regenerator["default"].wrap(function _callee3$(_context3) { - while (1) { - switch (_context3.prev = _context3.next) { - case 0: - _context3.prev = 0; - _context3.next = 3; - return this._requestCallback(auth, background); - - case 3: - result = _context3.sent; - - this._resolveFunc(result); - - this._resolveFunc = null; - this._rejectFunc = null; - _context3.next = 34; - break; - - case 9: - _context3.prev = 9; - _context3.t0 = _context3["catch"](0); - // sometimes UI auth errors don't come with flows - errorFlows = _context3.t0.data ? _context3.t0.data.flows : null; - haveFlows = this._data.flows || Boolean(errorFlows); - - if (_context3.t0.httpStatus !== 401 || !_context3.t0.data || !haveFlows) { - // doesn't look like an interactive-auth failure. - if (!background) { - this._rejectFunc(_context3.t0); - } else { - // We ignore all failures here (even non-UI auth related ones) - // since we don't want to suddenly fail if the internet connection - // had a blip whilst we were polling - _logger.logger.log("Background poll request failed doing UI auth: ignoring", _context3.t0); - } - } // if the error didn't come with flows, completed flows or session ID, - // copy over the ones we have. Synapse sometimes sends responses without - // any UI auth data (eg. when polling for email validation, if the email - // has not yet been validated). This appears to be a Synapse bug, which - // we workaround here. - - - if (!_context3.t0.data.flows && !_context3.t0.data.completed && !_context3.t0.data.session) { - _context3.t0.data.flows = this._data.flows; - _context3.t0.data.completed = this._data.completed; - _context3.t0.data.session = this._data.session; - } - - this._data = _context3.t0.data; - - try { - this._startNextAuthStage(); - } catch (e) { - this._rejectFunc(e); - - this._resolveFunc = null; - this._rejectFunc = null; - } - - if (!(!this._emailSid && !this._requestingEmailToken && this._chosenFlow.stages.includes('m.login.email.identity'))) { - _context3.next = 34; - break; - } - - // If we've picked a flow with email auth, we send the email - // now because we want the request to fail as soon as possible - // if the email address is not valid (ie. already taken or not - // registered, depending on what the operation is). - this._requestingEmailToken = true; - _context3.prev = 19; - _context3.next = 22; - return this._requestEmailTokenCallback(this._inputs.emailAddress, this._clientSecret, 1, // TODO: Multiple send attempts? - this._data.session); - - case 22: - requestTokenResult = _context3.sent; - this._emailSid = requestTokenResult.sid; // NB. promise is not resolved here - at some point, doRequest - // will be called again and if the user has jumped through all - // the hoops correctly, auth will be complete and the request - // will succeed. - // Also, we should expose the fact that this request has compledted - // so clients can know that the email has actually been sent. - - _context3.next = 31; - break; - - case 26: - _context3.prev = 26; - _context3.t1 = _context3["catch"](19); - - // we failed to request an email token, so fail the request. - // This could be due to the email already beeing registered - // (or not being registered, depending on what we're trying - // to do) or it could be a network failure. Either way, pass - // the failure up as the user can't complete auth if we can't - // send the email, for whatever reason. - this._rejectFunc(_context3.t1); - - this._resolveFunc = null; - this._rejectFunc = null; - - case 31: - _context3.prev = 31; - this._requestingEmailToken = false; - return _context3.finish(31); - - case 34: - case "end": - return _context3.stop(); - } - } - }, _callee3, this, [[0, 9], [19, 26, 31, 34]]); - })); - - function _doRequest(_x3, _x4) { - return _doRequest2.apply(this, arguments); - } - - return _doRequest; - }(), - - /** - * Pick the next stage and call the callback - * - * @private - * @throws {NoAuthFlowFoundError} If no suitable authentication flow can be found - */ - _startNextAuthStage: function _startNextAuthStage() { - var nextStage = this._chooseStage(); - - if (!nextStage) { - throw new Error("No incomplete flows from the server"); - } - - this._currentStage = nextStage; - - if (nextStage === 'm.login.dummy') { - this.submitAuthDict({ - type: 'm.login.dummy' - }); - return; - } - - if (this._data && this._data.errcode || this._data.error) { - this._stateUpdatedCallback(nextStage, { - errcode: this._data.errcode || "", - error: this._data.error || "" - }); - - return; - } - - var stageStatus = {}; - - if (nextStage == EMAIL_STAGE_TYPE) { - stageStatus.emailSid = this._emailSid; - } - - this._stateUpdatedCallback(nextStage, stageStatus); - }, - - /** - * Pick the next auth stage - * - * @private - * @return {string?} login type - * @throws {NoAuthFlowFoundError} If no suitable authentication flow can be found - */ - _chooseStage: function _chooseStage() { - if (this._chosenFlow === null) { - this._chosenFlow = this._chooseFlow(); - } - - _logger.logger.log("Active flow => %s", JSON.stringify(this._chosenFlow)); - - var nextStage = this._firstUncompletedStage(this._chosenFlow); - - _logger.logger.log("Next stage: %s", nextStage); - - return nextStage; - }, - - /** - * Pick one of the flows from the returned list - * If a flow using all of the inputs is found, it will - * be returned, otherwise, null will be returned. - * - * Only flows using all given inputs are chosen because it - * is likley to be surprising if the user provides a - * credential and it is not used. For example, for registration, - * this could result in the email not being used which would leave - * the account with no means to reset a password. - * - * @private - * @return {object} flow - * @throws {NoAuthFlowFoundError} If no suitable authentication flow can be found - */ - _chooseFlow: function _chooseFlow() { - var flows = this._data.flows || []; // we've been given an email or we've already done an email part - - var haveEmail = Boolean(this._inputs.emailAddress) || Boolean(this._emailSid); - var haveMsisdn = Boolean(this._inputs.phoneCountry) && Boolean(this._inputs.phoneNumber); - - var _iterator = _createForOfIteratorHelper(flows), - _step; - - try { - for (_iterator.s(); !(_step = _iterator.n()).done;) { - var flow = _step.value; - var flowHasEmail = false; - var flowHasMsisdn = false; - - var _iterator2 = _createForOfIteratorHelper(flow.stages), - _step2; - - try { - for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) { - var stage = _step2.value; - - if (stage === EMAIL_STAGE_TYPE) { - flowHasEmail = true; - } else if (stage == MSISDN_STAGE_TYPE) { - flowHasMsisdn = true; } - } - } catch (err) { - _iterator2.e(err); - } finally { - _iterator2.f(); - } - - if (flowHasEmail == haveEmail && flowHasMsisdn == haveMsisdn) { - return flow; - } - } // Throw an error with a fairly generic description, but with more - // information such that the app can give a better one if so desired. - - } catch (err) { - _iterator.e(err); - } finally { - _iterator.f(); + else { + auth = authData; + } + try { + // NB. the 'background' flag is deprecated by the busyChanged + // callback and is here for backwards compat + this.submitPromise = this.doRequest(auth, background); + yield this.submitPromise; + } + finally { + this.submitPromise = null; + if (!background) { + (_b = this.busyChangedCallback) === null || _b === void 0 ? void 0 : _b.call(this, false); + } + } + }); } - - var err = new Error("No appropriate authentication flow found"); - err.name = 'NoAuthFlowFoundError'; - err.required_stages = []; - if (haveEmail) err.required_stages.push(EMAIL_STAGE_TYPE); - if (haveMsisdn) err.required_stages.push(MSISDN_STAGE_TYPE); - err.available_flows = flows; - throw err; - }, - - /** - * Get the first uncompleted stage in the given flow - * - * @private - * @param {object} flow - * @return {string} login type - */ - _firstUncompletedStage: function _firstUncompletedStage(flow) { - var completed = (this._data || {}).completed || []; - - for (var i = 0; i < flow.stages.length; ++i) { - var stageType = flow.stages[i]; - - if (completed.indexOf(stageType) === -1) { - return stageType; - } + /** + * Gets the sid for the email validation session + * Specific to m.login.email.identity + * + * @returns {string} The sid of the email auth session + */ + getEmailSid() { + return this.emailSid; } - } -}; + /** + * Sets the sid for the email validation session + * This must be set in order to successfully poll for completion + * of the email validation. + * Specific to m.login.email.identity + * + * @param {string} sid The sid for the email validation session + */ + setEmailSid(sid) { + this.emailSid = sid; + } + /** + * Fire off a request, and either resolve the promise, or call + * startAuthStage. + * + * @private + * @param {object?} auth new auth dict, including session id + * @param {boolean?} background If true, this request is a background poll, so it + * failing will not result in the attemptAuth promise being rejected. + * This can be set to true for requests that just poll to see if auth has + * been completed elsewhere. + */ + doRequest(auth, background = false) { + var _a, _b, _c; + return __awaiter(this, void 0, void 0, function* () { + try { + const result = yield this.requestCallback(auth, background); + this.attemptAuthDeferred.resolve(result); + this.attemptAuthDeferred = null; + } + catch (error) { + // sometimes UI auth errors don't come with flows + const errorFlows = (_b = (_a = error.data) === null || _a === void 0 ? void 0 : _a.flows) !== null && _b !== void 0 ? _b : null; + const haveFlows = this.data.flows || Boolean(errorFlows); + if (error.httpStatus !== 401 || !error.data || !haveFlows) { + // doesn't look like an interactive-auth failure. + if (!background) { + (_c = this.attemptAuthDeferred) === null || _c === void 0 ? void 0 : _c.reject(error); + } + else { + // We ignore all failures here (even non-UI auth related ones) + // since we don't want to suddenly fail if the internet connection + // had a blip whilst we were polling + logger_1.logger.log("Background poll request failed doing UI auth: ignoring", error); + } + } + // if the error didn't come with flows, completed flows or session ID, + // copy over the ones we have. Synapse sometimes sends responses without + // any UI auth data (eg. when polling for email validation, if the email + // has not yet been validated). This appears to be a Synapse bug, which + // we workaround here. + if (!error.data.flows && !error.data.completed && !error.data.session) { + error.data.flows = this.data.flows; + error.data.completed = this.data.completed; + error.data.session = this.data.session; + } + this.data = error.data; + try { + this.startNextAuthStage(); + } + catch (e) { + this.attemptAuthDeferred.reject(e); + this.attemptAuthDeferred = null; + } + if (!this.emailSid && + !this.requestingEmailToken && + this.chosenFlow.stages.includes(AuthType.Email)) { + // If we've picked a flow with email auth, we send the email + // now because we want the request to fail as soon as possible + // if the email address is not valid (ie. already taken or not + // registered, depending on what the operation is). + this.requestingEmailToken = true; + try { + const requestTokenResult = yield this.requestEmailTokenCallback(this.inputs.emailAddress, this.clientSecret, 1, // TODO: Multiple send attempts? + this.data.session); + this.emailSid = requestTokenResult.sid; + // NB. promise is not resolved here - at some point, doRequest + // will be called again and if the user has jumped through all + // the hoops correctly, auth will be complete and the request + // will succeed. + // Also, we should expose the fact that this request has compledted + // so clients can know that the email has actually been sent. + } + catch (e) { + // we failed to request an email token, so fail the request. + // This could be due to the email already beeing registered + // (or not being registered, depending on what we're trying + // to do) or it could be a network failure. Either way, pass + // the failure up as the user can't complete auth if we can't + // send the email, for whatever reason. + this.attemptAuthDeferred.reject(e); + this.attemptAuthDeferred = null; + } + finally { + this.requestingEmailToken = false; + } + } + } + }); + } + /** + * Pick the next stage and call the callback + * + * @private + * @throws {NoAuthFlowFoundError} If no suitable authentication flow can be found + */ + startNextAuthStage() { + const nextStage = this.chooseStage(); + if (!nextStage) { + throw new Error("No incomplete flows from the server"); + } + this.currentStage = nextStage; + if (nextStage === AuthType.Dummy) { + this.submitAuthDict({ + type: 'm.login.dummy', + }); + return; + } + if (this.data && this.data.errcode || this.data.error) { + this.stateUpdatedCallback(nextStage, { + errcode: this.data.errcode || "", + error: this.data.error || "", + }); + return; + } + const stageStatus = {}; + if (nextStage == EMAIL_STAGE_TYPE) { + stageStatus.emailSid = this.emailSid; + } + this.stateUpdatedCallback(nextStage, stageStatus); + } + /** + * Pick the next auth stage + * + * @private + * @return {string?} login type + * @throws {NoAuthFlowFoundError} If no suitable authentication flow can be found + */ + chooseStage() { + if (this.chosenFlow === null) { + this.chosenFlow = this.chooseFlow(); + } + logger_1.logger.log("Active flow => %s", JSON.stringify(this.chosenFlow)); + const nextStage = this.firstUncompletedStage(this.chosenFlow); + logger_1.logger.log("Next stage: %s", nextStage); + return nextStage; + } + /** + * Pick one of the flows from the returned list + * If a flow using all of the inputs is found, it will + * be returned, otherwise, null will be returned. + * + * Only flows using all given inputs are chosen because it + * is likely to be surprising if the user provides a + * credential and it is not used. For example, for registration, + * this could result in the email not being used which would leave + * the account with no means to reset a password. + * + * @private + * @return {object} flow + * @throws {NoAuthFlowFoundError} If no suitable authentication flow can be found + */ + chooseFlow() { + const flows = this.data.flows || []; + // we've been given an email or we've already done an email part + const haveEmail = Boolean(this.inputs.emailAddress) || Boolean(this.emailSid); + const haveMsisdn = (Boolean(this.inputs.phoneCountry) && + Boolean(this.inputs.phoneNumber)); + for (const flow of flows) { + let flowHasEmail = false; + let flowHasMsisdn = false; + for (const stage of flow.stages) { + if (stage === EMAIL_STAGE_TYPE) { + flowHasEmail = true; + } + else if (stage == MSISDN_STAGE_TYPE) { + flowHasMsisdn = true; + } + } + if (flowHasEmail == haveEmail && flowHasMsisdn == haveMsisdn) { + return flow; + } + } + const requiredStages = []; + if (haveEmail) + requiredStages.push(EMAIL_STAGE_TYPE); + if (haveMsisdn) + requiredStages.push(MSISDN_STAGE_TYPE); + // Throw an error with a fairly generic description, but with more + // information such that the app can give a better one if so desired. + throw new NoAuthFlowFoundError("No appropriate authentication flow found", requiredStages, flows); + } + /** + * Get the first uncompleted stage in the given flow + * + * @private + * @param {object} flow + * @return {string} login type + */ + firstUncompletedStage(flow) { + const completed = this.data.completed || []; + for (let i = 0; i < flow.stages.length; ++i) { + const stageType = flow.stages[i]; + if (completed.indexOf(stageType) === -1) { + return stageType; + } + } + } +} +exports.InteractiveAuth = InteractiveAuth; -},{"./logger":118,"./utils":149,"@babel/runtime/helpers/asyncToGenerator":5,"@babel/runtime/helpers/interopRequireDefault":12,"@babel/runtime/helpers/typeof":23,"@babel/runtime/regenerator":26}],118:[function(require,module,exports){ +},{"./logger":118,"./utils":150}],118:[function(require,module,exports){ "use strict"; /* Copyright 2018 André Jaenisch @@ -44993,7 +44922,7 @@ exports.createClient = createClient; }).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"./autodiscovery":74,"./client":76,"./content-helpers":77,"./content-repo":78,"./crypto/store/indexeddb-crypto-store":100,"./crypto/store/memory-crypto-store":102,"./errors":111,"./filter":114,"./http-api":115,"./interactive-auth":117,"./models/event":125,"./models/event-timeline":124,"./models/event-timeline-set":123,"./models/group":126,"./models/room":131,"./models/room-member":128,"./models/room-state":129,"./models/user":133,"./scheduler":137,"./service-types":138,"./store/indexeddb":141,"./store/memory":142,"./store/session/webstorage":143,"./sync-accumulator":145,"./timeline-window":148,"./webrtc/call":150}],120:[function(require,module,exports){ +},{"./autodiscovery":74,"./client":76,"./content-helpers":77,"./content-repo":78,"./crypto/store/indexeddb-crypto-store":100,"./crypto/store/memory-crypto-store":102,"./errors":111,"./filter":114,"./http-api":115,"./interactive-auth":117,"./models/event":125,"./models/event-timeline":124,"./models/event-timeline-set":123,"./models/group":126,"./models/room":131,"./models/room-member":128,"./models/room-state":129,"./models/user":134,"./scheduler":138,"./service-types":139,"./store/indexeddb":142,"./store/memory":143,"./store/session/webstorage":144,"./sync-accumulator":146,"./timeline-window":149,"./webrtc/call":151}],120:[function(require,module,exports){ "use strict"; /* Copyright 2021 The Matrix.org Foundation C.I.C. @@ -45557,22 +45486,17 @@ class MSC3089TreeSpace { * @param {string} name The name of the file. * @param {ArrayBuffer} encryptedContents The encrypted contents. * @param {Partial} info The encrypted file information. + * @param {IContent} additionalContent Optional event content fields to include in the message. * @returns {Promise} Resolves when uploaded. */ - createFile(name, encryptedContents, info) { + createFile(name, encryptedContents, info, additionalContent) { return __awaiter(this, void 0, void 0, function* () { const mxc = yield this.client.uploadContent(new Blob([encryptedContents]), { includeFilename: false, onlyContentUri: true, }); info.url = mxc; - const res = yield this.client.sendMessage(this.roomId, { - msgtype: event_1.MsgType.File, - body: name, - url: mxc, - file: info, - [event_1.UNSTABLE_MSC3089_LEAF.name]: {}, - }); + const res = yield this.client.sendMessage(this.roomId, Object.assign(Object.assign({}, (additionalContent !== null && additionalContent !== void 0 ? additionalContent : {})), { msgtype: event_1.MsgType.File, body: name, url: mxc, file: info, [event_1.UNSTABLE_MSC3089_LEAF.name]: {} })); yield this.client.sendStateEvent(this.roomId, event_1.UNSTABLE_MSC3089_BRANCH.name, { active: true, name: name, @@ -45600,7 +45524,7 @@ class MSC3089TreeSpace { } exports.MSC3089TreeSpace = MSC3089TreeSpace; -},{"../@types/event":69,"../crypto/algorithms/megolm":89,"../logger":118,"../utils":149,"./MSC3089Branch":120,"p-retry":48}],122:[function(require,module,exports){ +},{"../@types/event":69,"../crypto/algorithms/megolm":89,"../logger":118,"../utils":150,"./MSC3089Branch":120,"p-retry":48}],122:[function(require,module,exports){ "use strict"; /* Copyright 2015 - 2021 The Matrix.org Foundation C.I.C. @@ -46890,6 +46814,7 @@ const events_1 = require("events"); const logger_1 = require("../logger"); const event_1 = require("../@types/event"); const utils_1 = require("../utils"); +const ReEmitter_1 = require("../ReEmitter"); /** * Enum for event statuses. * @readonly @@ -46977,6 +46902,11 @@ class MatrixEvent extends events_1.EventEmitter { * allows for a unique ID which does not change when the event comes back down sync. */ this.txnId = null; + /** + * @experimental + * A reference to the thread this event belongs to + */ + this.thread = null; // XXX: these should be read-only this.sender = null; this.target = null; @@ -47013,6 +46943,7 @@ class MatrixEvent extends events_1.EventEmitter { }); this.txnId = event.txn_id || null; this.localTimestamp = Date.now() - this.getAge(); + this.reEmitter = new ReEmitter_1.ReEmitter(this); } /** * Gets the event as though it would appear unencrypted. If the event is already not @@ -47123,6 +47054,15 @@ class MatrixEvent extends events_1.EventEmitter { getWireContent() { return this.event.content || {}; } + /** + * @experimental + * Get the event ID of the replied event + */ + get replyEventId() { + var _a; + const relations = this.getWireContent()["m.relates_to"]; + return (_a = relations === null || relations === void 0 ? void 0 : relations["m.in_reply_to"]) === null || _a === void 0 ? void 0 : _a["event_id"]; + } /** * Get the previous event content JSON. This will only return something for * state events which exist in the timeline. @@ -47908,10 +47848,15 @@ class MatrixEvent extends events_1.EventEmitter { return JSON.stringify(myProps) === JSON.stringify(theirProps); } /** - * Summarise the event as JSON for debugging. If encrypted, include both the - * decrypted and encrypted view of the event. This is named `toJSON` for use - * with `JSON.stringify` which checks objects for functions named `toJSON` - * and will call them to customise the output if they are defined. + * Summarise the event as JSON. This is currently used by React SDK's view + * event source feature and Seshat's event indexing, so take care when + * adjusting the output here. + * + * If encrypted, include both the decrypted and encrypted view of the event. + * + * This is named `toJSON` for use with `JSON.stringify` which checks objects + * for functions named `toJSON` and will call them to customise the output + * if they are defined. * * @return {Object} */ @@ -47934,6 +47879,19 @@ class MatrixEvent extends events_1.EventEmitter { getTxnId() { return this.txnId; } + /** + * @experimental + */ + setThread(thread) { + this.thread = thread; + this.reEmitter.reEmit(thread, ["Thread.ready", "Thread.update"]); + } + /** + * @experimental + */ + getThread() { + return this.thread; + } } exports.MatrixEvent = MatrixEvent; /* REDACT_KEEP_KEYS gives the keys we keep when an event is redacted @@ -47973,7 +47931,7 @@ const REDACT_KEEP_CONTENT_MAP = { * error occurred. */ -},{"../@types/event":69,"../logger":118,"../utils":149,"events":38}],126:[function(require,module,exports){ +},{"../@types/event":69,"../ReEmitter":73,"../logger":118,"../utils":150,"events":38}],126:[function(require,module,exports){ "use strict"; var _typeof = require("@babel/runtime/helpers/typeof"); @@ -48010,6 +47968,7 @@ limitations under the License. /** * @module models/group + * @deprecated groups/communities never made it to the spec and support for them is being discontinued. */ /** @@ -48024,6 +47983,7 @@ limitations under the License. * @prop {Object} inviter Infomation about the user who invited the logged in user * to the group, if myMembership is 'invite'. * @prop {string} inviter.userId The user ID of the inviter + * @deprecated groups/communities never made it to the spec and support for them is being discontinued. */ function Group(groupId) { this.groupId = groupId; @@ -48063,6 +48023,7 @@ Group.prototype.setInviter = function (inviter) { * This means the 'name' and 'avatarUrl' properties. * @event module:client~MatrixClient#"Group.profile" * @param {Group} group The group whose profile was updated. + * @deprecated groups/communities never made it to the spec and support for them is being discontinued. * @example * matrixClient.on("Group.profile", function(group){ * var name = group.name; @@ -48074,13 +48035,14 @@ Group.prototype.setInviter = function (inviter) { * the group is updated. * @event module:client~MatrixClient#"Group.myMembership" * @param {Group} group The group in which the user's membership changed + * @deprecated groups/communities never made it to the spec and support for them is being discontinued. * @example * matrixClient.on("Group.myMembership", function(group){ * var myMembership = group.myMembership; * }); */ -},{"../utils":149,"@babel/runtime/helpers/typeof":23,"events":38}],127:[function(require,module,exports){ +},{"../utils":150,"@babel/runtime/helpers/typeof":23,"events":38}],127:[function(require,module,exports){ "use strict"; /* Copyright 2019, 2021 The Matrix.org Foundation C.I.C. @@ -48811,7 +48773,7 @@ function calculateDisplayName(selfUserId, displayName, roomState, disambiguate) * }); */ -},{"../content-repo":78,"../utils":149,"events":38}],129:[function(require,module,exports){ +},{"../content-repo":78,"../utils":150,"events":38}],129:[function(require,module,exports){ "use strict"; /* Copyright 2015 - 2021 The Matrix.org Foundation C.I.C. @@ -49569,7 +49531,7 @@ exports.RoomState = RoomState; * }); */ -},{"../@types/event":69,"../logger":118,"../utils":149,"./room-member":128,"events":38}],130:[function(require,module,exports){ +},{"../@types/event":69,"../logger":118,"../utils":150,"./room-member":128,"events":38}],130:[function(require,module,exports){ "use strict"; /* Copyright 2015 - 2021 The Matrix.org Foundation C.I.C. @@ -49671,6 +49633,7 @@ const logger_1 = require("../logger"); const ReEmitter_1 = require("../ReEmitter"); const event_2 = require("../@types/event"); const client_1 = require("../client"); +const thread_1 = require("./thread"); // These constants are used as sane defaults when the homeserver doesn't support // the m.room_versions capability. In practice, KNOWN_SAFE_ROOM_VERSION should be // the same as the common default room version whereas SAFE_ROOM_VERSIONS are the @@ -49790,6 +49753,29 @@ class Room extends events_1.EventEmitter { this.tags = {}; // $tagName: { $metadata: $value } this.accountData = {}; // $eventType: $event this.summary = null; + /** + * @experimental + */ + this.threads = new Set(); + /** + * Two threads starting from a different child event can end up + * with the same event root. This method ensures that the duplicates + * are removed + * @experimental + */ + this.dedupeThreads = (readyThread) => { + const threads = Array.from(this.threads); + if (threads.includes(readyThread)) { + this.threads = new Set(threads.filter(thread => { + if (readyThread.id === thread.id && readyThread !== thread) { + return false; + } + else { + return true; + } + })); + } + }; // In some cases, we add listeners for every displayed Matrix event, so it's // common to have quite a few more than the default limit. this.setMaxListeners(100); @@ -50375,13 +50361,26 @@ class Room extends events_1.EventEmitter { return this.getUnfilteredTimelineSet().addTimeline(); } /** - * Get an event which is stored in our unfiltered timeline set + * Get an event which is stored in our unfiltered timeline set or in a thread * * @param {string} eventId event ID to look for * @return {?module:models/event.MatrixEvent} the given event, or undefined if unknown */ findEventById(eventId) { - return this.getUnfilteredTimelineSet().findEventById(eventId); + let event = this.getUnfilteredTimelineSet().findEventById(eventId); + if (event) { + return event; + } + else { + const threads = this.getThreads(); + for (let i = 0; i < threads.length; i++) { + const thread = threads[i]; + event = thread.findEventById(eventId); + if (event) { + return event; + } + } + } } /** * Get one of the notification counts for this room @@ -50541,6 +50540,32 @@ class Room extends events_1.EventEmitter { addEventsToTimeline(events, toStartOfTimeline, timeline, paginationToken) { timeline.getTimelineSet().addEventsToTimeline(events, toStartOfTimeline, timeline, paginationToken); } + /** + * @experimental + */ + addThread(thread) { + this.threads.add(thread); + if (!thread.ready) { + thread.once("Thread.ready", this.dedupeThreads); + this.emit("Thread.update", thread); + this.reEmitter.reEmit(thread, ["Thread.update", "Thread.ready"]); + } + return this.threads; + } + /** + * @experimental + */ + getThread(eventId) { + return this.getThreads().find(thread => { + return thread.id === eventId; + }); + } + /** + * @experimental + */ + getThreads() { + return Array.from(this.threads.values()); + } /** * Get a member from the current room state. * @param {string} userId The user ID of the member. @@ -50697,6 +50722,28 @@ class Room extends events_1.EventEmitter { this.timelineSets.splice(i, 1); } } + /** + * Add an event to a thread's timeline. Will fire "Thread.update" + * @experimental + */ + addThreadedEvent(event) { + var _a; + if (event.getUnsigned().transaction_id) { + const existingEvent = this.txnToEvent[event.getUnsigned().transaction_id]; + if (existingEvent) { + // remote echo of an event we sent earlier + this.handleRemoteEcho(event, existingEvent); + } + } + let thread = (_a = this.findEventById(event.replyEventId)) === null || _a === void 0 ? void 0 : _a.getThread(); + if (thread) { + thread.addEvent(event); + } + else { + thread = new thread_1.Thread([event], this, this.client); + this.addThread(thread); + } + } /** * Add an event to the end of this room's live timelines. Will fire * "Room.timeline". @@ -51644,7 +51691,7 @@ function memberNamesToRoomName(names, count = (names.length + 1)) { * @param {string} prevMembership The previous membership value */ -},{"../@types/event":69,"../ReEmitter":73,"../client":76,"../content-repo":78,"../logger":118,"../utils":149,"./event":125,"./event-timeline":124,"./event-timeline-set":123,"./room-member":128,"./room-summary":130,"events":38}],132:[function(require,module,exports){ +},{"../@types/event":69,"../ReEmitter":73,"../client":76,"../content-repo":78,"../logger":118,"../utils":150,"./event":125,"./event-timeline":124,"./event-timeline-set":123,"./room-member":128,"./room-summary":130,"./thread":133,"events":38}],132:[function(require,module,exports){ "use strict"; /* Copyright 2015 - 2021 The Matrix.org Foundation C.I.C. @@ -51705,6 +51752,179 @@ exports.SearchResult = SearchResult; },{"./event-context":122}],133:[function(require,module,exports){ "use strict"; /* +Copyright 2021 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. +*/ +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Thread = void 0; +const events_1 = require("events"); +const event_1 = require("./event"); +const event_timeline_set_1 = require("./event-timeline-set"); +/** + * @experimental + */ +class Thread extends events_1.EventEmitter { + constructor(events = [], room, client) { + super(); + this.room = room; + this.client = client; + /** + * A reference to all the events ID at the bottom of the threads + */ + this.tail = new Set(); + this._timelineSet = new event_timeline_set_1.EventTimelineSet(room, { + unstableClientRelationAggregation: true, + timelineSupport: true, + }); + events.forEach(event => this.addEvent(event)); + } + /** + * Add an event to the thread and updates + * the tail/root references if needed + * Will fire "Thread.update" + * @param event The event to add + */ + addEvent(event) { + return __awaiter(this, void 0, void 0, function* () { + if (this._timelineSet.findEventById(event.getId()) || event.status !== null) { + return; + } + if (this.tail.has(event.replyEventId)) { + this.tail.delete(event.replyEventId); + } + this.tail.add(event.getId()); + if (!event.replyEventId || !this._timelineSet.findEventById(event.replyEventId)) { + this.root = event.getId(); + } + event.setThread(this); + this._timelineSet.addLiveEvent(event); + if (this.ready) { + this.client.decryptEventIfNeeded(event, {}); + this.emit("Thread.update", this); + } + else { + this.emit("Thread.update", this); + } + }); + } + /** + * Completes the reply chain with all events + * missing from the current sync data + * Will fire "Thread.ready" + */ + fetchReplyChain() { + return __awaiter(this, void 0, void 0, function* () { + if (!this.ready) { + let mxEvent = this.room.findEventById(this.rootEvent.replyEventId); + if (!mxEvent) { + mxEvent = yield this.fetchEventById(this.rootEvent.getRoomId(), this.rootEvent.replyEventId); + } + this.addEvent(mxEvent); + if (mxEvent.replyEventId) { + yield this.fetchReplyChain(); + } + else { + yield this.decryptEvents(); + this.emit("Thread.ready", this); + } + } + }); + } + decryptEvents() { + return __awaiter(this, void 0, void 0, function* () { + yield Promise.allSettled(Array.from(this._timelineSet.getLiveTimeline().getEvents()).map(event => { + return this.client.decryptEventIfNeeded(event, {}); + })); + }); + } + /** + * Fetches an event over the network + */ + fetchEventById(roomId, eventId) { + return __awaiter(this, void 0, void 0, function* () { + const response = yield this.client.http.authedRequest(undefined, "GET", `/rooms/${roomId}/event/${eventId}`); + return new event_1.MatrixEvent(response); + }); + } + /** + * Finds an event by ID in the current thread + */ + findEventById(eventId) { + return this._timelineSet.findEventById(eventId); + } + /** + * Determines thread's ready status + */ + get ready() { + return this.rootEvent.replyEventId === undefined; + } + /** + * The thread ID, which is the same as the root event ID + */ + get id() { + return this.root; + } + /** + * The thread root event + */ + get rootEvent() { + return this.findEventById(this.root); + } + /** + * The number of messages in the thread + */ + get length() { + return this._timelineSet.getLiveTimeline().getEvents().length; + } + /** + * A set of mxid participating to the thread + */ + get participants() { + const participants = new Set(); + this._timelineSet.getLiveTimeline().getEvents().forEach(event => { + participants.add(event.getSender()); + }); + return participants; + } + /** + * A read-only getter to access the timeline set + */ + get timelineSet() { + return this._timelineSet; + } + /** + * A getter for the last event added to the thread + */ + get replyToEvent() { + const events = this._timelineSet.getLiveTimeline().getEvents(); + return events[events.length - 1]; + } +} +exports.Thread = Thread; + +},{"./event":125,"./event-timeline-set":123,"events":38}],134:[function(require,module,exports){ +"use strict"; +/* Copyright 2015 - 2021 The Matrix.org Foundation C.I.C. Licensed under the Apache License, Version 2.0 (the "License"); @@ -51953,530 +52173,432 @@ exports.User = User; * }); */ -},{"events":38}],134:[function(require,module,exports){ +},{"events":38}],135:[function(require,module,exports){ "use strict"; +/* +Copyright 2015 - 2021 The Matrix.org Foundation C.I.C. -var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); +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 -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.PushProcessor = PushProcessor; - -var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof")); - -var _utils = require("./utils"); - -var _logger = require("./logger"); - -function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; } - -function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } - -function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } + 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. +*/ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.PushProcessor = void 0; +const utils_1 = require("./utils"); +const logger_1 = require("./logger"); +const PushRules_1 = require("./@types/PushRules"); /** * @module pushprocessor */ -var RULEKINDS_IN_ORDER = ['override', 'content', 'room', 'sender', 'underride']; // The default override rules to apply to the push rules that arrive from the server. +const RULEKINDS_IN_ORDER = [ + PushRules_1.PushRuleKind.Override, + PushRules_1.PushRuleKind.ContentSpecific, + PushRules_1.PushRuleKind.RoomSpecific, + PushRules_1.PushRuleKind.SenderSpecific, + PushRules_1.PushRuleKind.Underride, +]; +// The default override rules to apply to the push rules that arrive from the server. // We do this for two reasons: // 1. Synapse is unlikely to send us the push rule in an incremental sync - see // https://github.com/matrix-org/synapse/pull/4867#issuecomment-481446072 for // more details. // 2. We often want to start using push rules ahead of the server supporting them, // and so we can put them here. - -var DEFAULT_OVERRIDE_RULES = [{ - // For homeservers which don't support MSC1930 yet - rule_id: ".m.rule.tombstone", - "default": true, - enabled: true, - conditions: [{ - kind: "event_match", - key: "type", - pattern: "m.room.tombstone" - }, { - kind: "event_match", - key: "state_key", - pattern: "" - }], - actions: ["notify", { - set_tweak: "highlight", - value: true - }] -}, { - // For homeservers which don't support MSC2153 yet - rule_id: ".m.rule.reaction", - "default": true, - enabled: true, - conditions: [{ - kind: "event_match", - key: "type", - pattern: "m.reaction" - }], - actions: ["dont_notify"] -}]; -/** - * Construct a Push Processor. - * @constructor - * @param {Object} client The Matrix client object to use - */ - -function PushProcessor(client) { - var _this = this; - - var cachedGlobToRegex = {// $glob: RegExp, - }; - - var matchingRuleFromKindSet = function matchingRuleFromKindSet(ev, kindset) { - for (var ruleKindIndex = 0; ruleKindIndex < RULEKINDS_IN_ORDER.length; ++ruleKindIndex) { - var kind = RULEKINDS_IN_ORDER[ruleKindIndex]; - var ruleset = kindset[kind]; - - if (!ruleset) { - continue; - } - - for (var ruleIndex = 0; ruleIndex < ruleset.length; ++ruleIndex) { - var rule = ruleset[ruleIndex]; - - if (!rule.enabled) { - continue; +const DEFAULT_OVERRIDE_RULES = [ + { + // For homeservers which don't support MSC1930 yet + rule_id: ".m.rule.tombstone", + default: true, + enabled: true, + conditions: [ + { + kind: PushRules_1.ConditionKind.EventMatch, + key: "type", + pattern: "m.room.tombstone", + }, + { + kind: PushRules_1.ConditionKind.EventMatch, + key: "state_key", + pattern: "", + }, + ], + actions: [ + PushRules_1.PushRuleActionName.Notify, + { + set_tweak: PushRules_1.TweakName.Highlight, + value: true, + }, + ], + }, + { + // For homeservers which don't support MSC2153 yet + rule_id: ".m.rule.reaction", + default: true, + enabled: true, + conditions: [ + { + kind: PushRules_1.ConditionKind.EventMatch, + key: "type", + pattern: "m.reaction", + }, + ], + actions: [ + PushRules_1.PushRuleActionName.DontNotify, + ], + }, +]; +class PushProcessor { + /** + * Construct a Push Processor. + * @constructor + * @param {Object} client The Matrix client object to use + */ + constructor(client) { + this.client = client; + } + /** + * Convert a list of actions into a object with the actions as keys and their values + * eg. [ 'notify', { set_tweak: 'sound', value: 'default' } ] + * becomes { notify: true, tweaks: { sound: 'default' } } + * @param {array} actionList The actions list + * + * @return {object} A object with key 'notify' (true or false) and an object of actions + */ + static actionListToActionsObject(actionList) { + const actionObj = { notify: false, tweaks: {} }; + for (let i = 0; i < actionList.length; ++i) { + const action = actionList[i]; + if (action === PushRules_1.PushRuleActionName.Notify) { + actionObj.notify = true; + } + else if (typeof action === 'object') { + if (action.value === undefined) { + action.value = true; + } + actionObj.tweaks[action.set_tweak] = action.value; + } } - - var rawrule = templateRuleToRaw(kind, rule); - - if (!rawrule) { - continue; + return actionObj; + } + /** + * Rewrites conditions on a client's push rules to match the defaults + * where applicable. Useful for upgrading push rules to more strict + * conditions when the server is falling behind on defaults. + * @param {object} incomingRules The client's existing push rules + * @returns {object} The rewritten rules + */ + static rewriteDefaultRules(incomingRules) { + let newRules = JSON.parse(JSON.stringify(incomingRules)); // deep clone + // These lines are mostly to make the tests happy. We shouldn't run into these + // properties missing in practice. + if (!newRules) + newRules = {}; + if (!newRules.global) + newRules.global = {}; + if (!newRules.global.override) + newRules.global.override = []; + // Merge the client-level defaults with the ones from the server + const globalOverrides = newRules.global.override; + for (const override of DEFAULT_OVERRIDE_RULES) { + const existingRule = globalOverrides + .find((r) => r.rule_id === override.rule_id); + if (existingRule) { + // Copy over the actions, default, and conditions. Don't touch the user's + // preference. + existingRule.default = override.default; + existingRule.conditions = override.conditions; + existingRule.actions = override.actions; + } + else { + // Add the rule + const ruleId = override.rule_id; + logger_1.logger.warn(`Adding default global override for ${ruleId}`); + globalOverrides.push(override); + } } - - if (_this.ruleMatchesEvent(rawrule, ev)) { - rule.kind = kind; - return rule; + return newRules; + } + matchingRuleFromKindSet(ev, kindset) { + for (let ruleKindIndex = 0; ruleKindIndex < RULEKINDS_IN_ORDER.length; ++ruleKindIndex) { + const kind = RULEKINDS_IN_ORDER[ruleKindIndex]; + const ruleset = kindset[kind]; + if (!ruleset) { + continue; + } + for (let ruleIndex = 0; ruleIndex < ruleset.length; ++ruleIndex) { + const rule = ruleset[ruleIndex]; + if (!rule.enabled) { + continue; + } + const rawrule = this.templateRuleToRaw(kind, rule); + if (!rawrule) { + continue; + } + if (this.ruleMatchesEvent(rawrule, ev)) { + return Object.assign(Object.assign({}, rule), { kind }); + } + } } - } + return null; } - - return null; - }; - - var templateRuleToRaw = function templateRuleToRaw(kind, tprule) { - var rawrule = { - 'rule_id': tprule.rule_id, - 'actions': tprule.actions, - 'conditions': [] - }; - - switch (kind) { - case 'underride': - case 'override': - rawrule.conditions = tprule.conditions; - break; - - case 'room': - if (!tprule.rule_id) { - return null; + templateRuleToRaw(kind, tprule) { + const rawrule = { + 'rule_id': tprule.rule_id, + 'actions': tprule.actions, + 'conditions': [], + }; + switch (kind) { + case PushRules_1.PushRuleKind.Underride: + case PushRules_1.PushRuleKind.Override: + rawrule.conditions = tprule.conditions; + break; + case PushRules_1.PushRuleKind.RoomSpecific: + if (!tprule.rule_id) { + return null; + } + rawrule.conditions.push({ + 'kind': PushRules_1.ConditionKind.EventMatch, + 'key': 'room_id', + 'value': tprule.rule_id, + }); + break; + case PushRules_1.PushRuleKind.SenderSpecific: + if (!tprule.rule_id) { + return null; + } + rawrule.conditions.push({ + 'kind': PushRules_1.ConditionKind.EventMatch, + 'key': 'user_id', + 'value': tprule.rule_id, + }); + break; + case PushRules_1.PushRuleKind.ContentSpecific: + if (!tprule.pattern) { + return null; + } + rawrule.conditions.push({ + 'kind': PushRules_1.ConditionKind.EventMatch, + 'key': 'content.body', + 'pattern': tprule.pattern, + }); + break; } - - rawrule.conditions.push({ - 'kind': 'event_match', - 'key': 'room_id', - 'value': tprule.rule_id - }); - break; - - case 'sender': - if (!tprule.rule_id) { - return null; + return rawrule; + } + eventFulfillsCondition(cond, ev) { + switch (cond.kind) { + case PushRules_1.ConditionKind.EventMatch: + return this.eventFulfillsEventMatchCondition(cond, ev); + case PushRules_1.ConditionKind.ContainsDisplayName: + return this.eventFulfillsDisplayNameCondition(cond, ev); + case PushRules_1.ConditionKind.RoomMemberCount: + return this.eventFulfillsRoomMemberCountCondition(cond, ev); + case PushRules_1.ConditionKind.SenderNotificationPermission: + return this.eventFulfillsSenderNotifPermCondition(cond, ev); } - - rawrule.conditions.push({ - 'kind': 'event_match', - 'key': 'user_id', - 'value': tprule.rule_id - }); - break; - - case 'content': - if (!tprule.pattern) { - return null; - } - - rawrule.conditions.push({ - 'kind': 'event_match', - 'key': 'content.body', - 'pattern': tprule.pattern - }); - break; - } - - return rawrule; - }; - - var eventFulfillsCondition = function eventFulfillsCondition(cond, ev) { - var condition_functions = { - "event_match": eventFulfillsEventMatchCondition, - "contains_display_name": eventFulfillsDisplayNameCondition, - "room_member_count": eventFulfillsRoomMemberCountCondition, - "sender_notification_permission": eventFulfillsSenderNotifPermCondition - }; - - if (condition_functions[cond.kind]) { - return condition_functions[cond.kind](cond, ev); - } // unknown conditions: we previously matched all unknown conditions, - // but given that rules can be added to the base rules on a server, - // it's probably better to not match unknown conditions. - - - return false; - }; - - var eventFulfillsSenderNotifPermCondition = function eventFulfillsSenderNotifPermCondition(cond, ev) { - var notifLevelKey = cond['key']; - - if (!notifLevelKey) { - return false; - } - - var room = client.getRoom(ev.getRoomId()); - - if (!room || !room.currentState) { - return false; - } // Note that this should not be the current state of the room but the state at - // the point the event is in the DAG. Unfortunately the js-sdk does not store - // this. - - - return room.currentState.mayTriggerNotifOfType(notifLevelKey, ev.getSender()); - }; - - var eventFulfillsRoomMemberCountCondition = function eventFulfillsRoomMemberCountCondition(cond, ev) { - if (!cond.is) { - return false; - } - - var room = client.getRoom(ev.getRoomId()); - - if (!room || !room.currentState || !room.currentState.members) { - return false; - } - - var memberCount = room.currentState.getJoinedMemberCount(); - var m = cond.is.match(/^([=<>]*)([0-9]*)$/); - - if (!m) { - return false; - } - - var ineq = m[1]; - var rhs = parseInt(m[2]); - - if (isNaN(rhs)) { - return false; - } - - switch (ineq) { - case '': - case '==': - return memberCount == rhs; - - case '<': - return memberCount < rhs; - - case '>': - return memberCount > rhs; - - case '<=': - return memberCount <= rhs; - - case '>=': - return memberCount >= rhs; - - default: + // unknown conditions: we previously matched all unknown conditions, + // but given that rules can be added to the base rules on a server, + // it's probably better to not match unknown conditions. return false; } - }; - - var eventFulfillsDisplayNameCondition = function eventFulfillsDisplayNameCondition(cond, ev) { - var content = ev.getContent(); - - if (ev.isEncrypted() && ev.getClearContent()) { - content = ev.getClearContent(); - } - - if (!content || !content.body || typeof content.body != 'string') { - return false; - } - - var room = client.getRoom(ev.getRoomId()); - - if (!room || !room.currentState || !room.currentState.members || !room.currentState.getMember(client.credentials.userId)) { - return false; - } - - var displayName = room.currentState.getMember(client.credentials.userId).name; // N.B. we can't use \b as it chokes on unicode. however \W seems to be okay - // as shorthand for [^0-9A-Za-z_]. - - var pat = new RegExp("(^|\\W)" + (0, _utils.escapeRegExp)(displayName) + "(\\W|$)", 'i'); - return content.body.search(pat) > -1; - }; - - var eventFulfillsEventMatchCondition = function eventFulfillsEventMatchCondition(cond, ev) { - if (!cond.key) { - return false; - } - - var val = valueForDottedKey(cond.key, ev); - - if (typeof val !== 'string') { - return false; - } - - if (cond.value) { - return cond.value === val; - } - - if (typeof cond.pattern !== 'string') { - return false; - } - - var regex; - - if (cond.key == 'content.body') { - regex = createCachedRegex('(^|\\W)', cond.pattern, '(\\W|$)'); - } else { - regex = createCachedRegex('^', cond.pattern, '$'); - } - - return !!val.match(regex); - }; - - var createCachedRegex = function createCachedRegex(prefix, glob, suffix) { - if (cachedGlobToRegex[glob]) { - return cachedGlobToRegex[glob]; - } - - cachedGlobToRegex[glob] = new RegExp(prefix + (0, _utils.globToRegexp)(glob) + suffix, 'i'); - return cachedGlobToRegex[glob]; - }; - - var valueForDottedKey = function valueForDottedKey(key, ev) { - var parts = key.split('.'); - var val; // special-case the first component to deal with encrypted messages - - var firstPart = parts[0]; - - if (firstPart === 'content') { - val = ev.getContent(); - parts.shift(); - } else if (firstPart === 'type') { - val = ev.getType(); - parts.shift(); - } else { - // use the raw event for any other fields - val = ev.event; - } - - while (parts.length > 0) { - var thisPart = parts.shift(); - - if ((0, _utils.isNullOrUndefined)(val[thisPart])) { - return null; - } - - val = val[thisPart]; - } - - return val; - }; - - var matchingRuleForEventWithRulesets = function matchingRuleForEventWithRulesets(ev, rulesets) { - if (!rulesets) { - return null; - } - - if (ev.getSender() === client.credentials.userId) { - return null; - } - - return matchingRuleFromKindSet(ev, rulesets.global); - }; - - var pushActionsForEventAndRulesets = function pushActionsForEventAndRulesets(ev, rulesets) { - var rule = matchingRuleForEventWithRulesets(ev, rulesets); - - if (!rule) { - return {}; - } - - var actionObj = PushProcessor.actionListToActionsObject(rule.actions); // Some actions are implicit in some situations: we add those here - - if (actionObj.tweaks.highlight === undefined) { - // if it isn't specified, highlight if it's a content - // rule but otherwise not - actionObj.tweaks.highlight = rule.kind == 'content'; - } - - return actionObj; - }; - - this.ruleMatchesEvent = function (rule, ev) { - var ret = true; - - for (var i = 0; i < rule.conditions.length; ++i) { - var cond = rule.conditions[i]; - ret &= eventFulfillsCondition(cond, ev); - } //console.log("Rule "+rule.rule_id+(ret ? " matches" : " doesn't match")); - - - return ret; - }; - /** - * Get the user's push actions for the given event - * - * @param {module:models/event.MatrixEvent} ev - * - * @return {PushAction} - */ - - - this.actionsForEvent = function (ev) { - return pushActionsForEventAndRulesets(ev, client.pushRules); - }; - /** - * Get one of the users push rules by its ID - * - * @param {string} ruleId The ID of the rule to search for - * @return {object} The push rule, or null if no such rule was found - */ - - - this.getPushRuleById = function (ruleId) { - for (var _i = 0, _arr = ['global']; _i < _arr.length; _i++) { - var scope = _arr[_i]; - if (client.pushRules[scope] === undefined) continue; - - var _iterator = _createForOfIteratorHelper(RULEKINDS_IN_ORDER), - _step; - - try { - for (_iterator.s(); !(_step = _iterator.n()).done;) { - var kind = _step.value; - if (client.pushRules[scope][kind] === undefined) continue; - - var _iterator2 = _createForOfIteratorHelper(client.pushRules[scope][kind]), - _step2; - - try { - for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) { - var rule = _step2.value; - if (rule.rule_id === ruleId) return rule; - } - } catch (err) { - _iterator2.e(err); - } finally { - _iterator2.f(); - } + eventFulfillsSenderNotifPermCondition(cond, ev) { + const notifLevelKey = cond['key']; + if (!notifLevelKey) { + return false; } - } catch (err) { - _iterator.e(err); - } finally { - _iterator.f(); - } + const room = this.client.getRoom(ev.getRoomId()); + if (!(room === null || room === void 0 ? void 0 : room.currentState)) { + return false; + } + // Note that this should not be the current state of the room but the state at + // the point the event is in the DAG. Unfortunately the js-sdk does not store + // this. + return room.currentState.mayTriggerNotifOfType(notifLevelKey, ev.getSender()); + } + eventFulfillsRoomMemberCountCondition(cond, ev) { + if (!cond.is) { + return false; + } + const room = this.client.getRoom(ev.getRoomId()); + if (!room || !room.currentState || !room.currentState.members) { + return false; + } + const memberCount = room.currentState.getJoinedMemberCount(); + const m = cond.is.match(/^([=<>]*)([0-9]*)$/); + if (!m) { + return false; + } + const ineq = m[1]; + const rhs = parseInt(m[2]); + if (isNaN(rhs)) { + return false; + } + switch (ineq) { + case '': + case '==': + return memberCount == rhs; + case '<': + return memberCount < rhs; + case '>': + return memberCount > rhs; + case '<=': + return memberCount <= rhs; + case '>=': + return memberCount >= rhs; + default: + return false; + } + } + eventFulfillsDisplayNameCondition(cond, ev) { + let content = ev.getContent(); + if (ev.isEncrypted() && ev.getClearContent()) { + content = ev.getClearContent(); + } + if (!content || !content.body || typeof content.body != 'string') { + return false; + } + const room = this.client.getRoom(ev.getRoomId()); + if (!room || !room.currentState || !room.currentState.members || + !room.currentState.getMember(this.client.credentials.userId)) { + return false; + } + const displayName = room.currentState.getMember(this.client.credentials.userId).name; + // N.B. we can't use \b as it chokes on unicode. however \W seems to be okay + // as shorthand for [^0-9A-Za-z_]. + const pat = new RegExp("(^|\\W)" + utils_1.escapeRegExp(displayName) + "(\\W|$)", 'i'); + return content.body.search(pat) > -1; + } + eventFulfillsEventMatchCondition(cond, ev) { + if (!cond.key) { + return false; + } + const val = this.valueForDottedKey(cond.key, ev); + if (typeof val !== 'string') { + return false; + } + if (cond.value) { + return cond.value === val; + } + if (typeof cond.pattern !== 'string') { + return false; + } + let regex; + if (cond.key == 'content.body') { + regex = this.createCachedRegex('(^|\\W)', cond.pattern, '(\\W|$)'); + } + else { + regex = this.createCachedRegex('^', cond.pattern, '$'); + } + return !!val.match(regex); + } + createCachedRegex(prefix, glob, suffix) { + if (PushProcessor.cachedGlobToRegex[glob]) { + return PushProcessor.cachedGlobToRegex[glob]; + } + PushProcessor.cachedGlobToRegex[glob] = new RegExp(prefix + utils_1.globToRegexp(glob) + suffix, 'i'); + return PushProcessor.cachedGlobToRegex[glob]; + } + valueForDottedKey(key, ev) { + const parts = key.split('.'); + let val; + // special-case the first component to deal with encrypted messages + const firstPart = parts[0]; + if (firstPart === 'content') { + val = ev.getContent(); + parts.shift(); + } + else if (firstPart === 'type') { + val = ev.getType(); + parts.shift(); + } + else { + // use the raw event for any other fields + val = ev.event; + } + while (parts.length > 0) { + const thisPart = parts.shift(); + if (utils_1.isNullOrUndefined(val[thisPart])) { + return null; + } + val = val[thisPart]; + } + return val; + } + matchingRuleForEventWithRulesets(ev, rulesets) { + if (!rulesets) { + return null; + } + if (ev.getSender() === this.client.credentials.userId) { + return null; + } + return this.matchingRuleFromKindSet(ev, rulesets.global); + } + pushActionsForEventAndRulesets(ev, rulesets) { + const rule = this.matchingRuleForEventWithRulesets(ev, rulesets); + if (!rule) { + return {}; + } + const actionObj = PushProcessor.actionListToActionsObject(rule.actions); + // Some actions are implicit in some situations: we add those here + if (actionObj.tweaks.highlight === undefined) { + // if it isn't specified, highlight if it's a content + // rule but otherwise not + actionObj.tweaks.highlight = (rule.kind == PushRules_1.PushRuleKind.ContentSpecific); + } + return actionObj; + } + ruleMatchesEvent(rule, ev) { + let ret = true; + for (let i = 0; i < rule.conditions.length; ++i) { + const cond = rule.conditions[i]; + // @ts-ignore + ret &= this.eventFulfillsCondition(cond, ev); + } + //console.log("Rule "+rule.rule_id+(ret ? " matches" : " doesn't match")); + return ret; + } + /** + * Get the user's push actions for the given event + * + * @param {module:models/event.MatrixEvent} ev + * + * @return {PushAction} + */ + actionsForEvent(ev) { + return this.pushActionsForEventAndRulesets(ev, this.client.pushRules); + } + /** + * Get one of the users push rules by its ID + * + * @param {string} ruleId The ID of the rule to search for + * @return {object} The push rule, or null if no such rule was found + */ + getPushRuleById(ruleId) { + for (const scope of ['global']) { + if (this.client.pushRules[scope] === undefined) + continue; + for (const kind of RULEKINDS_IN_ORDER) { + if (this.client.pushRules[scope][kind] === undefined) + continue; + for (const rule of this.client.pushRules[scope][kind]) { + if (rule.rule_id === ruleId) + return rule; + } + } + } + return null; } - - return null; - }; } -/** - * Convert a list of actions into a object with the actions as keys and their values - * eg. [ 'notify', { set_tweak: 'sound', value: 'default' } ] - * becomes { notify: true, tweaks: { sound: 'default' } } - * @param {array} actionlist The actions list - * - * @return {object} A object with key 'notify' (true or false) and an object of actions - */ - - -PushProcessor.actionListToActionsObject = function (actionlist) { - var actionobj = { - 'notify': false, - 'tweaks': {} - }; - - for (var i = 0; i < actionlist.length; ++i) { - var action = actionlist[i]; - - if (action === 'notify') { - actionobj.notify = true; - } else if ((0, _typeof2["default"])(action) === 'object') { - if (action.value === undefined) { - action.value = true; - } - - actionobj.tweaks[action.set_tweak] = action.value; - } - } - - return actionobj; -}; -/** - * Rewrites conditions on a client's push rules to match the defaults - * where applicable. Useful for upgrading push rules to more strict - * conditions when the server is falling behind on defaults. - * @param {object} incomingRules The client's existing push rules - * @returns {object} The rewritten rules - */ - - -PushProcessor.rewriteDefaultRules = function (incomingRules) { - var newRules = JSON.parse(JSON.stringify(incomingRules)); // deep clone - // These lines are mostly to make the tests happy. We shouldn't run into these - // properties missing in practice. - - if (!newRules) newRules = {}; - if (!newRules.global) newRules.global = {}; - if (!newRules.global.override) newRules.global.override = []; // Merge the client-level defaults with the ones from the server - - var globalOverrides = newRules.global.override; - - var _iterator3 = _createForOfIteratorHelper(DEFAULT_OVERRIDE_RULES), - _step3; - - try { - var _loop = function _loop() { - var override = _step3.value; - var existingRule = globalOverrides.find(function (r) { - return r.rule_id === override.rule_id; - }); - - if (existingRule) { - // Copy over the actions, default, and conditions. Don't touch the user's - // preference. - existingRule["default"] = override["default"]; - existingRule.conditions = override.conditions; - existingRule.actions = override.actions; - } else { - // Add the rule - var ruleId = override.rule_id; - - _logger.logger.warn("Adding default global override for ".concat(ruleId)); - - globalOverrides.push(override); - } - }; - - for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) { - _loop(); - } - } catch (err) { - _iterator3.e(err); - } finally { - _iterator3.f(); - } - - return newRules; -}; +exports.PushProcessor = PushProcessor; +PushProcessor.cachedGlobToRegex = {}; // $glob: RegExp /** * @typedef {Object} PushAction * @type {Object} @@ -52488,7 +52610,7 @@ PushProcessor.rewriteDefaultRules = function (incomingRules) { * noise. */ -},{"./logger":118,"./utils":149,"@babel/runtime/helpers/interopRequireDefault":12,"@babel/runtime/helpers/typeof":23}],135:[function(require,module,exports){ +},{"./@types/PushRules":68,"./logger":118,"./utils":150}],136:[function(require,module,exports){ "use strict"; /* Copyright 2018 New Vector Ltd @@ -52531,7 +52653,7 @@ function randomStringFrom(len, chars) { return ret; } -},{}],136:[function(require,module,exports){ +},{}],137:[function(require,module,exports){ (function (global){(function (){ "use strict"; @@ -52755,27 +52877,10 @@ function binarySearch(array, func) { }).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"./logger":118}],137:[function(require,module,exports){ +},{"./logger":118}],138:[function(require,module,exports){ "use strict"; - -var _typeof = require("@babel/runtime/helpers/typeof"); - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.MatrixScheduler = MatrixScheduler; - -var utils = _interopRequireWildcard(require("./utils")); - -var _logger = require("./logger"); - -function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } - -function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; } - /* -Copyright 2015, 2016 OpenMarket Ltd -Copyright 2019 The Matrix.org Foundation C.I.C. +Copyright 2015 - 2021 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. @@ -52789,14 +52894,36 @@ 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. */ - +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MatrixScheduler = void 0; /** * This is an internal module which manages queuing, scheduling and retrying * of requests. * @module scheduler */ -var DEBUG = false; // set true to enable console logging. - +const utils = __importStar(require("./utils")); +const logger_1 = require("./logger"); +const event_1 = require("./@types/event"); +const DEBUG = false; // set true to enable console logging. /** * Construct a scheduler for Matrix. Requires * {@link module:scheduler~MatrixScheduler#setProcessFunction} to be provided @@ -52809,278 +52936,233 @@ var DEBUG = false; // set true to enable console logging. * algorithm to apply when determining which events should be sent before the * given event. Defaults to {@link module:scheduler~MatrixScheduler.QUEUE_MESSAGES}. */ - -function MatrixScheduler(retryAlgorithm, queueAlgorithm) { - this.retryAlgorithm = retryAlgorithm || MatrixScheduler.RETRY_BACKOFF_RATELIMIT; - this.queueAlgorithm = queueAlgorithm || MatrixScheduler.QUEUE_MESSAGES; - this._queues = {// queueName: [{ - // event: MatrixEvent, // event to send - // defer: Deferred, // defer to resolve/reject at the END of the retries - // attempts: Number // number of times we've called processFn - // }, ...] - }; - this._activeQueues = []; - this._procFn = null; -} -/** - * Retrieve a queue based on an event. The event provided does not need to be in - * the queue. - * @param {MatrixEvent} event An event to get the queue for. - * @return {?Array} A shallow copy of events in the queue or null. - * Modifying this array will not modify the list itself. Modifying events in - * this array will modify the underlying event in the queue. - * @see MatrixScheduler.removeEventFromQueue To remove an event from the queue. - */ - - -MatrixScheduler.prototype.getQueueForEvent = function (event) { - var name = this.queueAlgorithm(event); - - if (!name || !this._queues[name]) { - return null; - } - - return this._queues[name].map(function (obj) { - return obj.event; - }); -}; -/** - * Remove this event from the queue. The event is equal to another event if they - * have the same ID returned from event.getId(). - * @param {MatrixEvent} event The event to remove. - * @return {boolean} True if this event was removed. - */ - - -MatrixScheduler.prototype.removeEventFromQueue = function (event) { - var name = this.queueAlgorithm(event); - - if (!name || !this._queues[name]) { - return false; - } - - var removed = false; - utils.removeElement(this._queues[name], function (element) { - if (element.event.getId() === event.getId()) { - // XXX we should probably reject the promise? - // https://github.com/matrix-org/matrix-js-sdk/issues/496 - removed = true; - return true; +// eslint-disable-next-line camelcase +class MatrixScheduler { + constructor(retryAlgorithm = MatrixScheduler.RETRY_BACKOFF_RATELIMIT, queueAlgorithm = MatrixScheduler.QUEUE_MESSAGES) { + this.retryAlgorithm = retryAlgorithm; + this.queueAlgorithm = queueAlgorithm; + // queueName: [{ + // event: MatrixEvent, // event to send + // defer: Deferred, // defer to resolve/reject at the END of the retries + // attempts: Number // number of times we've called processFn + // }, ...] + this.queues = {}; + this.activeQueues = []; + this.procFn = null; + this.processQueue = (queueName) => { + // get head of queue + const obj = this.peekNextEvent(queueName); + if (!obj) { + // queue is empty. Mark as inactive and stop recursing. + const index = this.activeQueues.indexOf(queueName); + if (index >= 0) { + this.activeQueues.splice(index, 1); + } + debuglog("Stopping queue '%s' as it is now empty", queueName); + return; + } + debuglog("Queue '%s' has %s pending events", queueName, this.queues[queueName].length); + // fire the process function and if it resolves, resolve the deferred. Else + // invoke the retry algorithm. + // First wait for a resolved promise, so the resolve handlers for + // the deferred of the previously sent event can run. + // This way enqueued relations/redactions to enqueued events can receive + // the remove id of their target before being sent. + Promise.resolve().then(() => { + return this.procFn(obj.event); + }).then((res) => { + // remove this from the queue + this.removeNextEvent(queueName); + debuglog("Queue '%s' sent event %s", queueName, obj.event.getId()); + obj.defer.resolve(res); + // keep processing + this.processQueue(queueName); + }, (err) => { + obj.attempts += 1; + // ask the retry algorithm when/if we should try again + const waitTimeMs = this.retryAlgorithm(obj.event, obj.attempts, err); + debuglog("retry(%s) err=%s event_id=%s waitTime=%s", obj.attempts, err, obj.event.getId(), waitTimeMs); + if (waitTimeMs === -1) { // give up (you quitter!) + debuglog("Queue '%s' giving up on event %s", queueName, obj.event.getId()); + // remove this from the queue + this.removeNextEvent(queueName); + obj.defer.reject(err); + // process next event + this.processQueue(queueName); + } + else { + setTimeout(this.processQueue, waitTimeMs, queueName); + } + }); + }; } - }); - return removed; -}; -/** - * 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 - * processing them. - * @param {module:scheduler~processFn} fn The function that can process events - * in the queue. - */ - - -MatrixScheduler.prototype.setProcessFunction = function (fn) { - this._procFn = fn; - - _startProcessingQueues(this); -}; -/** - * Queue an event if it is required and start processing queues. - * @param {MatrixEvent} event The event that may be queued. - * @return {?Promise} A promise if the event was queued, which will be - * resolved or rejected in due time, else null. - */ - - -MatrixScheduler.prototype.queueEvent = function (event) { - var queueName = this.queueAlgorithm(event); - - if (!queueName) { - return null; - } // add the event to the queue and make a deferred for it. - - - if (!this._queues[queueName]) { - this._queues[queueName] = []; - } - - var defer = utils.defer(); - - this._queues[queueName].push({ - event: event, - defer: defer, - attempts: 0 - }); - - debuglog("Queue algorithm dumped event %s into queue '%s'", event.getId(), queueName); - - _startProcessingQueues(this); - - return defer.promise; -}; -/** - * Retries events up to 4 times using exponential backoff. This produces wait - * times of 2, 4, 8, and 16 seconds (30s total) after which we give up. If the - * failure was due to a rate limited request, the time specified in the error is - * waited before being retried. - * @param {MatrixEvent} event - * @param {Number} attempts - * @param {MatrixError} err - * @return {Number} - * @see module:scheduler~retryAlgorithm - */ - - -MatrixScheduler.RETRY_BACKOFF_RATELIMIT = function (event, attempts, err) { - if (err.httpStatus === 400 || err.httpStatus === 403 || err.httpStatus === 401) { - // client error; no amount of retrying with save you now. - return -1; - } // we ship with browser-request which returns { cors: rejected } when trying - // with no connection, so if we match that, give up since they have no conn. - - - if (err.cors === "rejected") { - return -1; - } // if event that we are trying to send is too large in any way then retrying won't help - - - if (err.name === "M_TOO_LARGE") { - return -1; - } - - if (err.name === "M_LIMIT_EXCEEDED") { - var waitTime = err.data.retry_after_ms; - - if (waitTime > 0) { - return waitTime; + /** + * Retries events up to 4 times using exponential backoff. This produces wait + * times of 2, 4, 8, and 16 seconds (30s total) after which we give up. If the + * failure was due to a rate limited request, the time specified in the error is + * waited before being retried. + * @param {MatrixEvent} event + * @param {Number} attempts + * @param {MatrixError} err + * @return {Number} + * @see module:scheduler~retryAlgorithm + */ + // eslint-disable-next-line @typescript-eslint/naming-convention + static RETRY_BACKOFF_RATELIMIT(event, attempts, err) { + if (err.httpStatus === 400 || err.httpStatus === 403 || err.httpStatus === 401) { + // client error; no amount of retrying with save you now. + return -1; + } + // we ship with browser-request which returns { cors: rejected } when trying + // with no connection, so if we match that, give up since they have no conn. + if (err.cors === "rejected") { + return -1; + } + // if event that we are trying to send is too large in any way then retrying won't help + if (err.name === "M_TOO_LARGE") { + return -1; + } + if (err.name === "M_LIMIT_EXCEEDED") { + const waitTime = err.data.retry_after_ms; + if (waitTime > 0) { + return waitTime; + } + } + if (attempts > 4) { + return -1; // give up + } + return (1000 * Math.pow(2, attempts)); } - } - - if (attempts > 4) { - return -1; // give up - } - - return 1000 * Math.pow(2, attempts); -}; -/** - * Queues m.room.message events and lets other events continue - * concurrently. - * @param {MatrixEvent} event - * @return {string} - * @see module:scheduler~queueAlgorithm - */ - - -MatrixScheduler.QUEUE_MESSAGES = function (event) { - // enqueue messages or events that associate with another event (redactions and relations) - if (event.getType() === "m.room.message" || event.hasAssocation()) { - // put these events in the 'message' queue. - return "message"; - } // allow all other events continue concurrently. - - - return null; -}; - -function _startProcessingQueues(scheduler) { - if (!scheduler._procFn) { - return; - } // for each inactive queue with events in them - - - Object.keys(scheduler._queues).filter(function (queueName) { - return scheduler._activeQueues.indexOf(queueName) === -1 && scheduler._queues[queueName].length > 0; - }).forEach(function (queueName) { - // mark the queue as active - scheduler._activeQueues.push(queueName); // begin processing the head of the queue - - - debuglog("Spinning up queue: '%s'", queueName); - - _processQueue(scheduler, queueName); - }); -} - -function _processQueue(scheduler, queueName) { - // get head of queue - var obj = _peekNextEvent(scheduler, queueName); - - if (!obj) { - // queue is empty. Mark as inactive and stop recursing. - var index = scheduler._activeQueues.indexOf(queueName); - - if (index >= 0) { - scheduler._activeQueues.splice(index, 1); + /** + * Queues m.room.message events and lets other events continue + * concurrently. + * @param {MatrixEvent} event + * @return {string} + * @see module:scheduler~queueAlgorithm + */ + // eslint-disable-next-line @typescript-eslint/naming-convention + static QUEUE_MESSAGES(event) { + // enqueue messages or events that associate with another event (redactions and relations) + if (event.getType() === event_1.EventType.RoomMessage || event.hasAssocation()) { + // put these events in the 'message' queue. + return "message"; + } + // allow all other events continue concurrently. + return null; } - - debuglog("Stopping queue '%s' as it is now empty", queueName); - return; - } - - debuglog("Queue '%s' has %s pending events", queueName, scheduler._queues[queueName].length); // fire the process function and if it resolves, resolve the deferred. Else - // invoke the retry algorithm. - // First wait for a resolved promise, so the resolve handlers for - // the deferred of the previously sent event can run. - // This way enqueued relations/redactions to enqueued events can receive - // the remove id of their target before being sent. - - Promise.resolve().then(function () { - return scheduler._procFn(obj.event); - }).then(function (res) { - // remove this from the queue - _removeNextEvent(scheduler, queueName); - - debuglog("Queue '%s' sent event %s", queueName, obj.event.getId()); - obj.defer.resolve(res); // keep processing - - _processQueue(scheduler, queueName); - }, function (err) { - obj.attempts += 1; // ask the retry algorithm when/if we should try again - - var waitTimeMs = scheduler.retryAlgorithm(obj.event, obj.attempts, err); - debuglog("retry(%s) err=%s event_id=%s waitTime=%s", obj.attempts, err, obj.event.getId(), waitTimeMs); - - if (waitTimeMs === -1) { - // give up (you quitter!) - debuglog("Queue '%s' giving up on event %s", queueName, obj.event.getId()); // remove this from the queue - - _removeNextEvent(scheduler, queueName); - - obj.defer.reject(err); // process next event - - _processQueue(scheduler, queueName); - } else { - setTimeout(function () { - _processQueue(scheduler, queueName); - }, waitTimeMs); + /** + * Retrieve a queue based on an event. The event provided does not need to be in + * the queue. + * @param {MatrixEvent} event An event to get the queue for. + * @return {?Array} A shallow copy of events in the queue or null. + * Modifying this array will not modify the list itself. Modifying events in + * this array will modify the underlying event in the queue. + * @see MatrixScheduler.removeEventFromQueue To remove an event from the queue. + */ + getQueueForEvent(event) { + const name = this.queueAlgorithm(event); + if (!name || !this.queues[name]) { + return null; + } + return this.queues[name].map(function (obj) { + return obj.event; + }); + } + /** + * Remove this event from the queue. The event is equal to another event if they + * have the same ID returned from event.getId(). + * @param {MatrixEvent} event The event to remove. + * @return {boolean} True if this event was removed. + */ + removeEventFromQueue(event) { + const name = this.queueAlgorithm(event); + if (!name || !this.queues[name]) { + return false; + } + let removed = false; + utils.removeElement(this.queues[name], (element) => { + if (element.event.getId() === event.getId()) { + // XXX we should probably reject the promise? + // https://github.com/matrix-org/matrix-js-sdk/issues/496 + removed = true; + return true; + } + }); + return removed; + } + /** + * 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 + * processing them. + * @param {module:scheduler~processFn} fn The function that can process events + * in the queue. + */ + setProcessFunction(fn) { + this.procFn = fn; + this.startProcessingQueues(); + } + /** + * Queue an event if it is required and start processing queues. + * @param {MatrixEvent} event The event that may be queued. + * @return {?Promise} A promise if the event was queued, which will be + * resolved or rejected in due time, else null. + */ + queueEvent(event) { + const queueName = this.queueAlgorithm(event); + if (!queueName) { + return null; + } + // add the event to the queue and make a deferred for it. + if (!this.queues[queueName]) { + this.queues[queueName] = []; + } + const defer = utils.defer(); + this.queues[queueName].push({ + event: event, + defer: defer, + attempts: 0, + }); + debuglog("Queue algorithm dumped event %s into queue '%s'", event.getId(), queueName); + this.startProcessingQueues(); + return defer.promise; + } + startProcessingQueues() { + if (!this.procFn) + return; + // for each inactive queue with events in them + Object.keys(this.queues) + .filter((queueName) => { + return this.activeQueues.indexOf(queueName) === -1 && + this.queues[queueName].length > 0; + }) + .forEach((queueName) => { + // mark the queue as active + this.activeQueues.push(queueName); + // begin processing the head of the queue + debuglog("Spinning up queue: '%s'", queueName); + this.processQueue(queueName); + }); + } + peekNextEvent(queueName) { + const queue = this.queues[queueName]; + if (!Array.isArray(queue)) { + return null; + } + return queue[0]; + } + removeNextEvent(queueName) { + const queue = this.queues[queueName]; + if (!Array.isArray(queue)) { + return null; + } + return queue.shift(); } - }); } - -function _peekNextEvent(scheduler, queueName) { - var queue = scheduler._queues[queueName]; - - if (!Array.isArray(queue)) { - return null; - } - - return queue[0]; -} - -function _removeNextEvent(scheduler, queueName) { - var queue = scheduler._queues[queueName]; - - if (!Array.isArray(queue)) { - return null; - } - - return queue.shift(); -} - -function debuglog() { - if (DEBUG) { - _logger.logger.log.apply(_logger.logger, arguments); - } +exports.MatrixScheduler = MatrixScheduler; +function debuglog(...args) { + if (DEBUG) { + logger_1.logger.log(...args); + } } /** * The retry algorithm to apply when retrying events. To stop retrying, return @@ -53097,7 +53179,6 @@ function debuglog() { * -1, the event will be marked as * {@link module:models/event.EventStatus.NOT_SENT} and will not be retried. */ - /** * The queuing algorithm to apply to events. This function must be idempotent as * it may be called multiple times with the same event. All queues created are @@ -53111,15 +53192,14 @@ function debuglog() { * this name does not exist, it will be created. If this is null, * the event is not put into a queue and will be sent concurrently. */ - /** -* The function to invoke to process (send) events in the queue. -* @callback processFn -* @param {MatrixEvent} event The event to send. -* @return {Promise} Resolved/rejected depending on the outcome of the request. -*/ + * The function to invoke to process (send) events in the queue. + * @callback processFn + * @param {MatrixEvent} event The event to send. + * @return {Promise} Resolved/rejected depending on the outcome of the request. + */ -},{"./logger":118,"./utils":149,"@babel/runtime/helpers/typeof":23}],138:[function(require,module,exports){ +},{"./@types/event":69,"./logger":118,"./utils":150}],139:[function(require,module,exports){ "use strict"; /* Copyright 2019 - 2021 The Matrix.org Foundation C.I.C. @@ -53144,7 +53224,7 @@ var SERVICE_TYPES; SERVICE_TYPES["IM"] = "SERVICE_TYPE_IM"; })(SERVICE_TYPES = exports.SERVICE_TYPES || (exports.SERVICE_TYPES = {})); -},{}],139:[function(require,module,exports){ +},{}],140:[function(require,module,exports){ "use strict"; /* Copyright 2017 - 2021 The Matrix.org Foundation C.I.C. @@ -53664,7 +53744,7 @@ class LocalIndexedDBStoreBackend { } exports.LocalIndexedDBStoreBackend = LocalIndexedDBStoreBackend; -},{"../indexeddb-helpers":116,"../logger":118,"../sync-accumulator":145,"../utils":149}],140:[function(require,module,exports){ +},{"../indexeddb-helpers":116,"../logger":118,"../sync-accumulator":146,"../utils":150}],141:[function(require,module,exports){ "use strict"; /* Copyright 2017 - 2021 The Matrix.org Foundation C.I.C. @@ -53832,7 +53912,7 @@ class RemoteIndexedDBStoreBackend { } exports.RemoteIndexedDBStoreBackend = RemoteIndexedDBStoreBackend; -},{"../logger":118,"../utils":149}],141:[function(require,module,exports){ +},{"../logger":118,"../utils":150}],142:[function(require,module,exports){ "use strict"; /* Copyright 2017 - 2021 Vector Creations Ltd @@ -54127,7 +54207,7 @@ class IndexedDBStore extends memory_1.MemoryStore { } exports.IndexedDBStore = IndexedDBStore; -},{"../logger":118,"../models/event":125,"../models/user":133,"./indexeddb-local-backend":139,"./indexeddb-remote-backend":140,"./memory":142,"events":38}],142:[function(require,module,exports){ +},{"../logger":118,"../models/event":125,"../models/user":134,"./indexeddb-local-backend":140,"./indexeddb-remote-backend":141,"./memory":143,"events":38}],143:[function(require,module,exports){ "use strict"; /* Copyright 2015 - 2021 The Matrix.org Foundation C.I.C. @@ -54222,6 +54302,7 @@ class MemoryStore { /** * Store the given room. * @param {Group} group The group to be stored + * @deprecated groups/communities never made it to the spec and support for them is being discontinued. */ storeGroup(group) { this.groups[group.groupId] = group; @@ -54230,6 +54311,7 @@ class MemoryStore { * Retrieve a group by its group ID. * @param {string} groupId The group ID. * @return {Group} The group or null. + * @deprecated groups/communities never made it to the spec and support for them is being discontinued. */ getGroup(groupId) { return this.groups[groupId] || null; @@ -54237,6 +54319,7 @@ class MemoryStore { /** * Retrieve all known groups. * @return {Group[]} A list of groups, which may be empty. + * @deprecated groups/communities never made it to the spec and support for them is being discontinued. */ getGroups() { return Object.values(this.groups); @@ -54522,7 +54605,7 @@ class MemoryStore { } exports.MemoryStore = MemoryStore; -},{"../models/user":133}],143:[function(require,module,exports){ +},{"../models/user":134}],144:[function(require,module,exports){ "use strict"; var _typeof = require("@babel/runtime/helpers/typeof"); @@ -54807,7 +54890,7 @@ function debuglog() { } } -},{"../../logger":118,"../../utils":149,"@babel/runtime/helpers/typeof":23}],144:[function(require,module,exports){ +},{"../../logger":118,"../../utils":150,"@babel/runtime/helpers/typeof":23}],145:[function(require,module,exports){ "use strict"; /* Copyright 2015 - 2021 The Matrix.org Foundation C.I.C. @@ -54856,12 +54939,14 @@ class StubStore { /** * No-op. * @param {Group} group + * @deprecated groups/communities never made it to the spec and support for them is being discontinued. */ storeGroup(group) { } /** * No-op. * @param {string} groupId * @return {null} + * @deprecated groups/communities never made it to the spec and support for them is being discontinued. */ getGroup(groupId) { return null; @@ -54869,6 +54954,7 @@ class StubStore { /** * No-op. * @return {Array} An empty array. + * @deprecated groups/communities never made it to the spec and support for them is being discontinued. */ getGroups() { return []; @@ -55053,7 +55139,7 @@ class StubStore { } exports.StubStore = StubStore; -},{}],145:[function(require,module,exports){ +},{}],146:[function(require,module,exports){ "use strict"; /* Copyright 2017 - 2021 The Matrix.org Foundation C.I.C. @@ -55586,7 +55672,7 @@ function setState(eventMap, event) { eventMap[event.type][event.state_key] = event; } -},{"./logger":118,"./utils":149}],146:[function(require,module,exports){ +},{"./logger":118,"./utils":150}],147:[function(require,module,exports){ "use strict"; /* Copyright 2021 The Matrix.org Foundation C.I.C. @@ -55616,7 +55702,7 @@ var SyncState; SyncState["Reconnecting"] = "RECONNECTING"; })(SyncState = exports.SyncState || (exports.SyncState = {})); -},{}],147:[function(require,module,exports){ +},{}],148:[function(require,module,exports){ (function (global){(function (){ "use strict"; /* @@ -55684,6 +55770,7 @@ const errors_1 = require("./errors"); const client_1 = require("./client"); const sync_api_1 = require("./sync.api"); const sync_accumulator_1 = require("./sync-accumulator"); +const event_1 = require("./@types/event"); const DEBUG = true; // /sync requests allow you to set a timeout= but the request may continue // beyond that and wedge forever, so we need to track how long we are willing @@ -55750,6 +55837,7 @@ class SyncApi { this.opts.resolveInvitesToProfiles = this.opts.resolveInvitesToProfiles || false; this.opts.pollTimeout = this.opts.pollTimeout || (30 * 1000); this.opts.pendingEventOrdering = this.opts.pendingEventOrdering || client_1.PendingEventOrdering.Chronological; + this.opts.experimentalThreadSupport = this.opts.experimentalThreadSupport === true; if (!opts.canResetEntireTimeline) { opts.canResetEntireTimeline = (roomId) => { return false; @@ -55864,20 +55952,43 @@ class SyncApi { return; } leaveObj.timeline = leaveObj.timeline || {}; - const timelineEvents = this.mapSyncEventsFormat(leaveObj.timeline, room); + const events = this.mapSyncEventsFormat(leaveObj.timeline, room); + const [timelineEvents, threadedEvents] = this.partitionThreadedEvents(events); const stateEvents = this.mapSyncEventsFormat(leaveObj.state, room); // set the back-pagination token. Do this *before* adding any // events so that clients can start back-paginating. room.getLiveTimeline().setPaginationToken(leaveObj.timeline.prev_batch, event_timeline_1.EventTimeline.BACKWARDS); this.processRoomEvents(room, stateEvents, timelineEvents); + this.processThreadEvents(room, threadedEvents); room.recalculate(); client.store.storeRoom(room); client.emit("Room", room); - this.processEventsForNotifs(room, timelineEvents); + this.processEventsForNotifs(room, events); }); return rooms; }); } + /** + * Split events between the ones that will end up in the main + * room timeline versus the one that need to be processed in a thread + * @experimental + */ + partitionThreadedEvents(events) { + if (this.opts.experimentalThreadSupport) { + return events.reduce((memo, event) => { + memo[event.replyEventId ? 1 : 0].push(event); + return memo; + }, [[], []]); + } + else { + // When `experimentalThreadSupport` is disabled + // treat all events as timelineEvents + return [ + events, + [], + ]; + } + } /** * Peek into a room. This will result in the room in question being synced so it * is accessible via getRooms(). Live updates for the room will be provided. @@ -56573,7 +56684,7 @@ class SyncApi { // honour push rules that were previously cached. Base rules // will be updated when we receive push rules via getPushRules // (see sync) before syncing over the network. - if (accountDataEvent.getType() === 'm.push_rules') { + if (accountDataEvent.getType() === event_1.EventType.PushRules) { const rules = accountDataEvent.getContent(); client.pushRules = pushprocessor_1.PushProcessor.rewriteDefaultRules(rules); } @@ -56679,7 +56790,7 @@ class SyncApi { // this helps large account to speed up faster // room::decryptCriticalEvent is in charge of decrypting all the events // required for a client to function properly - const timelineEvents = this.mapSyncEventsFormat(joinObj.timeline, room, false); + const events = this.mapSyncEventsFormat(joinObj.timeline, room, false); const ephemeralEvents = this.mapSyncEventsFormat(joinObj.ephemeral); const accountDataEvents = this.mapSyncEventsFormat(joinObj.account_data); const encrypted = client.isRoomEncrypted(room.roomId); @@ -56715,8 +56826,8 @@ class SyncApi { // which we'll try to paginate but not get any new events (which // will stop us linking the empty timeline into the chain). // - for (let i = timelineEvents.length - 1; i >= 0; i--) { - const eventId = timelineEvents[i].getId(); + for (let i = events.length - 1; i >= 0; i--) { + const eventId = events[i].getId(); if (room.getTimelineForEvent(eventId)) { debuglog("Already have event " + eventId + " in limited " + "sync - not resetting"); @@ -56724,7 +56835,7 @@ class SyncApi { // we might still be missing some of the events before i; // we don't want to be adding them to the end of the // timeline because that would put them out of order. - timelineEvents.splice(0, i); + events.splice(0, i); // XXX: there's a problem here if the skipped part of the // timeline modifies the state set in stateEvents, because // we'll end up using the state from stateEvents rather @@ -56745,7 +56856,9 @@ class SyncApi { this.registerStateListeners(room); } } + const [timelineEvents, threadedEvents] = this.partitionThreadedEvents(events); this.processRoomEvents(room, stateEvents, timelineEvents, syncEventData.fromCache); + this.processThreadEvents(room, threadedEvents); // set summary after processing events, // because it will trigger a name calculation // which needs the room state to be up to date @@ -56761,7 +56874,7 @@ class SyncApi { client.store.storeRoom(room); client.emit("Room", room); } - this.processEventsForNotifs(room, timelineEvents); + this.processEventsForNotifs(room, events); const processRoomEvent = (e) => __awaiter(this, void 0, void 0, function* () { client.emit("event", e); if (e.isState() && e.getType() == "m.room.encryption" && this.opts.crypto) { @@ -56781,6 +56894,7 @@ class SyncApi { }); yield utils.promiseMapSeries(stateEvents, processRoomEvent); yield utils.promiseMapSeries(timelineEvents, processRoomEvent); + yield utils.promiseMapSeries(threadedEvents, processRoomEvent); ephemeralEvents.forEach(function (e) { client.emit("event", e); }); @@ -56797,22 +56911,27 @@ class SyncApi { leaveRooms.forEach((leaveObj) => { const room = leaveObj.room; const stateEvents = this.mapSyncEventsFormat(leaveObj.state, room); - const timelineEvents = this.mapSyncEventsFormat(leaveObj.timeline, room); + const events = this.mapSyncEventsFormat(leaveObj.timeline, room); const accountDataEvents = this.mapSyncEventsFormat(leaveObj.account_data); + const [timelineEvents, threadedEvents] = this.partitionThreadedEvents(events); this.processRoomEvents(room, stateEvents, timelineEvents); + this.processThreadEvents(room, threadedEvents); room.addAccountData(accountDataEvents); room.recalculate(); if (leaveObj.isBrandNewRoom) { client.store.storeRoom(room); client.emit("Room", room); } - this.processEventsForNotifs(room, timelineEvents); + this.processEventsForNotifs(room, events); stateEvents.forEach(function (e) { client.emit("event", e); }); timelineEvents.forEach(function (e) { client.emit("event", e); }); + threadedEvents.forEach(function (e) { + client.emit("event", e); + }); accountDataEvents.forEach(function (e) { client.emit("event", e); }); @@ -57100,6 +57219,14 @@ class SyncApi { // to be decorated with sender etc. room.addLiveEvents(timelineEventList || [], null, fromCache); } + /** + * @experimental + */ + processThreadEvents(room, threadedEvents) { + threadedEvents.forEach(event => { + room.addThreadedEvent(event); + }); + } /** * Takes a list of timelineEvents and adds and adds to notifEvents * as appropriate. @@ -57153,7 +57280,7 @@ function createNewUser(client, userId) { }).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"./client":76,"./errors":111,"./filter":114,"./logger":118,"./models/event-timeline":124,"./models/group":126,"./models/room":131,"./models/user":133,"./pushprocessor":134,"./sync-accumulator":145,"./sync.api":146,"./utils":149}],148:[function(require,module,exports){ +},{"./@types/event":69,"./client":76,"./errors":111,"./filter":114,"./logger":118,"./models/event-timeline":124,"./models/group":126,"./models/room":131,"./models/user":134,"./pushprocessor":135,"./sync-accumulator":146,"./sync.api":147,"./utils":150}],149:[function(require,module,exports){ "use strict"; /* Copyright 2016 - 2021 The Matrix.org Foundation C.I.C. @@ -57619,7 +57746,7 @@ class TimelineIndex { } exports.TimelineIndex = TimelineIndex; -},{"./logger":118,"./models/event-timeline":124}],149:[function(require,module,exports){ +},{"./logger":118,"./models/event-timeline":124}],150:[function(require,module,exports){ "use strict"; /* Copyright 2015, 2016 OpenMarket Ltd @@ -58314,7 +58441,7 @@ function recursivelyAssign(target, source, ignoreNullish = false) { } exports.recursivelyAssign = recursivelyAssign; -},{"p-retry":48,"unhomoglyph":65}],150:[function(require,module,exports){ +},{"p-retry":48,"unhomoglyph":65}],151:[function(require,module,exports){ (function (process){(function (){ "use strict"; /* @@ -58538,6 +58665,23 @@ function genCallID() { class MatrixCall extends events_1.EventEmitter { constructor(opts) { super(); + this.type = null; + this.state = CallState.Fledgling; + // A queue for candidates waiting to go out. + // We try to amalgamate candidates into a single candidate message where + // possible + this.candidateSendQueue = []; + this.candidateSendTries = 0; + this.sentEndOfCandidates = false; + this.feeds = []; + this.usermediaSenders = []; + this.screensharingSenders = []; + this.inviteOrAnswerSent = false; + // The logic of when & if a call is on hold is nontrivial and explained in is*OnHold + // This flag represents whether we want the other party to be on hold + this.remoteOnHold = false; + // Perfect negotiation state: https://www.w3.org/TR/webrtc/#perfect-negotiation-example + this.makingOffer = false; // If candidates arrive before we've picked an opponent (which, in particular, // will happen if the opponent sends candidates eagerly before the user answers // the call) we buffer them up here so we can then add the ones from the party we pick @@ -58813,7 +58957,6 @@ class MatrixCall extends events_1.EventEmitter { this.roomId = opts.roomId; this.invitee = opts.invitee; this.client = opts.client; - this.type = null; this.forceTURN = opts.forceTURN; this.ourPartyId = this.client.deviceId; // Array of Objects with urls, username, credential keys @@ -58827,19 +58970,6 @@ class MatrixCall extends events_1.EventEmitter { utils.checkObjectHasKeys(server, ["urls"]); } this.callId = genCallID(); - this.state = CallState.Fledgling; - // A queue for candidates waiting to go out. - // We try to amalgamate candidates into a single candidate message where - // possible - this.candidateSendQueue = []; - this.candidateSendTries = 0; - this.sentEndOfCandidates = false; - this.inviteOrAnswerSent = false; - this.makingOffer = false; - this.remoteOnHold = false; - this.feeds = []; - this.usermediaSenders = []; - this.screensharingSenders = []; } /** * Place a voice call to this room. @@ -58850,7 +58980,7 @@ class MatrixCall extends events_1.EventEmitter { logger_1.logger.debug("placeVoiceCall"); this.checkForErrorListener(); this.type = CallType.Voice; - yield this.placeCall(ConstraintsType.Audio); + yield this.placeCallWithConstraints(ConstraintsType.Audio); }); } /** @@ -58862,7 +58992,7 @@ class MatrixCall extends events_1.EventEmitter { logger_1.logger.debug("placeVideoCall"); this.checkForErrorListener(); this.type = CallType.Video; - yield this.placeCall(ConstraintsType.Video); + yield this.placeCallWithConstraints(ConstraintsType.Video); }); } getOpponentMember() { @@ -59493,12 +59623,13 @@ class MatrixCall extends events_1.EventEmitter { //debuglog("Ignoring remote ICE candidate because call has ended"); return; } - const candidates = ev.getContent().candidates; + const content = ev.getContent(); + const candidates = content.candidates; if (!candidates) { logger_1.logger.info("Ignoring candidates event with no candidates!"); return; } - const fromPartyId = ev.getContent().version === 0 ? null : ev.getContent().party_id || null; + const fromPartyId = content.version === 0 ? null : content.party_id || null; if (this.opponentPartyId === undefined) { // we haven't picked an opponent yet so save the candidates logger_1.logger.info(`Buffering ${candidates.length} candidates until we pick an opponent`); @@ -59507,8 +59638,8 @@ class MatrixCall extends events_1.EventEmitter { this.remoteCandidateBuffer.set(fromPartyId, bufferedCandidates); return; } - if (!this.partyIdMatches(ev.getContent())) { - logger_1.logger.info(`Ignoring candidates from party ID ${ev.getContent().party_id}: ` + + if (!this.partyIdMatches(content)) { + logger_1.logger.info(`Ignoring candidates from party ID ${content.party_id}: ` + `we have chosen party ID ${this.opponentPartyId}`); return; } @@ -59521,20 +59652,21 @@ class MatrixCall extends events_1.EventEmitter { */ onAnswerReceived(event) { return __awaiter(this, void 0, void 0, function* () { - logger_1.logger.debug(`Got answer for call ID ${this.callId} from party ID ${event.getContent().party_id}`); + const content = event.getContent(); + logger_1.logger.debug(`Got answer for call ID ${this.callId} from party ID ${content.party_id}`); if (this.callHasEnded()) { logger_1.logger.debug(`Ignoring answer because call ID ${this.callId} has ended`); return; } if (this.opponentPartyId !== undefined) { - logger_1.logger.info(`Ignoring answer from party ID ${event.getContent().party_id}: ` + + logger_1.logger.info(`Ignoring answer from party ID ${content.party_id}: ` + `we already have an answer/reject from ${this.opponentPartyId}`); return; } this.chooseOpponent(event); yield this.addBufferedIceCandidates(); this.setState(CallState.Connecting); - const sdpStreamMetadata = event.getContent()[callEventTypes_1.SDPStreamMetadataKey]; + const sdpStreamMetadata = content[callEventTypes_1.SDPStreamMetadataKey]; if (sdpStreamMetadata) { this.updateRemoteSDPStreamMetadata(sdpStreamMetadata); } @@ -59542,7 +59674,7 @@ class MatrixCall extends events_1.EventEmitter { logger_1.logger.warn("Did not get any SDPStreamMetadata! Can not send/receive multiple streams"); } try { - yield this.peerConn.setRemoteDescription(event.getContent().answer); + yield this.peerConn.setRemoteDescription(content.answer); } catch (e) { logger_1.logger.debug("Failed to set remote description", e); @@ -59586,7 +59718,8 @@ class MatrixCall extends events_1.EventEmitter { } onNegotiateReceived(event) { return __awaiter(this, void 0, void 0, function* () { - const description = event.getContent().description; + const content = event.getContent(); + const description = content.description; if (!description || !description.sdp || !description.type) { logger_1.logger.info("Ignoring invalid m.call.negotiate event"); return; @@ -59598,14 +59731,14 @@ class MatrixCall extends events_1.EventEmitter { // Here we follow the perfect negotiation logic from // https://developer.mozilla.org/en-US/docs/Web/API/WebRTC_API/Perfect_negotiation const offerCollision = ((description.type === 'offer') && - (this.makingOffer || this.peerConn.signalingState != 'stable')); + (this.makingOffer || this.peerConn.signalingState !== 'stable')); this.ignoreOffer = !polite && offerCollision; if (this.ignoreOffer) { logger_1.logger.info("Ignoring colliding negotiate event because we're impolite"); return; } const prevLocalOnHold = this.isLocalOnHold(); - const sdpStreamMetadata = event.getContent()[callEventTypes_1.SDPStreamMetadataKey]; + const sdpStreamMetadata = content[callEventTypes_1.SDPStreamMetadataKey]; if (sdpStreamMetadata) { this.updateRemoteSDPStreamMetadata(sdpStreamMetadata); } @@ -59652,11 +59785,12 @@ class MatrixCall extends events_1.EventEmitter { } onAssertedIdentityReceived(event) { return __awaiter(this, void 0, void 0, function* () { - if (!event.getContent().asserted_identity) + const content = event.getContent(); + if (!content.asserted_identity) return; this.remoteAssertedIdentity = { - id: event.getContent().asserted_identity.id, - displayName: event.getContent().asserted_identity.display_name, + id: content.asserted_identity.id, + displayName: content.asserted_identity.display_name, }; this.emit(CallEvent.AssertedIdentityChanged); }); @@ -59760,7 +59894,7 @@ class MatrixCall extends events_1.EventEmitter { replacement_id: genCallID(), target_user: { id: targetUserId, - display_name: profileInfo.display_name, + display_name: profileInfo.displayname, avatar_url: profileInfo.avatar_url, }, create_call: replacementId, @@ -59784,7 +59918,7 @@ class MatrixCall extends events_1.EventEmitter { replacement_id: genCallID(), target_user: { id: this.getOpponentMember().userId, - display_name: transfereeProfileInfo.display_name, + display_name: transfereeProfileInfo.displayname, avatar_url: transfereeProfileInfo.avatar_url, }, await_call: newCallId, @@ -59794,7 +59928,7 @@ class MatrixCall extends events_1.EventEmitter { replacement_id: genCallID(), target_user: { id: transferTargetCall.getOpponentMember().userId, - display_name: targetProfileInfo.display_name, + display_name: targetProfileInfo.displayname, avatar_url: targetProfileInfo.avatar_url, }, create_call: newCallId, @@ -59885,7 +60019,7 @@ class MatrixCall extends events_1.EventEmitter { } }); } - placeCall(constraintsType) { + placeCallWithConstraints(constraintsType) { return __awaiter(this, void 0, void 0, function* () { // XXX Find a better way to do this this.client.callEventHandler.calls.set(this.callId, this); @@ -59990,6 +60124,9 @@ class MatrixCall extends events_1.EventEmitter { } }); } + get hasPeerConnection() { + return Boolean(this.peerConn); + } } exports.MatrixCall = MatrixCall; function getScreensharingStream(selectDesktopCapturerSource) { @@ -60149,7 +60286,7 @@ exports.createNewMatrixCall = createNewMatrixCall; }).call(this)}).call(this,require('_process')) -},{"../@types/event":69,"../logger":118,"../randomstring":135,"../utils":149,"./callEventTypes":152,"./callFeed":153,"_process":49,"events":38}],151:[function(require,module,exports){ +},{"../@types/event":69,"../logger":118,"../randomstring":136,"../utils":150,"./callEventTypes":153,"./callFeed":154,"_process":49,"events":38}],152:[function(require,module,exports){ "use strict"; /* Copyright 2020 The Matrix.org Foundation C.I.C. @@ -60207,7 +60344,7 @@ class CallEventHandler { continue; } try { - this.handleCallEvent(e); + yield this.handleCallEvent(e); } catch (e) { logger_1.logger.error("Caught exception handling call event", e); @@ -60226,7 +60363,7 @@ class CallEventHandler { } if (event.isBeingDecrypted() || event.isDecryptionFailure()) { // add an event listener for once the event is decrypted. - event.once("Event.decrypted", () => { + event.once("Event.decrypted", () => __awaiter(this, void 0, void 0, function* () { if (!this.eventIsACall(event)) return; if (this.callEventBuffer.includes(event)) { @@ -60237,13 +60374,13 @@ class CallEventHandler { // This one wasn't buffered so just run the event handler for it // straight away try { - this.handleCallEvent(event); + yield this.handleCallEvent(event); } catch (e) { logger_1.logger.error("Caught exception handling call event", e); } } - }); + })); } }; this.client = client; @@ -60311,7 +60448,7 @@ class CallEventHandler { return; } call.callId = content.call_id; - const initWithInvitePromise = call.initWithInvite(event); + yield call.initWithInvite(event); this.calls.set(call.callId, call); // if we stashed candidate events for that call ID, play them back now if (this.candidateEventsByCall.get(call.callId)) { @@ -60341,8 +60478,6 @@ class CallEventHandler { existingCall.callId > call.callId) { logger_1.logger.log("Glare detected: answering incoming call " + call.callId + " and canceling outgoing call " + existingCall.callId); - // Await init with invite as we need a peerConn for the following methods - yield initWithInvitePromise; existingCall.replacedBy(call); call.answer(); } @@ -60353,10 +60488,9 @@ class CallEventHandler { } } else { - initWithInvitePromise.then(() => { - this.client.emit("Call.incoming", call); - }); + this.client.emit("Call.incoming", call); } + return; } else if (type === event_1.EventType.CallCandidates) { if (weSentTheEvent) @@ -60371,6 +60505,7 @@ class CallEventHandler { else { call.onRemoteIceCandidatesReceived(event); } + return; } else if ([event_1.EventType.CallHangup, event_1.EventType.CallReject].includes(type)) { // Note that we also observe our own hangups here so we can see @@ -60397,10 +60532,13 @@ class CallEventHandler { this.calls.delete(content.call_id); } } - } - // The following events need a call - if (!call) return; + } + // The following events need a call and a peer connection + if (!call || !call.hasPeerConnection) { + logger_1.logger.warn("Discarding an event, we don't have a call/peerConn", type); + return; + } // Ignore remote echo if (event.getContent().party_id === call.ourPartyId) return; @@ -60435,7 +60573,7 @@ class CallEventHandler { } exports.CallEventHandler = CallEventHandler; -},{"../@types/event":69,"../logger":118,"./call":150}],152:[function(require,module,exports){ +},{"../@types/event":69,"../logger":118,"./call":151}],153:[function(require,module,exports){ "use strict"; // allow non-camelcase as these are events type that go onto the wire /* eslint-disable camelcase */ @@ -60450,7 +60588,7 @@ var SDPStreamMetadataPurpose; })(SDPStreamMetadataPurpose = exports.SDPStreamMetadataPurpose || (exports.SDPStreamMetadataPurpose = {})); /* eslint-enable camelcase */ -},{}],153:[function(require,module,exports){ +},{}],154:[function(require,module,exports){ "use strict"; /* Copyright 2021 Šimon Brandner @@ -60473,10 +60611,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) { Object.defineProperty(exports, "__esModule", { value: true }); exports.CallFeed = exports.CallFeedEvent = void 0; const events_1 = __importDefault(require("events")); +const POLLING_INTERVAL = 250; // ms +const SPEAKING_THRESHOLD = -60; // dB var CallFeedEvent; (function (CallFeedEvent) { CallFeedEvent["NewStream"] = "new_stream"; CallFeedEvent["MuteStateChanged"] = "mute_state_changed"; + CallFeedEvent["VolumeChanged"] = "volume_changed"; + CallFeedEvent["Speaking"] = "speaking"; })(CallFeedEvent = exports.CallFeedEvent || (exports.CallFeedEvent = {})); class CallFeed extends events_1.default { constructor(stream, userId, purpose, client, roomId, audioMuted, videoMuted) { @@ -60488,6 +60630,27 @@ class CallFeed extends events_1.default { this.roomId = roomId; this.audioMuted = audioMuted; this.videoMuted = videoMuted; + this.measuringVolumeActivity = false; + this.speakingThreshold = SPEAKING_THRESHOLD; + this.speaking = false; + if (this.hasAudioTrack) { + this.initVolumeMeasuring(); + } + } + get hasAudioTrack() { + return this.stream.getAudioTracks().length > 0; + } + initVolumeMeasuring() { + const AudioContext = window.AudioContext || window.webkitAudioContext; + if (!this.hasAudioTrack || !AudioContext) + return; + this.audioContext = new AudioContext(); + this.analyser = this.audioContext.createAnalyser(); + this.analyser.fftSize = 512; + this.analyser.smoothingTimeConstant = 0.1; + const mediaStreamAudioSourceNode = this.audioContext.createMediaStreamSource(this.stream); + mediaStreamAudioSourceNode.connect(this.analyser); + this.frequencyBinCount = new Float32Array(this.analyser.frequencyBinCount); } /** * Returns callRoom member @@ -60529,15 +60692,70 @@ class CallFeed extends events_1.default { setNewStream(newStream) { this.stream = newStream; this.emit(CallFeedEvent.NewStream, this.stream); + if (this.hasAudioTrack) { + this.initVolumeMeasuring(); + } + else { + this.measureVolumeActivity(false); + } } + /** + * Set feed's internal audio mute state + * @param muted is the feed's audio muted? + */ setAudioMuted(muted) { this.audioMuted = muted; this.emit(CallFeedEvent.MuteStateChanged, this.audioMuted, this.videoMuted); } + /** + * Set feed's internal video mute state + * @param muted is the feed's video muted? + */ setVideoMuted(muted) { this.videoMuted = muted; this.emit(CallFeedEvent.MuteStateChanged, this.audioMuted, this.videoMuted); } + /** + * Starts emitting volume_changed events where the emitter value is in decibels + * @param enabled emit volume changes + */ + measureVolumeActivity(enabled) { + if (enabled) { + if (!this.audioContext || !this.analyser || !this.frequencyBinCount || !this.hasAudioTrack) + return; + this.measuringVolumeActivity = true; + this.volumeLooper(); + } + else { + this.measuringVolumeActivity = false; + this.emit(CallFeedEvent.VolumeChanged, -Infinity); + } + } + setSpeakingThreshold(threshold) { + this.speakingThreshold = threshold; + } + volumeLooper() { + if (!this.analyser) + return; + setTimeout(() => { + if (!this.measuringVolumeActivity) + return; + this.analyser.getFloatFrequencyData(this.frequencyBinCount); + let maxVolume = -Infinity; + for (let i = 0; i < this.frequencyBinCount.length; i++) { + if (this.frequencyBinCount[i] > maxVolume) { + maxVolume = this.frequencyBinCount[i]; + } + } + this.emit(CallFeedEvent.VolumeChanged, maxVolume); + const newSpeaking = maxVolume > this.speakingThreshold; + if (this.speaking !== newSpeaking) { + this.speaking = newSpeaking; + this.emit(CallFeedEvent.Speaking, this.speaking); + } + this.volumeLooper(); + }, POLLING_INTERVAL); + } } exports.CallFeed = CallFeed; diff --git a/public/browser-matrix.js.map b/public/browser-matrix.js.map index d6a7f16..a6c753a 100644 --- a/public/browser-matrix.js.map +++ b/public/browser-matrix.js.map @@ -118,7 +118,7 @@ "src/filter.ts", "src/http-api.js", "src/indexeddb-helpers.ts", - "src/interactive-auth.js", + "src/interactive-auth.ts", "src/logger.ts", "src/matrix.ts", "src/models/MSC3089Branch.ts", @@ -134,11 +134,12 @@ "src/models/room-summary.ts", "src/models/room.ts", "src/models/search-result.ts", + "src/models/thread.ts", "src/models/user.ts", - "src/pushprocessor.js", + "src/pushprocessor.ts", "src/randomstring.ts", "src/realtime-callbacks.js", - "src/scheduler.js", + "src/scheduler.ts", "src/service-types.ts", "src/store/indexeddb-local-backend.ts", "src/store/indexeddb-remote-backend.ts", @@ -157,7 +158,7 @@ "src/webrtc/callFeed.ts" ], "names": [], - "mappings": "AAAA;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACXA;AACA;AACA;AACA;AACA;AACA;;ACLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACPA;AACA;AACA;AACA;AACA;AACA;;ACLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACdA;AACA;AACA;AACA;AACA;AACA;;ACLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/BA;AACA;AACA;AACA;AACA;AACA;;ACLA;AACA;AACA;AACA;AACA;AACA;;ACLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5CA;AACA;;ACDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3HA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9eA;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;ACrhBA;AACA;AACA;AACA;AACA;;;ACJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;ACjvDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9NA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpDA;AACA;AACA;AACA;AACA;AACA;;ACLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1UA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1CA;AACA;AACA;AACA;AACA;AACA;;ACLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClSA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3PA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrFA;AACA;AACA;AACA;AACA;;ACJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5uBA;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5HA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxqMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5tBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AChBA;;;;;;;;;;;;;;EAcE;;;AAEF,4DAA4D;AAC5D,8BAA8B;AAE9B,IAAY,kBAIX;AAJD,WAAY,kBAAkB;IAC1B,gDAA0B,CAAA;IAC1B,uCAAiB,CAAA;IACjB,2CAAqB,CAAA;AACzB,CAAC,EAJW,kBAAkB,GAAlB,0BAAkB,KAAlB,0BAAkB,QAI7B;AA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;QAC/B,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;QACxB,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,gBAAgB,EAAE,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;IAChF,CAAC;CACJ;AApED,4BAoEC", + "mappings": "AAAA;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACXA;AACA;AACA;AACA;AACA;AACA;;ACLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACPA;AACA;AACA;AACA;AACA;AACA;;ACLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACdA;AACA;AACA;AACA;AACA;AACA;;ACLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/BA;AACA;AACA;AACA;AACA;AACA;;ACLA;AACA;AACA;AACA;AACA;AACA;;ACLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5CA;AACA;;ACDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3HA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9eA;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;ACrhBA;AACA;AACA;AACA;AACA;;;ACJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;ACjvDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9NA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpDA;AACA;AACA;AACA;AACA;AACA;;ACLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1UA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1CA;AACA;AACA;AACA;AACA;AACA;;ACLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClSA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3PA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrFA;AACA;AACA;AACA;AACA;;ACJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClvBA;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5HA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxqMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5tBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AChBA;;;;;;;;;;;;;;EAcE;;;AAEF,4DAA4D;AAC5D,8BAA8B;AAE9B,IAAY,kBAIX;AAJD,WAAY,kBAAkB;IAC1B,gDAA0B,CAAA;IAC1B,uCAAiB,CAAA;IACjB,2CAAqB,CAAA;AACzB,CAAC,EAJW,kBAAkB,GAAlB,0BAAkB,KAAlB,0BAAkB,QAI7B;AAED,IAA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AAC,aAAa,CAAC,aAAa,EAAE,SAAS,CAAC,CAAC;YAClD,MAAM,WAAW,GAAG,SAAS,GAAG,IAAI,CAAC,iBAAiB,CAAC;YACvD,IAAI,IAAI,CAAC,QAAQ,KAAK,WAAW,EAAE;gBAC/B,IAAI,CAAC,QAAQ,GAAG,WAAW,CAAC;gBAC5B,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;aACpD;YAED,IAAI,CAAC,YAAY,EAAE,CAAC;QACxB,CAAC,EAAE,gBAAgB,CAAC,CAAC;IACzB,CAAC;CACJ;AA/JD,4BA+JC", "file": "generated.js", "sourceRoot": "", "sourcesContent": [ @@ -180,7 +181,7 @@ "function _iterableToArrayLimit(arr, i) {\n var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"];\n\n if (_i == null) return;\n var _arr = [];\n var _n = true;\n var _d = false;\n\n var _s, _e;\n\n try {\n for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {\n _arr.push(_s.value);\n\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally {\n try {\n if (!_n && _i[\"return\"] != null) _i[\"return\"]();\n } finally {\n if (_d) throw _e;\n }\n }\n\n return _arr;\n}\n\nmodule.exports = _iterableToArrayLimit;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;", "function _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n\nmodule.exports = _nonIterableRest;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;", "function _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n\nmodule.exports = _nonIterableSpread;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;", - "var _typeof = require(\"@babel/runtime/helpers/typeof\")[\"default\"];\n\nvar assertThisInitialized = require(\"./assertThisInitialized.js\");\n\nfunction _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n }\n\n return assertThisInitialized(self);\n}\n\nmodule.exports = _possibleConstructorReturn;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;", + "var _typeof = require(\"@babel/runtime/helpers/typeof\")[\"default\"];\n\nvar assertThisInitialized = require(\"./assertThisInitialized.js\");\n\nfunction _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n } else if (call !== void 0) {\n throw new TypeError(\"Derived constructors may only return object or undefined\");\n }\n\n return assertThisInitialized(self);\n}\n\nmodule.exports = _possibleConstructorReturn;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;", "function _setPrototypeOf(o, p) {\n module.exports = _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n module.exports[\"default\"] = module.exports, module.exports.__esModule = true;\n return _setPrototypeOf(o, p);\n}\n\nmodule.exports = _setPrototypeOf;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;", "var arrayWithHoles = require(\"./arrayWithHoles.js\");\n\nvar iterableToArrayLimit = require(\"./iterableToArrayLimit.js\");\n\nvar unsupportedIterableToArray = require(\"./unsupportedIterableToArray.js\");\n\nvar nonIterableRest = require(\"./nonIterableRest.js\");\n\nfunction _slicedToArray(arr, i) {\n return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();\n}\n\nmodule.exports = _slicedToArray;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;", "var arrayWithoutHoles = require(\"./arrayWithoutHoles.js\");\n\nvar iterableToArray = require(\"./iterableToArray.js\");\n\nvar unsupportedIterableToArray = require(\"./unsupportedIterableToArray.js\");\n\nvar nonIterableSpread = require(\"./nonIterableSpread.js\");\n\nfunction _toConsumableArray(arr) {\n return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread();\n}\n\nmodule.exports = _toConsumableArray;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;", @@ -219,7 +220,7 @@ "// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n'use strict';\n\n// If obj.hasOwnProperty has been overridden, then calling\n// obj.hasOwnProperty(prop) will break.\n// See: https://github.com/joyent/node/issues/1707\nfunction hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n\nmodule.exports = function(qs, sep, eq, options) {\n sep = sep || '&';\n eq = eq || '=';\n var obj = {};\n\n if (typeof qs !== 'string' || qs.length === 0) {\n return obj;\n }\n\n var regexp = /\\+/g;\n qs = qs.split(sep);\n\n var maxKeys = 1000;\n if (options && typeof options.maxKeys === 'number') {\n maxKeys = options.maxKeys;\n }\n\n var len = qs.length;\n // maxKeys <= 0 means that we should not limit keys count\n if (maxKeys > 0 && len > maxKeys) {\n len = maxKeys;\n }\n\n for (var i = 0; i < len; ++i) {\n var x = qs[i].replace(regexp, '%20'),\n idx = x.indexOf(eq),\n kstr, vstr, k, v;\n\n if (idx >= 0) {\n kstr = x.substr(0, idx);\n vstr = x.substr(idx + 1);\n } else {\n kstr = x;\n vstr = '';\n }\n\n k = decodeURIComponent(kstr);\n v = decodeURIComponent(vstr);\n\n if (!hasOwnProperty(obj, k)) {\n obj[k] = v;\n } else if (isArray(obj[k])) {\n obj[k].push(v);\n } else {\n obj[k] = [obj[k], v];\n }\n }\n\n return obj;\n};\n\nvar isArray = Array.isArray || function (xs) {\n return Object.prototype.toString.call(xs) === '[object Array]';\n};\n", "// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n'use strict';\n\nvar stringifyPrimitive = function(v) {\n switch (typeof v) {\n case 'string':\n return v;\n\n case 'boolean':\n return v ? 'true' : 'false';\n\n case 'number':\n return isFinite(v) ? v : '';\n\n default:\n return '';\n }\n};\n\nmodule.exports = function(obj, sep, eq, name) {\n sep = sep || '&';\n eq = eq || '=';\n if (obj === null) {\n obj = undefined;\n }\n\n if (typeof obj === 'object') {\n return map(objectKeys(obj), function(k) {\n var ks = encodeURIComponent(stringifyPrimitive(k)) + eq;\n if (isArray(obj[k])) {\n return map(obj[k], function(v) {\n return ks + encodeURIComponent(stringifyPrimitive(v));\n }).join(sep);\n } else {\n return ks + encodeURIComponent(stringifyPrimitive(obj[k]));\n }\n }).join(sep);\n\n }\n\n if (!name) return '';\n return encodeURIComponent(stringifyPrimitive(name)) + eq +\n encodeURIComponent(stringifyPrimitive(obj));\n};\n\nvar isArray = Array.isArray || function (xs) {\n return Object.prototype.toString.call(xs) === '[object Array]';\n};\n\nfunction map (xs, f) {\n if (xs.map) return xs.map(f);\n var res = [];\n for (var i = 0; i < xs.length; i++) {\n res.push(f(xs[i], i));\n }\n return res;\n}\n\nvar objectKeys = Object.keys || function (obj) {\n var res = [];\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) res.push(key);\n }\n return res;\n};\n", "'use strict';\n\nexports.decode = exports.parse = require('./decode');\nexports.encode = exports.stringify = require('./encode');\n", - "/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nvar runtime = (function (exports) {\n \"use strict\";\n\n var Op = Object.prototype;\n var hasOwn = Op.hasOwnProperty;\n var undefined; // More compressible than void 0.\n var $Symbol = typeof Symbol === \"function\" ? Symbol : {};\n var iteratorSymbol = $Symbol.iterator || \"@@iterator\";\n var asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\";\n var toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n\n function define(obj, key, value) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n return obj[key];\n }\n try {\n // IE 8 has a broken Object.defineProperty that only works on DOM objects.\n define({}, \"\");\n } catch (err) {\n define = function(obj, key, value) {\n return obj[key] = value;\n };\n }\n\n function wrap(innerFn, outerFn, self, tryLocsList) {\n // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n var generator = Object.create(protoGenerator.prototype);\n var context = new Context(tryLocsList || []);\n\n // The ._invoke method unifies the implementations of the .next,\n // .throw, and .return methods.\n generator._invoke = makeInvokeMethod(innerFn, self, context);\n\n return generator;\n }\n exports.wrap = wrap;\n\n // Try/catch helper to minimize deoptimizations. Returns a completion\n // record like context.tryEntries[i].completion. This interface could\n // have been (and was previously) designed to take a closure to be\n // invoked without arguments, but in all the cases we care about we\n // already have an existing method we want to call, so there's no need\n // to create a new function object. We can even get away with assuming\n // the method takes exactly one argument, since that happens to be true\n // in every case, so we don't have to touch the arguments object. The\n // only additional allocation required is the completion record, which\n // has a stable shape and so hopefully should be cheap to allocate.\n function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }\n\n var GenStateSuspendedStart = \"suspendedStart\";\n var GenStateSuspendedYield = \"suspendedYield\";\n var GenStateExecuting = \"executing\";\n var GenStateCompleted = \"completed\";\n\n // Returning this object from the innerFn has the same effect as\n // breaking out of the dispatch switch statement.\n var ContinueSentinel = {};\n\n // Dummy constructor functions that we use as the .constructor and\n // .constructor.prototype properties for functions that return Generator\n // objects. For full spec compliance, you may wish to configure your\n // minifier not to mangle the names of these two functions.\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n\n // This is a polyfill for %IteratorPrototype% for environments that\n // don't natively support it.\n var IteratorPrototype = {};\n IteratorPrototype[iteratorSymbol] = function () {\n return this;\n };\n\n var getProto = Object.getPrototypeOf;\n var NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n if (NativeIteratorPrototype &&\n NativeIteratorPrototype !== Op &&\n hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n // This environment has a native %IteratorPrototype%; use it instead\n // of the polyfill.\n IteratorPrototype = NativeIteratorPrototype;\n }\n\n var Gp = GeneratorFunctionPrototype.prototype =\n Generator.prototype = Object.create(IteratorPrototype);\n GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;\n GeneratorFunctionPrototype.constructor = GeneratorFunction;\n GeneratorFunction.displayName = define(\n GeneratorFunctionPrototype,\n toStringTagSymbol,\n \"GeneratorFunction\"\n );\n\n // Helper for defining the .next, .throw, and .return methods of the\n // Iterator interface in terms of a single ._invoke method.\n function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n define(prototype, method, function(arg) {\n return this._invoke(method, arg);\n });\n });\n }\n\n exports.isGeneratorFunction = function(genFun) {\n var ctor = typeof genFun === \"function\" && genFun.constructor;\n return ctor\n ? ctor === GeneratorFunction ||\n // For the native GeneratorFunction constructor, the best we can\n // do is to check its .name property.\n (ctor.displayName || ctor.name) === \"GeneratorFunction\"\n : false;\n };\n\n exports.mark = function(genFun) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n } else {\n genFun.__proto__ = GeneratorFunctionPrototype;\n define(genFun, toStringTagSymbol, \"GeneratorFunction\");\n }\n genFun.prototype = Object.create(Gp);\n return genFun;\n };\n\n // Within the body of any async function, `await x` is transformed to\n // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test\n // `hasOwn.call(value, \"__await\")` to determine if the yielded value is\n // meant to be awaited.\n exports.awrap = function(arg) {\n return { __await: arg };\n };\n\n function AsyncIterator(generator, PromiseImpl) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n if (record.type === \"throw\") {\n reject(record.arg);\n } else {\n var result = record.arg;\n var value = result.value;\n if (value &&\n typeof value === \"object\" &&\n hasOwn.call(value, \"__await\")) {\n return PromiseImpl.resolve(value.__await).then(function(value) {\n invoke(\"next\", value, resolve, reject);\n }, function(err) {\n invoke(\"throw\", err, resolve, reject);\n });\n }\n\n return PromiseImpl.resolve(value).then(function(unwrapped) {\n // When a yielded Promise is resolved, its final value becomes\n // the .value of the Promise<{value,done}> result for the\n // current iteration.\n result.value = unwrapped;\n resolve(result);\n }, function(error) {\n // If a rejected Promise was yielded, throw the rejection back\n // into the async generator function so it can be handled there.\n return invoke(\"throw\", error, resolve, reject);\n });\n }\n }\n\n var previousPromise;\n\n function enqueue(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new PromiseImpl(function(resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return previousPromise =\n // If enqueue has been called before, then we want to wait until\n // all previous Promises have been resolved before calling invoke,\n // so that results are always delivered in the correct order. If\n // enqueue has not been called before, then it is important to\n // call invoke immediately, without waiting on a callback to fire,\n // so that the async generator function has the opportunity to do\n // any necessary setup in a predictable way. This predictability\n // is why the Promise constructor synchronously invokes its\n // executor callback, and why async functions synchronously\n // execute code before the first await. Since we implement simple\n // async functions in terms of async generators, it is especially\n // important to get this right, even though it requires care.\n previousPromise ? previousPromise.then(\n callInvokeWithMethodAndArg,\n // Avoid propagating failures to Promises returned by later\n // invocations of the iterator.\n callInvokeWithMethodAndArg\n ) : callInvokeWithMethodAndArg();\n }\n\n // Define the unified helper method that is used to implement .next,\n // .throw, and .return (see defineIteratorMethods).\n this._invoke = enqueue;\n }\n\n defineIteratorMethods(AsyncIterator.prototype);\n AsyncIterator.prototype[asyncIteratorSymbol] = function () {\n return this;\n };\n exports.AsyncIterator = AsyncIterator;\n\n // Note that simple async functions are implemented on top of\n // AsyncIterator objects; they just return a Promise for the value of\n // the final result produced by the iterator.\n exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {\n if (PromiseImpl === void 0) PromiseImpl = Promise;\n\n var iter = new AsyncIterator(\n wrap(innerFn, outerFn, self, tryLocsList),\n PromiseImpl\n );\n\n return exports.isGeneratorFunction(outerFn)\n ? iter // If outerFn is a generator, return the full iterator.\n : iter.next().then(function(result) {\n return result.done ? result.value : iter.next();\n });\n };\n\n function makeInvokeMethod(innerFn, self, context) {\n var state = GenStateSuspendedStart;\n\n return function invoke(method, arg) {\n if (state === GenStateExecuting) {\n throw new Error(\"Generator is already running\");\n }\n\n if (state === GenStateCompleted) {\n if (method === \"throw\") {\n throw arg;\n }\n\n // Be forgiving, per 25.3.3.3.3 of the spec:\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n return doneResult();\n }\n\n context.method = method;\n context.arg = arg;\n\n while (true) {\n var delegate = context.delegate;\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n\n if (context.method === \"next\") {\n // Setting context._sent for legacy support of Babel's\n // function.sent implementation.\n context.sent = context._sent = context.arg;\n\n } else if (context.method === \"throw\") {\n if (state === GenStateSuspendedStart) {\n state = GenStateCompleted;\n throw context.arg;\n }\n\n context.dispatchException(context.arg);\n\n } else if (context.method === \"return\") {\n context.abrupt(\"return\", context.arg);\n }\n\n state = GenStateExecuting;\n\n var record = tryCatch(innerFn, self, context);\n if (record.type === \"normal\") {\n // If an exception is thrown from innerFn, we leave state ===\n // GenStateExecuting and loop back for another invocation.\n state = context.done\n ? GenStateCompleted\n : GenStateSuspendedYield;\n\n if (record.arg === ContinueSentinel) {\n continue;\n }\n\n return {\n value: record.arg,\n done: context.done\n };\n\n } else if (record.type === \"throw\") {\n state = GenStateCompleted;\n // Dispatch the exception by looping back around to the\n // context.dispatchException(context.arg) call above.\n context.method = \"throw\";\n context.arg = record.arg;\n }\n }\n };\n }\n\n // Call delegate.iterator[context.method](context.arg) and handle the\n // result, either by returning a { value, done } result from the\n // delegate iterator, or by modifying context.method and context.arg,\n // setting context.delegate to null, and returning the ContinueSentinel.\n function maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n if (method === undefined) {\n // A .throw or .return when the delegate iterator has no .throw\n // method always terminates the yield* loop.\n context.delegate = null;\n\n if (context.method === \"throw\") {\n // Note: [\"return\"] must be used for ES3 parsing compatibility.\n if (delegate.iterator[\"return\"]) {\n // If the delegate iterator has a return method, give it a\n // chance to clean up.\n context.method = \"return\";\n context.arg = undefined;\n maybeInvokeDelegate(delegate, context);\n\n if (context.method === \"throw\") {\n // If maybeInvokeDelegate(context) changed context.method from\n // \"return\" to \"throw\", let that override the TypeError below.\n return ContinueSentinel;\n }\n }\n\n context.method = \"throw\";\n context.arg = new TypeError(\n \"The iterator does not provide a 'throw' method\");\n }\n\n return ContinueSentinel;\n }\n\n var record = tryCatch(method, delegate.iterator, context.arg);\n\n if (record.type === \"throw\") {\n context.method = \"throw\";\n context.arg = record.arg;\n context.delegate = null;\n return ContinueSentinel;\n }\n\n var info = record.arg;\n\n if (! info) {\n context.method = \"throw\";\n context.arg = new TypeError(\"iterator result is not an object\");\n context.delegate = null;\n return ContinueSentinel;\n }\n\n if (info.done) {\n // Assign the result of the finished delegate to the temporary\n // variable specified by delegate.resultName (see delegateYield).\n context[delegate.resultName] = info.value;\n\n // Resume execution at the desired location (see delegateYield).\n context.next = delegate.nextLoc;\n\n // If context.method was \"throw\" but the delegate handled the\n // exception, let the outer generator proceed normally. If\n // context.method was \"next\", forget context.arg since it has been\n // \"consumed\" by the delegate iterator. If context.method was\n // \"return\", allow the original .return call to continue in the\n // outer generator.\n if (context.method !== \"return\") {\n context.method = \"next\";\n context.arg = undefined;\n }\n\n } else {\n // Re-yield the result returned by the delegate method.\n return info;\n }\n\n // The delegate iterator is finished, so forget it and continue with\n // the outer generator.\n context.delegate = null;\n return ContinueSentinel;\n }\n\n // Define Generator.prototype.{next,throw,return} in terms of the\n // unified ._invoke helper method.\n defineIteratorMethods(Gp);\n\n define(Gp, toStringTagSymbol, \"Generator\");\n\n // A Generator should always return itself as the iterator object when the\n // @@iterator function is called on it. Some browsers' implementations of the\n // iterator prototype chain incorrectly implement this, causing the Generator\n // object to not be returned from this call. This ensures that doesn't happen.\n // See https://github.com/facebook/regenerator/issues/274 for more details.\n Gp[iteratorSymbol] = function() {\n return this;\n };\n\n Gp.toString = function() {\n return \"[object Generator]\";\n };\n\n function pushTryEntry(locs) {\n var entry = { tryLoc: locs[0] };\n\n if (1 in locs) {\n entry.catchLoc = locs[1];\n }\n\n if (2 in locs) {\n entry.finallyLoc = locs[2];\n entry.afterLoc = locs[3];\n }\n\n this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\";\n delete record.arg;\n entry.completion = record;\n }\n\n function Context(tryLocsList) {\n // The root entry object (effectively a try statement without a catch\n // or a finally block) gives us a place to store values thrown from\n // locations where there is no enclosing try statement.\n this.tryEntries = [{ tryLoc: \"root\" }];\n tryLocsList.forEach(pushTryEntry, this);\n this.reset(true);\n }\n\n exports.keys = function(object) {\n var keys = [];\n for (var key in object) {\n keys.push(key);\n }\n keys.reverse();\n\n // Rather than returning an object with a next method, we keep\n // things simple and return the next function itself.\n return function next() {\n while (keys.length) {\n var key = keys.pop();\n if (key in object) {\n next.value = key;\n next.done = false;\n return next;\n }\n }\n\n // To avoid creating an additional object, we just hang the .value\n // and .done properties off the next function object itself. This\n // also ensures that the minifier will not anonymize the function.\n next.done = true;\n return next;\n };\n };\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n\n if (typeof iterable.next === \"function\") {\n return iterable;\n }\n\n if (!isNaN(iterable.length)) {\n var i = -1, next = function next() {\n while (++i < iterable.length) {\n if (hasOwn.call(iterable, i)) {\n next.value = iterable[i];\n next.done = false;\n return next;\n }\n }\n\n next.value = undefined;\n next.done = true;\n\n return next;\n };\n\n return next.next = next;\n }\n }\n\n // Return an iterator with no values.\n return { next: doneResult };\n }\n exports.values = values;\n\n function doneResult() {\n return { value: undefined, done: true };\n }\n\n Context.prototype = {\n constructor: Context,\n\n reset: function(skipTempReset) {\n this.prev = 0;\n this.next = 0;\n // Resetting context._sent for legacy support of Babel's\n // function.sent implementation.\n this.sent = this._sent = undefined;\n this.done = false;\n this.delegate = null;\n\n this.method = \"next\";\n this.arg = undefined;\n\n this.tryEntries.forEach(resetTryEntry);\n\n if (!skipTempReset) {\n for (var name in this) {\n // Not sure about the optimal order of these conditions:\n if (name.charAt(0) === \"t\" &&\n hasOwn.call(this, name) &&\n !isNaN(+name.slice(1))) {\n this[name] = undefined;\n }\n }\n }\n },\n\n stop: function() {\n this.done = true;\n\n var rootEntry = this.tryEntries[0];\n var rootRecord = rootEntry.completion;\n if (rootRecord.type === \"throw\") {\n throw rootRecord.arg;\n }\n\n return this.rval;\n },\n\n dispatchException: function(exception) {\n if (this.done) {\n throw exception;\n }\n\n var context = this;\n function handle(loc, caught) {\n record.type = \"throw\";\n record.arg = exception;\n context.next = loc;\n\n if (caught) {\n // If the dispatched exception was caught by a catch block,\n // then let that catch block handle the exception normally.\n context.method = \"next\";\n context.arg = undefined;\n }\n\n return !! caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n var record = entry.completion;\n\n if (entry.tryLoc === \"root\") {\n // Exception thrown outside of any try block that could handle\n // it, so set the completion value of the entire function to\n // throw the exception.\n return handle(\"end\");\n }\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\");\n var hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n } else if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n }\n\n } else if (hasFinally) {\n if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else {\n throw new Error(\"try statement without catch or finally\");\n }\n }\n }\n },\n\n abrupt: function(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev &&\n hasOwn.call(entry, \"finallyLoc\") &&\n this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n if (finallyEntry &&\n (type === \"break\" ||\n type === \"continue\") &&\n finallyEntry.tryLoc <= arg &&\n arg <= finallyEntry.finallyLoc) {\n // Ignore the finally entry if control is not jumping to a\n // location outside the try/catch block.\n finallyEntry = null;\n }\n\n var record = finallyEntry ? finallyEntry.completion : {};\n record.type = type;\n record.arg = arg;\n\n if (finallyEntry) {\n this.method = \"next\";\n this.next = finallyEntry.finallyLoc;\n return ContinueSentinel;\n }\n\n return this.complete(record);\n },\n\n complete: function(record, afterLoc) {\n if (record.type === \"throw\") {\n throw record.arg;\n }\n\n if (record.type === \"break\" ||\n record.type === \"continue\") {\n this.next = record.arg;\n } else if (record.type === \"return\") {\n this.rval = this.arg = record.arg;\n this.method = \"return\";\n this.next = \"end\";\n } else if (record.type === \"normal\" && afterLoc) {\n this.next = afterLoc;\n }\n\n return ContinueSentinel;\n },\n\n finish: function(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) {\n this.complete(entry.completion, entry.afterLoc);\n resetTryEntry(entry);\n return ContinueSentinel;\n }\n }\n },\n\n \"catch\": function(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (record.type === \"throw\") {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n\n // The context.catch method must only be called with a location\n // argument that corresponds to a known catch block.\n throw new Error(\"illegal catch attempt\");\n },\n\n delegateYield: function(iterable, resultName, nextLoc) {\n this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n };\n\n if (this.method === \"next\") {\n // Deliberately forget the last sent value so that we don't\n // accidentally pass it on to the delegate.\n this.arg = undefined;\n }\n\n return ContinueSentinel;\n }\n };\n\n // Regardless of whether this script is executing as a CommonJS module\n // or not, return the runtime object so that we can declare the variable\n // regeneratorRuntime in the outer scope, which allows this module to be\n // injected easily by `bin/regenerator --include-runtime script.js`.\n return exports;\n\n}(\n // If this script is executing as a CommonJS module, use module.exports\n // as the regeneratorRuntime namespace. Otherwise create a new empty\n // object. Either way, the resulting object will be used to initialize\n // the regeneratorRuntime variable at the top of this file.\n typeof module === \"object\" ? module.exports : {}\n));\n\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n // This module should not be running in strict mode, so the above\n // assignment should always work unless something is misconfigured. Just\n // in case runtime.js accidentally runs in strict mode, we can escape\n // strict mode using a global Function call. This could conceivably fail\n // if a Content Security Policy forbids using Function, but in that case\n // the proper solution is to fix the accidental strict mode problem. If\n // you've misconfigured your bundler to force strict mode and applied a\n // CSP to forbid Function, and you're not willing to fix either of those\n // problems, please detail your unique predicament in a GitHub issue.\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n}\n", + "/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nvar runtime = (function (exports) {\n \"use strict\";\n\n var Op = Object.prototype;\n var hasOwn = Op.hasOwnProperty;\n var undefined; // More compressible than void 0.\n var $Symbol = typeof Symbol === \"function\" ? Symbol : {};\n var iteratorSymbol = $Symbol.iterator || \"@@iterator\";\n var asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\";\n var toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n\n function define(obj, key, value) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n return obj[key];\n }\n try {\n // IE 8 has a broken Object.defineProperty that only works on DOM objects.\n define({}, \"\");\n } catch (err) {\n define = function(obj, key, value) {\n return obj[key] = value;\n };\n }\n\n function wrap(innerFn, outerFn, self, tryLocsList) {\n // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n var generator = Object.create(protoGenerator.prototype);\n var context = new Context(tryLocsList || []);\n\n // The ._invoke method unifies the implementations of the .next,\n // .throw, and .return methods.\n generator._invoke = makeInvokeMethod(innerFn, self, context);\n\n return generator;\n }\n exports.wrap = wrap;\n\n // Try/catch helper to minimize deoptimizations. Returns a completion\n // record like context.tryEntries[i].completion. This interface could\n // have been (and was previously) designed to take a closure to be\n // invoked without arguments, but in all the cases we care about we\n // already have an existing method we want to call, so there's no need\n // to create a new function object. We can even get away with assuming\n // the method takes exactly one argument, since that happens to be true\n // in every case, so we don't have to touch the arguments object. The\n // only additional allocation required is the completion record, which\n // has a stable shape and so hopefully should be cheap to allocate.\n function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }\n\n var GenStateSuspendedStart = \"suspendedStart\";\n var GenStateSuspendedYield = \"suspendedYield\";\n var GenStateExecuting = \"executing\";\n var GenStateCompleted = \"completed\";\n\n // Returning this object from the innerFn has the same effect as\n // breaking out of the dispatch switch statement.\n var ContinueSentinel = {};\n\n // Dummy constructor functions that we use as the .constructor and\n // .constructor.prototype properties for functions that return Generator\n // objects. For full spec compliance, you may wish to configure your\n // minifier not to mangle the names of these two functions.\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n\n // This is a polyfill for %IteratorPrototype% for environments that\n // don't natively support it.\n var IteratorPrototype = {};\n define(IteratorPrototype, iteratorSymbol, function () {\n return this;\n });\n\n var getProto = Object.getPrototypeOf;\n var NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n if (NativeIteratorPrototype &&\n NativeIteratorPrototype !== Op &&\n hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n // This environment has a native %IteratorPrototype%; use it instead\n // of the polyfill.\n IteratorPrototype = NativeIteratorPrototype;\n }\n\n var Gp = GeneratorFunctionPrototype.prototype =\n Generator.prototype = Object.create(IteratorPrototype);\n GeneratorFunction.prototype = GeneratorFunctionPrototype;\n define(Gp, \"constructor\", GeneratorFunctionPrototype);\n define(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction);\n GeneratorFunction.displayName = define(\n GeneratorFunctionPrototype,\n toStringTagSymbol,\n \"GeneratorFunction\"\n );\n\n // Helper for defining the .next, .throw, and .return methods of the\n // Iterator interface in terms of a single ._invoke method.\n function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n define(prototype, method, function(arg) {\n return this._invoke(method, arg);\n });\n });\n }\n\n exports.isGeneratorFunction = function(genFun) {\n var ctor = typeof genFun === \"function\" && genFun.constructor;\n return ctor\n ? ctor === GeneratorFunction ||\n // For the native GeneratorFunction constructor, the best we can\n // do is to check its .name property.\n (ctor.displayName || ctor.name) === \"GeneratorFunction\"\n : false;\n };\n\n exports.mark = function(genFun) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n } else {\n genFun.__proto__ = GeneratorFunctionPrototype;\n define(genFun, toStringTagSymbol, \"GeneratorFunction\");\n }\n genFun.prototype = Object.create(Gp);\n return genFun;\n };\n\n // Within the body of any async function, `await x` is transformed to\n // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test\n // `hasOwn.call(value, \"__await\")` to determine if the yielded value is\n // meant to be awaited.\n exports.awrap = function(arg) {\n return { __await: arg };\n };\n\n function AsyncIterator(generator, PromiseImpl) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n if (record.type === \"throw\") {\n reject(record.arg);\n } else {\n var result = record.arg;\n var value = result.value;\n if (value &&\n typeof value === \"object\" &&\n hasOwn.call(value, \"__await\")) {\n return PromiseImpl.resolve(value.__await).then(function(value) {\n invoke(\"next\", value, resolve, reject);\n }, function(err) {\n invoke(\"throw\", err, resolve, reject);\n });\n }\n\n return PromiseImpl.resolve(value).then(function(unwrapped) {\n // When a yielded Promise is resolved, its final value becomes\n // the .value of the Promise<{value,done}> result for the\n // current iteration.\n result.value = unwrapped;\n resolve(result);\n }, function(error) {\n // If a rejected Promise was yielded, throw the rejection back\n // into the async generator function so it can be handled there.\n return invoke(\"throw\", error, resolve, reject);\n });\n }\n }\n\n var previousPromise;\n\n function enqueue(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new PromiseImpl(function(resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return previousPromise =\n // If enqueue has been called before, then we want to wait until\n // all previous Promises have been resolved before calling invoke,\n // so that results are always delivered in the correct order. If\n // enqueue has not been called before, then it is important to\n // call invoke immediately, without waiting on a callback to fire,\n // so that the async generator function has the opportunity to do\n // any necessary setup in a predictable way. This predictability\n // is why the Promise constructor synchronously invokes its\n // executor callback, and why async functions synchronously\n // execute code before the first await. Since we implement simple\n // async functions in terms of async generators, it is especially\n // important to get this right, even though it requires care.\n previousPromise ? previousPromise.then(\n callInvokeWithMethodAndArg,\n // Avoid propagating failures to Promises returned by later\n // invocations of the iterator.\n callInvokeWithMethodAndArg\n ) : callInvokeWithMethodAndArg();\n }\n\n // Define the unified helper method that is used to implement .next,\n // .throw, and .return (see defineIteratorMethods).\n this._invoke = enqueue;\n }\n\n defineIteratorMethods(AsyncIterator.prototype);\n define(AsyncIterator.prototype, asyncIteratorSymbol, function () {\n return this;\n });\n exports.AsyncIterator = AsyncIterator;\n\n // Note that simple async functions are implemented on top of\n // AsyncIterator objects; they just return a Promise for the value of\n // the final result produced by the iterator.\n exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {\n if (PromiseImpl === void 0) PromiseImpl = Promise;\n\n var iter = new AsyncIterator(\n wrap(innerFn, outerFn, self, tryLocsList),\n PromiseImpl\n );\n\n return exports.isGeneratorFunction(outerFn)\n ? iter // If outerFn is a generator, return the full iterator.\n : iter.next().then(function(result) {\n return result.done ? result.value : iter.next();\n });\n };\n\n function makeInvokeMethod(innerFn, self, context) {\n var state = GenStateSuspendedStart;\n\n return function invoke(method, arg) {\n if (state === GenStateExecuting) {\n throw new Error(\"Generator is already running\");\n }\n\n if (state === GenStateCompleted) {\n if (method === \"throw\") {\n throw arg;\n }\n\n // Be forgiving, per 25.3.3.3.3 of the spec:\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n return doneResult();\n }\n\n context.method = method;\n context.arg = arg;\n\n while (true) {\n var delegate = context.delegate;\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n\n if (context.method === \"next\") {\n // Setting context._sent for legacy support of Babel's\n // function.sent implementation.\n context.sent = context._sent = context.arg;\n\n } else if (context.method === \"throw\") {\n if (state === GenStateSuspendedStart) {\n state = GenStateCompleted;\n throw context.arg;\n }\n\n context.dispatchException(context.arg);\n\n } else if (context.method === \"return\") {\n context.abrupt(\"return\", context.arg);\n }\n\n state = GenStateExecuting;\n\n var record = tryCatch(innerFn, self, context);\n if (record.type === \"normal\") {\n // If an exception is thrown from innerFn, we leave state ===\n // GenStateExecuting and loop back for another invocation.\n state = context.done\n ? GenStateCompleted\n : GenStateSuspendedYield;\n\n if (record.arg === ContinueSentinel) {\n continue;\n }\n\n return {\n value: record.arg,\n done: context.done\n };\n\n } else if (record.type === \"throw\") {\n state = GenStateCompleted;\n // Dispatch the exception by looping back around to the\n // context.dispatchException(context.arg) call above.\n context.method = \"throw\";\n context.arg = record.arg;\n }\n }\n };\n }\n\n // Call delegate.iterator[context.method](context.arg) and handle the\n // result, either by returning a { value, done } result from the\n // delegate iterator, or by modifying context.method and context.arg,\n // setting context.delegate to null, and returning the ContinueSentinel.\n function maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n if (method === undefined) {\n // A .throw or .return when the delegate iterator has no .throw\n // method always terminates the yield* loop.\n context.delegate = null;\n\n if (context.method === \"throw\") {\n // Note: [\"return\"] must be used for ES3 parsing compatibility.\n if (delegate.iterator[\"return\"]) {\n // If the delegate iterator has a return method, give it a\n // chance to clean up.\n context.method = \"return\";\n context.arg = undefined;\n maybeInvokeDelegate(delegate, context);\n\n if (context.method === \"throw\") {\n // If maybeInvokeDelegate(context) changed context.method from\n // \"return\" to \"throw\", let that override the TypeError below.\n return ContinueSentinel;\n }\n }\n\n context.method = \"throw\";\n context.arg = new TypeError(\n \"The iterator does not provide a 'throw' method\");\n }\n\n return ContinueSentinel;\n }\n\n var record = tryCatch(method, delegate.iterator, context.arg);\n\n if (record.type === \"throw\") {\n context.method = \"throw\";\n context.arg = record.arg;\n context.delegate = null;\n return ContinueSentinel;\n }\n\n var info = record.arg;\n\n if (! info) {\n context.method = \"throw\";\n context.arg = new TypeError(\"iterator result is not an object\");\n context.delegate = null;\n return ContinueSentinel;\n }\n\n if (info.done) {\n // Assign the result of the finished delegate to the temporary\n // variable specified by delegate.resultName (see delegateYield).\n context[delegate.resultName] = info.value;\n\n // Resume execution at the desired location (see delegateYield).\n context.next = delegate.nextLoc;\n\n // If context.method was \"throw\" but the delegate handled the\n // exception, let the outer generator proceed normally. If\n // context.method was \"next\", forget context.arg since it has been\n // \"consumed\" by the delegate iterator. If context.method was\n // \"return\", allow the original .return call to continue in the\n // outer generator.\n if (context.method !== \"return\") {\n context.method = \"next\";\n context.arg = undefined;\n }\n\n } else {\n // Re-yield the result returned by the delegate method.\n return info;\n }\n\n // The delegate iterator is finished, so forget it and continue with\n // the outer generator.\n context.delegate = null;\n return ContinueSentinel;\n }\n\n // Define Generator.prototype.{next,throw,return} in terms of the\n // unified ._invoke helper method.\n defineIteratorMethods(Gp);\n\n define(Gp, toStringTagSymbol, \"Generator\");\n\n // A Generator should always return itself as the iterator object when the\n // @@iterator function is called on it. Some browsers' implementations of the\n // iterator prototype chain incorrectly implement this, causing the Generator\n // object to not be returned from this call. This ensures that doesn't happen.\n // See https://github.com/facebook/regenerator/issues/274 for more details.\n define(Gp, iteratorSymbol, function() {\n return this;\n });\n\n define(Gp, \"toString\", function() {\n return \"[object Generator]\";\n });\n\n function pushTryEntry(locs) {\n var entry = { tryLoc: locs[0] };\n\n if (1 in locs) {\n entry.catchLoc = locs[1];\n }\n\n if (2 in locs) {\n entry.finallyLoc = locs[2];\n entry.afterLoc = locs[3];\n }\n\n this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\";\n delete record.arg;\n entry.completion = record;\n }\n\n function Context(tryLocsList) {\n // The root entry object (effectively a try statement without a catch\n // or a finally block) gives us a place to store values thrown from\n // locations where there is no enclosing try statement.\n this.tryEntries = [{ tryLoc: \"root\" }];\n tryLocsList.forEach(pushTryEntry, this);\n this.reset(true);\n }\n\n exports.keys = function(object) {\n var keys = [];\n for (var key in object) {\n keys.push(key);\n }\n keys.reverse();\n\n // Rather than returning an object with a next method, we keep\n // things simple and return the next function itself.\n return function next() {\n while (keys.length) {\n var key = keys.pop();\n if (key in object) {\n next.value = key;\n next.done = false;\n return next;\n }\n }\n\n // To avoid creating an additional object, we just hang the .value\n // and .done properties off the next function object itself. This\n // also ensures that the minifier will not anonymize the function.\n next.done = true;\n return next;\n };\n };\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n\n if (typeof iterable.next === \"function\") {\n return iterable;\n }\n\n if (!isNaN(iterable.length)) {\n var i = -1, next = function next() {\n while (++i < iterable.length) {\n if (hasOwn.call(iterable, i)) {\n next.value = iterable[i];\n next.done = false;\n return next;\n }\n }\n\n next.value = undefined;\n next.done = true;\n\n return next;\n };\n\n return next.next = next;\n }\n }\n\n // Return an iterator with no values.\n return { next: doneResult };\n }\n exports.values = values;\n\n function doneResult() {\n return { value: undefined, done: true };\n }\n\n Context.prototype = {\n constructor: Context,\n\n reset: function(skipTempReset) {\n this.prev = 0;\n this.next = 0;\n // Resetting context._sent for legacy support of Babel's\n // function.sent implementation.\n this.sent = this._sent = undefined;\n this.done = false;\n this.delegate = null;\n\n this.method = \"next\";\n this.arg = undefined;\n\n this.tryEntries.forEach(resetTryEntry);\n\n if (!skipTempReset) {\n for (var name in this) {\n // Not sure about the optimal order of these conditions:\n if (name.charAt(0) === \"t\" &&\n hasOwn.call(this, name) &&\n !isNaN(+name.slice(1))) {\n this[name] = undefined;\n }\n }\n }\n },\n\n stop: function() {\n this.done = true;\n\n var rootEntry = this.tryEntries[0];\n var rootRecord = rootEntry.completion;\n if (rootRecord.type === \"throw\") {\n throw rootRecord.arg;\n }\n\n return this.rval;\n },\n\n dispatchException: function(exception) {\n if (this.done) {\n throw exception;\n }\n\n var context = this;\n function handle(loc, caught) {\n record.type = \"throw\";\n record.arg = exception;\n context.next = loc;\n\n if (caught) {\n // If the dispatched exception was caught by a catch block,\n // then let that catch block handle the exception normally.\n context.method = \"next\";\n context.arg = undefined;\n }\n\n return !! caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n var record = entry.completion;\n\n if (entry.tryLoc === \"root\") {\n // Exception thrown outside of any try block that could handle\n // it, so set the completion value of the entire function to\n // throw the exception.\n return handle(\"end\");\n }\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\");\n var hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n } else if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n }\n\n } else if (hasFinally) {\n if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else {\n throw new Error(\"try statement without catch or finally\");\n }\n }\n }\n },\n\n abrupt: function(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev &&\n hasOwn.call(entry, \"finallyLoc\") &&\n this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n if (finallyEntry &&\n (type === \"break\" ||\n type === \"continue\") &&\n finallyEntry.tryLoc <= arg &&\n arg <= finallyEntry.finallyLoc) {\n // Ignore the finally entry if control is not jumping to a\n // location outside the try/catch block.\n finallyEntry = null;\n }\n\n var record = finallyEntry ? finallyEntry.completion : {};\n record.type = type;\n record.arg = arg;\n\n if (finallyEntry) {\n this.method = \"next\";\n this.next = finallyEntry.finallyLoc;\n return ContinueSentinel;\n }\n\n return this.complete(record);\n },\n\n complete: function(record, afterLoc) {\n if (record.type === \"throw\") {\n throw record.arg;\n }\n\n if (record.type === \"break\" ||\n record.type === \"continue\") {\n this.next = record.arg;\n } else if (record.type === \"return\") {\n this.rval = this.arg = record.arg;\n this.method = \"return\";\n this.next = \"end\";\n } else if (record.type === \"normal\" && afterLoc) {\n this.next = afterLoc;\n }\n\n return ContinueSentinel;\n },\n\n finish: function(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) {\n this.complete(entry.completion, entry.afterLoc);\n resetTryEntry(entry);\n return ContinueSentinel;\n }\n }\n },\n\n \"catch\": function(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (record.type === \"throw\") {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n\n // The context.catch method must only be called with a location\n // argument that corresponds to a known catch block.\n throw new Error(\"illegal catch attempt\");\n },\n\n delegateYield: function(iterable, resultName, nextLoc) {\n this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n };\n\n if (this.method === \"next\") {\n // Deliberately forget the last sent value so that we don't\n // accidentally pass it on to the delegate.\n this.arg = undefined;\n }\n\n return ContinueSentinel;\n }\n };\n\n // Regardless of whether this script is executing as a CommonJS module\n // or not, return the runtime object so that we can declare the variable\n // regeneratorRuntime in the outer scope, which allows this module to be\n // injected easily by `bin/regenerator --include-runtime script.js`.\n return exports;\n\n}(\n // If this script is executing as a CommonJS module, use module.exports\n // as the regeneratorRuntime namespace. Otherwise create a new empty\n // object. Either way, the resulting object will be used to initialize\n // the regeneratorRuntime variable at the top of this file.\n typeof module === \"object\" ? module.exports : {}\n));\n\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n // This module should not be running in strict mode, so the above\n // assignment should always work unless something is misconfigured. Just\n // in case runtime.js accidentally runs in strict mode, in modern engines\n // we can explicitly access globalThis. In older engines we can escape\n // strict mode using a global Function call. This could conceivably fail\n // if a Content Security Policy forbids using Function, but in that case\n // the proper solution is to fix the accidental strict mode problem. If\n // you've misconfigured your bundler to force strict mode and applied a\n // CSP to forbid Function, and you're not willing to fix either of those\n // problems, please detail your unique predicament in a GitHub issue.\n if (typeof globalThis === \"object\") {\n globalThis.regeneratorRuntime = runtime;\n } else {\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n }\n}\n", "module.exports = require('./lib/retry');", "var RetryOperation = require('./retry_operation');\n\nexports.operation = function(options) {\n var timeouts = exports.timeouts(options);\n return new RetryOperation(timeouts, {\n forever: options && (options.forever || options.retries === Infinity),\n unref: options && options.unref,\n maxRetryTime: options && options.maxRetryTime\n });\n};\n\nexports.timeouts = function(options) {\n if (options instanceof Array) {\n return [].concat(options);\n }\n\n var opts = {\n retries: 10,\n factor: 2,\n minTimeout: 1 * 1000,\n maxTimeout: Infinity,\n randomize: false\n };\n for (var key in options) {\n opts[key] = options[key];\n }\n\n if (opts.minTimeout > opts.maxTimeout) {\n throw new Error('minTimeout is greater than maxTimeout');\n }\n\n var timeouts = [];\n for (var i = 0; i < opts.retries; i++) {\n timeouts.push(this.createTimeout(i, opts));\n }\n\n if (options && options.forever && !timeouts.length) {\n timeouts.push(this.createTimeout(i, opts));\n }\n\n // sort the array numerically ascending\n timeouts.sort(function(a,b) {\n return a - b;\n });\n\n return timeouts;\n};\n\nexports.createTimeout = function(attempt, opts) {\n var random = (opts.randomize)\n ? (Math.random() + 1)\n : 1;\n\n var timeout = Math.round(random * Math.max(opts.minTimeout, 1) * Math.pow(opts.factor, attempt));\n timeout = Math.min(timeout, opts.maxTimeout);\n\n return timeout;\n};\n\nexports.wrap = function(obj, options, methods) {\n if (options instanceof Array) {\n methods = options;\n options = null;\n }\n\n if (!methods) {\n methods = [];\n for (var key in obj) {\n if (typeof obj[key] === 'function') {\n methods.push(key);\n }\n }\n }\n\n for (var i = 0; i < methods.length; i++) {\n var method = methods[i];\n var original = obj[method];\n\n obj[method] = function retryWrapper(original) {\n var op = exports.operation(options);\n var args = Array.prototype.slice.call(arguments, 1);\n var callback = args.pop();\n\n args.push(function(err) {\n if (op.retry(err)) {\n return;\n }\n if (err) {\n arguments[0] = op.mainError();\n }\n callback.apply(this, arguments);\n });\n\n op.attempt(function() {\n original.apply(obj, args);\n });\n }.bind(obj, original);\n obj[method].options = options;\n }\n};\n", "function RetryOperation(timeouts, options) {\n // Compatibility for the old (timeouts, retryForever) signature\n if (typeof options === 'boolean') {\n options = { forever: options };\n }\n\n this._originalTimeouts = JSON.parse(JSON.stringify(timeouts));\n this._timeouts = timeouts;\n this._options = options || {};\n this._maxRetryTime = options && options.maxRetryTime || Infinity;\n this._fn = null;\n this._errors = [];\n this._attempts = 1;\n this._operationTimeout = null;\n this._operationTimeoutCb = null;\n this._timeout = null;\n this._operationStart = null;\n this._timer = null;\n\n if (this._options.forever) {\n this._cachedTimeouts = this._timeouts.slice(0);\n }\n}\nmodule.exports = RetryOperation;\n\nRetryOperation.prototype.reset = function() {\n this._attempts = 1;\n this._timeouts = this._originalTimeouts.slice(0);\n}\n\nRetryOperation.prototype.stop = function() {\n if (this._timeout) {\n clearTimeout(this._timeout);\n }\n if (this._timer) {\n clearTimeout(this._timer);\n }\n\n this._timeouts = [];\n this._cachedTimeouts = null;\n};\n\nRetryOperation.prototype.retry = function(err) {\n if (this._timeout) {\n clearTimeout(this._timeout);\n }\n\n if (!err) {\n return false;\n }\n var currentTime = new Date().getTime();\n if (err && currentTime - this._operationStart >= this._maxRetryTime) {\n this._errors.push(err);\n this._errors.unshift(new Error('RetryOperation timeout occurred'));\n return false;\n }\n\n this._errors.push(err);\n\n var timeout = this._timeouts.shift();\n if (timeout === undefined) {\n if (this._cachedTimeouts) {\n // retry forever, only keep last error\n this._errors.splice(0, this._errors.length - 1);\n timeout = this._cachedTimeouts.slice(-1);\n } else {\n return false;\n }\n }\n\n var self = this;\n this._timer = setTimeout(function() {\n self._attempts++;\n\n if (self._operationTimeoutCb) {\n self._timeout = setTimeout(function() {\n self._operationTimeoutCb(self._attempts);\n }, self._operationTimeout);\n\n if (self._options.unref) {\n self._timeout.unref();\n }\n }\n\n self._fn(self._attempts);\n }, timeout);\n\n if (this._options.unref) {\n this._timer.unref();\n }\n\n return true;\n};\n\nRetryOperation.prototype.attempt = function(fn, timeoutOps) {\n this._fn = fn;\n\n if (timeoutOps) {\n if (timeoutOps.timeout) {\n this._operationTimeout = timeoutOps.timeout;\n }\n if (timeoutOps.cb) {\n this._operationTimeoutCb = timeoutOps.cb;\n }\n }\n\n var self = this;\n if (this._operationTimeoutCb) {\n this._timeout = setTimeout(function() {\n self._operationTimeoutCb();\n }, self._operationTimeout);\n }\n\n this._operationStart = new Date().getTime();\n\n this._fn(this._attempts);\n};\n\nRetryOperation.prototype.try = function(fn) {\n console.log('Using RetryOperation.try() is deprecated');\n this.attempt(fn);\n};\n\nRetryOperation.prototype.start = function(fn) {\n console.log('Using RetryOperation.start() is deprecated');\n this.attempt(fn);\n};\n\nRetryOperation.prototype.start = RetryOperation.prototype.try;\n\nRetryOperation.prototype.errors = function() {\n return this._errors;\n};\n\nRetryOperation.prototype.attempts = function() {\n return this._attempts;\n};\n\nRetryOperation.prototype.mainError = function() {\n if (this._errors.length === 0) {\n return null;\n }\n\n var counts = {};\n var mainError = null;\n var mainErrorCount = 0;\n\n for (var i = 0; i < this._errors.length; i++) {\n var error = this._errors[i];\n var message = error.message;\n var count = (counts[message] || 0) + 1;\n\n counts[message] = count;\n\n if (count >= mainErrorCount) {\n mainError = error;\n mainErrorCount = count;\n }\n }\n\n return mainError;\n};\n", @@ -229,7 +230,7 @@ "'use strict';\n\n\nvar data = require('./data.json');\n\nfunction escapeRegexp(str) {\n return str.replace(/([.?*+^$[\\]\\\\(){}|-])/g, '\\\\$1');\n}\n\nvar REPLACE_RE = RegExp(Object.keys(data).map(escapeRegexp).join('|'), 'g');\n\nfunction replace_fn(match) {\n return data[match];\n}\n\nfunction unhomoglyph(str) {\n return str.replace(REPLACE_RE, replace_fn);\n}\n\nmodule.exports = unhomoglyph;\n", "// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n'use strict';\n\nvar punycode = require('punycode');\nvar util = require('./util');\n\nexports.parse = urlParse;\nexports.resolve = urlResolve;\nexports.resolveObject = urlResolveObject;\nexports.format = urlFormat;\n\nexports.Url = Url;\n\nfunction Url() {\n this.protocol = null;\n this.slashes = null;\n this.auth = null;\n this.host = null;\n this.port = null;\n this.hostname = null;\n this.hash = null;\n this.search = null;\n this.query = null;\n this.pathname = null;\n this.path = null;\n this.href = null;\n}\n\n// Reference: RFC 3986, RFC 1808, RFC 2396\n\n// define these here so at least they only have to be\n// compiled once on the first module load.\nvar protocolPattern = /^([a-z0-9.+-]+:)/i,\n portPattern = /:[0-9]*$/,\n\n // Special case for a simple path URL\n simplePathPattern = /^(\\/\\/?(?!\\/)[^\\?\\s]*)(\\?[^\\s]*)?$/,\n\n // RFC 2396: characters reserved for delimiting URLs.\n // We actually just auto-escape these.\n delims = ['<', '>', '\"', '`', ' ', '\\r', '\\n', '\\t'],\n\n // RFC 2396: characters not allowed for various reasons.\n unwise = ['{', '}', '|', '\\\\', '^', '`'].concat(delims),\n\n // Allowed by RFCs, but cause of XSS attacks. Always escape these.\n autoEscape = ['\\''].concat(unwise),\n // Characters that are never ever allowed in a hostname.\n // Note that any invalid chars are also handled, but these\n // are the ones that are *expected* to be seen, so we fast-path\n // them.\n nonHostChars = ['%', '/', '?', ';', '#'].concat(autoEscape),\n hostEndingChars = ['/', '?', '#'],\n hostnameMaxLen = 255,\n hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/,\n hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/,\n // protocols that can allow \"unsafe\" and \"unwise\" chars.\n unsafeProtocol = {\n 'javascript': true,\n 'javascript:': true\n },\n // protocols that never have a hostname.\n hostlessProtocol = {\n 'javascript': true,\n 'javascript:': true\n },\n // protocols that always contain a // bit.\n slashedProtocol = {\n 'http': true,\n 'https': true,\n 'ftp': true,\n 'gopher': true,\n 'file': true,\n 'http:': true,\n 'https:': true,\n 'ftp:': true,\n 'gopher:': true,\n 'file:': true\n },\n querystring = require('querystring');\n\nfunction urlParse(url, parseQueryString, slashesDenoteHost) {\n if (url && util.isObject(url) && url instanceof Url) return url;\n\n var u = new Url;\n u.parse(url, parseQueryString, slashesDenoteHost);\n return u;\n}\n\nUrl.prototype.parse = function(url, parseQueryString, slashesDenoteHost) {\n if (!util.isString(url)) {\n throw new TypeError(\"Parameter 'url' must be a string, not \" + typeof url);\n }\n\n // Copy chrome, IE, opera backslash-handling behavior.\n // Back slashes before the query string get converted to forward slashes\n // See: https://code.google.com/p/chromium/issues/detail?id=25916\n var queryIndex = url.indexOf('?'),\n splitter =\n (queryIndex !== -1 && queryIndex < url.indexOf('#')) ? '?' : '#',\n uSplit = url.split(splitter),\n slashRegex = /\\\\/g;\n uSplit[0] = uSplit[0].replace(slashRegex, '/');\n url = uSplit.join(splitter);\n\n var rest = url;\n\n // trim before proceeding.\n // This is to support parse stuff like \" http://foo.com \\n\"\n rest = rest.trim();\n\n if (!slashesDenoteHost && url.split('#').length === 1) {\n // Try fast path regexp\n var simplePath = simplePathPattern.exec(rest);\n if (simplePath) {\n this.path = rest;\n this.href = rest;\n this.pathname = simplePath[1];\n if (simplePath[2]) {\n this.search = simplePath[2];\n if (parseQueryString) {\n this.query = querystring.parse(this.search.substr(1));\n } else {\n this.query = this.search.substr(1);\n }\n } else if (parseQueryString) {\n this.search = '';\n this.query = {};\n }\n return this;\n }\n }\n\n var proto = protocolPattern.exec(rest);\n if (proto) {\n proto = proto[0];\n var lowerProto = proto.toLowerCase();\n this.protocol = lowerProto;\n rest = rest.substr(proto.length);\n }\n\n // figure out if it's got a host\n // user@server is *always* interpreted as a hostname, and url\n // resolution will treat //foo/bar as host=foo,path=bar because that's\n // how the browser resolves relative URLs.\n if (slashesDenoteHost || proto || rest.match(/^\\/\\/[^@\\/]+@[^@\\/]+/)) {\n var slashes = rest.substr(0, 2) === '//';\n if (slashes && !(proto && hostlessProtocol[proto])) {\n rest = rest.substr(2);\n this.slashes = true;\n }\n }\n\n if (!hostlessProtocol[proto] &&\n (slashes || (proto && !slashedProtocol[proto]))) {\n\n // there's a hostname.\n // the first instance of /, ?, ;, or # ends the host.\n //\n // If there is an @ in the hostname, then non-host chars *are* allowed\n // to the left of the last @ sign, unless some host-ending character\n // comes *before* the @-sign.\n // URLs are obnoxious.\n //\n // ex:\n // http://a@b@c/ => user:a@b host:c\n // http://a@b?@c => user:a host:c path:/?@c\n\n // v0.12 TODO(isaacs): This is not quite how Chrome does things.\n // Review our test case against browsers more comprehensively.\n\n // find the first instance of any hostEndingChars\n var hostEnd = -1;\n for (var i = 0; i < hostEndingChars.length; i++) {\n var hec = rest.indexOf(hostEndingChars[i]);\n if (hec !== -1 && (hostEnd === -1 || hec < hostEnd))\n hostEnd = hec;\n }\n\n // at this point, either we have an explicit point where the\n // auth portion cannot go past, or the last @ char is the decider.\n var auth, atSign;\n if (hostEnd === -1) {\n // atSign can be anywhere.\n atSign = rest.lastIndexOf('@');\n } else {\n // atSign must be in auth portion.\n // http://a@b/c@d => host:b auth:a path:/c@d\n atSign = rest.lastIndexOf('@', hostEnd);\n }\n\n // Now we have a portion which is definitely the auth.\n // Pull that off.\n if (atSign !== -1) {\n auth = rest.slice(0, atSign);\n rest = rest.slice(atSign + 1);\n this.auth = decodeURIComponent(auth);\n }\n\n // the host is the remaining to the left of the first non-host char\n hostEnd = -1;\n for (var i = 0; i < nonHostChars.length; i++) {\n var hec = rest.indexOf(nonHostChars[i]);\n if (hec !== -1 && (hostEnd === -1 || hec < hostEnd))\n hostEnd = hec;\n }\n // if we still have not hit it, then the entire thing is a host.\n if (hostEnd === -1)\n hostEnd = rest.length;\n\n this.host = rest.slice(0, hostEnd);\n rest = rest.slice(hostEnd);\n\n // pull out port.\n this.parseHost();\n\n // we've indicated that there is a hostname,\n // so even if it's empty, it has to be present.\n this.hostname = this.hostname || '';\n\n // if hostname begins with [ and ends with ]\n // assume that it's an IPv6 address.\n var ipv6Hostname = this.hostname[0] === '[' &&\n this.hostname[this.hostname.length - 1] === ']';\n\n // validate a little.\n if (!ipv6Hostname) {\n var hostparts = this.hostname.split(/\\./);\n for (var i = 0, l = hostparts.length; i < l; i++) {\n var part = hostparts[i];\n if (!part) continue;\n if (!part.match(hostnamePartPattern)) {\n var newpart = '';\n for (var j = 0, k = part.length; j < k; j++) {\n if (part.charCodeAt(j) > 127) {\n // we replace non-ASCII char with a temporary placeholder\n // we need this to make sure size of hostname is not\n // broken by replacing non-ASCII by nothing\n newpart += 'x';\n } else {\n newpart += part[j];\n }\n }\n // we test again with ASCII char only\n if (!newpart.match(hostnamePartPattern)) {\n var validParts = hostparts.slice(0, i);\n var notHost = hostparts.slice(i + 1);\n var bit = part.match(hostnamePartStart);\n if (bit) {\n validParts.push(bit[1]);\n notHost.unshift(bit[2]);\n }\n if (notHost.length) {\n rest = '/' + notHost.join('.') + rest;\n }\n this.hostname = validParts.join('.');\n break;\n }\n }\n }\n }\n\n if (this.hostname.length > hostnameMaxLen) {\n this.hostname = '';\n } else {\n // hostnames are always lower case.\n this.hostname = this.hostname.toLowerCase();\n }\n\n if (!ipv6Hostname) {\n // IDNA Support: Returns a punycoded representation of \"domain\".\n // It only converts parts of the domain name that\n // have non-ASCII characters, i.e. it doesn't matter if\n // you call it with a domain that already is ASCII-only.\n this.hostname = punycode.toASCII(this.hostname);\n }\n\n var p = this.port ? ':' + this.port : '';\n var h = this.hostname || '';\n this.host = h + p;\n this.href += this.host;\n\n // strip [ and ] from the hostname\n // the host field still retains them, though\n if (ipv6Hostname) {\n this.hostname = this.hostname.substr(1, this.hostname.length - 2);\n if (rest[0] !== '/') {\n rest = '/' + rest;\n }\n }\n }\n\n // now rest is set to the post-host stuff.\n // chop off any delim chars.\n if (!unsafeProtocol[lowerProto]) {\n\n // First, make 100% sure that any \"autoEscape\" chars get\n // escaped, even if encodeURIComponent doesn't think they\n // need to be.\n for (var i = 0, l = autoEscape.length; i < l; i++) {\n var ae = autoEscape[i];\n if (rest.indexOf(ae) === -1)\n continue;\n var esc = encodeURIComponent(ae);\n if (esc === ae) {\n esc = escape(ae);\n }\n rest = rest.split(ae).join(esc);\n }\n }\n\n\n // chop off from the tail first.\n var hash = rest.indexOf('#');\n if (hash !== -1) {\n // got a fragment string.\n this.hash = rest.substr(hash);\n rest = rest.slice(0, hash);\n }\n var qm = rest.indexOf('?');\n if (qm !== -1) {\n this.search = rest.substr(qm);\n this.query = rest.substr(qm + 1);\n if (parseQueryString) {\n this.query = querystring.parse(this.query);\n }\n rest = rest.slice(0, qm);\n } else if (parseQueryString) {\n // no query string, but parseQueryString still requested\n this.search = '';\n this.query = {};\n }\n if (rest) this.pathname = rest;\n if (slashedProtocol[lowerProto] &&\n this.hostname && !this.pathname) {\n this.pathname = '/';\n }\n\n //to support http.request\n if (this.pathname || this.search) {\n var p = this.pathname || '';\n var s = this.search || '';\n this.path = p + s;\n }\n\n // finally, reconstruct the href based on what has been validated.\n this.href = this.format();\n return this;\n};\n\n// format a parsed object into a url string\nfunction urlFormat(obj) {\n // ensure it's an object, and not a string url.\n // If it's an obj, this is a no-op.\n // this way, you can call url_format() on strings\n // to clean up potentially wonky urls.\n if (util.isString(obj)) obj = urlParse(obj);\n if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n return obj.format();\n}\n\nUrl.prototype.format = function() {\n var auth = this.auth || '';\n if (auth) {\n auth = encodeURIComponent(auth);\n auth = auth.replace(/%3A/i, ':');\n auth += '@';\n }\n\n var protocol = this.protocol || '',\n pathname = this.pathname || '',\n hash = this.hash || '',\n host = false,\n query = '';\n\n if (this.host) {\n host = auth + this.host;\n } else if (this.hostname) {\n host = auth + (this.hostname.indexOf(':') === -1 ?\n this.hostname :\n '[' + this.hostname + ']');\n if (this.port) {\n host += ':' + this.port;\n }\n }\n\n if (this.query &&\n util.isObject(this.query) &&\n Object.keys(this.query).length) {\n query = querystring.stringify(this.query);\n }\n\n var search = this.search || (query && ('?' + query)) || '';\n\n if (protocol && protocol.substr(-1) !== ':') protocol += ':';\n\n // only the slashedProtocols get the //. Not mailto:, xmpp:, etc.\n // unless they had them to begin with.\n if (this.slashes ||\n (!protocol || slashedProtocol[protocol]) && host !== false) {\n host = '//' + (host || '');\n if (pathname && pathname.charAt(0) !== '/') pathname = '/' + pathname;\n } else if (!host) {\n host = '';\n }\n\n if (hash && hash.charAt(0) !== '#') hash = '#' + hash;\n if (search && search.charAt(0) !== '?') search = '?' + search;\n\n pathname = pathname.replace(/[?#]/g, function(match) {\n return encodeURIComponent(match);\n });\n search = search.replace('#', '%23');\n\n return protocol + host + pathname + search + hash;\n};\n\nfunction urlResolve(source, relative) {\n return urlParse(source, false, true).resolve(relative);\n}\n\nUrl.prototype.resolve = function(relative) {\n return this.resolveObject(urlParse(relative, false, true)).format();\n};\n\nfunction urlResolveObject(source, relative) {\n if (!source) return relative;\n return urlParse(source, false, true).resolveObject(relative);\n}\n\nUrl.prototype.resolveObject = function(relative) {\n if (util.isString(relative)) {\n var rel = new Url();\n rel.parse(relative, false, true);\n relative = rel;\n }\n\n var result = new Url();\n var tkeys = Object.keys(this);\n for (var tk = 0; tk < tkeys.length; tk++) {\n var tkey = tkeys[tk];\n result[tkey] = this[tkey];\n }\n\n // hash is always overridden, no matter what.\n // even href=\"\" will remove it.\n result.hash = relative.hash;\n\n // if the relative url is empty, then there's nothing left to do here.\n if (relative.href === '') {\n result.href = result.format();\n return result;\n }\n\n // hrefs like //foo/bar always cut to the protocol.\n if (relative.slashes && !relative.protocol) {\n // take everything except the protocol from relative\n var rkeys = Object.keys(relative);\n for (var rk = 0; rk < rkeys.length; rk++) {\n var rkey = rkeys[rk];\n if (rkey !== 'protocol')\n result[rkey] = relative[rkey];\n }\n\n //urlParse appends trailing / to urls like http://www.example.com\n if (slashedProtocol[result.protocol] &&\n result.hostname && !result.pathname) {\n result.path = result.pathname = '/';\n }\n\n result.href = result.format();\n return result;\n }\n\n if (relative.protocol && relative.protocol !== result.protocol) {\n // if it's a known url protocol, then changing\n // the protocol does weird things\n // first, if it's not file:, then we MUST have a host,\n // and if there was a path\n // to begin with, then we MUST have a path.\n // if it is file:, then the host is dropped,\n // because that's known to be hostless.\n // anything else is assumed to be absolute.\n if (!slashedProtocol[relative.protocol]) {\n var keys = Object.keys(relative);\n for (var v = 0; v < keys.length; v++) {\n var k = keys[v];\n result[k] = relative[k];\n }\n result.href = result.format();\n return result;\n }\n\n result.protocol = relative.protocol;\n if (!relative.host && !hostlessProtocol[relative.protocol]) {\n var relPath = (relative.pathname || '').split('/');\n while (relPath.length && !(relative.host = relPath.shift()));\n if (!relative.host) relative.host = '';\n if (!relative.hostname) relative.hostname = '';\n if (relPath[0] !== '') relPath.unshift('');\n if (relPath.length < 2) relPath.unshift('');\n result.pathname = relPath.join('/');\n } else {\n result.pathname = relative.pathname;\n }\n result.search = relative.search;\n result.query = relative.query;\n result.host = relative.host || '';\n result.auth = relative.auth;\n result.hostname = relative.hostname || relative.host;\n result.port = relative.port;\n // to support http.request\n if (result.pathname || result.search) {\n var p = result.pathname || '';\n var s = result.search || '';\n result.path = p + s;\n }\n result.slashes = result.slashes || relative.slashes;\n result.href = result.format();\n return result;\n }\n\n var isSourceAbs = (result.pathname && result.pathname.charAt(0) === '/'),\n isRelAbs = (\n relative.host ||\n relative.pathname && relative.pathname.charAt(0) === '/'\n ),\n mustEndAbs = (isRelAbs || isSourceAbs ||\n (result.host && relative.pathname)),\n removeAllDots = mustEndAbs,\n srcPath = result.pathname && result.pathname.split('/') || [],\n relPath = relative.pathname && relative.pathname.split('/') || [],\n psychotic = result.protocol && !slashedProtocol[result.protocol];\n\n // if the url is a non-slashed url, then relative\n // links like ../.. should be able\n // to crawl up to the hostname, as well. This is strange.\n // result.protocol has already been set by now.\n // Later on, put the first path part into the host field.\n if (psychotic) {\n result.hostname = '';\n result.port = null;\n if (result.host) {\n if (srcPath[0] === '') srcPath[0] = result.host;\n else srcPath.unshift(result.host);\n }\n result.host = '';\n if (relative.protocol) {\n relative.hostname = null;\n relative.port = null;\n if (relative.host) {\n if (relPath[0] === '') relPath[0] = relative.host;\n else relPath.unshift(relative.host);\n }\n relative.host = null;\n }\n mustEndAbs = mustEndAbs && (relPath[0] === '' || srcPath[0] === '');\n }\n\n if (isRelAbs) {\n // it's absolute.\n result.host = (relative.host || relative.host === '') ?\n relative.host : result.host;\n result.hostname = (relative.hostname || relative.hostname === '') ?\n relative.hostname : result.hostname;\n result.search = relative.search;\n result.query = relative.query;\n srcPath = relPath;\n // fall through to the dot-handling below.\n } else if (relPath.length) {\n // it's relative\n // throw away the existing file, and take the new path instead.\n if (!srcPath) srcPath = [];\n srcPath.pop();\n srcPath = srcPath.concat(relPath);\n result.search = relative.search;\n result.query = relative.query;\n } else if (!util.isNullOrUndefined(relative.search)) {\n // just pull out the search.\n // like href='?foo'.\n // Put this after the other two cases because it simplifies the booleans\n if (psychotic) {\n result.hostname = result.host = srcPath.shift();\n //occationaly the auth can get stuck only in host\n //this especially happens in cases like\n //url.resolveObject('mailto:local1@domain1', 'local2@domain2')\n var authInHost = result.host && result.host.indexOf('@') > 0 ?\n result.host.split('@') : false;\n if (authInHost) {\n result.auth = authInHost.shift();\n result.host = result.hostname = authInHost.shift();\n }\n }\n result.search = relative.search;\n result.query = relative.query;\n //to support http.request\n if (!util.isNull(result.pathname) || !util.isNull(result.search)) {\n result.path = (result.pathname ? result.pathname : '') +\n (result.search ? result.search : '');\n }\n result.href = result.format();\n return result;\n }\n\n if (!srcPath.length) {\n // no path at all. easy.\n // we've already handled the other stuff above.\n result.pathname = null;\n //to support http.request\n if (result.search) {\n result.path = '/' + result.search;\n } else {\n result.path = null;\n }\n result.href = result.format();\n return result;\n }\n\n // if a url ENDs in . or .., then it must get a trailing slash.\n // however, if it ends in anything else non-slashy,\n // then it must NOT get a trailing slash.\n var last = srcPath.slice(-1)[0];\n var hasTrailingSlash = (\n (result.host || relative.host || srcPath.length > 1) &&\n (last === '.' || last === '..') || last === '');\n\n // strip single dots, resolve double dots to parent dir\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = srcPath.length; i >= 0; i--) {\n last = srcPath[i];\n if (last === '.') {\n srcPath.splice(i, 1);\n } else if (last === '..') {\n srcPath.splice(i, 1);\n up++;\n } else if (up) {\n srcPath.splice(i, 1);\n up--;\n }\n }\n\n // if the path is allowed to go above the root, restore leading ..s\n if (!mustEndAbs && !removeAllDots) {\n for (; up--; up) {\n srcPath.unshift('..');\n }\n }\n\n if (mustEndAbs && srcPath[0] !== '' &&\n (!srcPath[0] || srcPath[0].charAt(0) !== '/')) {\n srcPath.unshift('');\n }\n\n if (hasTrailingSlash && (srcPath.join('/').substr(-1) !== '/')) {\n srcPath.push('');\n }\n\n var isAbsolute = srcPath[0] === '' ||\n (srcPath[0] && srcPath[0].charAt(0) === '/');\n\n // put the host back\n if (psychotic) {\n result.hostname = result.host = isAbsolute ? '' :\n srcPath.length ? srcPath.shift() : '';\n //occationaly the auth can get stuck only in host\n //this especially happens in cases like\n //url.resolveObject('mailto:local1@domain1', 'local2@domain2')\n var authInHost = result.host && result.host.indexOf('@') > 0 ?\n result.host.split('@') : false;\n if (authInHost) {\n result.auth = authInHost.shift();\n result.host = result.hostname = authInHost.shift();\n }\n }\n\n mustEndAbs = mustEndAbs || (result.host && srcPath.length);\n\n if (mustEndAbs && !isAbsolute) {\n srcPath.unshift('');\n }\n\n if (!srcPath.length) {\n result.pathname = null;\n result.path = null;\n } else {\n result.pathname = srcPath.join('/');\n }\n\n //to support request.http\n if (!util.isNull(result.pathname) || !util.isNull(result.search)) {\n result.path = (result.pathname ? result.pathname : '') +\n (result.search ? result.search : '');\n }\n result.auth = relative.auth || result.auth;\n result.slashes = result.slashes || relative.slashes;\n result.href = result.format();\n return result;\n};\n\nUrl.prototype.parseHost = function() {\n var host = this.host;\n var port = portPattern.exec(host);\n if (port) {\n port = port[0];\n if (port !== ':') {\n this.port = port.substr(1);\n }\n host = host.substr(0, host.length - port.length);\n }\n if (host) this.hostname = host;\n};\n", "'use strict';\n\nmodule.exports = {\n isString: function(arg) {\n return typeof(arg) === 'string';\n },\n isObject: function(arg) {\n return typeof(arg) === 'object' && arg !== null;\n },\n isNull: function(arg) {\n return arg === null;\n },\n isNullOrUndefined: function(arg) {\n return arg == null;\n }\n};\n", - "/*\nCopyright 2021 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n// allow camelcase as these are things that go onto the wire\n/* eslint-disable camelcase */\n\nexport enum PushRuleActionName {\n DontNotify = \"dont_notify\",\n Notify = \"notify\",\n Coalesce = \"coalesce\",\n}\n\nexport enum TweakName {\n Highlight = \"highlight\",\n Sound = \"sound\",\n}\n\nexport type Tweak = {\n set_tweak: N;\n value: V;\n};\n\nexport type TweakHighlight = Tweak;\nexport type TweakSound = Tweak;\n\nexport type Tweaks = TweakHighlight | TweakSound;\n\nexport enum ConditionOperator {\n ExactEquals = \"==\",\n LessThan = \"<\",\n GreaterThan = \">\",\n GreaterThanOrEqual = \">=\",\n LessThanOrEqual = \"<=\",\n}\n\nexport type PushRuleAction = Tweaks | PushRuleActionName;\n\nexport type MemberCountCondition\n \n = `${Op}${N}` | (Op extends ConditionOperator.ExactEquals ? `${N}` : never);\n\nexport type AnyMemberCountCondition = MemberCountCondition;\n\nexport const DMMemberCountCondition: MemberCountCondition<2> = \"2\";\n\nexport function isDmMemberCountCondition(condition: AnyMemberCountCondition): boolean {\n return condition === \"==2\" || condition === \"2\";\n}\n\nexport enum ConditionKind {\n EventMatch = \"event_match\",\n ContainsDisplayName = \"contains_display_name\",\n RoomMemberCount = \"room_member_count\",\n SenderNotificationPermission = \"sender_notification_permission\",\n}\n\nexport interface IPushRuleCondition {\n [k: string]: any; // for custom conditions, there can be other fields here\n kind: N;\n}\n\nexport interface IEventMatchCondition extends IPushRuleCondition {\n key: string;\n pattern: string;\n}\n\nexport interface IContainsDisplayNameCondition extends IPushRuleCondition {\n // no additional fields\n}\n\nexport interface IRoomMemberCountCondition extends IPushRuleCondition {\n is: AnyMemberCountCondition;\n}\n\nexport interface ISenderNotificationPermissionCondition\n extends IPushRuleCondition {\n key: string;\n}\n\nexport type PushRuleCondition = IPushRuleCondition\n | IEventMatchCondition\n | IContainsDisplayNameCondition\n | IRoomMemberCountCondition\n | ISenderNotificationPermissionCondition;\n\nexport enum PushRuleKind {\n Override = \"override\",\n ContentSpecific = \"content\",\n RoomSpecific = \"room\",\n SenderSpecific = \"sender\",\n Underride = \"underride\",\n}\n\nexport enum RuleId {\n Master = \".m.rule.master\",\n ContainsDisplayName = \".m.rule.contains_display_name\",\n ContainsUserName = \".m.rule.contains_user_name\",\n AtRoomNotification = \".m.rule.roomnotif\",\n DM = \".m.rule.room_one_to_one\",\n EncryptedDM = \".m.rule.encrypted_room_one_to_one\",\n Message = \".m.rule.message\",\n EncryptedMessage = \".m.rule.encrypted\",\n InviteToSelf = \".m.rule.invite_for_me\",\n MemberEvent = \".m.rule.member_event\",\n IncomingCall = \".m.rule.call\",\n SuppressNotices = \".m.rule.suppress_notices\",\n Tombstone = \".m.rule.tombstone\",\n}\n\nexport type PushRuleSet = {\n [k in PushRuleKind]?: IPushRule[];\n};\n\nexport interface IPushRule {\n actions: PushRuleAction[];\n conditions?: PushRuleCondition[];\n default: boolean;\n enabled: boolean;\n pattern?: string;\n rule_id: RuleId | string;\n}\n\nexport interface IAnnotatedPushRule extends IPushRule {\n kind: PushRuleKind;\n}\n\nexport interface IPushRules {\n global: PushRuleSet;\n device?: PushRuleSet;\n}\n\nexport interface IPusher {\n app_display_name: string;\n app_id: string;\n data: {\n format?: string; // TODO: Types\n url?: string; // TODO: Required if kind==http\n brand?: string; // TODO: For email notifications only?\n };\n device_display_name: string;\n kind: string; // TODO: Types\n lang: string;\n profile_tag?: string;\n pushkey: string;\n}\n\nexport interface IPusherRequest extends IPusher {\n append?: boolean;\n}\n\n/* eslint-enable camelcase */\n", + "/*\nCopyright 2021 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n// allow camelcase as these are things that go onto the wire\n/* eslint-disable camelcase */\n\nexport enum PushRuleActionName {\n DontNotify = \"dont_notify\",\n Notify = \"notify\",\n Coalesce = \"coalesce\",\n}\n\nexport enum TweakName {\n Highlight = \"highlight\",\n Sound = \"sound\",\n}\n\nexport type Tweak = {\n set_tweak: N;\n value: V;\n};\n\nexport type TweakHighlight = Tweak;\nexport type TweakSound = Tweak;\n\nexport type Tweaks = TweakHighlight | TweakSound;\n\nexport enum ConditionOperator {\n ExactEquals = \"==\",\n LessThan = \"<\",\n GreaterThan = \">\",\n GreaterThanOrEqual = \">=\",\n LessThanOrEqual = \"<=\",\n}\n\nexport type PushRuleAction = Tweaks | PushRuleActionName;\n\nexport type MemberCountCondition\n \n = `${Op}${N}` | (Op extends ConditionOperator.ExactEquals ? `${N}` : never);\n\nexport type AnyMemberCountCondition = MemberCountCondition;\n\nexport const DMMemberCountCondition: MemberCountCondition<2> = \"2\";\n\nexport function isDmMemberCountCondition(condition: AnyMemberCountCondition): boolean {\n return condition === \"==2\" || condition === \"2\";\n}\n\nexport enum ConditionKind {\n EventMatch = \"event_match\",\n ContainsDisplayName = \"contains_display_name\",\n RoomMemberCount = \"room_member_count\",\n SenderNotificationPermission = \"sender_notification_permission\",\n}\n\nexport interface IPushRuleCondition {\n [k: string]: any; // for custom conditions, there can be other fields here\n kind: N;\n}\n\nexport interface IEventMatchCondition extends IPushRuleCondition {\n key: string;\n pattern: string;\n}\n\nexport interface IContainsDisplayNameCondition extends IPushRuleCondition {\n // no additional fields\n}\n\nexport interface IRoomMemberCountCondition extends IPushRuleCondition {\n is: AnyMemberCountCondition;\n}\n\nexport interface ISenderNotificationPermissionCondition\n extends IPushRuleCondition {\n key: string;\n}\n\n// XXX: custom conditions are possible but always fail, and break the typescript discriminated union so ignore them here\n// IPushRuleCondition> unfortunately does not resolve this at the time of writing.\nexport type PushRuleCondition = IEventMatchCondition\n | IContainsDisplayNameCondition\n | IRoomMemberCountCondition\n | ISenderNotificationPermissionCondition;\n\nexport enum PushRuleKind {\n Override = \"override\",\n ContentSpecific = \"content\",\n RoomSpecific = \"room\",\n SenderSpecific = \"sender\",\n Underride = \"underride\",\n}\n\nexport enum RuleId {\n Master = \".m.rule.master\",\n ContainsDisplayName = \".m.rule.contains_display_name\",\n ContainsUserName = \".m.rule.contains_user_name\",\n AtRoomNotification = \".m.rule.roomnotif\",\n DM = \".m.rule.room_one_to_one\",\n EncryptedDM = \".m.rule.encrypted_room_one_to_one\",\n Message = \".m.rule.message\",\n EncryptedMessage = \".m.rule.encrypted\",\n InviteToSelf = \".m.rule.invite_for_me\",\n MemberEvent = \".m.rule.member_event\",\n IncomingCall = \".m.rule.call\",\n SuppressNotices = \".m.rule.suppress_notices\",\n Tombstone = \".m.rule.tombstone\",\n}\n\nexport type PushRuleSet = {\n [k in PushRuleKind]?: IPushRule[];\n};\n\nexport interface IPushRule {\n actions: PushRuleAction[];\n conditions?: PushRuleCondition[];\n default: boolean;\n enabled: boolean;\n pattern?: string;\n rule_id: RuleId | string;\n}\n\nexport interface IAnnotatedPushRule extends IPushRule {\n kind: PushRuleKind;\n}\n\nexport interface IPushRules {\n global: PushRuleSet;\n device?: PushRuleSet;\n}\n\nexport interface IPusher {\n app_display_name: string;\n app_id: string;\n data: {\n format?: string; // TODO: Types\n url?: string; // TODO: Required if kind==http\n brand?: string; // TODO: For email notifications only?\n };\n device_display_name: string;\n kind: string; // TODO: Types\n lang: string;\n profile_tag?: string;\n pushkey: string;\n}\n\nexport interface IPusherRequest extends IPusher {\n append?: boolean;\n}\n\n/* eslint-enable camelcase */\n", "/*\nCopyright 2020 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\nimport { UnstableValue } from \"../NamespacedValue\";\n\nexport enum EventType {\n // Room state events\n RoomCanonicalAlias = \"m.room.canonical_alias\",\n RoomCreate = \"m.room.create\",\n RoomJoinRules = \"m.room.join_rules\",\n RoomMember = \"m.room.member\",\n RoomThirdPartyInvite = \"m.room.third_party_invite\",\n RoomPowerLevels = \"m.room.power_levels\",\n RoomName = \"m.room.name\",\n RoomTopic = \"m.room.topic\",\n RoomAvatar = \"m.room.avatar\",\n RoomPinnedEvents = \"m.room.pinned_events\",\n RoomEncryption = \"m.room.encryption\",\n RoomHistoryVisibility = \"m.room.history_visibility\",\n RoomGuestAccess = \"m.room.guest_access\",\n RoomServerAcl = \"m.room.server_acl\",\n RoomTombstone = \"m.room.tombstone\",\n /**\n * @deprecated Should not be used.\n */\n RoomAliases = \"m.room.aliases\", // deprecated https://matrix.org/docs/spec/client_server/r0.6.1#historical-events\n\n SpaceChild = \"m.space.child\",\n SpaceParent = \"m.space.parent\",\n\n // Room timeline events\n RoomRedaction = \"m.room.redaction\",\n RoomMessage = \"m.room.message\",\n RoomMessageEncrypted = \"m.room.encrypted\",\n Sticker = \"m.sticker\",\n CallInvite = \"m.call.invite\",\n CallCandidates = \"m.call.candidates\",\n CallAnswer = \"m.call.answer\",\n CallHangup = \"m.call.hangup\",\n CallReject = \"m.call.reject\",\n CallSelectAnswer = \"m.call.select_answer\",\n CallNegotiate = \"m.call.negotiate\",\n CallSDPStreamMetadataChanged = \"m.call.sdp_stream_metadata_changed\",\n CallSDPStreamMetadataChangedPrefix = \"org.matrix.call.sdp_stream_metadata_changed\",\n CallReplaces = \"m.call.replaces\",\n CallAssertedIdentity = \"m.call.asserted_identity\",\n CallAssertedIdentityPrefix = \"org.matrix.call.asserted_identity\",\n KeyVerificationRequest = \"m.key.verification.request\",\n KeyVerificationStart = \"m.key.verification.start\",\n KeyVerificationCancel = \"m.key.verification.cancel\",\n KeyVerificationMac = \"m.key.verification.mac\",\n KeyVerificationDone = \"m.key.verification.done\",\n // use of this is discouraged https://matrix.org/docs/spec/client_server/r0.6.1#m-room-message-feedback\n RoomMessageFeedback = \"m.room.message.feedback\",\n Reaction = \"m.reaction\",\n\n // Room ephemeral events\n Typing = \"m.typing\",\n Receipt = \"m.receipt\",\n Presence = \"m.presence\",\n\n // Room account_data events\n FullyRead = \"m.fully_read\",\n Tag = \"m.tag\",\n SpaceOrder = \"org.matrix.msc3230.space_order\", // MSC3230\n\n // User account_data events\n PushRules = \"m.push_rules\",\n Direct = \"m.direct\",\n IgnoredUserList = \"m.ignored_user_list\",\n\n // to_device events\n RoomKey = \"m.room_key\",\n RoomKeyRequest = \"m.room_key_request\",\n ForwardedRoomKey = \"m.forwarded_room_key\",\n Dummy = \"m.dummy\",\n}\n\nexport enum RelationType {\n Annotation = \"m.annotation\",\n Replace = \"m.replace\",\n}\n\nexport enum MsgType {\n Text = \"m.text\",\n Emote = \"m.emote\",\n Notice = \"m.notice\",\n Image = \"m.image\",\n File = \"m.file\",\n Audio = \"m.audio\",\n Location = \"m.location\",\n Video = \"m.video\",\n}\n\nexport const RoomCreateTypeField = \"type\";\n\nexport enum RoomType {\n Space = \"m.space\",\n}\n\n/**\n * Identifier for an [MSC3088](https://github.com/matrix-org/matrix-doc/pull/3088)\n * room purpose. Note that this reference is UNSTABLE and subject to breaking changes,\n * including its eventual removal.\n */\nexport const UNSTABLE_MSC3088_PURPOSE = new UnstableValue(\"m.room.purpose\", \"org.matrix.msc3088.purpose\");\n\n/**\n * Enabled flag for an [MSC3088](https://github.com/matrix-org/matrix-doc/pull/3088)\n * room purpose. Note that this reference is UNSTABLE and subject to breaking changes,\n * including its eventual removal.\n */\nexport const UNSTABLE_MSC3088_ENABLED = new UnstableValue(\"m.enabled\", \"org.matrix.msc3088.enabled\");\n\n/**\n * Subtype for an [MSC3089](https://github.com/matrix-org/matrix-doc/pull/3089) space-room.\n * Note that this reference is UNSTABLE and subject to breaking changes, including its\n * eventual removal.\n */\nexport const UNSTABLE_MSC3089_TREE_SUBTYPE = new UnstableValue(\"m.data_tree\", \"org.matrix.msc3089.data_tree\");\n\n/**\n * Leaf type for an event in a [MSC3089](https://github.com/matrix-org/matrix-doc/pull/3089) space-room.\n * Note that this reference is UNSTABLE and subject to breaking changes, including its\n * eventual removal.\n */\nexport const UNSTABLE_MSC3089_LEAF = new UnstableValue(\"m.leaf\", \"org.matrix.msc3089.leaf\");\n\n/**\n * Branch (Leaf Reference) type for the index approach in a\n * [MSC3089](https://github.com/matrix-org/matrix-doc/pull/3089) space-room. Note that this reference is\n * UNSTABLE and subject to breaking changes, including its eventual removal.\n */\nexport const UNSTABLE_MSC3089_BRANCH = new UnstableValue(\"m.branch\", \"org.matrix.msc3089.branch\");\n\n/**\n * Functional members type for declaring a purpose of room members (e.g. helpful bots).\n * Note that this reference is UNSTABLE and subject to breaking changes, including its\n * eventual removal.\n *\n * Schema (TypeScript):\n * {\n * service_members?: string[]\n * }\n *\n * Example:\n * {\n * \"service_members\": [\n * \"@helperbot:localhost\",\n * \"@reminderbot:alice.tdl\"\n * ]\n * }\n */\nexport const UNSTABLE_ELEMENT_FUNCTIONAL_USERS = new UnstableValue(\n \"io.element.functional_members\",\n \"io.element.functional_members\");\n\nexport interface IEncryptedFile {\n url: string;\n mimetype?: string;\n key: {\n alg: string;\n key_ops: string[]; // eslint-disable-line camelcase\n kty: string;\n k: string;\n ext: boolean;\n };\n iv: string;\n hashes: {[alg: string]: string};\n v: string;\n}\n", "/*\nCopyright 2021 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\nexport interface IImageInfo {\n size?: number;\n mimetype?: string;\n thumbnail_info?: { // eslint-disable-line camelcase\n w?: number;\n h?: number;\n size?: number;\n mimetype?: string;\n };\n w?: number;\n h?: number;\n}\n\nexport enum Visibility {\n Public = \"public\",\n Private = \"private\",\n}\n\nexport enum Preset {\n PrivateChat = \"private_chat\",\n TrustedPrivateChat = \"trusted_private_chat\",\n PublicChat = \"public_chat\",\n}\n\nexport type ResizeMethod = \"crop\" | \"scale\";\n\n// TODO move to http-api after TSification\nexport interface IAbortablePromise extends Promise {\n abort(): void;\n}\n\nexport type IdServerUnbindResult = \"no-support\" | \"success\";\n\n// Knock and private are reserved keywords which are not yet implemented.\nexport enum JoinRule {\n Public = \"public\",\n Invite = \"invite\",\n /**\n * @deprecated Reserved keyword. Should not be used. Not yet implemented.\n */\n Private = \"private\",\n Knock = \"knock\", // MSC2403 - only valid inside experimental room versions at this time.\n Restricted = \"restricted\", // MSC3083 - only valid inside experimental room versions at this time.\n}\n\nexport enum RestrictedAllowType {\n RoomMembership = \"m.room_membership\", // MSC3083 - only valid inside experimental room versions at this time.\n}\n\nexport enum GuestAccess {\n CanJoin = \"can_join\",\n Forbidden = \"forbidden\",\n}\n\nexport enum HistoryVisibility {\n Invited = \"invited\",\n Joined = \"joined\",\n Shared = \"shared\",\n WorldReadable = \"world_readable\",\n}\n\n// XXX move to OlmDevice when converted\nexport interface InboundGroupSessionData {\n room_id: string; // eslint-disable-line camelcase\n session: string;\n keysClaimed: Record;\n forwardingCurve25519KeyChain: string[];\n}\n", "/*\nCopyright 2021 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n// Types relating to the /search API\n\nimport { IRoomEvent, IStateEvent } from \"../sync-accumulator\";\nimport { IRoomEventFilter } from \"../filter\";\nimport { SearchResult } from \"../models/search-result\";\n\n/* eslint-disable camelcase */\nexport interface IEventWithRoomId extends IRoomEvent {\n room_id: string;\n}\n\nexport interface IStateEventWithRoomId extends IStateEvent {\n room_id: string;\n}\n\nexport interface IMatrixProfile {\n avatar_url?: string;\n displayname?: string;\n}\n\nexport interface IResultContext {\n events_before: IEventWithRoomId[];\n events_after: IEventWithRoomId[];\n profile_info: Record;\n start?: string;\n end?: string;\n}\n\nexport interface ISearchResult {\n rank: number;\n result: IEventWithRoomId;\n context: IResultContext;\n}\n\nenum GroupKey {\n RoomId = \"room_id\",\n Sender = \"sender\",\n}\n\nexport interface IResultRoomEvents {\n count: number;\n highlights: string[];\n results: ISearchResult[];\n state?: { [roomId: string]: IStateEventWithRoomId[] };\n groups?: {\n [groupKey in GroupKey]: {\n [value: string]: {\n next_batch?: string;\n order: number;\n results: string[];\n };\n };\n };\n next_batch?: string;\n}\n\ninterface IResultCategories {\n room_events: IResultRoomEvents;\n}\n\nexport type SearchKey = \"content.body\" | \"content.name\" | \"content.topic\";\n\nexport enum SearchOrderBy {\n Recent = \"recent\",\n Rank = \"rank\",\n}\n\nexport interface ISearchRequestBody {\n search_categories: {\n room_events: {\n search_term: string;\n keys?: SearchKey[];\n filter?: IRoomEventFilter;\n order_by?: SearchOrderBy;\n event_context?: {\n before_limit?: number;\n after_limit?: number;\n include_profile?: boolean;\n };\n include_state?: boolean;\n groupings?: {\n group_by: {\n key: GroupKey;\n }[];\n };\n };\n };\n}\n\nexport interface ISearchResponse {\n search_categories: IResultCategories;\n}\n\nexport interface ISearchResults {\n _query?: ISearchRequestBody;\n results: SearchResult[];\n highlights: string[];\n count?: number;\n next_batch?: string;\n pendingRequest?: Promise;\n}\n/* eslint-enable camelcase */\n", @@ -237,12 +238,12 @@ "/*\nCopyright 2015, 2016 OpenMarket Ltd\nCopyright 2017 Vector Creations Ltd\nCopyright 2017 New Vector Ltd\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\nimport { EventEmitter } from \"events\";\n\nexport class ReEmitter {\n private target: EventEmitter;\n\n constructor(target: EventEmitter) {\n this.target = target;\n }\n\n reEmit(source: EventEmitter, eventNames: string[]) {\n for (const eventName of eventNames) {\n // We include the source as the last argument for event handlers which may need it,\n // such as read receipt listeners on the client class which won't have the context\n // of the room.\n const forSource = (...args) => {\n // EventEmitter special cases 'error' to make the emit function throw if no\n // handler is attached, which sort of makes sense for making sure that something\n // handles an error, but for re-emitting, there could be a listener on the original\n // source object so the test doesn't really work. We *could* try to replicate the\n // same logic and throw if there is no listener on either the source or the target,\n // but this behaviour is fairly undesireable for us anyway: the main place we throw\n // 'error' events is for calls, where error events are usually emitted some time\n // later by a different part of the code where 'emit' throwing because the app hasn't\n // added an error handler isn't terribly helpful. (A better fix in retrospect may\n // have been to just avoid using the event name 'error', but backwards compat...)\n if (eventName === 'error' && this.target.listenerCount('error') === 0) return;\n this.target.emit(eventName, ...args, source);\n };\n source.on(eventName, forSource);\n }\n }\n}\n", "/*\nCopyright 2018 New Vector Ltd\nCopyright 2019 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n/** @module auto-discovery */\n\nimport { logger } from './logger';\nimport { URL as NodeURL } from \"url\";\n\n// Dev note: Auto discovery is part of the spec.\n// See: https://matrix.org/docs/spec/client_server/r0.4.0.html#server-discovery\n\n/**\n * Description for what an automatically discovered client configuration\n * would look like. Although this is a class, it is recommended that it\n * be treated as an interface definition rather than as a class.\n *\n * Additional properties than those defined here may be present, and\n * should follow the Java package naming convention.\n */\nclass DiscoveredClientConfig { // eslint-disable-line no-unused-vars\n // Dev note: this is basically a copy/paste of the .well-known response\n // object as defined in the spec. It does have additional information,\n // however. Overall, this exists to serve as a place for documentation\n // and not functionality.\n // See https://matrix.org/docs/spec/client_server/r0.4.0.html#get-well-known-matrix-client\n\n constructor() {\n /**\n * The homeserver configuration the client should use. This will\n * always be present on the object.\n * @type {{state: string, base_url: string}} The configuration.\n */\n this[\"m.homeserver\"] = {\n /**\n * The lookup result state. If this is anything other than\n * AutoDiscovery.SUCCESS then base_url may be falsey. Additionally,\n * if this is not AutoDiscovery.SUCCESS then the client should\n * assume the other properties in the client config (such as\n * the identity server configuration) are not valid.\n */\n state: AutoDiscovery.PROMPT,\n\n /**\n * If the state is AutoDiscovery.FAIL_ERROR or .FAIL_PROMPT\n * then this will contain a human-readable (English) message\n * for what went wrong. If the state is none of those previously\n * mentioned, this will be falsey.\n */\n error: \"Something went wrong\",\n\n /**\n * The base URL clients should use to talk to the homeserver,\n * particularly for the login process. May be falsey if the\n * state is not AutoDiscovery.SUCCESS.\n */\n base_url: \"https://matrix.org\",\n };\n\n /**\n * The identity server configuration the client should use. This\n * will always be present on teh object.\n * @type {{state: string, base_url: string}} The configuration.\n */\n this[\"m.identity_server\"] = {\n /**\n * The lookup result state. If this is anything other than\n * AutoDiscovery.SUCCESS then base_url may be falsey.\n */\n state: AutoDiscovery.PROMPT,\n\n /**\n * The base URL clients should use for interacting with the\n * identity server. May be falsey if the state is not\n * AutoDiscovery.SUCCESS.\n */\n base_url: \"https://vector.im\",\n };\n }\n}\n\n/**\n * Utilities for automatically discovery resources, such as homeservers\n * for users to log in to.\n */\nexport class AutoDiscovery {\n // Dev note: the constants defined here are related to but not\n // exactly the same as those in the spec. This is to hopefully\n // translate the meaning of the states in the spec, but also\n // support our own if needed.\n\n static get ERROR_INVALID() {\n return \"Invalid homeserver discovery response\";\n }\n\n static get ERROR_GENERIC_FAILURE() {\n return \"Failed to get autodiscovery configuration from server\";\n }\n\n static get ERROR_INVALID_HS_BASE_URL() {\n return \"Invalid base_url for m.homeserver\";\n }\n\n static get ERROR_INVALID_HOMESERVER() {\n return \"Homeserver URL does not appear to be a valid Matrix homeserver\";\n }\n\n static get ERROR_INVALID_IS_BASE_URL() {\n return \"Invalid base_url for m.identity_server\";\n }\n\n static get ERROR_INVALID_IDENTITY_SERVER() {\n return \"Identity server URL does not appear to be a valid identity server\";\n }\n\n static get ERROR_INVALID_IS() {\n return \"Invalid identity server discovery response\";\n }\n\n static get ERROR_MISSING_WELLKNOWN() {\n return \"No .well-known JSON file found\";\n }\n\n static get ERROR_INVALID_JSON() {\n return \"Invalid JSON\";\n }\n\n static get ALL_ERRORS() {\n return [\n AutoDiscovery.ERROR_INVALID,\n AutoDiscovery.ERROR_GENERIC_FAILURE,\n AutoDiscovery.ERROR_INVALID_HS_BASE_URL,\n AutoDiscovery.ERROR_INVALID_HOMESERVER,\n AutoDiscovery.ERROR_INVALID_IS_BASE_URL,\n AutoDiscovery.ERROR_INVALID_IDENTITY_SERVER,\n AutoDiscovery.ERROR_INVALID_IS,\n AutoDiscovery.ERROR_MISSING_WELLKNOWN,\n AutoDiscovery.ERROR_INVALID_JSON,\n ];\n }\n\n /**\n * The auto discovery failed. The client is expected to communicate\n * the error to the user and refuse logging in.\n * @return {string}\n * @constructor\n */\n static get FAIL_ERROR() { return \"FAIL_ERROR\"; }\n\n /**\n * The auto discovery failed, however the client may still recover\n * from the problem. The client is recommended to that the same\n * action it would for PROMPT while also warning the user about\n * what went wrong. The client may also treat this the same as\n * a FAIL_ERROR state.\n * @return {string}\n * @constructor\n */\n static get FAIL_PROMPT() { return \"FAIL_PROMPT\"; }\n\n /**\n * The auto discovery didn't fail but did not find anything of\n * interest. The client is expected to prompt the user for more\n * information, or fail if it prefers.\n * @return {string}\n * @constructor\n */\n static get PROMPT() { return \"PROMPT\"; }\n\n /**\n * The auto discovery was successful.\n * @return {string}\n * @constructor\n */\n static get SUCCESS() { return \"SUCCESS\"; }\n\n /**\n * Validates and verifies client configuration information for purposes\n * of logging in. Such information includes the homeserver URL\n * and identity server URL the client would want. Additional details\n * may also be included, and will be transparently brought into the\n * response object unaltered.\n * @param {string} wellknown The configuration object itself, as returned\n * by the .well-known auto-discovery endpoint.\n * @return {Promise} Resolves to the verified\n * configuration, which may include error states. Rejects on unexpected\n * failure, not when verification fails.\n */\n static async fromDiscoveryConfig(wellknown) {\n // Step 1 is to get the config, which is provided to us here.\n\n // We default to an error state to make the first few checks easier to\n // write. We'll update the properties of this object over the duration\n // of this function.\n const clientConfig = {\n \"m.homeserver\": {\n state: AutoDiscovery.FAIL_ERROR,\n error: AutoDiscovery.ERROR_INVALID,\n base_url: null,\n },\n \"m.identity_server\": {\n // Technically, we don't have a problem with the identity server\n // config at this point.\n state: AutoDiscovery.PROMPT,\n error: null,\n base_url: null,\n },\n };\n\n if (!wellknown || !wellknown[\"m.homeserver\"]) {\n logger.error(\"No m.homeserver key in config\");\n\n clientConfig[\"m.homeserver\"].state = AutoDiscovery.FAIL_PROMPT;\n clientConfig[\"m.homeserver\"].error = AutoDiscovery.ERROR_INVALID;\n\n return Promise.resolve(clientConfig);\n }\n\n if (!wellknown[\"m.homeserver\"][\"base_url\"]) {\n logger.error(\"No m.homeserver base_url in config\");\n\n clientConfig[\"m.homeserver\"].state = AutoDiscovery.FAIL_PROMPT;\n clientConfig[\"m.homeserver\"].error = AutoDiscovery.ERROR_INVALID_HS_BASE_URL;\n\n return Promise.resolve(clientConfig);\n }\n\n // Step 2: Make sure the homeserver URL is valid *looking*. We'll make\n // sure it points to a homeserver in Step 3.\n const hsUrl = this._sanitizeWellKnownUrl(\n wellknown[\"m.homeserver\"][\"base_url\"],\n );\n if (!hsUrl) {\n logger.error(\"Invalid base_url for m.homeserver\");\n clientConfig[\"m.homeserver\"].error = AutoDiscovery.ERROR_INVALID_HS_BASE_URL;\n return Promise.resolve(clientConfig);\n }\n\n // Step 3: Make sure the homeserver URL points to a homeserver.\n const hsVersions = await this._fetchWellKnownObject(\n `${hsUrl}/_matrix/client/versions`,\n );\n if (!hsVersions || !hsVersions.raw[\"versions\"]) {\n logger.error(\"Invalid /versions response\");\n clientConfig[\"m.homeserver\"].error = AutoDiscovery.ERROR_INVALID_HOMESERVER;\n\n // Supply the base_url to the caller because they may be ignoring liveliness\n // errors, like this one.\n clientConfig[\"m.homeserver\"].base_url = hsUrl;\n\n return Promise.resolve(clientConfig);\n }\n\n // Step 4: Now that the homeserver looks valid, update our client config.\n clientConfig[\"m.homeserver\"] = {\n state: AutoDiscovery.SUCCESS,\n error: null,\n base_url: hsUrl,\n };\n\n // Step 5: Try to pull out the identity server configuration\n let isUrl = \"\";\n if (wellknown[\"m.identity_server\"]) {\n // We prepare a failing identity server response to save lines later\n // in this branch.\n const failingClientConfig = {\n \"m.homeserver\": clientConfig[\"m.homeserver\"],\n \"m.identity_server\": {\n state: AutoDiscovery.FAIL_PROMPT,\n error: AutoDiscovery.ERROR_INVALID_IS,\n base_url: null,\n },\n };\n\n // Step 5a: Make sure the URL is valid *looking*. We'll make sure it\n // points to an identity server in Step 5b.\n isUrl = this._sanitizeWellKnownUrl(\n wellknown[\"m.identity_server\"][\"base_url\"],\n );\n if (!isUrl) {\n logger.error(\"Invalid base_url for m.identity_server\");\n failingClientConfig[\"m.identity_server\"].error =\n AutoDiscovery.ERROR_INVALID_IS_BASE_URL;\n return Promise.resolve(failingClientConfig);\n }\n\n // Step 5b: Verify there is an identity server listening on the provided\n // URL.\n const isResponse = await this._fetchWellKnownObject(\n `${isUrl}/_matrix/identity/api/v1`,\n );\n if (!isResponse || !isResponse.raw || isResponse.action !== \"SUCCESS\") {\n logger.error(\"Invalid /api/v1 response\");\n failingClientConfig[\"m.identity_server\"].error =\n AutoDiscovery.ERROR_INVALID_IDENTITY_SERVER;\n\n // Supply the base_url to the caller because they may be ignoring\n // liveliness errors, like this one.\n failingClientConfig[\"m.identity_server\"].base_url = isUrl;\n\n return Promise.resolve(failingClientConfig);\n }\n }\n\n // Step 6: Now that the identity server is valid, or never existed,\n // populate the IS section.\n if (isUrl && isUrl.length > 0) {\n clientConfig[\"m.identity_server\"] = {\n state: AutoDiscovery.SUCCESS,\n error: null,\n base_url: isUrl,\n };\n }\n\n // Step 7: Copy any other keys directly into the clientConfig. This is for\n // things like custom configuration of services.\n Object.keys(wellknown)\n .map((k) => {\n if (k === \"m.homeserver\" || k === \"m.identity_server\") {\n // Only copy selected parts of the config to avoid overwriting\n // properties computed by the validation logic above.\n const notProps = [\"error\", \"state\", \"base_url\"];\n for (const prop of Object.keys(wellknown[k])) {\n if (notProps.includes(prop)) continue;\n clientConfig[k][prop] = wellknown[k][prop];\n }\n } else {\n // Just copy the whole thing over otherwise\n clientConfig[k] = wellknown[k];\n }\n });\n\n // Step 8: Give the config to the caller (finally)\n return Promise.resolve(clientConfig);\n }\n\n /**\n * Attempts to automatically discover client configuration information\n * prior to logging in. Such information includes the homeserver URL\n * and identity server URL the client would want. Additional details\n * may also be discovered, and will be transparently included in the\n * response object unaltered.\n * @param {string} domain The homeserver domain to perform discovery\n * on. For example, \"matrix.org\".\n * @return {Promise} Resolves to the discovered\n * configuration, which may include error states. Rejects on unexpected\n * failure, not when discovery fails.\n */\n static async findClientConfig(domain) {\n if (!domain || typeof(domain) !== \"string\" || domain.length === 0) {\n throw new Error(\"'domain' must be a string of non-zero length\");\n }\n\n // We use a .well-known lookup for all cases. According to the spec, we\n // can do other discovery mechanisms if we want such as custom lookups\n // however we won't bother with that here (mostly because the spec only\n // supports .well-known right now).\n //\n // By using .well-known, we need to ensure we at least pull out a URL\n // for the homeserver. We don't really need an identity server configuration\n // but will return one anyways (with state PROMPT) to make development\n // easier for clients. If we can't get a homeserver URL, all bets are\n // off on the rest of the config and we'll assume it is invalid too.\n\n // We default to an error state to make the first few checks easier to\n // write. We'll update the properties of this object over the duration\n // of this function.\n const clientConfig = {\n \"m.homeserver\": {\n state: AutoDiscovery.FAIL_ERROR,\n error: AutoDiscovery.ERROR_INVALID,\n base_url: null,\n },\n \"m.identity_server\": {\n // Technically, we don't have a problem with the identity server\n // config at this point.\n state: AutoDiscovery.PROMPT,\n error: null,\n base_url: null,\n },\n };\n\n // Step 1: Actually request the .well-known JSON file and make sure it\n // at least has a homeserver definition.\n const wellknown = await this._fetchWellKnownObject(\n `https://${domain}/.well-known/matrix/client`,\n );\n if (!wellknown || wellknown.action !== \"SUCCESS\") {\n logger.error(\"No response or error when parsing .well-known\");\n if (wellknown.reason) logger.error(wellknown.reason);\n if (wellknown.action === \"IGNORE\") {\n clientConfig[\"m.homeserver\"] = {\n state: AutoDiscovery.PROMPT,\n error: null,\n base_url: null,\n };\n } else {\n // this can only ever be FAIL_PROMPT at this point.\n clientConfig[\"m.homeserver\"].state = AutoDiscovery.FAIL_PROMPT;\n clientConfig[\"m.homeserver\"].error = AutoDiscovery.ERROR_INVALID;\n }\n return Promise.resolve(clientConfig);\n }\n\n // Step 2: Validate and parse the config\n return AutoDiscovery.fromDiscoveryConfig(wellknown.raw);\n }\n\n /**\n * Gets the raw discovery client configuration for the given domain name.\n * Should only be used if there's no validation to be done on the resulting\n * object, otherwise use findClientConfig().\n * @param {string} domain The domain to get the client config for.\n * @returns {Promise} Resolves to the domain's client config. Can\n * be an empty object.\n */\n static async getRawClientConfig(domain) {\n if (!domain || typeof(domain) !== \"string\" || domain.length === 0) {\n throw new Error(\"'domain' must be a string of non-zero length\");\n }\n\n const response = await this._fetchWellKnownObject(\n `https://${domain}/.well-known/matrix/client`,\n );\n if (!response) return {};\n return response.raw || {};\n }\n\n /**\n * Sanitizes a given URL to ensure it is either an HTTP or HTTP URL and\n * is suitable for the requirements laid out by .well-known auto discovery.\n * If valid, the URL will also be stripped of any trailing slashes.\n * @param {string} url The potentially invalid URL to sanitize.\n * @return {string|boolean} The sanitized URL or a falsey value if the URL is invalid.\n * @private\n */\n static _sanitizeWellKnownUrl(url) {\n if (!url) return false;\n\n try {\n // We have to try and parse the URL using the NodeJS URL\n // library if we're on NodeJS and use the browser's URL\n // library when we're in a browser. To accomplish this, we\n // try the NodeJS version first and fall back to the browser.\n let parsed = null;\n try {\n if (NodeURL) parsed = new NodeURL(url);\n else parsed = new URL(url);\n } catch (e) {\n parsed = new URL(url);\n }\n\n if (!parsed || !parsed.hostname) return false;\n if (parsed.protocol !== \"http:\" && parsed.protocol !== \"https:\") return false;\n\n const port = parsed.port ? `:${parsed.port}` : \"\";\n const path = parsed.pathname ? parsed.pathname : \"\";\n let saferUrl = `${parsed.protocol}//${parsed.hostname}${port}${path}`;\n if (saferUrl.endsWith(\"/\")) {\n saferUrl = saferUrl.substring(0, saferUrl.length - 1);\n }\n return saferUrl;\n } catch (e) {\n logger.error(e);\n return false;\n }\n }\n\n /**\n * Fetches a JSON object from a given URL, as expected by all .well-known\n * related lookups. If the server gives a 404 then the `action` will be\n * IGNORE. If the server returns something that isn't JSON, the `action`\n * will be FAIL_PROMPT. For any other failure the `action` will be FAIL_PROMPT.\n *\n * The returned object will be a result of the call in object form with\n * the following properties:\n * raw: The JSON object returned by the server.\n * action: One of SUCCESS, IGNORE, or FAIL_PROMPT.\n * reason: Relatively human readable description of what went wrong.\n * error: The actual Error, if one exists.\n * @param {string} url The URL to fetch a JSON object from.\n * @return {Promise} Resolves to the returned state.\n * @private\n */\n static async _fetchWellKnownObject(url) {\n return new Promise(function(resolve, reject) {\n const request = require(\"./matrix\").getRequest();\n if (!request) throw new Error(\"No request library available\");\n request(\n { method: \"GET\", uri: url, timeout: 5000 },\n (err, response, body) => {\n if (err || response &&\n (response.statusCode < 200 || response.statusCode >= 300)\n ) {\n let action = \"FAIL_PROMPT\";\n let reason = (err ? err.message : null) || \"General failure\";\n if (response && response.statusCode === 404) {\n action = \"IGNORE\";\n reason = AutoDiscovery.ERROR_MISSING_WELLKNOWN;\n }\n resolve({ raw: {}, action: action, reason: reason, error: err });\n return;\n }\n\n try {\n resolve({ raw: JSON.parse(body), action: \"SUCCESS\" });\n } catch (e) {\n let reason = AutoDiscovery.ERROR_INVALID;\n if (e.name === \"SyntaxError\") {\n reason = AutoDiscovery.ERROR_INVALID_JSON;\n }\n resolve({\n raw: {},\n action: \"FAIL_PROMPT\",\n reason: reason,\n error: e,\n });\n }\n },\n );\n });\n }\n}\n", "/*\nCopyright 2019 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\nimport * as matrixcs from \"./matrix\";\nimport request from \"browser-request\";\nimport queryString from \"qs\";\n\nmatrixcs.request(function(opts, fn) {\n // We manually fix the query string for browser-request because\n // it doesn't correctly handle cases like ?via=one&via=two. Instead\n // we mimic `request`'s query string interface to make it all work\n // as expected.\n // browser-request will happily take the constructed string as the\n // query string without trying to modify it further.\n opts.qs = queryString.stringify(opts.qs || {}, opts.qsStringifyOptions);\n return request(opts, fn);\n});\n\n// just *accessing* indexedDB throws an exception in firefox with\n// indexeddb disabled.\nlet indexedDB;\ntry {\n indexedDB = global.indexedDB;\n} catch (e) {}\n\n// if our browser (appears to) support indexeddb, use an indexeddb crypto store.\nif (indexedDB) {\n matrixcs.setCryptoStoreFactory(\n function() {\n return new matrixcs.IndexedDBCryptoStore(\n indexedDB, \"matrix-js-sdk:crypto\",\n );\n },\n );\n}\n\n// We export 3 things to make browserify happy as well as downstream projects.\n// It's awkward, but required.\nexport * from \"./matrix\";\nexport default matrixcs; // keep export for browserify package deps\nglobal.matrixcs = matrixcs;\n", - "/*\nCopyright 2015-2021 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n/**\n * This is an internal module. See {@link MatrixClient} for the public class.\n * @module client\n */\n\nimport { EventEmitter } from \"events\";\nimport { ISyncStateData, SyncApi } from \"./sync\";\nimport { EventStatus, IContent, IDecryptOptions, IEvent, MatrixEvent } from \"./models/event\";\nimport { StubStore } from \"./store/stub\";\nimport { createNewMatrixCall, MatrixCall, ConstraintsType, getUserMediaContraints } from \"./webrtc/call\";\nimport { Filter, IFilterDefinition } from \"./filter\";\nimport { CallEventHandler } from './webrtc/callEventHandler';\nimport * as utils from './utils';\nimport { sleep } from './utils';\nimport { Group } from \"./models/group\";\nimport { Direction, EventTimeline } from \"./models/event-timeline\";\nimport { PushAction, PushProcessor } from \"./pushprocessor\";\nimport { AutoDiscovery } from \"./autodiscovery\";\nimport * as olmlib from \"./crypto/olmlib\";\nimport { decodeBase64, encodeBase64 } from \"./crypto/olmlib\";\nimport { ReEmitter } from './ReEmitter';\nimport { IRoomEncryption, RoomList } from './crypto/RoomList';\nimport { logger } from './logger';\nimport { SERVICE_TYPES } from './service-types';\nimport {\n MatrixError,\n MatrixHttpApi,\n PREFIX_IDENTITY_V2,\n PREFIX_MEDIA_R0,\n PREFIX_R0,\n PREFIX_UNSTABLE,\n retryNetworkOperation,\n} from \"./http-api\";\nimport {\n Crypto,\n fixBackupKey,\n IBootstrapCrossSigningOpts,\n ICheckOwnCrossSigningTrustOpts,\n IMegolmSessionData,\n isCryptoAvailable,\n VerificationMethod,\n} from './crypto';\nimport { DeviceInfo, IDevice } from \"./crypto/deviceinfo\";\nimport { decodeRecoveryKey } from './crypto/recoverykey';\nimport { keyFromAuthData } from './crypto/key_passphrase';\nimport { User } from \"./models/user\";\nimport { getHttpUriForMxc } from \"./content-repo\";\nimport { SearchResult } from \"./models/search-result\";\nimport {\n DEHYDRATION_ALGORITHM,\n IDehydratedDevice,\n IDehydratedDeviceKeyInfo,\n IDeviceKeys,\n IOneTimeKey,\n} from \"./crypto/dehydration\";\nimport {\n IKeyBackupInfo,\n IKeyBackupPrepareOpts,\n IKeyBackupRestoreOpts,\n IKeyBackupRestoreResult,\n IKeyBackupSession,\n} from \"./crypto/keybackup\";\nimport { IIdentityServerProvider } from \"./@types/IIdentityServerProvider\";\nimport type Request from \"request\";\nimport { MatrixScheduler } from \"./scheduler\";\nimport { ICryptoCallbacks, IMinimalEvent, IRoomEvent, IStateEvent, NotificationCountType } from \"./matrix\";\nimport {\n CrossSigningKey,\n IAddSecretStorageKeyOpts,\n ICreateSecretStorageOpts,\n IEncryptedEventInfo,\n IImportRoomKeysOpts,\n IRecoveryKey,\n ISecretStorageKeyInfo,\n} from \"./crypto/api\";\nimport { SyncState } from \"./sync.api\";\nimport { EventTimelineSet } from \"./models/event-timeline-set\";\nimport { VerificationRequest } from \"./crypto/verification/request/VerificationRequest\";\nimport { Base as Verification } from \"./crypto/verification/Base\";\nimport * as ContentHelpers from \"./content-helpers\";\nimport { CrossSigningInfo, DeviceTrustLevel, ICacheCallbacks, UserTrustLevel } from \"./crypto/CrossSigning\";\nimport { Room } from \"./models/room\";\nimport {\n IAddThreePidOnlyBody,\n IBindThreePidBody,\n ICreateRoomOpts,\n IEventSearchOpts,\n IGuestAccessOpts,\n IJoinRoomOpts,\n IPaginateOpts,\n IPresenceOpts,\n IRedactOpts,\n IRoomDirectoryOptions,\n ISearchOpts,\n ISendEventResponse,\n IUploadOpts,\n} from \"./@types/requests\";\nimport {\n EventType,\n MsgType,\n RelationType,\n RoomCreateTypeField,\n RoomType,\n UNSTABLE_MSC3088_ENABLED,\n UNSTABLE_MSC3088_PURPOSE,\n UNSTABLE_MSC3089_TREE_SUBTYPE,\n} from \"./@types/event\";\nimport { IAbortablePromise, IdServerUnbindResult, IImageInfo, Preset, Visibility } from \"./@types/partials\";\nimport { EventMapper, eventMapperFor, MapperOpts } from \"./event-mapper\";\nimport { randomString } from \"./randomstring\";\nimport { ReadStream } from \"fs\";\nimport { WebStorageSessionStore } from \"./store/session/webstorage\";\nimport { BackupManager, IKeyBackup, IKeyBackupCheck, IPreparedKeyBackupVersion, TrustInfo } from \"./crypto/backup\";\nimport { DEFAULT_TREE_POWER_LEVELS_TEMPLATE, MSC3089TreeSpace } from \"./models/MSC3089TreeSpace\";\nimport { ISignatures } from \"./@types/signed\";\nimport { IStore } from \"./store\";\nimport { ISecretRequest } from \"./crypto/SecretStorage\";\nimport {\n IEventWithRoomId,\n ISearchRequestBody,\n ISearchResponse,\n ISearchResults,\n IStateEventWithRoomId,\n SearchOrderBy,\n} from \"./@types/search\";\nimport { ISynapseAdminDeactivateResponse, ISynapseAdminWhoisResponse } from \"./@types/synapse\";\nimport { ISpaceSummaryEvent, ISpaceSummaryRoom } from \"./@types/spaces\";\nimport { IPusher, IPusherRequest, IPushRules, PushRuleAction, PushRuleKind, RuleId } from \"./@types/PushRules\";\nimport { IThreepid } from \"./@types/threepids\";\nimport { CryptoStore } from \"./crypto/store/base\";\n\nexport type Store = IStore;\nexport type SessionStore = WebStorageSessionStore;\n\nexport type Callback = (err: Error | any | null, data?: any) => void;\nexport type ResetTimelineCallback = (roomId: string) => boolean;\n\nconst SCROLLBACK_DELAY_MS = 3000;\nexport const CRYPTO_ENABLED: boolean = isCryptoAvailable();\nconst CAPABILITIES_CACHE_MS = 21600000; // 6 hours - an arbitrary value\nconst TURN_CHECK_INTERVAL = 10 * 60 * 1000; // poll for turn credentials every 10 minutes\n\ninterface IOlmDevice {\n pickledAccount: string;\n sessions: Array>;\n pickleKey: string;\n}\n\ninterface IExportedDevice {\n olmDevice: IOlmDevice;\n userId: string;\n deviceId: string;\n}\n\nexport interface IKeysUploadResponse {\n one_time_key_counts: { // eslint-disable-line camelcase\n [algorithm: string]: number;\n };\n}\n\nexport interface ICreateClientOpts {\n baseUrl: string;\n\n idBaseUrl?: string;\n\n /**\n * The data store used for sync data from the homeserver. If not specified,\n * this client will not store any HTTP responses. The `createClient` helper\n * will create a default store if needed.\n */\n store?: Store;\n\n /**\n * A store to be used for end-to-end crypto session data. If not specified,\n * end-to-end crypto will be disabled. The `createClient` helper will create\n * a default store if needed.\n */\n cryptoStore?: CryptoStore;\n\n /**\n * The scheduler to use. If not\n * specified, this client will not retry requests on failure. This client\n * will supply its own processing function to\n * {@link module:scheduler~MatrixScheduler#setProcessFunction}.\n */\n scheduler?: MatrixScheduler;\n\n /**\n * The function to invoke for HTTP\n * requests. The value of this property is typically require(\"request\")\n * as it returns a function which meets the required interface. See\n * {@link requestFunction} for more information.\n */\n request?: Request;\n\n userId?: string;\n\n /**\n * A unique identifier for this device; used for tracking things like crypto\n * keys and access tokens. If not specified, end-to-end encryption will be\n * disabled.\n */\n deviceId?: string;\n\n accessToken?: string;\n\n /**\n * Identity server provider to retrieve the user's access token when accessing\n * the identity server. See also https://github.com/vector-im/element-web/issues/10615\n * which seeks to replace the previous approach of manual access tokens params\n * with this callback throughout the SDK.\n */\n identityServer?: IIdentityServerProvider;\n\n /**\n * The default maximum amount of\n * time to wait before timing out HTTP requests. If not specified, there is no timeout.\n */\n localTimeoutMs?: number;\n\n /**\n * Set to true to use\n * Authorization header instead of query param to send the access token to the server.\n *\n * Default false.\n */\n useAuthorizationHeader?: boolean;\n\n /**\n * Set to true to enable\n * improved timeline support ({@link module:client~MatrixClient#getEventTimeline getEventTimeline}). It is\n * disabled by default for compatibility with older clients - in particular to\n * maintain support for back-paginating the live timeline after a '/sync'\n * result with a gap.\n */\n timelineSupport?: boolean;\n\n /**\n * Extra query parameters to append\n * to all requests with this client. Useful for application services which require\n * ?user_id=.\n */\n queryParams?: Record;\n\n /**\n * Device data exported with\n * \"exportDevice\" method that must be imported to recreate this device.\n * Should only be useful for devices with end-to-end crypto enabled.\n * If provided, deviceId and userId should **NOT** be provided at the top\n * level (they are present in the exported data).\n */\n deviceToImport?: IExportedDevice;\n\n /**\n * Key used to pickle olm objects or other sensitive data.\n */\n pickleKey?: string;\n\n /**\n * A store to be used for end-to-end crypto session data. Most data has been\n * migrated out of here to `cryptoStore` instead. If not specified,\n * end-to-end crypto will be disabled. The `createClient` helper\n * _will not_ create this store at the moment.\n */\n sessionStore?: SessionStore;\n\n /**\n * Set to true to enable client-side aggregation of event relations\n * via `EventTimelineSet#getRelationsForEvent`.\n * This feature is currently unstable and the API may change without notice.\n */\n unstableClientRelationAggregation?: boolean;\n\n verificationMethods?: Array;\n\n /**\n * Whether relaying calls through a TURN server should be forced. Default false.\n */\n forceTURN?: boolean;\n\n /**\n * Up to this many ICE candidates will be gathered when an incoming call arrives.\n * Gathering does not send data to the caller, but will communicate with the configured TURN\n * server. Default 0.\n */\n iceCandidatePoolSize?: number;\n\n /**\n * True to advertise support for call transfers to other parties on Matrix calls. Default false.\n */\n supportsCallTransfer?: boolean;\n\n /**\n * Whether to allow a fallback ICE server should be used for negotiating a\n * WebRTC connection if the homeserver doesn't provide any servers. Defaults to false.\n */\n fallbackICEServerAllowed?: boolean;\n\n cryptoCallbacks?: ICryptoCallbacks;\n}\n\nexport interface IMatrixClientCreateOpts extends ICreateClientOpts {\n /**\n * Whether to allow sending messages to encrypted rooms when encryption\n * is not available internally within this SDK. This is useful if you are using an external\n * E2E proxy, for example. Defaults to false.\n */\n usingExternalCrypto?: boolean;\n}\n\nexport enum PendingEventOrdering {\n Chronological = \"chronological\",\n Detached = \"detached\",\n}\n\nexport interface IStartClientOpts {\n /**\n * The event limit= to apply to initial sync. Default: 8.\n */\n initialSyncLimit?: number;\n\n /**\n * True to put archived=true on the /initialSync request. Default: false.\n */\n includeArchivedRooms?: boolean;\n\n /**\n * True to do /profile requests on every invite event if the displayname/avatar_url is not known for this user ID. Default: false.\n */\n resolveInvitesToProfiles?: boolean;\n\n /**\n * Controls where pending messages appear in a room's timeline. If \"chronological\", messages will\n * appear in the timeline when the call to sendEvent was made. If \"detached\",\n * pending messages will appear in a separate list, accessbile via {@link module:models/room#getPendingEvents}.\n * Default: \"chronological\".\n */\n pendingEventOrdering?: PendingEventOrdering;\n\n /**\n * The number of milliseconds to wait on /sync. Default: 30000 (30 seconds).\n */\n pollTimeout?: number;\n\n /**\n * The filter to apply to /sync calls. This will override the opts.initialSyncLimit, which would\n * normally result in a timeline limit filter.\n */\n filter?: Filter;\n\n /**\n * True to perform syncing without automatically updating presence.\n */\n disablePresence?: boolean;\n\n /**\n * True to not load all membership events during initial sync but fetch them when needed by calling\n * `loadOutOfBandMembers` This will override the filter option at this moment.\n */\n lazyLoadMembers?: boolean;\n\n /**\n * The number of seconds between polls to /.well-known/matrix/client, undefined to disable.\n * This should be in the order of hours. Default: undefined.\n */\n clientWellKnownPollPeriod?: number;\n}\n\nexport interface IStoredClientOpts extends IStartClientOpts {\n crypto: Crypto;\n canResetEntireTimeline: ResetTimelineCallback;\n}\n\nexport enum RoomVersionStability {\n Stable = \"stable\",\n Unstable = \"unstable\",\n}\n\nexport interface IRoomCapability { // MSC3244\n preferred: string | null;\n support: string[];\n}\n\nexport interface IRoomVersionsCapability {\n default: string;\n available: Record;\n \"org.matrix.msc3244.room_capabilities\"?: Record; // MSC3244\n}\n\nexport interface IChangePasswordCapability {\n enabled: boolean;\n}\n\ninterface ICapabilities {\n [key: string]: any;\n \"m.change_password\"?: IChangePasswordCapability;\n \"m.room_versions\"?: IRoomVersionsCapability;\n}\n\n/* eslint-disable camelcase */\nexport interface ICrossSigningKey {\n keys: { [algorithm: string]: string };\n signatures?: ISignatures;\n usage: string[];\n user_id: string;\n}\n\nenum CrossSigningKeyType {\n MasterKey = \"master_key\",\n SelfSigningKey = \"self_signing_key\",\n UserSigningKey = \"user_signing_key\",\n}\n\nexport type CrossSigningKeys = Record;\n\nexport interface ISignedKey {\n keys: Record;\n signatures: ISignatures;\n user_id: string;\n algorithms: string[];\n device_id: string;\n}\n\nexport type KeySignatures = Record>;\ninterface IUploadKeySignaturesResponse {\n failures: Record>;\n}\n\nexport interface IPreviewUrlResponse {\n [key: string]: string | number;\n \"og:title\": string;\n \"og:type\": string;\n \"og:url\": string;\n \"og:image\"?: string;\n \"og:image:type\"?: string;\n \"og:image:height\"?: number;\n \"og:image:width\"?: number;\n \"og:description\"?: string;\n \"matrix:image:size\"?: number;\n}\n\ninterface ITurnServerResponse {\n uris: string[];\n username: string;\n password: string;\n ttl: number;\n}\n\ninterface ITurnServer {\n urls: string[];\n username: string;\n credential: string;\n}\n\ninterface IServerVersions {\n versions: string;\n unstable_features: Record;\n}\n\ninterface IClientWellKnown {\n [key: string]: any;\n \"m.homeserver\": {\n base_url: string;\n };\n \"m.identity_server\"?: {\n base_url: string;\n };\n}\n\ninterface IKeyBackupPath {\n path: string;\n queryData?: {\n version: string;\n };\n}\n\ninterface IMediaConfig {\n [key: string]: any; // extensible\n \"m.upload.size\"?: number;\n}\n\ninterface IThirdPartySigned {\n sender: string;\n mxid: string;\n token: string;\n signatures: ISignatures;\n}\n\ninterface IJoinRequestBody {\n third_party_signed?: IThirdPartySigned;\n}\n\ninterface ITagMetadata {\n [key: string]: any;\n order: number;\n}\n\ninterface IMessagesResponse {\n start: string;\n end: string;\n chunk: IRoomEvent[];\n state: IStateEvent[];\n}\n\ninterface IRequestTokenResponse {\n sid: string;\n submit_url?: string;\n}\n\ninterface IRequestMsisdnTokenResponse extends IRequestTokenResponse {\n msisdn: string;\n success: boolean;\n intl_fmt: string;\n}\n\ninterface IUploadKeysRequest {\n device_keys?: Required;\n one_time_keys?: {\n [userId: string]: {\n [deviceId: string]: number;\n };\n };\n \"org.matrix.msc2732.fallback_keys\"?: Record;\n}\n\ninterface IOpenIDToken {\n access_token: string;\n token_type: \"Bearer\" | string;\n matrix_server_name: string;\n expires_in: number;\n}\n\ninterface IRoomInitialSyncResponse {\n room_id: string;\n membership: \"invite\" | \"join\" | \"leave\" | \"ban\";\n messages?: {\n start?: string;\n end?: string;\n chunk: IEventWithRoomId[];\n };\n state?: IStateEventWithRoomId[];\n visibility: Visibility;\n account_data?: IMinimalEvent[];\n presence: Partial; // legacy and undocumented, api is deprecated so this won't get attention\n}\n\ninterface IJoinedMembersResponse {\n joined: {\n [userId: string]: {\n display_name: string;\n avatar_url: string;\n };\n };\n}\n\nexport interface IPublicRoomsChunkRoom {\n room_id: string;\n name?: string;\n avatar_url?: string;\n topic?: string;\n canonical_alias?: string;\n aliases?: string[];\n world_readable: boolean;\n guest_can_join: boolean;\n num_joined_members: number;\n}\n\ninterface IPublicRoomsResponse {\n chunk: IPublicRoomsChunkRoom[];\n next_batch?: string;\n prev_batch?: string;\n total_room_count_estimate?: number;\n}\n\ninterface IUserDirectoryResponse {\n results: {\n user_id: string;\n display_name?: string;\n avatar_url?: string;\n }[];\n limited: boolean;\n}\n\ninterface IMyDevice {\n device_id: string;\n display_name?: string;\n last_seen_ip?: string;\n last_seen_ts?: number;\n}\n\ninterface IDownloadKeyResult {\n failures: { [serverName: string]: object };\n device_keys: {\n [userId: string]: {\n [deviceId: string]: IDeviceKeys & {\n unsigned?: {\n device_display_name: string;\n };\n };\n };\n };\n}\n\ninterface IClaimOTKsResult {\n failures: { [serverName: string]: object };\n one_time_keys: {\n [userId: string]: {\n [deviceId: string]: string;\n };\n };\n}\n\nexport interface IFieldType {\n regexp: string;\n placeholder: string;\n}\n\nexport interface IInstance {\n desc: string;\n icon?: string;\n fields: object;\n network_id: string;\n // XXX: this is undocumented but we rely on it: https://github.com/matrix-org/matrix-doc/issues/3203\n instance_id: string;\n}\n\nexport interface IProtocol {\n user_fields: string[];\n location_fields: string[];\n icon: string;\n field_types: Record;\n instances: IInstance[];\n}\n\ninterface IThirdPartyLocation {\n alias: string;\n protocol: string;\n fields: object;\n}\n\ninterface IThirdPartyUser {\n userid: string;\n protocol: string;\n fields: object;\n}\n/* eslint-enable camelcase */\n\n/**\n * Represents a Matrix Client. Only directly construct this if you want to use\n * custom modules. Normally, {@link createClient} should be used\n * as it specifies 'sensible' defaults for these modules.\n */\nexport class MatrixClient extends EventEmitter {\n public static readonly RESTORE_BACKUP_ERROR_BAD_KEY = 'RESTORE_BACKUP_ERROR_BAD_KEY';\n\n public reEmitter = new ReEmitter(this);\n public olmVersion: string = null; // populated after initCrypto\n public usingExternalCrypto = false;\n public store: Store;\n public deviceId?: string;\n public credentials: { userId?: string };\n public pickleKey: string;\n public scheduler: MatrixScheduler;\n public clientRunning = false;\n public timelineSupport = false;\n public urlPreviewCache: { [key: string]: Promise } = {};\n public unstableClientRelationAggregation = false;\n public identityServer: IIdentityServerProvider;\n public sessionStore: SessionStore; // XXX: Intended private, used in code.\n public http: MatrixHttpApi; // XXX: Intended private, used in code.\n public crypto: Crypto; // XXX: Intended private, used in code.\n public cryptoCallbacks: ICryptoCallbacks; // XXX: Intended private, used in code.\n public callEventHandler: CallEventHandler; // XXX: Intended private, used in code.\n public supportsCallTransfer = false; // XXX: Intended private, used in code.\n public forceTURN = false; // XXX: Intended private, used in code.\n public iceCandidatePoolSize = 0; // XXX: Intended private, used in code.\n public idBaseUrl: string;\n public baseUrl: string;\n private localAVStreamType: ConstraintsType;\n private localAVStream: MediaStream;\n\n // Note: these are all `protected` to let downstream consumers make mistakes if they want to.\n // We don't technically support this usage, but have reasons to do this.\n\n protected canSupportVoip = false;\n protected peekSync: SyncApi = null;\n protected isGuestAccount = false;\n protected ongoingScrollbacks: {[roomId: string]: {promise?: Promise, errorTs?: number}} = {};\n protected notifTimelineSet: EventTimelineSet = null;\n protected cryptoStore: CryptoStore;\n protected verificationMethods: VerificationMethod[];\n protected fallbackICEServerAllowed = false;\n protected roomList: RoomList;\n protected syncApi: SyncApi;\n public pushRules: any; // TODO: Types\n protected syncLeftRoomsPromise: Promise;\n protected syncedLeftRooms = false;\n protected clientOpts: IStoredClientOpts;\n protected clientWellKnownIntervalID: number;\n protected canResetTimelineCallback: ResetTimelineCallback;\n\n // The pushprocessor caches useful things, so keep one and re-use it\n protected pushProcessor = new PushProcessor(this);\n\n // Promise to a response of the server's /versions response\n // TODO: This should expire: https://github.com/matrix-org/matrix-js-sdk/issues/1020\n protected serverVersionsPromise: Promise;\n\n protected cachedCapabilities: {\n capabilities: ICapabilities;\n expiration: number;\n };\n protected clientWellKnown: IClientWellKnown;\n protected clientWellKnownPromise: Promise;\n protected turnServers: ITurnServer[] = [];\n protected turnServersExpiry = 0;\n protected checkTurnServersIntervalID: number;\n protected exportedOlmDeviceToImport: IOlmDevice;\n protected txnCtr = 0;\n\n constructor(opts: IMatrixClientCreateOpts) {\n super();\n\n opts.baseUrl = utils.ensureNoTrailingSlash(opts.baseUrl);\n opts.idBaseUrl = utils.ensureNoTrailingSlash(opts.idBaseUrl);\n\n this.baseUrl = opts.baseUrl;\n this.idBaseUrl = opts.idBaseUrl;\n\n this.usingExternalCrypto = opts.usingExternalCrypto;\n this.store = opts.store || new StubStore();\n this.deviceId = opts.deviceId || null;\n\n const userId = opts.userId || null;\n this.credentials = { userId };\n\n this.http = new MatrixHttpApi(this, {\n baseUrl: opts.baseUrl,\n idBaseUrl: opts.idBaseUrl,\n accessToken: opts.accessToken,\n request: opts.request,\n prefix: PREFIX_R0,\n onlyData: true,\n extraParams: opts.queryParams,\n localTimeoutMs: opts.localTimeoutMs,\n useAuthorizationHeader: opts.useAuthorizationHeader,\n });\n\n if (opts.deviceToImport) {\n if (this.deviceId) {\n logger.warn(\n 'not importing device because device ID is provided to ' +\n 'constructor independently of exported data',\n );\n } else if (this.credentials.userId) {\n logger.warn(\n 'not importing device because user ID is provided to ' +\n 'constructor independently of exported data',\n );\n } else if (!opts.deviceToImport.deviceId) {\n logger.warn('not importing device because no device ID in exported data');\n } else {\n this.deviceId = opts.deviceToImport.deviceId;\n this.credentials.userId = opts.deviceToImport.userId;\n // will be used during async initialization of the crypto\n this.exportedOlmDeviceToImport = opts.deviceToImport.olmDevice;\n }\n } else if (opts.pickleKey) {\n this.pickleKey = opts.pickleKey;\n }\n\n this.scheduler = opts.scheduler;\n if (this.scheduler) {\n this.scheduler.setProcessFunction(async (eventToSend) => {\n const room = this.getRoom(eventToSend.getRoomId());\n if (eventToSend.status !== EventStatus.SENDING) {\n this.updatePendingEventStatus(room, eventToSend, EventStatus.SENDING);\n }\n const res = await this.sendEventHttpRequest(eventToSend);\n if (room) {\n // ensure we update pending event before the next scheduler run so that any listeners to event id\n // updates on the synchronous event emitter get a chance to run first.\n room.updatePendingEvent(eventToSend, EventStatus.SENT, res.event_id);\n }\n return res;\n });\n }\n\n // try constructing a MatrixCall to see if we are running in an environment\n // which has WebRTC. If we are, listen for and handle m.call.* events.\n const call = createNewMatrixCall(this, undefined, undefined);\n if (call) {\n this.callEventHandler = new CallEventHandler(this);\n this.canSupportVoip = true;\n // Start listening for calls after the initial sync is done\n // We do not need to backfill the call event buffer\n // with encrypted events that might never get decrypted\n this.on(\"sync\", this.startCallEventHandler);\n }\n\n this.timelineSupport = Boolean(opts.timelineSupport);\n this.unstableClientRelationAggregation = !!opts.unstableClientRelationAggregation;\n\n this.cryptoStore = opts.cryptoStore;\n this.sessionStore = opts.sessionStore;\n this.verificationMethods = opts.verificationMethods;\n this.cryptoCallbacks = opts.cryptoCallbacks || {};\n\n this.forceTURN = opts.forceTURN || false;\n this.iceCandidatePoolSize = opts.iceCandidatePoolSize === undefined ? 0 : opts.iceCandidatePoolSize;\n this.supportsCallTransfer = opts.supportsCallTransfer || false;\n this.fallbackICEServerAllowed = opts.fallbackICEServerAllowed || false;\n\n // List of which rooms have encryption enabled: separate from crypto because\n // we still want to know which rooms are encrypted even if crypto is disabled:\n // we don't want to start sending unencrypted events to them.\n this.roomList = new RoomList(this.cryptoStore);\n\n // The SDK doesn't really provide a clean way for events to recalculate the push\n // actions for themselves, so we have to kinda help them out when they are encrypted.\n // We do this so that push rules are correctly executed on events in their decrypted\n // state, such as highlights when the user's name is mentioned.\n this.on(\"Event.decrypted\", (event) => {\n const oldActions = event.getPushActions();\n const actions = this.pushProcessor.actionsForEvent(event);\n event.setPushActions(actions); // Might as well while we're here\n\n const room = this.getRoom(event.getRoomId());\n if (!room) return;\n\n const currentCount = room.getUnreadNotificationCount(NotificationCountType.Highlight);\n\n // Ensure the unread counts are kept up to date if the event is encrypted\n // We also want to make sure that the notification count goes up if we already\n // have encrypted events to avoid other code from resetting 'highlight' to zero.\n const oldHighlight = oldActions && oldActions.tweaks\n ? !!oldActions.tweaks.highlight : false;\n const newHighlight = actions && actions.tweaks\n ? !!actions.tweaks.highlight : false;\n if (oldHighlight !== newHighlight || currentCount > 0) {\n // TODO: Handle mentions received while the client is offline\n // See also https://github.com/vector-im/element-web/issues/9069\n if (!room.hasUserReadEvent(this.getUserId(), event.getId())) {\n let newCount = currentCount;\n if (newHighlight && !oldHighlight) newCount++;\n if (!newHighlight && oldHighlight) newCount--;\n room.setUnreadNotificationCount(NotificationCountType.Highlight, newCount);\n\n // Fix 'Mentions Only' rooms from not having the right badge count\n const totalCount = room.getUnreadNotificationCount(NotificationCountType.Total);\n if (totalCount < newCount) {\n room.setUnreadNotificationCount(NotificationCountType.Total, newCount);\n }\n }\n }\n });\n\n // Like above, we have to listen for read receipts from ourselves in order to\n // correctly handle notification counts on encrypted rooms.\n // This fixes https://github.com/vector-im/element-web/issues/9421\n this.on(\"Room.receipt\", (event, room) => {\n if (room && this.isRoomEncrypted(room.roomId)) {\n // Figure out if we've read something or if it's just informational\n const content = event.getContent();\n const isSelf = Object.keys(content).filter(eid => {\n return Object.keys(content[eid]['m.read']).includes(this.getUserId());\n }).length > 0;\n\n if (!isSelf) return;\n\n // Work backwards to determine how many events are unread. We also set\n // a limit for how back we'll look to avoid spinning CPU for too long.\n // If we hit the limit, we assume the count is unchanged.\n const maxHistory = 20;\n const events = room.getLiveTimeline().getEvents();\n\n let highlightCount = 0;\n\n for (let i = events.length - 1; i >= 0; i--) {\n if (i === events.length - maxHistory) return; // limit reached\n\n const event = events[i];\n\n if (room.hasUserReadEvent(this.getUserId(), event.getId())) {\n // If the user has read the event, then the counting is done.\n break;\n }\n\n const pushActions = this.getPushActionsForEvent(event);\n highlightCount += pushActions.tweaks &&\n pushActions.tweaks.highlight ? 1 : 0;\n }\n\n // Note: we don't need to handle 'total' notifications because the counts\n // will come from the server.\n room.setUnreadNotificationCount(\"highlight\", highlightCount);\n }\n });\n }\n\n /**\n * High level helper method to begin syncing and poll for new events. To listen for these\n * events, add a listener for {@link module:client~MatrixClient#event:\"event\"}\n * via {@link module:client~MatrixClient#on}. Alternatively, listen for specific\n * state change events.\n * @param {Object=} opts Options to apply when syncing.\n */\n public async startClient(opts: IStartClientOpts) {\n if (this.clientRunning) {\n // client is already running.\n return;\n }\n this.clientRunning = true;\n // backwards compat for when 'opts' was 'historyLen'.\n if (typeof opts === \"number\") {\n opts = {\n initialSyncLimit: opts,\n };\n }\n\n // Create our own user object artificially (instead of waiting for sync)\n // so it's always available, even if the user is not in any rooms etc.\n const userId = this.getUserId();\n if (userId) {\n this.store.storeUser(new User(userId));\n }\n\n if (this.crypto) {\n this.crypto.uploadDeviceKeys();\n this.crypto.start();\n }\n\n // periodically poll for turn servers if we support voip\n if (this.canSupportVoip) {\n this.checkTurnServersIntervalID = setInterval(() => {\n this.checkTurnServers();\n }, TURN_CHECK_INTERVAL);\n // noinspection ES6MissingAwait\n this.checkTurnServers();\n }\n\n if (this.syncApi) {\n // This shouldn't happen since we thought the client was not running\n logger.error(\"Still have sync object whilst not running: stopping old one\");\n this.syncApi.stop();\n }\n\n // shallow-copy the opts dict before modifying and storing it\n this.clientOpts = Object.assign({}, opts) as IStoredClientOpts;\n this.clientOpts.crypto = this.crypto;\n this.clientOpts.canResetEntireTimeline = (roomId) => {\n if (!this.canResetTimelineCallback) {\n return false;\n }\n return this.canResetTimelineCallback(roomId);\n };\n this.syncApi = new SyncApi(this, this.clientOpts);\n this.syncApi.sync();\n\n if (this.clientOpts.clientWellKnownPollPeriod !== undefined) {\n this.clientWellKnownIntervalID = setInterval(() => {\n this.fetchClientWellKnown();\n }, 1000 * this.clientOpts.clientWellKnownPollPeriod);\n this.fetchClientWellKnown();\n }\n }\n\n /**\n * High level helper method to stop the client from polling and allow a\n * clean shutdown.\n */\n public stopClient() {\n logger.log('stopping MatrixClient');\n\n this.clientRunning = false;\n\n this.syncApi?.stop();\n this.syncApi = null;\n\n this.crypto?.stop();\n this.peekSync?.stopPeeking();\n\n this.callEventHandler?.stop();\n this.callEventHandler = null;\n\n global.clearInterval(this.checkTurnServersIntervalID);\n if (this.clientWellKnownIntervalID !== undefined) {\n global.clearInterval(this.clientWellKnownIntervalID);\n }\n }\n\n /**\n * Try to rehydrate a device if available. The client must have been\n * initialized with a `cryptoCallback.getDehydrationKey` option, and this\n * function must be called before initCrypto and startClient are called.\n *\n * @return {Promise} Resolves to undefined if a device could not be dehydrated, or\n * to the new device ID if the dehydration was successful.\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public async rehydrateDevice(): Promise {\n if (this.crypto) {\n throw new Error(\"Cannot rehydrate device after crypto is initialized\");\n }\n\n if (!this.cryptoCallbacks.getDehydrationKey) {\n return;\n }\n\n const getDeviceResult = await this.getDehydratedDevice();\n if (!getDeviceResult) {\n return;\n }\n\n if (!getDeviceResult.device_data || !getDeviceResult.device_id) {\n logger.info(\"no dehydrated device found\");\n return;\n }\n\n const account = new global.Olm.Account();\n try {\n const deviceData = getDeviceResult.device_data;\n if (deviceData.algorithm !== DEHYDRATION_ALGORITHM) {\n logger.warn(\"Wrong algorithm for dehydrated device\");\n return;\n }\n logger.log(\"unpickling dehydrated device\");\n const key = await this.cryptoCallbacks.getDehydrationKey(\n deviceData,\n (k) => {\n // copy the key so that it doesn't get clobbered\n account.unpickle(new Uint8Array(k), deviceData.account);\n },\n );\n account.unpickle(key, deviceData.account);\n logger.log(\"unpickled device\");\n\n const rehydrateResult = await this.http.authedRequest(\n undefined,\n \"POST\",\n \"/dehydrated_device/claim\",\n undefined,\n {\n device_id: getDeviceResult.device_id,\n },\n {\n prefix: \"/_matrix/client/unstable/org.matrix.msc2697.v2\",\n },\n );\n\n if (rehydrateResult.success === true) {\n this.deviceId = getDeviceResult.device_id;\n logger.info(\"using dehydrated device\");\n const pickleKey = this.pickleKey || \"DEFAULT_KEY\";\n this.exportedOlmDeviceToImport = {\n pickledAccount: account.pickle(pickleKey),\n sessions: [],\n pickleKey: pickleKey,\n };\n account.free();\n return this.deviceId;\n } else {\n account.free();\n logger.info(\"not using dehydrated device\");\n return;\n }\n } catch (e) {\n account.free();\n logger.warn(\"could not unpickle\", e);\n }\n }\n\n /**\n * Get the current dehydrated device, if any\n * @return {Promise} A promise of an object containing the dehydrated device\n */\n public async getDehydratedDevice(): Promise {\n try {\n return await this.http.authedRequest(\n undefined,\n \"GET\",\n \"/dehydrated_device\",\n undefined, undefined,\n {\n prefix: \"/_matrix/client/unstable/org.matrix.msc2697.v2\",\n },\n );\n } catch (e) {\n logger.info(\"could not get dehydrated device\", e.toString());\n return;\n }\n }\n\n /**\n * Set the dehydration key. This will also periodically dehydrate devices to\n * the server.\n *\n * @param {Uint8Array} key the dehydration key\n * @param {IDehydratedDeviceKeyInfo} [keyInfo] Information about the key. Primarily for\n * information about how to generate the key from a passphrase.\n * @param {string} [deviceDisplayName] The device display name for the\n * dehydrated device.\n * @return {Promise} A promise that resolves when the dehydrated device is stored.\n */\n public async setDehydrationKey(\n key: Uint8Array,\n keyInfo: IDehydratedDeviceKeyInfo,\n deviceDisplayName?: string,\n ): Promise {\n if (!this.crypto) {\n logger.warn('not dehydrating device if crypto is not enabled');\n return;\n }\n // XXX: Private member access.\n return await this.crypto.dehydrationManager.setKeyAndQueueDehydration(\n key, keyInfo, deviceDisplayName,\n );\n }\n\n /**\n * Creates a new dehydrated device (without queuing periodic dehydration)\n * @param {Uint8Array} key the dehydration key\n * @param {IDehydratedDeviceKeyInfo} [keyInfo] Information about the key. Primarily for\n * information about how to generate the key from a passphrase.\n * @param {string} [deviceDisplayName] The device display name for the\n * dehydrated device.\n * @return {Promise} the device id of the newly created dehydrated device\n */\n public async createDehydratedDevice(\n key: Uint8Array,\n keyInfo: IDehydratedDeviceKeyInfo,\n deviceDisplayName?: string,\n ): Promise {\n if (!this.crypto) {\n logger.warn('not dehydrating device if crypto is not enabled');\n return;\n }\n await this.crypto.dehydrationManager.setKey(\n key, keyInfo, deviceDisplayName,\n );\n // XXX: Private member access.\n return await this.crypto.dehydrationManager.dehydrateDevice();\n }\n\n public async exportDevice(): Promise {\n if (!this.crypto) {\n logger.warn('not exporting device if crypto is not enabled');\n return;\n }\n return {\n userId: this.credentials.userId,\n deviceId: this.deviceId,\n // XXX: Private member access.\n olmDevice: await this.crypto.olmDevice.export(),\n };\n }\n\n /**\n * Clear any data out of the persistent stores used by the client.\n *\n * @returns {Promise} Promise which resolves when the stores have been cleared.\n */\n public clearStores(): Promise {\n if (this.clientRunning) {\n throw new Error(\"Cannot clear stores while client is running\");\n }\n\n const promises = [];\n\n promises.push(this.store.deleteAllData());\n if (this.cryptoStore) {\n promises.push(this.cryptoStore.deleteAllData());\n }\n return Promise.all(promises).then(); // .then to fix types\n }\n\n /**\n * Get the user-id of the logged-in user\n *\n * @return {?string} MXID for the logged-in user, or null if not logged in\n */\n public getUserId(): string {\n if (this.credentials && this.credentials.userId) {\n return this.credentials.userId;\n }\n return null;\n }\n\n /**\n * Get the domain for this client's MXID\n * @return {?string} Domain of this MXID\n */\n public getDomain(): string {\n if (this.credentials && this.credentials.userId) {\n return this.credentials.userId.replace(/^.*?:/, '');\n }\n return null;\n }\n\n /**\n * Get the local part of the current user ID e.g. \"foo\" in \"@foo:bar\".\n * @return {?string} The user ID localpart or null.\n */\n public getUserIdLocalpart(): string {\n if (this.credentials && this.credentials.userId) {\n return this.credentials.userId.split(\":\")[0].substring(1);\n }\n return null;\n }\n\n /**\n * Get the device ID of this client\n * @return {?string} device ID\n */\n public getDeviceId(): string {\n return this.deviceId;\n }\n\n /**\n * Check if the runtime environment supports VoIP calling.\n * @return {boolean} True if VoIP is supported.\n */\n public supportsVoip(): boolean {\n return this.canSupportVoip;\n }\n\n /**\n * Set whether VoIP calls are forced to use only TURN\n * candidates. This is the same as the forceTURN option\n * when creating the client.\n * @param {boolean} force True to force use of TURN servers\n */\n public setForceTURN(force: boolean) {\n this.forceTURN = force;\n }\n\n /**\n * Set whether to advertise transfer support to other parties on Matrix calls.\n * @param {boolean} support True to advertise the 'm.call.transferee' capability\n */\n public setSupportsCallTransfer(support: boolean) {\n this.supportsCallTransfer = support;\n }\n\n public async getLocalVideoStream() {\n if (this.localAVStreamType === ConstraintsType.Video) {\n return this.localAVStream.clone();\n }\n\n const constraints = getUserMediaContraints(ConstraintsType.Video);\n logger.log(\"Getting user media with constraints\", constraints);\n const mediaStream = await navigator.mediaDevices.getUserMedia(constraints);\n this.localAVStreamType = ConstraintsType.Video;\n this.localAVStream = mediaStream;\n return mediaStream;\n }\n\n public async getLocalAudioStream() {\n if (this.localAVStreamType === ConstraintsType.Audio) {\n return this.localAVStream.clone();\n }\n\n const constraints = getUserMediaContraints(ConstraintsType.Audio);\n logger.log(\"Getting user media with constraints\", constraints);\n const mediaStream = await navigator.mediaDevices.getUserMedia(constraints);\n this.localAVStreamType = ConstraintsType.Audio;\n this.localAVStream = mediaStream;\n return mediaStream;\n }\n\n public stopLocalMediaStream() {\n if (this.localAVStream) {\n for (const track of this.localAVStream.getTracks()) {\n track.stop();\n }\n\n this.localAVStreamType = null;\n this.localAVStream = null;\n }\n }\n\n /**\n * Creates a new call.\n * The place*Call methods on the returned call can be used to actually place a call\n *\n * @param {string} roomId The room the call is to be placed in.\n * @param {string} invitee The user to call in the given room.\n * @return {MatrixCall} the call or null if the browser doesn't support calling.\n */\n public createCall(roomId: string, invitee?: string): MatrixCall {\n return createNewMatrixCall(this, roomId, { invitee });\n }\n\n /**\n * Get the current sync state.\n * @return {?SyncState} the sync state, which may be null.\n * @see module:client~MatrixClient#event:\"sync\"\n */\n public getSyncState(): SyncState {\n if (!this.syncApi) {\n return null;\n }\n return this.syncApi.getSyncState();\n }\n\n /**\n * Returns the additional data object associated with\n * the current sync state, or null if there is no\n * such data.\n * Sync errors, if available, are put in the 'error' key of\n * this object.\n * @return {?Object}\n */\n public getSyncStateData(): ISyncStateData | null {\n if (!this.syncApi) {\n return null;\n }\n return this.syncApi.getSyncStateData();\n }\n\n /**\n * Whether the initial sync has completed.\n * @return {boolean} True if at least one sync has happened.\n */\n public isInitialSyncComplete(): boolean {\n const state = this.getSyncState();\n if (!state) {\n return false;\n }\n return state === SyncState.Prepared || state === SyncState.Syncing;\n }\n\n /**\n * Return whether the client is configured for a guest account.\n * @return {boolean} True if this is a guest access_token (or no token is supplied).\n */\n public isGuest(): boolean {\n return this.isGuestAccount;\n }\n\n /**\n * Set whether this client is a guest account. This method is experimental\n * and may change without warning.\n * @param {boolean} guest True if this is a guest account.\n */\n public setGuest(guest: boolean) {\n // EXPERIMENTAL:\n // If the token is a macaroon, it should be encoded in it that it is a 'guest'\n // access token, which means that the SDK can determine this entirely without\n // the dev manually flipping this flag.\n this.isGuestAccount = guest;\n }\n\n /**\n * Return the provided scheduler, if any.\n * @return {?module:scheduler~MatrixScheduler} The scheduler or null\n */\n public getScheduler(): MatrixScheduler {\n return this.scheduler;\n }\n\n /**\n * Retry a backed off syncing request immediately. This should only be used when\n * the user explicitly attempts to retry their lost connection.\n * @return {boolean} True if this resulted in a request being retried.\n */\n public retryImmediately(): boolean {\n return this.syncApi.retryImmediately();\n }\n\n /**\n * Return the global notification EventTimelineSet, if any\n *\n * @return {EventTimelineSet} the globl notification EventTimelineSet\n */\n public getNotifTimelineSet(): EventTimelineSet {\n return this.notifTimelineSet;\n }\n\n /**\n * Set the global notification EventTimelineSet\n *\n * @param {EventTimelineSet} set\n */\n public setNotifTimelineSet(set: EventTimelineSet) {\n this.notifTimelineSet = set;\n }\n\n /**\n * Gets the capabilities of the homeserver. Always returns an object of\n * capability keys and their options, which may be empty.\n * @param {boolean} fresh True to ignore any cached values.\n * @return {Promise} Resolves to the capabilities of the homeserver\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public getCapabilities(fresh = false): Promise {\n const now = new Date().getTime();\n\n if (this.cachedCapabilities && !fresh) {\n if (now < this.cachedCapabilities.expiration) {\n logger.log(\"Returning cached capabilities\");\n return Promise.resolve(this.cachedCapabilities.capabilities);\n }\n }\n\n // We swallow errors because we need a default object anyhow\n return this.http.authedRequest(\n undefined, \"GET\", \"/capabilities\",\n ).catch((e) => {\n logger.error(e);\n return null; // otherwise consume the error\n }).then((r) => {\n if (!r) r = {};\n const capabilities: ICapabilities = r[\"capabilities\"] || {};\n\n // If the capabilities missed the cache, cache it for a shorter amount\n // of time to try and refresh them later.\n const cacheMs = Object.keys(capabilities).length\n ? CAPABILITIES_CACHE_MS\n : 60000 + (Math.random() * 5000);\n\n this.cachedCapabilities = {\n capabilities,\n expiration: now + cacheMs,\n };\n\n logger.log(\"Caching capabilities: \", capabilities);\n return capabilities;\n });\n }\n\n /**\n * Initialise support for end-to-end encryption in this client\n *\n * You should call this method after creating the matrixclient, but *before*\n * calling `startClient`, if you want to support end-to-end encryption.\n *\n * It will return a Promise which will resolve when the crypto layer has been\n * successfully initialised.\n */\n public async initCrypto(): Promise {\n if (!isCryptoAvailable()) {\n throw new Error(\n `End-to-end encryption not supported in this js-sdk build: did ` +\n `you remember to load the olm library?`,\n );\n }\n\n if (this.crypto) {\n logger.warn(\"Attempt to re-initialise e2e encryption on MatrixClient\");\n return;\n }\n\n if (!this.sessionStore) {\n // this is temporary, the sessionstore is supposed to be going away\n throw new Error(`Cannot enable encryption: no sessionStore provided`);\n }\n if (!this.cryptoStore) {\n // the cryptostore is provided by sdk.createClient, so this shouldn't happen\n throw new Error(`Cannot enable encryption: no cryptoStore provided`);\n }\n\n logger.log(\"Crypto: Starting up crypto store...\");\n await this.cryptoStore.startup();\n\n // initialise the list of encrypted rooms (whether or not crypto is enabled)\n logger.log(\"Crypto: initialising roomlist...\");\n await this.roomList.init();\n\n const userId = this.getUserId();\n if (userId === null) {\n throw new Error(\n `Cannot enable encryption on MatrixClient with unknown userId: ` +\n `ensure userId is passed in createClient().`,\n );\n }\n if (this.deviceId === null) {\n throw new Error(\n `Cannot enable encryption on MatrixClient with unknown deviceId: ` +\n `ensure deviceId is passed in createClient().`,\n );\n }\n\n const crypto = new Crypto(\n this,\n this.sessionStore,\n userId, this.deviceId,\n this.store,\n this.cryptoStore,\n this.roomList,\n this.verificationMethods,\n );\n\n this.reEmitter.reEmit(crypto, [\n \"crypto.keyBackupFailed\",\n \"crypto.keyBackupSessionsRemaining\",\n \"crypto.roomKeyRequest\",\n \"crypto.roomKeyRequestCancellation\",\n \"crypto.warning\",\n \"crypto.devicesUpdated\",\n \"crypto.willUpdateDevices\",\n \"deviceVerificationChanged\",\n \"userTrustStatusChanged\",\n \"crossSigning.keysChanged\",\n ]);\n\n logger.log(\"Crypto: initialising crypto object...\");\n await crypto.init({\n exportedOlmDevice: this.exportedOlmDeviceToImport,\n pickleKey: this.pickleKey,\n });\n delete this.exportedOlmDeviceToImport;\n\n this.olmVersion = Crypto.getOlmVersion();\n\n // if crypto initialisation was successful, tell it to attach its event\n // handlers.\n crypto.registerEventHandlers(this);\n this.crypto = crypto;\n }\n\n /**\n * Is end-to-end crypto enabled for this client.\n * @return {boolean} True if end-to-end is enabled.\n */\n public isCryptoEnabled(): boolean {\n return !!this.crypto;\n }\n\n /**\n * Get the Ed25519 key for this device\n *\n * @return {?string} base64-encoded ed25519 key. Null if crypto is\n * disabled.\n */\n public getDeviceEd25519Key(): string {\n if (!this.crypto) return null;\n return this.crypto.getDeviceEd25519Key();\n }\n\n /**\n * Get the Curve25519 key for this device\n *\n * @return {?string} base64-encoded curve25519 key. Null if crypto is\n * disabled.\n */\n public getDeviceCurve25519Key(): string {\n if (!this.crypto) return null;\n return this.crypto.getDeviceCurve25519Key();\n }\n\n /**\n * Upload the device keys to the homeserver.\n * @return {Promise} A promise that will resolve when the keys are uploaded.\n */\n public async uploadKeys(): Promise {\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n\n await this.crypto.uploadDeviceKeys();\n }\n\n /**\n * Download the keys for a list of users and stores the keys in the session\n * store.\n * @param {Array} userIds The users to fetch.\n * @param {boolean} forceDownload Always download the keys even if cached.\n *\n * @return {Promise} A promise which resolves to a map userId->deviceId->{@link\n * module:crypto~DeviceInfo|DeviceInfo}.\n */\n public downloadKeys(\n userIds: string[],\n forceDownload?: boolean,\n ): Promise>> {\n if (!this.crypto) {\n return Promise.reject(new Error(\"End-to-end encryption disabled\"));\n }\n return this.crypto.downloadKeys(userIds, forceDownload);\n }\n\n /**\n * Get the stored device keys for a user id\n *\n * @param {string} userId the user to list keys for.\n *\n * @return {module:crypto/deviceinfo[]} list of devices\n */\n public getStoredDevicesForUser(userId: string): DeviceInfo[] {\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n return this.crypto.getStoredDevicesForUser(userId) || [];\n }\n\n /**\n * Get the stored device key for a user id and device id\n *\n * @param {string} userId the user to list keys for.\n * @param {string} deviceId unique identifier for the device\n *\n * @return {module:crypto/deviceinfo} device or null\n */\n public getStoredDevice(userId: string, deviceId: string): DeviceInfo {\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n return this.crypto.getStoredDevice(userId, deviceId) || null;\n }\n\n /**\n * Mark the given device as verified\n *\n * @param {string} userId owner of the device\n * @param {string} deviceId unique identifier for the device or user's\n * cross-signing public key ID.\n *\n * @param {boolean=} verified whether to mark the device as verified. defaults\n * to 'true'.\n *\n * @returns {Promise}\n *\n * @fires module:client~event:MatrixClient\"deviceVerificationChanged\"\n */\n public setDeviceVerified(userId: string, deviceId: string, verified = true): Promise {\n const prom = this.setDeviceVerification(userId, deviceId, verified, null, null);\n\n // if one of the user's own devices is being marked as verified / unverified,\n // check the key backup status, since whether or not we use this depends on\n // whether it has a signature from a verified device\n if (userId == this.credentials.userId) {\n this.checkKeyBackup();\n }\n return prom;\n }\n\n /**\n * Mark the given device as blocked/unblocked\n *\n * @param {string} userId owner of the device\n * @param {string} deviceId unique identifier for the device or user's\n * cross-signing public key ID.\n *\n * @param {boolean=} blocked whether to mark the device as blocked. defaults\n * to 'true'.\n *\n * @returns {Promise}\n *\n * @fires module:client~event:MatrixClient\"deviceVerificationChanged\"\n */\n public setDeviceBlocked(userId: string, deviceId: string, blocked = true): Promise {\n return this.setDeviceVerification(userId, deviceId, null, blocked, null);\n }\n\n /**\n * Mark the given device as known/unknown\n *\n * @param {string} userId owner of the device\n * @param {string} deviceId unique identifier for the device or user's\n * cross-signing public key ID.\n *\n * @param {boolean=} known whether to mark the device as known. defaults\n * to 'true'.\n *\n * @returns {Promise}\n *\n * @fires module:client~event:MatrixClient\"deviceVerificationChanged\"\n */\n public setDeviceKnown(userId: string, deviceId: string, known = true): Promise {\n return this.setDeviceVerification(userId, deviceId, null, null, known);\n }\n\n private async setDeviceVerification(\n userId: string,\n deviceId: string,\n verified: boolean,\n blocked: boolean,\n known: boolean,\n ): Promise {\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n await this.crypto.setDeviceVerification(userId, deviceId, verified, blocked, known);\n }\n\n /**\n * Request a key verification from another user, using a DM.\n *\n * @param {string} userId the user to request verification with\n * @param {string} roomId the room to use for verification\n *\n * @returns {Promise} resolves to a VerificationRequest\n * when the request has been sent to the other party.\n */\n public requestVerificationDM(userId: string, roomId: string): Promise {\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n return this.crypto.requestVerificationDM(userId, roomId);\n }\n\n /**\n * Finds a DM verification request that is already in progress for the given room id\n *\n * @param {string} roomId the room to use for verification\n *\n * @returns {module:crypto/verification/request/VerificationRequest?} the VerificationRequest that is in progress, if any\n */\n public findVerificationRequestDMInProgress(roomId: string): VerificationRequest {\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n return this.crypto.findVerificationRequestDMInProgress(roomId);\n }\n\n /**\n * Returns all to-device verification requests that are already in progress for the given user id\n *\n * @param {string} userId the ID of the user to query\n *\n * @returns {module:crypto/verification/request/VerificationRequest[]} the VerificationRequests that are in progress\n */\n public getVerificationRequestsToDeviceInProgress(userId: string): VerificationRequest[] {\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n return this.crypto.getVerificationRequestsToDeviceInProgress(userId);\n }\n\n /**\n * Request a key verification from another user.\n *\n * @param {string} userId the user to request verification with\n * @param {Array} devices array of device IDs to send requests to. Defaults to\n * all devices owned by the user\n *\n * @returns {Promise} resolves to a VerificationRequest\n * when the request has been sent to the other party.\n */\n public requestVerification(userId: string, devices?: string[]): Promise {\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n return this.crypto.requestVerification(userId, devices);\n }\n\n /**\n * Begin a key verification.\n *\n * @param {string} method the verification method to use\n * @param {string} userId the user to verify keys with\n * @param {string} deviceId the device to verify\n *\n * @returns {Verification} a verification object\n */\n public beginKeyVerification(method: string, userId: string, deviceId: string): Verification {\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n return this.crypto.beginKeyVerification(method, userId, deviceId);\n }\n\n public checkSecretStorageKey(key: Uint8Array, info: ISecretStorageKeyInfo): Promise {\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n return this.crypto.checkSecretStorageKey(key, info);\n }\n\n /**\n * Set the global override for whether the client should ever send encrypted\n * messages to unverified devices. This provides the default for rooms which\n * do not specify a value.\n *\n * @param {boolean} value whether to blacklist all unverified devices by default\n */\n public setGlobalBlacklistUnverifiedDevices(value: boolean) {\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n return this.crypto.setGlobalBlacklistUnverifiedDevices(value);\n }\n\n /**\n * @return {boolean} whether to blacklist all unverified devices by default\n */\n public getGlobalBlacklistUnverifiedDevices(): boolean {\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n return this.crypto.getGlobalBlacklistUnverifiedDevices();\n }\n\n /**\n * Set whether sendMessage in a room with unknown and unverified devices\n * should throw an error and not send them message. This has 'Global' for\n * symmetry with setGlobalBlacklistUnverifiedDevices but there is currently\n * no room-level equivalent for this setting.\n *\n * This API is currently UNSTABLE and may change or be removed without notice.\n *\n * @param {boolean} value whether error on unknown devices\n */\n public setGlobalErrorOnUnknownDevices(value: boolean) {\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n return this.crypto.setGlobalErrorOnUnknownDevices(value);\n }\n\n /**\n * @return {boolean} whether to error on unknown devices\n *\n * This API is currently UNSTABLE and may change or be removed without notice.\n */\n public getGlobalErrorOnUnknownDevices(): boolean {\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n return this.crypto.getGlobalErrorOnUnknownDevices();\n }\n\n /**\n * Get the user's cross-signing key ID.\n *\n * The cross-signing API is currently UNSTABLE and may change without notice.\n *\n * @param {CrossSigningKey} [type=master] The type of key to get the ID of. One of\n * \"master\", \"self_signing\", or \"user_signing\". Defaults to \"master\".\n *\n * @returns {string} the key ID\n */\n public getCrossSigningId(type: CrossSigningKey | string = CrossSigningKey.Master): string {\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n return this.crypto.getCrossSigningId(type);\n }\n\n /**\n * Get the cross signing information for a given user.\n *\n * The cross-signing API is currently UNSTABLE and may change without notice.\n *\n * @param {string} userId the user ID to get the cross-signing info for.\n *\n * @returns {CrossSigningInfo} the cross signing information for the user.\n */\n public getStoredCrossSigningForUser(userId: string): CrossSigningInfo {\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n return this.crypto.getStoredCrossSigningForUser(userId);\n }\n\n /**\n * Check whether a given user is trusted.\n *\n * The cross-signing API is currently UNSTABLE and may change without notice.\n *\n * @param {string} userId The ID of the user to check.\n *\n * @returns {UserTrustLevel}\n */\n public checkUserTrust(userId: string): UserTrustLevel {\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n return this.crypto.checkUserTrust(userId);\n }\n\n /**\n * Check whether a given device is trusted.\n *\n * The cross-signing API is currently UNSTABLE and may change without notice.\n *\n * @function module:client~MatrixClient#checkDeviceTrust\n * @param {string} userId The ID of the user whose devices is to be checked.\n * @param {string} deviceId The ID of the device to check\n *\n * @returns {DeviceTrustLevel}\n */\n public checkDeviceTrust(userId: string, deviceId: string): DeviceTrustLevel {\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n return this.crypto.checkDeviceTrust(userId, deviceId);\n }\n\n /**\n * Check the copy of our cross-signing key that we have in the device list and\n * see if we can get the private key. If so, mark it as trusted.\n * @param {Object} opts ICheckOwnCrossSigningTrustOpts object\n */\n public checkOwnCrossSigningTrust(opts?: ICheckOwnCrossSigningTrustOpts): Promise {\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n return this.crypto.checkOwnCrossSigningTrust(opts);\n }\n\n /**\n * Checks that a given cross-signing private key matches a given public key.\n * This can be used by the getCrossSigningKey callback to verify that the\n * private key it is about to supply is the one that was requested.\n * @param {Uint8Array} privateKey The private key\n * @param {string} expectedPublicKey The public key\n * @returns {boolean} true if the key matches, otherwise false\n */\n public checkCrossSigningPrivateKey(privateKey: Uint8Array, expectedPublicKey: string): boolean {\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n return this.crypto.checkCrossSigningPrivateKey(privateKey, expectedPublicKey);\n }\n\n public legacyDeviceVerification(\n userId: string,\n deviceId: string,\n method: VerificationMethod,\n ): Promise {\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n return this.crypto.legacyDeviceVerification(userId, deviceId, method);\n }\n\n /**\n * Perform any background tasks that can be done before a message is ready to\n * send, in order to speed up sending of the message.\n * @param {module:models/room} room the room the event is in\n */\n public prepareToEncrypt(room: Room) {\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n return this.crypto.prepareToEncrypt(room);\n }\n\n /**\n * Checks whether cross signing:\n * - is enabled on this account and trusted by this device\n * - has private keys either cached locally or stored in secret storage\n *\n * If this function returns false, bootstrapCrossSigning() can be used\n * to fix things such that it returns true. That is to say, after\n * bootstrapCrossSigning() completes successfully, this function should\n * return true.\n * @return {boolean} True if cross-signing is ready to be used on this device\n */\n public isCrossSigningReady(): Promise {\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n return this.crypto.isCrossSigningReady();\n }\n\n /**\n * Bootstrap cross-signing by creating keys if needed. If everything is already\n * set up, then no changes are made, so this is safe to run to ensure\n * cross-signing is ready for use.\n *\n * This function:\n * - creates new cross-signing keys if they are not found locally cached nor in\n * secret storage (if it has been setup)\n *\n * The cross-signing API is currently UNSTABLE and may change without notice.\n *\n * @param {function} opts.authUploadDeviceSigningKeys Function\n * called to await an interactive auth flow when uploading device signing keys.\n * @param {boolean} [opts.setupNewCrossSigning] Optional. Reset even if keys\n * already exist.\n * Args:\n * {function} A function that makes the request requiring auth. Receives the\n * auth data as an object. Can be called multiple times, first with an empty\n * authDict, to obtain the flows.\n */\n public bootstrapCrossSigning(opts: IBootstrapCrossSigningOpts) {\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n return this.crypto.bootstrapCrossSigning(opts);\n }\n\n /**\n * Whether to trust a others users signatures of their devices.\n * If false, devices will only be considered 'verified' if we have\n * verified that device individually (effectively disabling cross-signing).\n *\n * Default: true\n *\n * @return {boolean} True if trusting cross-signed devices\n */\n public getCryptoTrustCrossSignedDevices(): boolean {\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n return this.crypto.getCryptoTrustCrossSignedDevices();\n }\n\n /**\n * See getCryptoTrustCrossSignedDevices\n\n * This may be set before initCrypto() is called to ensure no races occur.\n *\n * @param {boolean} val True to trust cross-signed devices\n */\n public setCryptoTrustCrossSignedDevices(val: boolean) {\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n return this.crypto.setCryptoTrustCrossSignedDevices(val);\n }\n\n /**\n * Counts the number of end to end session keys that are waiting to be backed up\n * @returns {Promise} Resolves to the number of sessions requiring backup\n */\n public countSessionsNeedingBackup(): Promise {\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n return this.crypto.countSessionsNeedingBackup();\n }\n\n /**\n * Get information about the encryption of an event\n *\n * @param {module:models/event.MatrixEvent} event event to be checked\n * @returns {IEncryptedEventInfo} The event information.\n */\n public getEventEncryptionInfo(event: MatrixEvent): IEncryptedEventInfo {\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n return this.crypto.getEventEncryptionInfo(event);\n }\n\n /**\n * Create a recovery key from a user-supplied passphrase.\n *\n * The Secure Secret Storage API is currently UNSTABLE and may change without notice.\n *\n * @param {string} password Passphrase string that can be entered by the user\n * when restoring the backup as an alternative to entering the recovery key.\n * Optional.\n * @returns {Promise} Object with public key metadata, encoded private\n * recovery key which should be disposed of after displaying to the user,\n * and raw private key to avoid round tripping if needed.\n */\n public createRecoveryKeyFromPassphrase(password: string): Promise {\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n return this.crypto.createRecoveryKeyFromPassphrase(password);\n }\n\n /**\n * Checks whether secret storage:\n * - is enabled on this account\n * - is storing cross-signing private keys\n * - is storing session backup key (if enabled)\n *\n * If this function returns false, bootstrapSecretStorage() can be used\n * to fix things such that it returns true. That is to say, after\n * bootstrapSecretStorage() completes successfully, this function should\n * return true.\n *\n * The Secure Secret Storage API is currently UNSTABLE and may change without notice.\n *\n * @return {boolean} True if secret storage is ready to be used on this device\n */\n public isSecretStorageReady(): Promise {\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n return this.crypto.isSecretStorageReady();\n }\n\n /**\n * Bootstrap Secure Secret Storage if needed by creating a default key. If everything is\n * already set up, then no changes are made, so this is safe to run to ensure secret\n * storage is ready for use.\n *\n * This function\n * - creates a new Secure Secret Storage key if no default key exists\n * - if a key backup exists, it is migrated to store the key in the Secret\n * Storage\n * - creates a backup if none exists, and one is requested\n * - migrates Secure Secret Storage to use the latest algorithm, if an outdated\n * algorithm is found\n *\n * @param opts\n */\n public bootstrapSecretStorage(opts: ICreateSecretStorageOpts): Promise {\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n return this.crypto.bootstrapSecretStorage(opts);\n }\n\n /**\n * Add a key for encrypting secrets.\n *\n * The Secure Secret Storage API is currently UNSTABLE and may change without notice.\n *\n * @param {string} algorithm the algorithm used by the key\n * @param {object} opts the options for the algorithm. The properties used\n * depend on the algorithm given.\n * @param {string} [keyName] the name of the key. If not given, a random name will be generated.\n *\n * @return {object} An object with:\n * keyId: {string} the ID of the key\n * keyInfo: {object} details about the key (iv, mac, passphrase)\n */\n public addSecretStorageKey(\n algorithm: string,\n opts: IAddSecretStorageKeyOpts,\n keyName?: string,\n ): Promise<{keyId: string, keyInfo: ISecretStorageKeyInfo}> {\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n return this.crypto.addSecretStorageKey(algorithm, opts, keyName);\n }\n\n /**\n * Check whether we have a key with a given ID.\n *\n * The Secure Secret Storage API is currently UNSTABLE and may change without notice.\n *\n * @param {string} [keyId = default key's ID] The ID of the key to check\n * for. Defaults to the default key ID if not provided.\n * @return {boolean} Whether we have the key.\n */\n public hasSecretStorageKey(keyId?: string): Promise {\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n return this.crypto.hasSecretStorageKey(keyId);\n }\n\n /**\n * Store an encrypted secret on the server.\n *\n * The Secure Secret Storage API is currently UNSTABLE and may change without notice.\n *\n * @param {string} name The name of the secret\n * @param {string} secret The secret contents.\n * @param {Array} keys The IDs of the keys to use to encrypt the secret or null/undefined\n * to use the default (will throw if no default key is set).\n */\n public storeSecret(name: string, secret: string, keys?: string[]) {\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n return this.crypto.storeSecret(name, secret, keys);\n }\n\n /**\n * Get a secret from storage.\n *\n * The Secure Secret Storage API is currently UNSTABLE and may change without notice.\n *\n * @param {string} name the name of the secret\n *\n * @return {string} the contents of the secret\n */\n public getSecret(name: string): Promise {\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n return this.crypto.getSecret(name);\n }\n\n /**\n * Check if a secret is stored on the server.\n *\n * The Secure Secret Storage API is currently UNSTABLE and may change without notice.\n *\n * @param {string} name the name of the secret\n * @param {boolean} checkKey check if the secret is encrypted by a trusted\n * key\n *\n * @return {object?} map of key name to key info the secret is encrypted\n * with, or null if it is not present or not encrypted with a trusted\n * key\n */\n public isSecretStored(name: string, checkKey: boolean): Promise> {\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n return this.crypto.isSecretStored(name, checkKey);\n }\n\n /**\n * Request a secret from another device.\n *\n * The Secure Secret Storage API is currently UNSTABLE and may change without notice.\n *\n * @param {string} name the name of the secret to request\n * @param {string[]} devices the devices to request the secret from\n *\n * @return {ISecretRequest} the secret request object\n */\n public requestSecret(name: string, devices: string[]): ISecretRequest {\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n return this.crypto.requestSecret(name, devices);\n }\n\n /**\n * Get the current default key ID for encrypting secrets.\n *\n * The Secure Secret Storage API is currently UNSTABLE and may change without notice.\n *\n * @return {string} The default key ID or null if no default key ID is set\n */\n public getDefaultSecretStorageKeyId(): Promise {\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n return this.crypto.getDefaultSecretStorageKeyId();\n }\n\n /**\n * Set the current default key ID for encrypting secrets.\n *\n * The Secure Secret Storage API is currently UNSTABLE and may change without notice.\n *\n * @param {string} keyId The new default key ID\n */\n public setDefaultSecretStorageKeyId(keyId: string) {\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n return this.crypto.setDefaultSecretStorageKeyId(keyId);\n }\n\n /**\n * Checks that a given secret storage private key matches a given public key.\n * This can be used by the getSecretStorageKey callback to verify that the\n * private key it is about to supply is the one that was requested.\n *\n * The Secure Secret Storage API is currently UNSTABLE and may change without notice.\n *\n * @param {Uint8Array} privateKey The private key\n * @param {string} expectedPublicKey The public key\n * @returns {boolean} true if the key matches, otherwise false\n */\n public checkSecretStoragePrivateKey(privateKey: Uint8Array, expectedPublicKey: string): boolean {\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n return this.crypto.checkSecretStoragePrivateKey(privateKey, expectedPublicKey);\n }\n\n /**\n * Get e2e information on the device that sent an event\n *\n * @param {MatrixEvent} event event to be checked\n *\n * @return {Promise}\n */\n public async getEventSenderDeviceInfo(event: MatrixEvent): Promise {\n if (!this.crypto) {\n return null;\n }\n return this.crypto.getEventSenderDeviceInfo(event);\n }\n\n /**\n * Check if the sender of an event is verified\n *\n * @param {MatrixEvent} event event to be checked\n *\n * @return {boolean} true if the sender of this event has been verified using\n * {@link module:client~MatrixClient#setDeviceVerified|setDeviceVerified}.\n */\n public async isEventSenderVerified(event: MatrixEvent): Promise {\n const device = await this.getEventSenderDeviceInfo(event);\n if (!device) {\n return false;\n }\n return device.isVerified();\n }\n\n /**\n * Cancel a room key request for this event if one is ongoing and resend the\n * request.\n * @param {MatrixEvent} event event of which to cancel and resend the room\n * key request.\n * @return {Promise} A promise that will resolve when the key request is queued\n */\n public cancelAndResendEventRoomKeyRequest(event: MatrixEvent): Promise {\n return event.cancelAndResendKeyRequest(this.crypto, this.getUserId());\n }\n\n /**\n * Enable end-to-end encryption for a room. This does not modify room state.\n * Any messages sent before the returned promise resolves will be sent unencrypted.\n * @param {string} roomId The room ID to enable encryption in.\n * @param {object} config The encryption config for the room.\n * @return {Promise} A promise that will resolve when encryption is set up.\n */\n public setRoomEncryption(roomId: string, config: IRoomEncryption): Promise {\n if (!this.crypto) {\n throw new Error(\"End-to-End encryption disabled\");\n }\n return this.crypto.setRoomEncryption(roomId, config);\n }\n\n /**\n * Whether encryption is enabled for a room.\n * @param {string} roomId the room id to query.\n * @return {boolean} whether encryption is enabled.\n */\n public isRoomEncrypted(roomId: string): boolean {\n const room = this.getRoom(roomId);\n if (!room) {\n // we don't know about this room, so can't determine if it should be\n // encrypted. Let's assume not.\n return false;\n }\n\n // if there is an 'm.room.encryption' event in this room, it should be\n // encrypted (independently of whether we actually support encryption)\n const ev = room.currentState.getStateEvents(EventType.RoomEncryption, \"\");\n if (ev) {\n return true;\n }\n\n // we don't have an m.room.encrypted event, but that might be because\n // the server is hiding it from us. Check the store to see if it was\n // previously encrypted.\n return this.roomList.isRoomEncrypted(roomId);\n }\n\n /**\n * Forces the current outbound group session to be discarded such\n * that another one will be created next time an event is sent.\n *\n * @param {string} roomId The ID of the room to discard the session for\n *\n * This should not normally be necessary.\n */\n public forceDiscardSession(roomId: string) {\n if (!this.crypto) {\n throw new Error(\"End-to-End encryption disabled\");\n }\n this.crypto.forceDiscardSession(roomId);\n }\n\n /**\n * Get a list containing all of the room keys\n *\n * This should be encrypted before returning it to the user.\n *\n * @return {Promise} a promise which resolves to a list of\n * session export objects\n */\n public exportRoomKeys(): Promise {\n if (!this.crypto) {\n return Promise.reject(new Error(\"End-to-end encryption disabled\"));\n }\n return this.crypto.exportRoomKeys();\n }\n\n /**\n * Import a list of room keys previously exported by exportRoomKeys\n *\n * @param {Object[]} keys a list of session export objects\n * @param {Object} opts\n * @param {Function} opts.progressCallback called with an object that has a \"stage\" param\n *\n * @return {Promise} a promise which resolves when the keys\n * have been imported\n */\n public importRoomKeys(keys: IMegolmSessionData[], opts: IImportRoomKeysOpts): Promise {\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n return this.crypto.importRoomKeys(keys, opts);\n }\n\n /**\n * Force a re-check of the local key backup status against\n * what's on the server.\n *\n * @returns {Object} Object with backup info (as returned by\n * getKeyBackupVersion) in backupInfo and\n * trust information (as returned by isKeyBackupTrusted)\n * in trustInfo.\n */\n public checkKeyBackup(): Promise {\n return this.crypto.backupManager.checkKeyBackup();\n }\n\n /**\n * Get information about the current key backup.\n * @returns {Promise} Information object from API or null\n */\n public async getKeyBackupVersion(): Promise {\n let res;\n try {\n res = await this.http.authedRequest(\n undefined, \"GET\", \"/room_keys/version\", undefined, undefined,\n { prefix: PREFIX_UNSTABLE },\n );\n } catch (e) {\n if (e.errcode === 'M_NOT_FOUND') {\n return null;\n } else {\n throw e;\n }\n }\n try {\n BackupManager.checkBackupVersion(res);\n } catch (e) {\n throw e;\n }\n return res;\n }\n\n /**\n * @param {object} info key backup info dict from getKeyBackupVersion()\n * @return {object} {\n * usable: [bool], // is the backup trusted, true iff there is a sig that is valid & from a trusted device\n * sigs: [\n * valid: [bool],\n * device: [DeviceInfo],\n * ]\n * }\n */\n public isKeyBackupTrusted(info: IKeyBackupInfo): Promise {\n return this.crypto.backupManager.isKeyBackupTrusted(info);\n }\n\n /**\n * @returns {boolean} true if the client is configured to back up keys to\n * the server, otherwise false. If we haven't completed a successful check\n * of key backup status yet, returns null.\n */\n public getKeyBackupEnabled(): boolean {\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n return this.crypto.backupManager.getKeyBackupEnabled();\n }\n\n /**\n * Enable backing up of keys, using data previously returned from\n * getKeyBackupVersion.\n *\n * @param {object} info Backup information object as returned by getKeyBackupVersion\n * @returns {Promise} Resolves when complete.\n */\n public enableKeyBackup(info: IKeyBackupInfo): Promise {\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n\n return this.crypto.backupManager.enableKeyBackup(info);\n }\n\n /**\n * Disable backing up of keys.\n */\n public disableKeyBackup() {\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n\n this.crypto.backupManager.disableKeyBackup();\n }\n\n /**\n * Set up the data required to create a new backup version. The backup version\n * will not be created and enabled until createKeyBackupVersion is called.\n *\n * @param {string} password Passphrase string that can be entered by the user\n * when restoring the backup as an alternative to entering the recovery key.\n * Optional.\n * @param {boolean} [opts.secureSecretStorage = false] Whether to use Secure\n * Secret Storage to store the key encrypting key backups.\n * Optional, defaults to false.\n *\n * @returns {Promise} Object that can be passed to createKeyBackupVersion and\n * additionally has a 'recovery_key' member with the user-facing recovery key string.\n */\n // TODO: Verify types\n public async prepareKeyBackupVersion(\n password: string,\n opts: IKeyBackupPrepareOpts = { secureSecretStorage: false },\n ): Promise> {\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n\n // eslint-disable-next-line camelcase\n const { algorithm, auth_data, recovery_key, privateKey } =\n await this.crypto.backupManager.prepareKeyBackupVersion(password);\n\n if (opts.secureSecretStorage) {\n await this.storeSecret(\"m.megolm_backup.v1\", encodeBase64(privateKey));\n logger.info(\"Key backup private key stored in secret storage\");\n }\n\n return {\n algorithm,\n auth_data,\n recovery_key,\n };\n }\n\n /**\n * Check whether the key backup private key is stored in secret storage.\n * @return {Promise} map of key name to key info the secret is\n * encrypted with, or null if it is not present or not encrypted with a\n * trusted key\n */\n public isKeyBackupKeyStored(): Promise> {\n return Promise.resolve(this.isSecretStored(\"m.megolm_backup.v1\", false /* checkKey */));\n }\n\n /**\n * Create a new key backup version and enable it, using the information return\n * from prepareKeyBackupVersion.\n *\n * @param {object} info Info object from prepareKeyBackupVersion\n * @returns {Promise} Object with 'version' param indicating the version created\n */\n // TODO: Fix types\n public async createKeyBackupVersion(info: IKeyBackupInfo): Promise {\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n\n await this.crypto.backupManager.createKeyBackupVersion(info);\n\n const data = {\n algorithm: info.algorithm,\n auth_data: info.auth_data,\n };\n\n // Sign the backup auth data with the device key for backwards compat with\n // older devices with cross-signing. This can probably go away very soon in\n // favour of just signing with the cross-singing master key.\n // XXX: Private member access\n await this.crypto.signObject(data.auth_data);\n\n if (\n this.cryptoCallbacks.getCrossSigningKey &&\n // XXX: Private member access\n this.crypto.crossSigningInfo.getId()\n ) {\n // now also sign the auth data with the cross-signing master key\n // we check for the callback explicitly here because we still want to be able\n // to create an un-cross-signed key backup if there is a cross-signing key but\n // no callback supplied.\n // XXX: Private member access\n await this.crypto.crossSigningInfo.signObject(data.auth_data, \"master\");\n }\n\n const res = await this.http.authedRequest(\n undefined, \"POST\", \"/room_keys/version\", undefined, data,\n { prefix: PREFIX_UNSTABLE },\n );\n\n // We could assume everything's okay and enable directly, but this ensures\n // we run the same signature verification that will be used for future\n // sessions.\n await this.checkKeyBackup();\n if (!this.getKeyBackupEnabled()) {\n logger.error(\"Key backup not usable even though we just created it\");\n }\n\n return res;\n }\n\n public deleteKeyBackupVersion(version: string): Promise {\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n\n // If we're currently backing up to this backup... stop.\n // (We start using it automatically in createKeyBackupVersion\n // so this is symmetrical).\n if (this.crypto.backupManager.version) {\n this.crypto.backupManager.disableKeyBackup();\n }\n\n const path = utils.encodeUri(\"/room_keys/version/$version\", {\n $version: version,\n });\n\n return this.http.authedRequest(\n undefined, \"DELETE\", path, undefined, undefined,\n { prefix: PREFIX_UNSTABLE },\n );\n }\n\n private makeKeyBackupPath(roomId: string, sessionId: string, version: string): IKeyBackupPath {\n let path;\n if (sessionId !== undefined) {\n path = utils.encodeUri(\"/room_keys/keys/$roomId/$sessionId\", {\n $roomId: roomId,\n $sessionId: sessionId,\n });\n } else if (roomId !== undefined) {\n path = utils.encodeUri(\"/room_keys/keys/$roomId\", {\n $roomId: roomId,\n });\n } else {\n path = \"/room_keys/keys\";\n }\n const queryData = version === undefined ? undefined : { version };\n return { path, queryData };\n }\n\n /**\n * Back up session keys to the homeserver.\n * @param {string} roomId ID of the room that the keys are for Optional.\n * @param {string} sessionId ID of the session that the keys are for Optional.\n * @param {number} version backup version Optional.\n * @param {object} data Object keys to send\n * @return {Promise} a promise that will resolve when the keys\n * are uploaded\n */\n public sendKeyBackup(roomId: string, sessionId: string, version: string, data: IKeyBackup): Promise {\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n\n const path = this.makeKeyBackupPath(roomId, sessionId, version);\n return this.http.authedRequest(\n undefined, \"PUT\", path.path, path.queryData, data,\n { prefix: PREFIX_UNSTABLE },\n );\n }\n\n /**\n * Marks all group sessions as needing to be backed up and schedules them to\n * upload in the background as soon as possible.\n */\n public async scheduleAllGroupSessionsForBackup() {\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n\n await this.crypto.backupManager.scheduleAllGroupSessionsForBackup();\n }\n\n /**\n * Marks all group sessions as needing to be backed up without scheduling\n * them to upload in the background.\n * @returns {Promise} Resolves to the number of sessions requiring a backup.\n */\n public flagAllGroupSessionsForBackup(): Promise {\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n\n return this.crypto.backupManager.flagAllGroupSessionsForBackup();\n }\n\n public isValidRecoveryKey(recoveryKey: string): boolean {\n try {\n decodeRecoveryKey(recoveryKey);\n return true;\n } catch (e) {\n return false;\n }\n }\n\n /**\n * Get the raw key for a key backup from the password\n * Used when migrating key backups into SSSS\n *\n * The cross-signing API is currently UNSTABLE and may change without notice.\n *\n * @param {string} password Passphrase\n * @param {object} backupInfo Backup metadata from `checkKeyBackup`\n * @return {Promise} key backup key\n */\n public keyBackupKeyFromPassword(password: string, backupInfo: IKeyBackupInfo): Promise {\n return keyFromAuthData(backupInfo.auth_data, password);\n }\n\n /**\n * Get the raw key for a key backup from the recovery key\n * Used when migrating key backups into SSSS\n *\n * The cross-signing API is currently UNSTABLE and may change without notice.\n *\n * @param {string} recoveryKey The recovery key\n * @return {Uint8Array} key backup key\n */\n public keyBackupKeyFromRecoveryKey(recoveryKey: string): Uint8Array {\n return decodeRecoveryKey(recoveryKey);\n }\n\n /**\n * Restore from an existing key backup via a passphrase.\n *\n * @param {string} password Passphrase\n * @param {string} [targetRoomId] Room ID to target a specific room.\n * Restores all rooms if omitted.\n * @param {string} [targetSessionId] Session ID to target a specific session.\n * Restores all sessions if omitted.\n * @param {object} backupInfo Backup metadata from `checkKeyBackup`\n * @param {object} opts Optional params such as callbacks\n * @return {Promise} Status of restoration with `total` and `imported`\n * key counts.\n */\n // TODO: Types\n public async restoreKeyBackupWithPassword(\n password: string,\n targetRoomId: string,\n targetSessionId: string,\n backupInfo: IKeyBackupInfo,\n opts: IKeyBackupRestoreOpts,\n ): Promise {\n const privKey = await keyFromAuthData(backupInfo.auth_data, password);\n return this.restoreKeyBackup(\n privKey, targetRoomId, targetSessionId, backupInfo, opts,\n );\n }\n\n /**\n * Restore from an existing key backup via a private key stored in secret\n * storage.\n *\n * @param {object} backupInfo Backup metadata from `checkKeyBackup`\n * @param {string} [targetRoomId] Room ID to target a specific room.\n * Restores all rooms if omitted.\n * @param {string} [targetSessionId] Session ID to target a specific session.\n * Restores all sessions if omitted.\n * @param {object} opts Optional params such as callbacks\n * @return {Promise} Status of restoration with `total` and `imported`\n * key counts.\n */\n // TODO: Types\n public async restoreKeyBackupWithSecretStorage(\n backupInfo: IKeyBackupInfo,\n targetRoomId?: string,\n targetSessionId?: string,\n opts?: IKeyBackupRestoreOpts,\n ): Promise {\n const storedKey = await this.getSecret(\"m.megolm_backup.v1\");\n\n // ensure that the key is in the right format. If not, fix the key and\n // store the fixed version\n const fixedKey = fixBackupKey(storedKey);\n if (fixedKey) {\n const [keyId] = await this.crypto.getSecretStorageKey();\n await this.storeSecret(\"m.megolm_backup.v1\", fixedKey, [keyId]);\n }\n\n const privKey = decodeBase64(fixedKey || storedKey);\n return this.restoreKeyBackup(\n privKey, targetRoomId, targetSessionId, backupInfo, opts,\n );\n }\n\n /**\n * Restore from an existing key backup via an encoded recovery key.\n *\n * @param {string} recoveryKey Encoded recovery key\n * @param {string} [targetRoomId] Room ID to target a specific room.\n * Restores all rooms if omitted.\n * @param {string} [targetSessionId] Session ID to target a specific session.\n * Restores all sessions if omitted.\n * @param {object} backupInfo Backup metadata from `checkKeyBackup`\n * @param {object} opts Optional params such as callbacks\n\n * @return {Promise} Status of restoration with `total` and `imported`\n * key counts.\n */\n // TODO: Types\n public restoreKeyBackupWithRecoveryKey(\n recoveryKey: string,\n targetRoomId: string,\n targetSessionId: string,\n backupInfo: IKeyBackupInfo,\n opts: IKeyBackupRestoreOpts,\n ): Promise {\n const privKey = decodeRecoveryKey(recoveryKey);\n return this.restoreKeyBackup(privKey, targetRoomId, targetSessionId, backupInfo, opts);\n }\n\n // TODO: Types\n public async restoreKeyBackupWithCache(\n targetRoomId: string,\n targetSessionId: string,\n backupInfo: IKeyBackupInfo,\n opts?: IKeyBackupRestoreOpts,\n ): Promise {\n const privKey = await this.crypto.getSessionBackupPrivateKey();\n if (!privKey) {\n throw new Error(\"Couldn't get key\");\n }\n return this.restoreKeyBackup(privKey, targetRoomId, targetSessionId, backupInfo, opts);\n }\n\n private async restoreKeyBackup(\n privKey: ArrayLike,\n targetRoomId: string,\n targetSessionId: string,\n backupInfo: IKeyBackupInfo,\n opts?: IKeyBackupRestoreOpts,\n ): Promise {\n const cacheCompleteCallback = opts?.cacheCompleteCallback;\n const progressCallback = opts?.progressCallback;\n\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n\n let totalKeyCount = 0;\n let keys = [];\n\n const path = this.makeKeyBackupPath(targetRoomId, targetSessionId, backupInfo.version);\n\n const algorithm = await BackupManager.makeAlgorithm(backupInfo, async () => { return privKey; });\n\n const untrusted = algorithm.untrusted;\n\n try {\n // If the pubkey computed from the private data we've been given\n // doesn't match the one in the auth_data, the user has entered\n // a different recovery key / the wrong passphrase.\n if (!await algorithm.keyMatches(privKey)) {\n return Promise.reject(new MatrixError({ errcode: MatrixClient.RESTORE_BACKUP_ERROR_BAD_KEY }));\n }\n\n // Cache the key, if possible.\n // This is async.\n this.crypto.storeSessionBackupPrivateKey(privKey)\n .catch((e) => {\n logger.warn(\"Error caching session backup key:\", e);\n }).then(cacheCompleteCallback);\n\n if (progressCallback) {\n progressCallback({\n stage: \"fetch\",\n });\n }\n\n const res = await this.http.authedRequest(\n undefined, \"GET\", path.path, path.queryData, undefined,\n { prefix: PREFIX_UNSTABLE },\n );\n\n if (res.rooms) {\n // TODO: Types\n for (const [roomId, roomData] of Object.entries(res.rooms)) {\n if (!roomData.sessions) continue;\n\n totalKeyCount += Object.keys(roomData.sessions).length;\n const roomKeys = await algorithm.decryptSessions(roomData.sessions);\n for (const k of roomKeys) {\n k.room_id = roomId;\n keys.push(k);\n }\n }\n } else if (res.sessions) {\n totalKeyCount = Object.keys(res.sessions).length;\n keys = await algorithm.decryptSessions(res.sessions);\n for (const k of keys) {\n k.room_id = targetRoomId;\n }\n } else {\n totalKeyCount = 1;\n try {\n const [key] = await algorithm.decryptSessions({\n [targetSessionId]: res,\n });\n key.room_id = targetRoomId;\n key.session_id = targetSessionId;\n keys.push(key);\n } catch (e) {\n logger.log(\"Failed to decrypt megolm session from backup\", e);\n }\n }\n } finally {\n algorithm.free();\n }\n\n await this.importRoomKeys(keys, {\n progressCallback,\n untrusted,\n source: \"backup\",\n });\n\n await this.checkKeyBackup();\n\n return { total: totalKeyCount, imported: keys.length };\n }\n\n public deleteKeysFromBackup(roomId: string, sessionId: string, version: string): Promise {\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n\n const path = this.makeKeyBackupPath(roomId, sessionId, version);\n return this.http.authedRequest(\n undefined, \"DELETE\", path.path, path.queryData, undefined,\n { prefix: PREFIX_UNSTABLE },\n );\n }\n\n /**\n * Share shared-history decryption keys with the given users.\n *\n * @param {string} roomId the room for which keys should be shared.\n * @param {array} userIds a list of users to share with. The keys will be sent to\n * all of the user's current devices.\n */\n public async sendSharedHistoryKeys(roomId: string, userIds: string[]) {\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n\n const roomEncryption = this.roomList.getRoomEncryption(roomId);\n if (!roomEncryption) {\n // unknown room, or unencrypted room\n logger.error(\"Unknown room. Not sharing decryption keys\");\n return;\n }\n\n const deviceInfos = await this.crypto.downloadKeys(userIds);\n const devicesByUser = {};\n for (const [userId, devices] of Object.entries(deviceInfos)) {\n devicesByUser[userId] = Object.values(devices);\n }\n\n // XXX: Private member access\n const alg = this.crypto.getRoomDecryptor(roomId, roomEncryption.algorithm);\n if (alg.sendSharedHistoryInboundSessions) {\n await alg.sendSharedHistoryInboundSessions(devicesByUser);\n } else {\n logger.warn(\"Algorithm does not support sharing previous keys\", roomEncryption.algorithm);\n }\n }\n\n /**\n * Get the group for the given group ID.\n * This function will return a valid group for any group for which a Group event\n * has been emitted.\n * @param {string} groupId The group ID\n * @return {Group} The Group or null if the group is not known or there is no data store.\n */\n public getGroup(groupId: string): Group {\n return this.store.getGroup(groupId);\n }\n\n /**\n * Retrieve all known groups.\n * @return {Group[]} A list of groups, or an empty list if there is no data store.\n */\n public getGroups(): Group[] {\n return this.store.getGroups();\n }\n\n /**\n * Get the config for the media repository.\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves with an object containing the config.\n */\n public getMediaConfig(callback?: Callback): Promise {\n return this.http.authedRequest(\n callback, \"GET\", \"/config\", undefined, undefined, {\n prefix: PREFIX_MEDIA_R0,\n },\n );\n }\n\n /**\n * Get the room for the given room ID.\n * This function will return a valid room for any room for which a Room event\n * has been emitted. Note in particular that other events, eg. RoomState.members\n * will be emitted for a room before this function will return the given room.\n * @param {string} roomId The room ID\n * @return {Room} The Room or null if it doesn't exist or there is no data store.\n */\n public getRoom(roomId: string): Room {\n return this.store.getRoom(roomId);\n }\n\n /**\n * Retrieve all known rooms.\n * @return {Room[]} A list of rooms, or an empty list if there is no data store.\n */\n public getRooms(): Room[] {\n return this.store.getRooms();\n }\n\n /**\n * Retrieve all rooms that should be displayed to the user\n * This is essentially getRooms() with some rooms filtered out, eg. old versions\n * of rooms that have been replaced or (in future) other rooms that have been\n * marked at the protocol level as not to be displayed to the user.\n * @return {Room[]} A list of rooms, or an empty list if there is no data store.\n */\n public getVisibleRooms(): Room[] {\n const allRooms = this.store.getRooms();\n\n const replacedRooms = new Set();\n for (const r of allRooms) {\n const createEvent = r.currentState.getStateEvents(EventType.RoomCreate, '');\n // invites are included in this list and we don't know their create events yet\n if (createEvent) {\n const predecessor = createEvent.getContent()['predecessor'];\n if (predecessor && predecessor['room_id']) {\n replacedRooms.add(predecessor['room_id']);\n }\n }\n }\n\n return allRooms.filter((r) => {\n const tombstone = r.currentState.getStateEvents(EventType.RoomTombstone, '');\n if (tombstone && replacedRooms.has(r.roomId)) {\n return false;\n }\n return true;\n });\n }\n\n /**\n * Retrieve a user.\n * @param {string} userId The user ID to retrieve.\n * @return {?User} A user or null if there is no data store or the user does\n * not exist.\n */\n public getUser(userId: string): User {\n return this.store.getUser(userId);\n }\n\n /**\n * Retrieve all known users.\n * @return {User[]} A list of users, or an empty list if there is no data store.\n */\n public getUsers(): User[] {\n return this.store.getUsers();\n }\n\n /**\n * Set account data event for the current user.\n * It will retry the request up to 5 times.\n * @param {string} eventType The event type\n * @param {Object} content the contents object for the event\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: an empty object\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public setAccountData(eventType: EventType | string, content: IContent, callback?: Callback): Promise<{}> {\n const path = utils.encodeUri(\"/user/$userId/account_data/$type\", {\n $userId: this.credentials.userId,\n $type: eventType,\n });\n const promise = retryNetworkOperation(5, () => {\n return this.http.authedRequest(undefined, \"PUT\", path, undefined, content);\n });\n if (callback) {\n promise.then(result => callback(null, result), callback);\n }\n return promise;\n }\n\n /**\n * Get account data event of given type for the current user.\n * @param {string} eventType The event type\n * @return {?object} The contents of the given account data event\n */\n public getAccountData(eventType: string): MatrixEvent {\n return this.store.getAccountData(eventType);\n }\n\n /**\n * Get account data event of given type for the current user. This variant\n * gets account data directly from the homeserver if the local store is not\n * ready, which can be useful very early in startup before the initial sync.\n * @param {string} eventType The event type\n * @return {Promise} Resolves: The contents of the given account\n * data event.\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public async getAccountDataFromServer(eventType: string): Promise> {\n if (this.isInitialSyncComplete()) {\n const event = this.store.getAccountData(eventType);\n if (!event) {\n return null;\n }\n // The network version below returns just the content, so this branch\n // does the same to match.\n return event.getContent();\n }\n const path = utils.encodeUri(\"/user/$userId/account_data/$type\", {\n $userId: this.credentials.userId,\n $type: eventType,\n });\n try {\n return await this.http.authedRequest(\n undefined, \"GET\", path, undefined,\n );\n } catch (e) {\n if (e.data && e.data.errcode === 'M_NOT_FOUND') {\n return null;\n }\n throw e;\n }\n }\n\n /**\n * Gets the users that are ignored by this client\n * @returns {string[]} The array of users that are ignored (empty if none)\n */\n public getIgnoredUsers(): string[] {\n const event = this.getAccountData(\"m.ignored_user_list\");\n if (!event || !event.getContent() || !event.getContent()[\"ignored_users\"]) return [];\n return Object.keys(event.getContent()[\"ignored_users\"]);\n }\n\n /**\n * Sets the users that the current user should ignore.\n * @param {string[]} userIds the user IDs to ignore\n * @param {module:client.callback} [callback] Optional.\n * @return {Promise} Resolves: an empty object\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public setIgnoredUsers(userIds: string[], callback?: Callback): Promise<{}> {\n const content = { ignored_users: {} };\n userIds.map((u) => content.ignored_users[u] = {});\n return this.setAccountData(\"m.ignored_user_list\", content, callback);\n }\n\n /**\n * Gets whether or not a specific user is being ignored by this client.\n * @param {string} userId the user ID to check\n * @returns {boolean} true if the user is ignored, false otherwise\n */\n public isUserIgnored(userId: string): boolean {\n return this.getIgnoredUsers().includes(userId);\n }\n\n /**\n * Join a room. If you have already joined the room, this will no-op.\n * @param {string} roomIdOrAlias The room ID or room alias to join.\n * @param {Object} opts Options when joining the room.\n * @param {boolean} opts.syncRoom True to do a room initial sync on the resulting\n * room. If false, the returned Room object will have no current state.\n * Default: true.\n * @param {boolean} opts.inviteSignUrl If the caller has a keypair 3pid invite, the signing URL is passed in this parameter.\n * @param {string[]} opts.viaServers The server names to try and join through in addition to those that are automatically chosen.\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: Room object.\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public async joinRoom(roomIdOrAlias: string, opts?: IJoinRoomOpts, callback?: Callback): Promise {\n // to help people when upgrading..\n if (utils.isFunction(opts)) {\n throw new Error(\"Expected 'opts' object, got function.\");\n }\n opts = opts || {};\n if (opts.syncRoom === undefined) {\n opts.syncRoom = true;\n }\n\n const room = this.getRoom(roomIdOrAlias);\n if (room && room.hasMembershipState(this.credentials.userId, \"join\")) {\n return Promise.resolve(room);\n }\n\n let signPromise: Promise = Promise.resolve();\n\n if (opts.inviteSignUrl) {\n signPromise = this.http.requestOtherUrl(\n undefined, 'POST',\n opts.inviteSignUrl, { mxid: this.credentials.userId },\n );\n }\n\n const queryString = {};\n if (opts.viaServers) {\n queryString[\"server_name\"] = opts.viaServers;\n }\n\n const reqOpts = { qsStringifyOptions: { arrayFormat: 'repeat' } };\n\n try {\n const data: IJoinRequestBody = {};\n const signedInviteObj = await signPromise;\n if (signedInviteObj) {\n data.third_party_signed = signedInviteObj;\n }\n\n const path = utils.encodeUri(\"/join/$roomid\", { $roomid: roomIdOrAlias });\n const res = await this.http.authedRequest(undefined, \"POST\", path, queryString, data, reqOpts);\n\n const roomId = res['room_id'];\n const syncApi = new SyncApi(this, this.clientOpts);\n const room = syncApi.createRoom(roomId);\n if (opts.syncRoom) {\n // v2 will do this for us\n // return syncApi.syncRoom(room);\n }\n callback?.(null, room);\n return room;\n } catch (e) {\n callback?.(e);\n throw e; // rethrow for reject\n }\n }\n\n /**\n * Resend an event.\n * @param {MatrixEvent} event The event to resend.\n * @param {Room} room Optional. The room the event is in. Will update the\n * timeline entry if provided.\n * @return {Promise} Resolves: to an ISendEventResponse object\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public resendEvent(event: MatrixEvent, room: Room): Promise {\n this.updatePendingEventStatus(room, event, EventStatus.SENDING);\n return this.encryptAndSendEvent(room, event);\n }\n\n /**\n * Cancel a queued or unsent event.\n *\n * @param {MatrixEvent} event Event to cancel\n * @throws Error if the event is not in QUEUED or NOT_SENT state\n */\n public cancelPendingEvent(event: MatrixEvent) {\n if ([EventStatus.QUEUED, EventStatus.NOT_SENT].indexOf(event.status) < 0) {\n throw new Error(\"cannot cancel an event with status \" + event.status);\n }\n\n // first tell the scheduler to forget about it, if it's queued\n if (this.scheduler) {\n this.scheduler.removeEventFromQueue(event);\n }\n\n // then tell the room about the change of state, which will remove it\n // from the room's list of pending events.\n const room = this.getRoom(event.getRoomId());\n this.updatePendingEventStatus(room, event, EventStatus.CANCELLED);\n }\n\n /**\n * @param {string} roomId\n * @param {string} name\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: TODO\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public setRoomName(roomId: string, name: string, callback?: Callback): Promise {\n return this.sendStateEvent(roomId, EventType.RoomName, { name: name }, undefined, callback);\n }\n\n /**\n * @param {string} roomId\n * @param {string} topic\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: TODO\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public setRoomTopic(roomId: string, topic: string, callback?: Callback): Promise {\n return this.sendStateEvent(roomId, EventType.RoomTopic, { topic: topic }, undefined, callback);\n }\n\n /**\n * @param {string} roomId\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: TODO\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public getRoomTags(roomId: string, callback?: Callback): Promise { // TODO: Types\n const path = utils.encodeUri(\"/user/$userId/rooms/$roomId/tags/\", {\n $userId: this.credentials.userId,\n $roomId: roomId,\n });\n return this.http.authedRequest(\n callback, \"GET\", path, undefined,\n );\n }\n\n /**\n * @param {string} roomId\n * @param {string} tagName name of room tag to be set\n * @param {object} metadata associated with that tag to be stored\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: to an empty object\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public setRoomTag(roomId: string, tagName: string, metadata: ITagMetadata, callback?: Callback): Promise<{}> {\n const path = utils.encodeUri(\"/user/$userId/rooms/$roomId/tags/$tag\", {\n $userId: this.credentials.userId,\n $roomId: roomId,\n $tag: tagName,\n });\n return this.http.authedRequest(callback, \"PUT\", path, undefined, metadata);\n }\n\n /**\n * @param {string} roomId\n * @param {string} tagName name of room tag to be removed\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: TODO\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public deleteRoomTag(roomId: string, tagName: string, callback?: Callback): Promise {\n const path = utils.encodeUri(\"/user/$userId/rooms/$roomId/tags/$tag\", {\n $userId: this.credentials.userId,\n $roomId: roomId,\n $tag: tagName,\n });\n return this.http.authedRequest(\n callback, \"DELETE\", path, undefined, undefined,\n );\n }\n\n /**\n * @param {string} roomId\n * @param {string} eventType event type to be set\n * @param {object} content event content\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: to an empty object {}\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public setRoomAccountData(\n roomId: string,\n eventType: string,\n content: Record,\n callback?: Callback,\n ): Promise<{}> {\n const path = utils.encodeUri(\"/user/$userId/rooms/$roomId/account_data/$type\", {\n $userId: this.credentials.userId,\n $roomId: roomId,\n $type: eventType,\n });\n return this.http.authedRequest(callback, \"PUT\", path, undefined, content);\n }\n\n /**\n * Set a user's power level.\n * @param {string} roomId\n * @param {string} userId\n * @param {Number} powerLevel\n * @param {MatrixEvent} event\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: to an ISendEventResponse object\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public setPowerLevel(\n roomId: string,\n userId: string,\n powerLevel: number,\n event: MatrixEvent,\n callback?: Callback,\n ): Promise {\n let content = {\n users: {},\n };\n if (event?.getType() === EventType.RoomPowerLevels) {\n // take a copy of the content to ensure we don't corrupt\n // existing client state with a failed power level change\n content = utils.deepCopy(event.getContent()) as typeof content;\n }\n content.users[userId] = powerLevel;\n const path = utils.encodeUri(\"/rooms/$roomId/state/m.room.power_levels\", {\n $roomId: roomId,\n });\n return this.http.authedRequest(callback, \"PUT\", path, undefined, content);\n }\n\n /**\n * @param {string} roomId\n * @param {string} eventType\n * @param {Object} content\n * @param {string} txnId Optional.\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: to an empty object {}\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public sendEvent(\n roomId: string,\n eventType: string,\n content: IContent,\n txnId?: string,\n callback?: Callback,\n ): Promise {\n return this.sendCompleteEvent(roomId, { type: eventType, content }, txnId, callback);\n }\n\n /**\n * @param {string} roomId\n * @param {object} eventObject An object with the partial structure of an event, to which event_id, user_id, room_id and origin_server_ts will be added.\n * @param {string} txnId the txnId.\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: to an empty object {}\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n private sendCompleteEvent(\n roomId: string,\n eventObject: any,\n txnId: string,\n callback?: Callback,\n ): Promise {\n if (utils.isFunction(txnId)) {\n callback = txnId as any as Callback; // convert for legacy\n txnId = undefined;\n }\n\n if (!txnId) {\n txnId = this.makeTxnId();\n }\n\n // we always construct a MatrixEvent when sending because the store and\n // scheduler use them. We'll extract the params back out if it turns out\n // the client has no scheduler or store.\n const localEvent = new MatrixEvent(Object.assign(eventObject, {\n event_id: \"~\" + roomId + \":\" + txnId,\n user_id: this.credentials.userId,\n sender: this.credentials.userId,\n room_id: roomId,\n origin_server_ts: new Date().getTime(),\n }));\n\n const room = this.getRoom(roomId);\n\n // if this is a relation or redaction of an event\n // that hasn't been sent yet (e.g. with a local id starting with a ~)\n // then listen for the remote echo of that event so that by the time\n // this event does get sent, we have the correct event_id\n const targetId = localEvent.getAssociatedId();\n if (targetId && targetId.startsWith(\"~\")) {\n const target = room.getPendingEvents().find(e => e.getId() === targetId);\n target.once(\"Event.localEventIdReplaced\", () => {\n localEvent.updateAssociatedId(target.getId());\n });\n }\n\n const type = localEvent.getType();\n logger.log(`sendEvent of type ${type} in ${roomId} with txnId ${txnId}`);\n\n localEvent.setTxnId(txnId);\n localEvent.setStatus(EventStatus.SENDING);\n\n // add this event immediately to the local store as 'sending'.\n if (room) {\n room.addPendingEvent(localEvent, txnId);\n }\n\n // addPendingEvent can change the state to NOT_SENT if it believes\n // that there's other events that have failed. We won't bother to\n // try sending the event if the state has changed as such.\n if (localEvent.status === EventStatus.NOT_SENT) {\n return Promise.reject(new Error(\"Event blocked by other events not yet sent\"));\n }\n\n return this.encryptAndSendEvent(room, localEvent, callback);\n }\n\n /**\n * encrypts the event if necessary; adds the event to the queue, or sends it; marks the event as sent/unsent\n * @param room\n * @param event\n * @param callback\n * @returns {Promise} returns a promise which resolves with the result of the send request\n * @private\n */\n private encryptAndSendEvent(room: Room, event: MatrixEvent, callback?: Callback): Promise {\n // Add an extra Promise.resolve() to turn synchronous exceptions into promise rejections,\n // so that we can handle synchronous and asynchronous exceptions with the\n // same code path.\n return Promise.resolve().then(() => {\n const encryptionPromise = this.encryptEventIfNeeded(event, room);\n if (!encryptionPromise) return null;\n\n this.updatePendingEventStatus(room, event, EventStatus.ENCRYPTING);\n return encryptionPromise.then(() => this.updatePendingEventStatus(room, event, EventStatus.SENDING));\n }).then(() => {\n let promise: Promise;\n if (this.scheduler) {\n // if this returns a promise then the scheduler has control now and will\n // resolve/reject when it is done. Internally, the scheduler will invoke\n // processFn which is set to this._sendEventHttpRequest so the same code\n // path is executed regardless.\n promise = this.scheduler.queueEvent(event);\n if (promise && this.scheduler.getQueueForEvent(event).length > 1) {\n // event is processed FIFO so if the length is 2 or more we know\n // this event is stuck behind an earlier event.\n this.updatePendingEventStatus(room, event, EventStatus.QUEUED);\n }\n }\n\n if (!promise) {\n promise = this.sendEventHttpRequest(event);\n if (room) {\n promise = promise.then(res => {\n room.updatePendingEvent(event, EventStatus.SENT, res['event_id']);\n return res;\n });\n }\n }\n\n return promise;\n }).then(res => {\n callback?.(null, res);\n return res;\n }).catch(err => {\n logger.error(\"Error sending event\", err.stack || err);\n try {\n // set the error on the event before we update the status:\n // updating the status emits the event, so the state should be\n // consistent at that point.\n event.error = err;\n this.updatePendingEventStatus(room, event, EventStatus.NOT_SENT);\n // also put the event object on the error: the caller will need this\n // to resend or cancel the event\n err.event = event;\n\n callback?.(err);\n } catch (e) {\n logger.error(\"Exception in error handler!\", e.stack || err);\n }\n throw err;\n });\n }\n\n private encryptEventIfNeeded(event: MatrixEvent, room?: Room): Promise | null {\n if (event.isEncrypted()) {\n // this event has already been encrypted; this happens if the\n // encryption step succeeded, but the send step failed on the first\n // attempt.\n return null;\n }\n\n if (!this.isRoomEncrypted(event.getRoomId())) {\n return null;\n }\n\n if (!this.crypto && this.usingExternalCrypto) {\n // The client has opted to allow sending messages to encrypted\n // rooms even if the room is encrypted, and we haven't setup\n // crypto. This is useful for users of matrix-org/pantalaimon\n return null;\n }\n\n if (event.getType() === EventType.Reaction) {\n // For reactions, there is a very little gained by encrypting the entire\n // event, as relation data is already kept in the clear. Event\n // encryption for a reaction effectively only obscures the event type,\n // but the purpose is still obvious from the relation data, so nothing\n // is really gained. It also causes quite a few problems, such as:\n // * triggers notifications via default push rules\n // * prevents server-side bundling for reactions\n // The reaction key / content / emoji value does warrant encrypting, but\n // this will be handled separately by encrypting just this value.\n // See https://github.com/matrix-org/matrix-doc/pull/1849#pullrequestreview-248763642\n return null;\n }\n\n if (!this.crypto) {\n throw new Error(\n \"This room is configured to use encryption, but your client does \" +\n \"not support encryption.\",\n );\n }\n\n return this.crypto.encryptEvent(event, room);\n }\n\n /**\n * Returns the eventType that should be used taking encryption into account\n * for a given eventType.\n * @param {MatrixClient} client the client\n * @param {string} roomId the room for the events `eventType` relates to\n * @param {string} eventType the event type\n * @return {string} the event type taking encryption into account\n */\n private getEncryptedIfNeededEventType(roomId: string, eventType: string): string {\n if (eventType === EventType.Reaction) return eventType;\n return this.isRoomEncrypted(roomId) ? EventType.RoomMessageEncrypted : eventType;\n }\n\n private updatePendingEventStatus(room: Room | null, event: MatrixEvent, newStatus: EventStatus) {\n if (room) {\n room.updatePendingEvent(event, newStatus);\n } else {\n event.setStatus(newStatus);\n }\n }\n\n private sendEventHttpRequest(event: MatrixEvent): Promise {\n let txnId = event.getTxnId();\n if (!txnId) {\n txnId = this.makeTxnId();\n event.setTxnId(txnId);\n }\n\n const pathParams = {\n $roomId: event.getRoomId(),\n $eventType: event.getWireType(),\n $stateKey: event.getStateKey(),\n $txnId: txnId,\n };\n\n let path;\n\n if (event.isState()) {\n let pathTemplate = \"/rooms/$roomId/state/$eventType\";\n if (event.getStateKey() && event.getStateKey().length > 0) {\n pathTemplate = \"/rooms/$roomId/state/$eventType/$stateKey\";\n }\n path = utils.encodeUri(pathTemplate, pathParams);\n } else if (event.isRedaction()) {\n const pathTemplate = `/rooms/$roomId/redact/$redactsEventId/$txnId`;\n path = utils.encodeUri(pathTemplate, Object.assign({\n $redactsEventId: event.event.redacts,\n }, pathParams));\n } else {\n path = utils.encodeUri(\"/rooms/$roomId/send/$eventType/$txnId\", pathParams);\n }\n\n return this.http.authedRequest(\n undefined, \"PUT\", path, undefined, event.getWireContent(),\n ).then((res) => {\n logger.log(`Event sent to ${event.getRoomId()} with event id ${res.event_id}`);\n return res;\n });\n }\n\n /**\n * @param {string} roomId\n * @param {string} eventId\n * @param {string} [txnId] transaction id. One will be made up if not\n * supplied.\n * @param {object|module:client.callback} cbOrOpts\n * Options to pass on, may contain `reason`.\n * Can be callback for backwards compatibility.\n * @return {Promise} Resolves: TODO\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public redactEvent(\n roomId: string,\n eventId: string,\n txnId?: string,\n cbOrOpts?: Callback | IRedactOpts,\n ): Promise {\n const opts = typeof (cbOrOpts) === 'object' ? cbOrOpts : {};\n const reason = opts.reason;\n const callback = typeof (cbOrOpts) === 'function' ? cbOrOpts : undefined;\n return this.sendCompleteEvent(roomId, {\n type: EventType.RoomRedaction,\n content: { reason: reason },\n redacts: eventId,\n }, txnId, callback);\n }\n\n /**\n * @param {string} roomId\n * @param {Object} content\n * @param {string} txnId Optional.\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: to an ISendEventResponse object\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public sendMessage(\n roomId: string,\n content: IContent,\n txnId?: string,\n callback?: Callback,\n ): Promise {\n if (utils.isFunction(txnId)) {\n callback = txnId as any as Callback; // for legacy\n txnId = undefined;\n }\n return this.sendEvent(roomId, EventType.RoomMessage, content, txnId, callback);\n }\n\n /**\n * @param {string} roomId\n * @param {string} body\n * @param {string} txnId Optional.\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: to an empty object {}\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public sendTextMessage(\n roomId: string,\n body: string,\n txnId?: string,\n callback?: Callback,\n ): Promise {\n const content = ContentHelpers.makeTextMessage(body);\n return this.sendMessage(roomId, content, txnId, callback);\n }\n\n /**\n * @param {string} roomId\n * @param {string} body\n * @param {string} txnId Optional.\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: to a ISendEventResponse object\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public sendNotice(roomId: string, body: string, txnId?: string, callback?: Callback): Promise {\n const content = ContentHelpers.makeNotice(body);\n return this.sendMessage(roomId, content, txnId, callback);\n }\n\n /**\n * @param {string} roomId\n * @param {string} body\n * @param {string} txnId Optional.\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: to a ISendEventResponse object\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public sendEmoteMessage(\n roomId: string,\n body: string,\n txnId?: string,\n callback?: Callback,\n ): Promise {\n const content = ContentHelpers.makeEmoteMessage(body);\n return this.sendMessage(roomId, content, txnId, callback);\n }\n\n /**\n * @param {string} roomId\n * @param {string} url\n * @param {Object} info\n * @param {string} text\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: to a ISendEventResponse object\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public sendImageMessage(\n roomId: string,\n url: string,\n info?: IImageInfo,\n text = \"Image\",\n callback?: Callback,\n ): Promise {\n if (utils.isFunction(text)) {\n callback = text as any as Callback; // legacy\n text = undefined;\n }\n const content = {\n msgtype: MsgType.Image,\n url: url,\n info: info,\n body: text,\n };\n return this.sendMessage(roomId, content, undefined, callback);\n }\n\n /**\n * @param {string} roomId\n * @param {string} url\n * @param {Object} info\n * @param {string} text\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: to a ISendEventResponse object\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public sendStickerMessage(\n roomId: string,\n url: string,\n info?: IImageInfo,\n text = \"Sticker\",\n callback?: Callback,\n ): Promise {\n if (utils.isFunction(text)) {\n callback = text as any as Callback; // legacy\n text = undefined;\n }\n const content = {\n url: url,\n info: info,\n body: text,\n };\n return this.sendEvent(roomId, EventType.Sticker, content, undefined, callback);\n }\n\n /**\n * @param {string} roomId\n * @param {string} body\n * @param {string} htmlBody\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: to a ISendEventResponse object\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public sendHtmlMessage(\n roomId: string,\n body: string,\n htmlBody: string,\n callback?: Callback,\n ): Promise {\n const content = ContentHelpers.makeHtmlMessage(body, htmlBody);\n return this.sendMessage(roomId, content, undefined, callback);\n }\n\n /**\n * @param {string} roomId\n * @param {string} body\n * @param {string} htmlBody\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: to a ISendEventResponse object\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public sendHtmlNotice(\n roomId: string,\n body: string,\n htmlBody: string,\n callback?: Callback,\n ): Promise {\n const content = ContentHelpers.makeHtmlNotice(body, htmlBody);\n return this.sendMessage(roomId, content, undefined, callback);\n }\n\n /**\n * @param {string} roomId\n * @param {string} body\n * @param {string} htmlBody\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: to a ISendEventResponse object\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public sendHtmlEmote(\n roomId: string,\n body: string,\n htmlBody: string,\n callback?: Callback,\n ): Promise {\n const content = ContentHelpers.makeHtmlEmote(body, htmlBody);\n return this.sendMessage(roomId, content, undefined, callback);\n }\n\n /**\n * Send a receipt.\n * @param {Event} event The event being acknowledged\n * @param {string} receiptType The kind of receipt e.g. \"m.read\"\n * @param {object} body Additional content to send alongside the receipt.\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: to an empty object {}\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public sendReceipt(event: MatrixEvent, receiptType: string, body: any, callback?: Callback): Promise<{}> {\n if (typeof (body) === 'function') {\n callback = body as any as Callback; // legacy\n body = {};\n }\n\n if (this.isGuest()) {\n return Promise.resolve({}); // guests cannot send receipts so don't bother.\n }\n\n const path = utils.encodeUri(\"/rooms/$roomId/receipt/$receiptType/$eventId\", {\n $roomId: event.getRoomId(),\n $receiptType: receiptType,\n $eventId: event.getId(),\n });\n const promise = this.http.authedRequest(callback, \"POST\", path, undefined, body || {});\n\n const room = this.getRoom(event.getRoomId());\n if (room) {\n room.addLocalEchoReceipt(this.credentials.userId, event, receiptType);\n }\n return promise;\n }\n\n /**\n * Send a read receipt.\n * @param {Event} event The event that has been read.\n * @param {object} opts The options for the read receipt.\n * @param {boolean} opts.hidden True to prevent the receipt from being sent to\n * other users and homeservers. Default false (send to everyone). This\n * property is unstable and may change in the future.\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: to an empty object\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public async sendReadReceipt(event: MatrixEvent, opts?: { hidden?: boolean }, callback?: Callback): Promise<{}> {\n if (typeof (opts) === 'function') {\n callback = opts as any as Callback; // legacy\n opts = {};\n }\n if (!opts) opts = {};\n\n const eventId = event.getId();\n const room = this.getRoom(event.getRoomId());\n if (room && room.hasPendingEvent(eventId)) {\n throw new Error(`Cannot set read receipt to a pending event (${eventId})`);\n }\n\n const addlContent = {\n \"org.matrix.msc2285.hidden\": Boolean(opts.hidden),\n };\n\n return this.sendReceipt(event, \"m.read\", addlContent, callback);\n }\n\n /**\n * Set a marker to indicate the point in a room before which the user has read every\n * event. This can be retrieved from room account data (the event type is `m.fully_read`)\n * and displayed as a horizontal line in the timeline that is visually distinct to the\n * position of the user's own read receipt.\n * @param {string} roomId ID of the room that has been read\n * @param {string} rmEventId ID of the event that has been read\n * @param {MatrixEvent} rrEvent the event tracked by the read receipt. This is here for\n * convenience because the RR and the RM are commonly updated at the same time as each\n * other. The local echo of this receipt will be done if set. Optional.\n * @param {object} opts Options for the read markers\n * @param {object} opts.hidden True to hide the receipt from other users and homeservers.\n * This property is unstable and may change in the future.\n * @return {Promise} Resolves: the empty object, {}.\n */\n public async setRoomReadMarkers(\n roomId: string,\n rmEventId: string,\n rrEvent: MatrixEvent,\n opts: { hidden?: boolean },\n ): Promise<{}> {\n const room = this.getRoom(roomId);\n if (room && room.hasPendingEvent(rmEventId)) {\n throw new Error(`Cannot set read marker to a pending event (${rmEventId})`);\n }\n\n // Add the optional RR update, do local echo like `sendReceipt`\n let rrEventId;\n if (rrEvent) {\n rrEventId = rrEvent.getId();\n if (room && room.hasPendingEvent(rrEventId)) {\n throw new Error(`Cannot set read receipt to a pending event (${rrEventId})`);\n }\n if (room) {\n room.addLocalEchoReceipt(this.credentials.userId, rrEvent, \"m.read\");\n }\n }\n\n return this.setRoomReadMarkersHttpRequest(roomId, rmEventId, rrEventId, opts);\n }\n\n /**\n * Get a preview of the given URL as of (roughly) the given point in time,\n * described as an object with OpenGraph keys and associated values.\n * Attributes may be synthesized where actual OG metadata is lacking.\n * Caches results to prevent hammering the server.\n * @param {string} url The URL to get preview data for\n * @param {Number} ts The preferred point in time that the preview should\n * describe (ms since epoch). The preview returned will either be the most\n * recent one preceding this timestamp if available, or failing that the next\n * most recent available preview.\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: Object of OG metadata.\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n * May return synthesized attributes if the URL lacked OG meta.\n */\n public getUrlPreview(url: string, ts: number, callback?: Callback): Promise {\n // bucket the timestamp to the nearest minute to prevent excessive spam to the server\n // Surely 60-second accuracy is enough for anyone.\n ts = Math.floor(ts / 60000) * 60000;\n\n const parsed = new URL(url);\n parsed.hash = \"\"; // strip the hash as it won't affect the preview\n url = parsed.toString();\n\n const key = ts + \"_\" + url;\n\n // If there's already a request in flight (or we've handled it), return that instead.\n const cachedPreview = this.urlPreviewCache[key];\n if (cachedPreview) {\n if (callback) {\n cachedPreview.then(callback).catch(callback);\n }\n return cachedPreview;\n }\n\n const resp = this.http.authedRequest(\n callback, \"GET\", \"/preview_url\", {\n url: url,\n ts: ts,\n }, undefined, {\n prefix: PREFIX_MEDIA_R0,\n },\n );\n // TODO: Expire the URL preview cache sometimes\n this.urlPreviewCache[key] = resp;\n return resp;\n }\n\n /**\n * @param {string} roomId\n * @param {boolean} isTyping\n * @param {Number} timeoutMs\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: to an empty object {}\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public sendTyping(roomId: string, isTyping: boolean, timeoutMs: number, callback?: Callback): Promise<{}> {\n if (this.isGuest()) {\n return Promise.resolve({}); // guests cannot send typing notifications so don't bother.\n }\n\n const path = utils.encodeUri(\"/rooms/$roomId/typing/$userId\", {\n $roomId: roomId,\n $userId: this.credentials.userId,\n });\n const data: any = {\n typing: isTyping,\n };\n if (isTyping) {\n data.timeout = timeoutMs ? timeoutMs : 20000;\n }\n return this.http.authedRequest(callback, \"PUT\", path, undefined, data);\n }\n\n /**\n * Determines the history of room upgrades for a given room, as far as the\n * client can see. Returns an array of Rooms where the first entry is the\n * oldest and the last entry is the newest (likely current) room. If the\n * provided room is not found, this returns an empty list. This works in\n * both directions, looking for older and newer rooms of the given room.\n * @param {string} roomId The room ID to search from\n * @param {boolean} verifyLinks If true, the function will only return rooms\n * which can be proven to be linked. For example, rooms which have a create\n * event pointing to an old room which the client is not aware of or doesn't\n * have a matching tombstone would not be returned.\n * @return {Room[]} An array of rooms representing the upgrade\n * history.\n */\n public getRoomUpgradeHistory(roomId: string, verifyLinks = false): Room[] {\n let currentRoom = this.getRoom(roomId);\n if (!currentRoom) return [];\n\n const upgradeHistory = [currentRoom];\n\n // Work backwards first, looking at create events.\n let createEvent = currentRoom.currentState.getStateEvents(EventType.RoomCreate, \"\");\n while (createEvent) {\n logger.log(`Looking at ${createEvent.getId()}`);\n const predecessor = createEvent.getContent()['predecessor'];\n if (predecessor && predecessor['room_id']) {\n logger.log(`Looking at predecessor ${predecessor['room_id']}`);\n const refRoom = this.getRoom(predecessor['room_id']);\n if (!refRoom) break; // end of the chain\n\n if (verifyLinks) {\n const tombstone = refRoom.currentState.getStateEvents(EventType.RoomTombstone, \"\");\n\n if (!tombstone\n || tombstone.getContent()['replacement_room'] !== refRoom.roomId) {\n break;\n }\n }\n\n // Insert at the front because we're working backwards from the currentRoom\n upgradeHistory.splice(0, 0, refRoom);\n createEvent = refRoom.currentState.getStateEvents(EventType.RoomCreate, \"\");\n } else {\n // No further create events to look at\n break;\n }\n }\n\n // Work forwards next, looking at tombstone events\n let tombstoneEvent = currentRoom.currentState.getStateEvents(EventType.RoomTombstone, \"\");\n while (tombstoneEvent) {\n const refRoom = this.getRoom(tombstoneEvent.getContent()['replacement_room']);\n if (!refRoom) break; // end of the chain\n if (refRoom.roomId === currentRoom.roomId) break; // Tombstone is referencing it's own room\n\n if (verifyLinks) {\n createEvent = refRoom.currentState.getStateEvents(EventType.RoomCreate, \"\");\n if (!createEvent || !createEvent.getContent()['predecessor']) break;\n\n const predecessor = createEvent.getContent()['predecessor'];\n if (predecessor['room_id'] !== currentRoom.roomId) break;\n }\n\n // Push to the end because we're looking forwards\n upgradeHistory.push(refRoom);\n const roomIds = new Set(upgradeHistory.map((ref) => ref.roomId));\n if (roomIds.size < upgradeHistory.length) {\n // The last room added to the list introduced a previous roomId\n // To avoid recursion, return the last rooms - 1\n return upgradeHistory.slice(0, upgradeHistory.length - 1);\n }\n\n // Set the current room to the reference room so we know where we're at\n currentRoom = refRoom;\n tombstoneEvent = currentRoom.currentState.getStateEvents(EventType.RoomTombstone, \"\");\n }\n\n return upgradeHistory;\n }\n\n /**\n * @param {string} roomId\n * @param {string} userId\n * @param {module:client.callback} callback Optional.\n * @param {string} reason Optional.\n * @return {Promise} Resolves: {} an empty object.\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public invite(roomId: string, userId: string, callback?: Callback, reason?: string): Promise<{}> {\n return this.membershipChange(roomId, userId, \"invite\", reason, callback);\n }\n\n /**\n * Invite a user to a room based on their email address.\n * @param {string} roomId The room to invite the user to.\n * @param {string} email The email address to invite.\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: {} an empty object.\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public inviteByEmail(roomId: string, email: string, callback?: Callback): Promise<{}> {\n return this.inviteByThreePid(roomId, \"email\", email, callback);\n }\n\n /**\n * Invite a user to a room based on a third-party identifier.\n * @param {string} roomId The room to invite the user to.\n * @param {string} medium The medium to invite the user e.g. \"email\".\n * @param {string} address The address for the specified medium.\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: {} an empty object.\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public async inviteByThreePid(roomId: string, medium: string, address: string, callback?: Callback): Promise<{}> {\n const path = utils.encodeUri(\n \"/rooms/$roomId/invite\",\n { $roomId: roomId },\n );\n\n const identityServerUrl = this.getIdentityServerUrl(true);\n if (!identityServerUrl) {\n return Promise.reject(new MatrixError({\n error: \"No supplied identity server URL\",\n errcode: \"ORG.MATRIX.JSSDK_MISSING_PARAM\",\n }));\n }\n const params = {\n id_server: identityServerUrl,\n medium: medium,\n address: address,\n };\n\n if (\n this.identityServer &&\n this.identityServer.getAccessToken &&\n await this.doesServerAcceptIdentityAccessToken()\n ) {\n const identityAccessToken = await this.identityServer.getAccessToken();\n if (identityAccessToken) {\n params['id_access_token'] = identityAccessToken;\n }\n }\n\n return this.http.authedRequest(callback, \"POST\", path, undefined, params);\n }\n\n /**\n * @param {string} roomId\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: {} an empty object.\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public leave(roomId: string, callback?: Callback): Promise<{}> {\n return this.membershipChange(roomId, undefined, \"leave\", undefined, callback);\n }\n\n /**\n * Leaves all rooms in the chain of room upgrades based on the given room. By\n * default, this will leave all the previous and upgraded rooms, including the\n * given room. To only leave the given room and any previous rooms, keeping the\n * upgraded (modern) rooms untouched supply `false` to `includeFuture`.\n * @param {string} roomId The room ID to start leaving at\n * @param {boolean} includeFuture If true, the whole chain (past and future) of\n * upgraded rooms will be left.\n * @return {Promise} Resolves when completed with an object keyed\n * by room ID and value of the error encountered when leaving or null.\n */\n public leaveRoomChain(\n roomId: string,\n includeFuture = true,\n ): Promise<{ [roomId: string]: Error | MatrixError | null }> {\n const upgradeHistory = this.getRoomUpgradeHistory(roomId);\n\n let eligibleToLeave = upgradeHistory;\n if (!includeFuture) {\n eligibleToLeave = [];\n for (const room of upgradeHistory) {\n eligibleToLeave.push(room);\n if (room.roomId === roomId) {\n break;\n }\n }\n }\n\n const populationResults = {}; // {roomId: Error}\n const promises = [];\n\n const doLeave = (roomId) => {\n return this.leave(roomId).then(() => {\n populationResults[roomId] = null;\n }).catch((err) => {\n populationResults[roomId] = err;\n return null; // suppress error\n });\n };\n\n for (const room of eligibleToLeave) {\n promises.push(doLeave(room.roomId));\n }\n\n return Promise.all(promises).then(() => populationResults);\n }\n\n /**\n * @param {string} roomId\n * @param {string} userId\n * @param {string} reason Optional.\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: TODO\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public ban(roomId: string, userId: string, reason?: string, callback?: Callback) {\n return this.membershipChange(roomId, userId, \"ban\", reason, callback);\n }\n\n /**\n * @param {string} roomId\n * @param {boolean} deleteRoom True to delete the room from the store on success.\n * Default: true.\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: {} an empty object.\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public forget(roomId: string, deleteRoom?: boolean, callback?: Callback): Promise<{}> {\n if (deleteRoom === undefined) {\n deleteRoom = true;\n }\n const promise = this.membershipChange(roomId, undefined, \"forget\", undefined,\n callback);\n if (!deleteRoom) {\n return promise;\n }\n return promise.then((response) => {\n this.store.removeRoom(roomId);\n this.emit(\"deleteRoom\", roomId);\n return response;\n });\n }\n\n /**\n * @param {string} roomId\n * @param {string} userId\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: Object (currently empty)\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public unban(roomId: string, userId: string, callback?: Callback): Promise {\n // unbanning != set their state to leave: this used to be\n // the case, but was then changed so that leaving was always\n // a revoking of privilege, otherwise two people racing to\n // kick / ban someone could end up banning and then un-banning\n // them.\n const path = utils.encodeUri(\"/rooms/$roomId/unban\", {\n $roomId: roomId,\n });\n const data = {\n user_id: userId,\n };\n return this.http.authedRequest(\n callback, \"POST\", path, undefined, data,\n );\n }\n\n /**\n * @param {string} roomId\n * @param {string} userId\n * @param {string} reason Optional.\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: {} an empty object.\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public kick(roomId: string, userId: string, reason?: string, callback?: Callback): Promise<{}> {\n return this.setMembershipState(roomId, userId, \"leave\", reason, callback);\n }\n\n /**\n * This is an internal method.\n * @param {MatrixClient} client\n * @param {string} roomId\n * @param {string} userId\n * @param {string} membershipValue\n * @param {string} reason\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: TODO\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n private setMembershipState(\n roomId: string,\n userId: string,\n membershipValue: string,\n reason?: string,\n callback?: Callback,\n ) {\n if (utils.isFunction(reason)) {\n callback = reason as any as Callback; // legacy\n reason = undefined;\n }\n\n const path = utils.encodeUri(\n \"/rooms/$roomId/state/m.room.member/$userId\",\n { $roomId: roomId, $userId: userId },\n );\n\n return this.http.authedRequest(callback, \"PUT\", path, undefined, {\n membership: membershipValue,\n reason: reason,\n });\n }\n\n private membershipChange(\n roomId: string,\n userId: string,\n membership: string,\n reason?: string,\n callback?: Callback,\n ): Promise<{}> {\n if (utils.isFunction(reason)) {\n callback = reason as any as Callback; // legacy\n reason = undefined;\n }\n\n const path = utils.encodeUri(\"/rooms/$room_id/$membership\", {\n $room_id: roomId,\n $membership: membership,\n });\n return this.http.authedRequest(\n callback, \"POST\", path, undefined, {\n user_id: userId, // may be undefined e.g. on leave\n reason: reason,\n },\n );\n }\n\n /**\n * Obtain a dict of actions which should be performed for this event according\n * to the push rules for this user. Caches the dict on the event.\n * @param {MatrixEvent} event The event to get push actions for.\n * @return {module:pushprocessor~PushAction} A dict of actions to perform.\n */\n public getPushActionsForEvent(event: MatrixEvent): PushAction {\n if (!event.getPushActions()) {\n event.setPushActions(this.pushProcessor.actionsForEvent(event));\n }\n return event.getPushActions();\n }\n\n /**\n * @param {string} info The kind of info to set (e.g. 'avatar_url')\n * @param {Object} data The JSON object to set.\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: to an empty object {}\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n // eslint-disable-next-line camelcase\n public setProfileInfo(info: \"avatar_url\", data: { avatar_url: string }, callback?: Callback): Promise<{}>;\n public setProfileInfo(info: \"displayname\", data: { displayname: string }, callback?: Callback): Promise<{}>;\n public setProfileInfo(info: \"avatar_url\" | \"displayname\", data: object, callback?: Callback): Promise<{}> {\n const path = utils.encodeUri(\"/profile/$userId/$info\", {\n $userId: this.credentials.userId,\n $info: info,\n });\n return this.http.authedRequest(callback, \"PUT\", path, undefined, data);\n }\n\n /**\n * @param {string} name\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: {} an empty object.\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public async setDisplayName(name: string, callback?: Callback): Promise<{}> {\n const prom = await this.setProfileInfo(\"displayname\", { displayname: name }, callback);\n // XXX: synthesise a profile update for ourselves because Synapse is broken and won't\n const user = this.getUser(this.getUserId());\n if (user) {\n user.displayName = name;\n user.emit(\"User.displayName\", user.events.presence, user);\n }\n return prom;\n }\n\n /**\n * @param {string} url\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: {} an empty object.\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public async setAvatarUrl(url: string, callback?: Callback): Promise<{}> {\n const prom = await this.setProfileInfo(\"avatar_url\", { avatar_url: url }, callback);\n // XXX: synthesise a profile update for ourselves because Synapse is broken and won't\n const user = this.getUser(this.getUserId());\n if (user) {\n user.avatarUrl = url;\n user.emit(\"User.avatarUrl\", user.events.presence, user);\n }\n return prom;\n }\n\n /**\n * Turn an MXC URL into an HTTP one. This method is experimental and\n * may change.\n * @param {string} mxcUrl The MXC URL\n * @param {Number} width The desired width of the thumbnail.\n * @param {Number} height The desired height of the thumbnail.\n * @param {string} resizeMethod The thumbnail resize method to use, either\n * \"crop\" or \"scale\".\n * @param {Boolean} allowDirectLinks If true, return any non-mxc URLs\n * directly. Fetching such URLs will leak information about the user to\n * anyone they share a room with. If false, will return null for such URLs.\n * @return {?string} the avatar URL or null.\n */\n public mxcUrlToHttp(\n mxcUrl: string,\n width?: number,\n height?: number,\n resizeMethod?: string,\n allowDirectLinks?: boolean,\n ): string | null {\n return getHttpUriForMxc(this.baseUrl, mxcUrl, width, height, resizeMethod, allowDirectLinks);\n }\n\n /**\n * Sets a new status message for the user. The message may be null/falsey\n * to clear the message.\n * @param {string} newMessage The new message to set.\n * @return {Promise} Resolves: to nothing\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public _unstable_setStatusMessage(newMessage: string): Promise { // eslint-disable-line\n const type = \"im.vector.user_status\";\n return Promise.all(this.getRooms().map(async (room) => {\n const isJoined = room.getMyMembership() === \"join\";\n const looksLikeDm = room.getInvitedAndJoinedMemberCount() === 2;\n if (!isJoined || !looksLikeDm) return;\n // Check power level separately as it's a bit more expensive.\n const maySend = room.currentState.mayClientSendStateEvent(type, this);\n if (!maySend) return;\n await this.sendStateEvent(room.roomId, type, { status: newMessage }, this.getUserId());\n })).then(); // .then to fix return type\n }\n\n /**\n * @param {Object} opts Options to apply\n * @param {string} opts.presence One of \"online\", \"offline\" or \"unavailable\"\n * @param {string} opts.status_msg The status message to attach.\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: TODO\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n * @throws If 'presence' isn't a valid presence enum value.\n */\n public setPresence(opts: IPresenceOpts, callback?: Callback): Promise {\n const path = utils.encodeUri(\"/presence/$userId/status\", {\n $userId: this.credentials.userId,\n });\n\n if (typeof opts === \"string\") {\n opts = { presence: opts }; // legacy\n }\n\n const validStates = [\"offline\", \"online\", \"unavailable\"];\n if (validStates.indexOf(opts.presence) === -1) {\n throw new Error(\"Bad presence value: \" + opts.presence);\n }\n return this.http.authedRequest(\n callback, \"PUT\", path, undefined, opts,\n );\n }\n\n /**\n * @param {string} userId The user to get presence for\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: The presence state for this user.\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public getPresence(userId: string, callback?: Callback): Promise { // TODO: Types\n const path = utils.encodeUri(\"/presence/$userId/status\", {\n $userId: userId,\n });\n\n return this.http.authedRequest(callback, \"GET\", path, undefined, undefined);\n }\n\n /**\n * Retrieve older messages from the given room and put them in the timeline.\n *\n * If this is called multiple times whilst a request is ongoing, the same\n * Promise will be returned. If there was a problem requesting scrollback, there\n * will be a small delay before another request can be made (to prevent tight-looping\n * when there is no connection).\n *\n * @param {Room} room The room to get older messages in.\n * @param {Integer} limit Optional. The maximum number of previous events to\n * pull in. Default: 30.\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: Room. If you are at the beginning\n * of the timeline, Room.oldState.paginationToken will be\n * null.\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public scrollback(room: Room, limit: number, callback?: Callback): Promise {\n if (utils.isFunction(limit)) {\n callback = limit as any as Callback; // legacy\n limit = undefined;\n }\n limit = limit || 30;\n let timeToWaitMs = 0;\n\n let info = this.ongoingScrollbacks[room.roomId] || {};\n if (info.promise) {\n return info.promise;\n } else if (info.errorTs) {\n const timeWaitedMs = Date.now() - info.errorTs;\n timeToWaitMs = Math.max(SCROLLBACK_DELAY_MS - timeWaitedMs, 0);\n }\n\n if (room.oldState.paginationToken === null) {\n return Promise.resolve(room); // already at the start.\n }\n // attempt to grab more events from the store first\n const numAdded = this.store.scrollback(room, limit).length;\n if (numAdded === limit) {\n // store contained everything we needed.\n return Promise.resolve(room);\n }\n // reduce the required number of events appropriately\n limit = limit - numAdded;\n\n const prom = new Promise((resolve, reject) => {\n // wait for a time before doing this request\n // (which may be 0 in order not to special case the code paths)\n sleep(timeToWaitMs).then(() => {\n return this.createMessagesRequest(\n room.roomId,\n room.oldState.paginationToken,\n limit,\n Direction.Backward,\n );\n }).then((res: IMessagesResponse) => {\n const matrixEvents = res.chunk.map(this.getEventMapper());\n if (res.state) {\n const stateEvents = res.state.map(this.getEventMapper());\n room.currentState.setUnknownStateEvents(stateEvents);\n }\n room.addEventsToTimeline(matrixEvents, true, room.getLiveTimeline());\n room.oldState.paginationToken = res.end;\n if (res.chunk.length === 0) {\n room.oldState.paginationToken = null;\n }\n this.store.storeEvents(room, matrixEvents, res.end, true);\n this.ongoingScrollbacks[room.roomId] = null;\n callback?.(null, room);\n resolve(room);\n }).catch((err) => {\n this.ongoingScrollbacks[room.roomId] = {\n errorTs: Date.now(),\n };\n callback?.(err);\n reject(err);\n });\n });\n\n info = {\n promise: prom,\n errorTs: null,\n };\n\n this.ongoingScrollbacks[room.roomId] = info;\n return prom;\n }\n\n /**\n * @param {object} [options]\n * @param {boolean} options.preventReEmit don't re-emit events emitted on an event mapped by this mapper on the client\n * @param {boolean} options.decrypt decrypt event proactively\n * @return {Function}\n */\n public getEventMapper(options?: MapperOpts): EventMapper {\n return eventMapperFor(this, options || {});\n }\n\n /**\n * Get an EventTimeline for the given event\n *\n *

If the EventTimelineSet object already has the given event in its store, the\n * corresponding timeline will be returned. Otherwise, a /context request is\n * made, and used to construct an EventTimeline.\n *\n * @param {EventTimelineSet} timelineSet The timelineSet to look for the event in\n * @param {string} eventId The ID of the event to look for\n *\n * @return {Promise} Resolves:\n * {@link module:models/event-timeline~EventTimeline} including the given\n * event\n */\n public getEventTimeline(timelineSet: EventTimelineSet, eventId: string): Promise {\n // don't allow any timeline support unless it's been enabled.\n if (!this.timelineSupport) {\n throw new Error(\"timeline support is disabled. Set the 'timelineSupport'\" +\n \" parameter to true when creating MatrixClient to enable\" +\n \" it.\");\n }\n\n if (timelineSet.getTimelineForEvent(eventId)) {\n return Promise.resolve(timelineSet.getTimelineForEvent(eventId));\n }\n\n const path = utils.encodeUri(\n \"/rooms/$roomId/context/$eventId\", {\n $roomId: timelineSet.room.roomId,\n $eventId: eventId,\n },\n );\n\n let params = undefined;\n if (this.clientOpts.lazyLoadMembers) {\n params = { filter: JSON.stringify(Filter.LAZY_LOADING_MESSAGES_FILTER) };\n }\n\n // TODO: we should implement a backoff (as per scrollback()) to deal more\n // nicely with HTTP errors.\n const promise = this.http.authedRequest(undefined, \"GET\", path, params).then((res) => {\n if (!res.event) {\n throw new Error(\"'event' not in '/context' result - homeserver too old?\");\n }\n\n // by the time the request completes, the event might have ended up in\n // the timeline.\n if (timelineSet.getTimelineForEvent(eventId)) {\n return timelineSet.getTimelineForEvent(eventId);\n }\n\n // we start with the last event, since that's the point at which we\n // have known state.\n // events_after is already backwards; events_before is forwards.\n res.events_after.reverse();\n const events = res.events_after\n .concat([res.event])\n .concat(res.events_before);\n const matrixEvents = events.map(this.getEventMapper());\n\n let timeline = timelineSet.getTimelineForEvent(matrixEvents[0].getId());\n if (!timeline) {\n timeline = timelineSet.addTimeline();\n timeline.initialiseState(res.state.map(this.getEventMapper()));\n timeline.getState(EventTimeline.FORWARDS).paginationToken = res.end;\n } else {\n const stateEvents = res.state.map(this.getEventMapper());\n timeline.getState(EventTimeline.BACKWARDS).setUnknownStateEvents(stateEvents);\n }\n timelineSet.addEventsToTimeline(matrixEvents, true, timeline, res.start);\n\n // there is no guarantee that the event ended up in \"timeline\" (we\n // might have switched to a neighbouring timeline) - so check the\n // room's index again. On the other hand, there's no guarantee the\n // event ended up anywhere, if it was later redacted, so we just\n // return the timeline we first thought of.\n return timelineSet.getTimelineForEvent(eventId) || timeline;\n });\n return promise;\n }\n\n /**\n * Makes a request to /messages with the appropriate lazy loading filter set.\n * XXX: if we do get rid of scrollback (as it's not used at the moment),\n * we could inline this method again in paginateEventTimeline as that would\n * then be the only call-site\n * @param {string} roomId\n * @param {string} fromToken\n * @param {number} limit the maximum amount of events the retrieve\n * @param {string} dir 'f' or 'b'\n * @param {Filter} timelineFilter the timeline filter to pass\n * @return {Promise}\n */\n // XXX: Intended private, used in code.\n public createMessagesRequest(\n roomId: string,\n fromToken: string,\n limit: number,\n dir: Direction,\n timelineFilter?: Filter,\n ): Promise {\n const path = utils.encodeUri(\"/rooms/$roomId/messages\", { $roomId: roomId });\n if (limit === undefined) {\n limit = 30;\n }\n const params: Record = {\n from: fromToken,\n limit: limit,\n dir: dir,\n };\n\n let filter = null;\n if (this.clientOpts.lazyLoadMembers) {\n // create a shallow copy of LAZY_LOADING_MESSAGES_FILTER,\n // so the timelineFilter doesn't get written into it below\n filter = Object.assign({}, Filter.LAZY_LOADING_MESSAGES_FILTER);\n }\n if (timelineFilter) {\n // XXX: it's horrific that /messages' filter parameter doesn't match\n // /sync's one - see https://matrix.org/jira/browse/SPEC-451\n filter = filter || {};\n Object.assign(filter, timelineFilter.getRoomTimelineFilterComponent()?.toJSON());\n }\n if (filter) {\n params.filter = JSON.stringify(filter);\n }\n return this.http.authedRequest(undefined, \"GET\", path, params);\n }\n\n /**\n * Take an EventTimeline, and back/forward-fill results.\n *\n * @param {module:models/event-timeline~EventTimeline} eventTimeline timeline\n * object to be updated\n * @param {Object} [opts]\n * @param {boolean} [opts.backwards = false] true to fill backwards,\n * false to go forwards\n * @param {number} [opts.limit = 30] number of events to request\n *\n * @return {Promise} Resolves to a boolean: false if there are no\n * events and we reached either end of the timeline; else true.\n */\n public paginateEventTimeline(eventTimeline: EventTimeline, opts: IPaginateOpts): Promise {\n const isNotifTimeline = (eventTimeline.getTimelineSet() === this.notifTimelineSet);\n\n // TODO: we should implement a backoff (as per scrollback()) to deal more\n // nicely with HTTP errors.\n opts = opts || {};\n const backwards = opts.backwards || false;\n\n if (isNotifTimeline) {\n if (!backwards) {\n throw new Error(\"paginateNotifTimeline can only paginate backwards\");\n }\n }\n\n const dir = backwards ? EventTimeline.BACKWARDS : EventTimeline.FORWARDS;\n\n const token = eventTimeline.getPaginationToken(dir);\n if (!token) {\n // no token - no results.\n return Promise.resolve(false);\n }\n\n const pendingRequest = eventTimeline.paginationRequests[dir];\n\n if (pendingRequest) {\n // already a request in progress - return the existing promise\n return pendingRequest;\n }\n\n let path;\n let params;\n let promise;\n\n if (isNotifTimeline) {\n path = \"/notifications\";\n params = {\n limit: ('limit' in opts) ? opts.limit : 30,\n only: 'highlight',\n };\n\n if (token && token !== \"end\") {\n params.from = token;\n }\n\n promise = this.http.authedRequest(\n undefined, \"GET\", path, params, undefined,\n ).then((res) => {\n const token = res.next_token;\n const matrixEvents = [];\n\n for (let i = 0; i < res.notifications.length; i++) {\n const notification = res.notifications[i];\n const event = this.getEventMapper()(notification.event);\n event.setPushActions(\n PushProcessor.actionListToActionsObject(notification.actions),\n );\n event.event.room_id = notification.room_id; // XXX: gutwrenching\n matrixEvents[i] = event;\n }\n\n eventTimeline.getTimelineSet()\n .addEventsToTimeline(matrixEvents, backwards, eventTimeline, token);\n\n // if we've hit the end of the timeline, we need to stop trying to\n // paginate. We need to keep the 'forwards' token though, to make sure\n // we can recover from gappy syncs.\n if (backwards && !res.next_token) {\n eventTimeline.setPaginationToken(null, dir);\n }\n return res.next_token ? true : false;\n }).finally(() => {\n eventTimeline.paginationRequests[dir] = null;\n });\n eventTimeline.paginationRequests[dir] = promise;\n } else {\n const room = this.getRoom(eventTimeline.getRoomId());\n if (!room) {\n throw new Error(\"Unknown room \" + eventTimeline.getRoomId());\n }\n\n promise = this.createMessagesRequest(\n eventTimeline.getRoomId(),\n token,\n opts.limit,\n dir,\n eventTimeline.getFilter());\n promise.then((res) => {\n if (res.state) {\n const roomState = eventTimeline.getState(dir);\n const stateEvents = res.state.map(this.getEventMapper());\n roomState.setUnknownStateEvents(stateEvents);\n }\n const token = res.end;\n const matrixEvents = res.chunk.map(this.getEventMapper());\n eventTimeline.getTimelineSet()\n .addEventsToTimeline(matrixEvents, backwards, eventTimeline, token);\n\n // if we've hit the end of the timeline, we need to stop trying to\n // paginate. We need to keep the 'forwards' token though, to make sure\n // we can recover from gappy syncs.\n if (backwards && res.end == res.start) {\n eventTimeline.setPaginationToken(null, dir);\n }\n return res.end != res.start;\n }).finally(() => {\n eventTimeline.paginationRequests[dir] = null;\n });\n eventTimeline.paginationRequests[dir] = promise;\n }\n\n return promise;\n }\n\n /**\n * Reset the notifTimelineSet entirely, paginating in some historical notifs as\n * a starting point for subsequent pagination.\n */\n public resetNotifTimelineSet() {\n if (!this.notifTimelineSet) {\n return;\n }\n\n // FIXME: This thing is a total hack, and results in duplicate events being\n // added to the timeline both from /sync and /notifications, and lots of\n // slow and wasteful processing and pagination. The correct solution is to\n // extend /messages or /search or something to filter on notifications.\n\n // use the fictitious token 'end'. in practice we would ideally give it\n // the oldest backwards pagination token from /sync, but /sync doesn't\n // know about /notifications, so we have no choice but to start paginating\n // from the current point in time. This may well overlap with historical\n // notifs which are then inserted into the timeline by /sync responses.\n this.notifTimelineSet.resetLiveTimeline('end', null);\n\n // we could try to paginate a single event at this point in order to get\n // a more valid pagination token, but it just ends up with an out of order\n // timeline. given what a mess this is and given we're going to have duplicate\n // events anyway, just leave it with the dummy token for now.\n /*\n this.paginateNotifTimeline(this._notifTimelineSet.getLiveTimeline(), {\n backwards: true,\n limit: 1\n });\n */\n }\n\n /**\n * Peek into a room and receive updates about the room. This only works if the\n * history visibility for the room is world_readable.\n * @param {String} roomId The room to attempt to peek into.\n * @return {Promise} Resolves: Room object\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public peekInRoom(roomId: string): Promise {\n if (this.peekSync) {\n this.peekSync.stopPeeking();\n }\n this.peekSync = new SyncApi(this, this.clientOpts);\n return this.peekSync.peek(roomId);\n }\n\n /**\n * Stop any ongoing room peeking.\n */\n public stopPeeking() {\n if (this.peekSync) {\n this.peekSync.stopPeeking();\n this.peekSync = null;\n }\n }\n\n /**\n * Set r/w flags for guest access in a room.\n * @param {string} roomId The room to configure guest access in.\n * @param {Object} opts Options\n * @param {boolean} opts.allowJoin True to allow guests to join this room. This\n * implicitly gives guests write access. If false or not given, guests are\n * explicitly forbidden from joining the room.\n * @param {boolean} opts.allowRead True to set history visibility to\n * be world_readable. This gives guests read access *from this point forward*.\n * If false or not given, history visibility is not modified.\n * @return {Promise} Resolves: TODO\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public setGuestAccess(roomId: string, opts: IGuestAccessOpts): Promise {\n const writePromise = this.sendStateEvent(roomId, EventType.RoomGuestAccess, {\n guest_access: opts.allowJoin ? \"can_join\" : \"forbidden\",\n }, \"\");\n\n let readPromise: Promise = Promise.resolve(undefined);\n if (opts.allowRead) {\n readPromise = this.sendStateEvent(roomId, EventType.RoomHistoryVisibility, {\n history_visibility: \"world_readable\",\n }, \"\");\n }\n\n return Promise.all([readPromise, writePromise]).then(); // .then() to hide results for contract\n }\n\n /**\n * Requests an email verification token for the purposes of registration.\n * This API requests a token from the homeserver.\n * The doesServerRequireIdServerParam() method can be used to determine if\n * the server requires the id_server parameter to be provided.\n *\n * Parameters and return value are as for requestEmailToken\n\n * @param {string} email As requestEmailToken\n * @param {string} clientSecret As requestEmailToken\n * @param {number} sendAttempt As requestEmailToken\n * @param {string} nextLink As requestEmailToken\n * @return {Promise} Resolves: As requestEmailToken\n */\n public requestRegisterEmailToken(\n email: string,\n clientSecret: string,\n sendAttempt: number,\n nextLink?: string,\n ): Promise {\n return this.requestTokenFromEndpoint(\n \"/register/email/requestToken\",\n {\n email: email,\n client_secret: clientSecret,\n send_attempt: sendAttempt,\n next_link: nextLink,\n },\n );\n }\n\n /**\n * Requests a text message verification token for the purposes of registration.\n * This API requests a token from the homeserver.\n * The doesServerRequireIdServerParam() method can be used to determine if\n * the server requires the id_server parameter to be provided.\n *\n * @param {string} phoneCountry The ISO 3166-1 alpha-2 code for the country in which\n * phoneNumber should be parsed relative to.\n * @param {string} phoneNumber The phone number, in national or international format\n * @param {string} clientSecret As requestEmailToken\n * @param {number} sendAttempt As requestEmailToken\n * @param {string} nextLink As requestEmailToken\n * @return {Promise} Resolves: As requestEmailToken\n */\n public requestRegisterMsisdnToken(\n phoneCountry: string,\n phoneNumber: string,\n clientSecret: string,\n sendAttempt: number,\n nextLink?: string,\n ): Promise {\n return this.requestTokenFromEndpoint(\n \"/register/msisdn/requestToken\",\n {\n country: phoneCountry,\n phone_number: phoneNumber,\n client_secret: clientSecret,\n send_attempt: sendAttempt,\n next_link: nextLink,\n },\n );\n }\n\n /**\n * Requests an email verification token for the purposes of adding a\n * third party identifier to an account.\n * This API requests a token from the homeserver.\n * The doesServerRequireIdServerParam() method can be used to determine if\n * the server requires the id_server parameter to be provided.\n * If an account with the given email address already exists and is\n * associated with an account other than the one the user is authed as,\n * it will either send an email to the address informing them of this\n * or return M_THREEPID_IN_USE (which one is up to the homeserver).\n *\n * @param {string} email As requestEmailToken\n * @param {string} clientSecret As requestEmailToken\n * @param {number} sendAttempt As requestEmailToken\n * @param {string} nextLink As requestEmailToken\n * @return {Promise} Resolves: As requestEmailToken\n */\n public requestAdd3pidEmailToken(\n email: string,\n clientSecret: string,\n sendAttempt: number,\n nextLink: string,\n ): Promise {\n return this.requestTokenFromEndpoint(\n \"/account/3pid/email/requestToken\",\n {\n email: email,\n client_secret: clientSecret,\n send_attempt: sendAttempt,\n next_link: nextLink,\n },\n );\n }\n\n /**\n * Requests a text message verification token for the purposes of adding a\n * third party identifier to an account.\n * This API proxies the identity server /validate/email/requestToken API,\n * adding specific behaviour for the addition of phone numbers to an\n * account, as requestAdd3pidEmailToken.\n *\n * @param {string} phoneCountry As requestRegisterMsisdnToken\n * @param {string} phoneNumber As requestRegisterMsisdnToken\n * @param {string} clientSecret As requestEmailToken\n * @param {number} sendAttempt As requestEmailToken\n * @param {string} nextLink As requestEmailToken\n * @return {Promise} Resolves: As requestEmailToken\n */\n public requestAdd3pidMsisdnToken(\n phoneCountry: string,\n phoneNumber: string,\n clientSecret: string,\n sendAttempt: number,\n nextLink: string,\n ): Promise {\n return this.requestTokenFromEndpoint(\n \"/account/3pid/msisdn/requestToken\",\n {\n country: phoneCountry,\n phone_number: phoneNumber,\n client_secret: clientSecret,\n send_attempt: sendAttempt,\n next_link: nextLink,\n },\n );\n }\n\n /**\n * Requests an email verification token for the purposes of resetting\n * the password on an account.\n * This API proxies the identity server /validate/email/requestToken API,\n * adding specific behaviour for the password resetting. Specifically,\n * if no account with the given email address exists, it may either\n * return M_THREEPID_NOT_FOUND or send an email\n * to the address informing them of this (which one is up to the homeserver).\n *\n * requestEmailToken calls the equivalent API directly on the identity server,\n * therefore bypassing the password reset specific logic.\n *\n * @param {string} email As requestEmailToken\n * @param {string} clientSecret As requestEmailToken\n * @param {number} sendAttempt As requestEmailToken\n * @param {string} nextLink As requestEmailToken\n * @param {module:client.callback} callback Optional. As requestEmailToken\n * @return {Promise} Resolves: As requestEmailToken\n */\n public requestPasswordEmailToken(\n email: string,\n clientSecret: string,\n sendAttempt: number,\n nextLink: string,\n ): Promise {\n return this.requestTokenFromEndpoint(\n \"/account/password/email/requestToken\",\n {\n email: email,\n client_secret: clientSecret,\n send_attempt: sendAttempt,\n next_link: nextLink,\n },\n );\n }\n\n /**\n * Requests a text message verification token for the purposes of resetting\n * the password on an account.\n * This API proxies the identity server /validate/email/requestToken API,\n * adding specific behaviour for the password resetting, as requestPasswordEmailToken.\n *\n * @param {string} phoneCountry As requestRegisterMsisdnToken\n * @param {string} phoneNumber As requestRegisterMsisdnToken\n * @param {string} clientSecret As requestEmailToken\n * @param {number} sendAttempt As requestEmailToken\n * @param {string} nextLink As requestEmailToken\n * @return {Promise} Resolves: As requestEmailToken\n */\n public requestPasswordMsisdnToken(\n phoneCountry: string,\n phoneNumber: string,\n clientSecret: string,\n sendAttempt: number,\n nextLink: string,\n ): Promise {\n return this.requestTokenFromEndpoint(\n \"/account/password/msisdn/requestToken\",\n {\n country: phoneCountry,\n phone_number: phoneNumber,\n client_secret: clientSecret,\n send_attempt: sendAttempt,\n next_link: nextLink,\n },\n );\n }\n\n /**\n * Internal utility function for requesting validation tokens from usage-specific\n * requestToken endpoints.\n *\n * @param {string} endpoint The endpoint to send the request to\n * @param {object} params Parameters for the POST request\n * @return {Promise} Resolves: As requestEmailToken\n */\n private async requestTokenFromEndpoint(\n endpoint: string,\n params: Record,\n ): Promise {\n const postParams = Object.assign({}, params);\n\n // If the HS supports separate add and bind, then requestToken endpoints\n // don't need an IS as they are all validated by the HS directly.\n if (!await this.doesServerSupportSeparateAddAndBind() && this.idBaseUrl) {\n const idServerUrl = new URL(this.idBaseUrl);\n postParams.id_server = idServerUrl.host;\n\n if (\n this.identityServer &&\n this.identityServer.getAccessToken &&\n await this.doesServerAcceptIdentityAccessToken()\n ) {\n const identityAccessToken = await this.identityServer.getAccessToken();\n if (identityAccessToken) {\n postParams.id_access_token = identityAccessToken;\n }\n }\n }\n\n return this.http.request(undefined, \"POST\", endpoint, undefined, postParams);\n }\n\n /**\n * Get the room-kind push rule associated with a room.\n * @param {string} scope \"global\" or device-specific.\n * @param {string} roomId the id of the room.\n * @return {object} the rule or undefined.\n */\n public getRoomPushRule(scope: string, roomId: string): any { // TODO: Types\n // There can be only room-kind push rule per room\n // and its id is the room id.\n if (this.pushRules) {\n for (let i = 0; i < this.pushRules[scope].room.length; i++) {\n const rule = this.pushRules[scope].room[i];\n if (rule.rule_id === roomId) {\n return rule;\n }\n }\n } else {\n throw new Error(\n \"SyncApi.sync() must be done before accessing to push rules.\",\n );\n }\n }\n\n /**\n * Set a room-kind muting push rule in a room.\n * The operation also updates MatrixClient.pushRules at the end.\n * @param {string} scope \"global\" or device-specific.\n * @param {string} roomId the id of the room.\n * @param {boolean} mute the mute state.\n * @return {Promise} Resolves: result object\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public setRoomMutePushRule(scope: string, roomId: string, mute: boolean): Promise | void {\n let deferred;\n let hasDontNotifyRule;\n\n // Get the existing room-kind push rule if any\n const roomPushRule = this.getRoomPushRule(scope, roomId);\n if (roomPushRule) {\n if (0 <= roomPushRule.actions.indexOf(\"dont_notify\")) {\n hasDontNotifyRule = true;\n }\n }\n\n if (!mute) {\n // Remove the rule only if it is a muting rule\n if (hasDontNotifyRule) {\n deferred = this.deletePushRule(scope, PushRuleKind.RoomSpecific, roomPushRule.rule_id);\n }\n } else {\n if (!roomPushRule) {\n deferred = this.addPushRule(scope, PushRuleKind.RoomSpecific, roomId, {\n actions: [\"dont_notify\"],\n });\n } else if (!hasDontNotifyRule) {\n // Remove the existing one before setting the mute push rule\n // This is a workaround to SYN-590 (Push rule update fails)\n deferred = utils.defer();\n this.deletePushRule(scope, PushRuleKind.RoomSpecific, roomPushRule.rule_id)\n .then(() => {\n this.addPushRule(scope, PushRuleKind.RoomSpecific, roomId, {\n actions: [\"dont_notify\"],\n }).then(() => {\n deferred.resolve();\n }).catch((err) => {\n deferred.reject(err);\n });\n }).catch((err) => {\n deferred.reject(err);\n });\n\n deferred = deferred.promise;\n }\n }\n\n if (deferred) {\n return new Promise((resolve, reject) => {\n // Update this.pushRules when the operation completes\n deferred.then(() => {\n this.getPushRules().then((result) => {\n this.pushRules = result;\n resolve();\n }).catch((err) => {\n reject(err);\n });\n }).catch((err) => {\n // Update it even if the previous operation fails. This can help the\n // app to recover when push settings has been modifed from another client\n this.getPushRules().then((result) => {\n this.pushRules = result;\n reject(err);\n }).catch((err2) => {\n reject(err);\n });\n });\n });\n }\n }\n\n public searchMessageText(opts: ISearchOpts, callback?: Callback): Promise {\n const roomEvents: ISearchRequestBody[\"search_categories\"][\"room_events\"] = {\n search_term: opts.query,\n };\n\n if ('keys' in opts) {\n roomEvents.keys = opts.keys;\n }\n\n return this.search({\n body: {\n search_categories: {\n room_events: roomEvents,\n },\n },\n }, callback);\n }\n\n /**\n * Perform a server-side search for room events.\n *\n * The returned promise resolves to an object containing the fields:\n *\n * * {number} count: estimate of the number of results\n * * {string} next_batch: token for back-pagination; if undefined, there are\n * no more results\n * * {Array} highlights: a list of words to highlight from the stemming\n * algorithm\n * * {Array} results: a list of results\n *\n * Each entry in the results list is a {module:models/search-result.SearchResult}.\n *\n * @param {Object} opts\n * @param {string} opts.term the term to search for\n * @param {Object} opts.filter a JSON filter object to pass in the request\n * @return {Promise} Resolves: result object\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public searchRoomEvents(opts: IEventSearchOpts): Promise {\n // TODO: support groups\n\n const body = {\n search_categories: {\n room_events: {\n search_term: opts.term,\n filter: opts.filter,\n order_by: SearchOrderBy.Recent,\n event_context: {\n before_limit: 1,\n after_limit: 1,\n include_profile: true,\n },\n },\n },\n };\n\n const searchResults: ISearchResults = {\n _query: body,\n results: [],\n highlights: [],\n };\n\n return this.search({ body: body }).then(res => this.processRoomEventsSearch(searchResults, res));\n }\n\n /**\n * Take a result from an earlier searchRoomEvents call, and backfill results.\n *\n * @param {object} searchResults the results object to be updated\n * @return {Promise} Resolves: updated result object\n * @return {Error} Rejects: with an error response.\n */\n public backPaginateRoomEventsSearch(searchResults: T): Promise {\n // TODO: we should implement a backoff (as per scrollback()) to deal more\n // nicely with HTTP errors.\n\n if (!searchResults.next_batch) {\n return Promise.reject(new Error(\"Cannot backpaginate event search any further\"));\n }\n\n if (searchResults.pendingRequest) {\n // already a request in progress - return the existing promise\n return searchResults.pendingRequest as Promise;\n }\n\n const searchOpts = {\n body: searchResults._query,\n next_batch: searchResults.next_batch,\n };\n\n const promise = this.search(searchOpts)\n .then(res => this.processRoomEventsSearch(searchResults, res))\n .finally(() => {\n searchResults.pendingRequest = null;\n });\n searchResults.pendingRequest = promise;\n\n return promise;\n }\n\n /**\n * helper for searchRoomEvents and backPaginateRoomEventsSearch. Processes the\n * response from the API call and updates the searchResults\n *\n * @param {Object} searchResults\n * @param {Object} response\n * @return {Object} searchResults\n * @private\n */\n // XXX: Intended private, used in code\n public processRoomEventsSearch(searchResults: T, response: ISearchResponse): T {\n const roomEvents = response.search_categories.room_events;\n\n searchResults.count = roomEvents.count;\n searchResults.next_batch = roomEvents.next_batch;\n\n // combine the highlight list with our existing list; build an object\n // to avoid O(N^2) fail\n const highlights = {};\n roomEvents.highlights.forEach((hl) => {\n highlights[hl] = 1;\n });\n searchResults.highlights.forEach((hl) => {\n highlights[hl] = 1;\n });\n\n // turn it back into a list.\n searchResults.highlights = Object.keys(highlights);\n\n // append the new results to our existing results\n const resultsLength = roomEvents.results ? roomEvents.results.length : 0;\n for (let i = 0; i < resultsLength; i++) {\n const sr = SearchResult.fromJson(roomEvents.results[i], this.getEventMapper());\n searchResults.results.push(sr);\n }\n return searchResults;\n }\n\n /**\n * Populate the store with rooms the user has left.\n * @return {Promise} Resolves: TODO - Resolved when the rooms have\n * been added to the data store.\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public syncLeftRooms(): Promise {\n // Guard against multiple calls whilst ongoing and multiple calls post success\n if (this.syncedLeftRooms) {\n return Promise.resolve([]); // don't call syncRooms again if it succeeded.\n }\n if (this.syncLeftRoomsPromise) {\n return this.syncLeftRoomsPromise; // return the ongoing request\n }\n const syncApi = new SyncApi(this, this.clientOpts);\n this.syncLeftRoomsPromise = syncApi.syncLeftRooms();\n\n // cleanup locks\n this.syncLeftRoomsPromise.then((res) => {\n logger.log(\"Marking success of sync left room request\");\n this.syncedLeftRooms = true; // flip the bit on success\n }).finally(() => {\n this.syncLeftRoomsPromise = null; // cleanup ongoing request state\n });\n\n return this.syncLeftRoomsPromise;\n }\n\n /**\n * Create a new filter.\n * @param {Object} content The HTTP body for the request\n * @return {Filter} Resolves to a Filter object.\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public createFilter(content: IFilterDefinition): Promise {\n const path = utils.encodeUri(\"/user/$userId/filter\", {\n $userId: this.credentials.userId,\n });\n return this.http.authedRequest(undefined, \"POST\", path, undefined, content).then((response) => {\n // persist the filter\n const filter = Filter.fromJson(\n this.credentials.userId, response.filter_id, content,\n );\n this.store.storeFilter(filter);\n return filter;\n });\n }\n\n /**\n * Retrieve a filter.\n * @param {string} userId The user ID of the filter owner\n * @param {string} filterId The filter ID to retrieve\n * @param {boolean} allowCached True to allow cached filters to be returned.\n * Default: True.\n * @return {Promise} Resolves: a Filter object\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public getFilter(userId: string, filterId: string, allowCached: boolean): Promise {\n if (allowCached) {\n const filter = this.store.getFilter(userId, filterId);\n if (filter) {\n return Promise.resolve(filter);\n }\n }\n\n const path = utils.encodeUri(\"/user/$userId/filter/$filterId\", {\n $userId: userId,\n $filterId: filterId,\n });\n\n return this.http.authedRequest(\n undefined, \"GET\", path, undefined, undefined,\n ).then((response) => {\n // persist the filter\n const filter = Filter.fromJson(\n userId, filterId, response,\n );\n this.store.storeFilter(filter);\n return filter;\n });\n }\n\n /**\n * @param {string} filterName\n * @param {Filter} filter\n * @return {Promise} Filter ID\n */\n public async getOrCreateFilter(filterName: string, filter: Filter): Promise {\n const filterId = this.store.getFilterIdByName(filterName);\n let existingId = undefined;\n\n if (filterId) {\n // check that the existing filter matches our expectations\n try {\n const existingFilter =\n await this.getFilter(this.credentials.userId, filterId, true);\n if (existingFilter) {\n const oldDef = existingFilter.getDefinition();\n const newDef = filter.getDefinition();\n\n if (utils.deepCompare(oldDef, newDef)) {\n // super, just use that.\n // debuglog(\"Using existing filter ID %s: %s\", filterId,\n // JSON.stringify(oldDef));\n existingId = filterId;\n }\n }\n } catch (error) {\n // Synapse currently returns the following when the filter cannot be found:\n // {\n // errcode: \"M_UNKNOWN\",\n // name: \"M_UNKNOWN\",\n // message: \"No row found\",\n // }\n if (error.errcode !== \"M_UNKNOWN\" && error.errcode !== \"M_NOT_FOUND\") {\n throw error;\n }\n }\n // if the filter doesn't exist anymore on the server, remove from store\n if (!existingId) {\n this.store.setFilterIdByName(filterName, undefined);\n }\n }\n\n if (existingId) {\n return existingId;\n }\n\n // create a new filter\n const createdFilter = await this.createFilter(filter.getDefinition());\n\n // debuglog(\"Created new filter ID %s: %s\", createdFilter.filterId,\n // JSON.stringify(createdFilter.getDefinition()));\n this.store.setFilterIdByName(filterName, createdFilter.filterId);\n return createdFilter.filterId;\n }\n\n /**\n * Gets a bearer token from the homeserver that the user can\n * present to a third party in order to prove their ownership\n * of the Matrix account they are logged into.\n * @return {Promise} Resolves: Token object\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public getOpenIdToken(): Promise {\n const path = utils.encodeUri(\"/user/$userId/openid/request_token\", {\n $userId: this.credentials.userId,\n });\n\n return this.http.authedRequest(\n undefined, \"POST\", path, undefined, {},\n );\n }\n\n private startCallEventHandler = (): void => {\n if (this.isInitialSyncComplete()) {\n this.callEventHandler.start();\n this.off(\"sync\", this.startCallEventHandler);\n }\n };\n\n /**\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: ITurnServerResponse object\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public turnServer(callback?: Callback): Promise {\n return this.http.authedRequest(callback, \"GET\", \"/voip/turnServer\");\n }\n\n /**\n * Get the TURN servers for this homeserver.\n * @return {Array} The servers or an empty list.\n */\n public getTurnServers(): ITurnServer[] {\n return this.turnServers || [];\n }\n\n /**\n * Get the unix timestamp (in seconds) at which the current\n * TURN credentials (from getTurnServers) expire\n * @return {number} The expiry timestamp, in seconds, or null if no credentials\n */\n public getTurnServersExpiry(): number | null {\n return this.turnServersExpiry;\n }\n\n // XXX: Intended private, used in code.\n public async checkTurnServers(): Promise {\n if (!this.canSupportVoip) {\n return;\n }\n\n let credentialsGood = false;\n const remainingTime = this.turnServersExpiry - Date.now();\n if (remainingTime > TURN_CHECK_INTERVAL) {\n logger.debug(\"TURN creds are valid for another \" + remainingTime + \" ms: not fetching new ones.\");\n credentialsGood = true;\n } else {\n logger.debug(\"Fetching new TURN credentials\");\n try {\n const res = await this.turnServer();\n if (res.uris) {\n logger.log(\"Got TURN URIs: \" + res.uris + \" refresh in \" + res.ttl + \" secs\");\n // map the response to a format that can be fed to RTCPeerConnection\n const servers: ITurnServer = {\n urls: res.uris,\n username: res.username,\n credential: res.password,\n };\n this.turnServers = [servers];\n // The TTL is in seconds but we work in ms\n this.turnServersExpiry = Date.now() + (res.ttl * 1000);\n credentialsGood = true;\n }\n } catch (err) {\n logger.error(\"Failed to get TURN URIs\", err);\n // If we get a 403, there's no point in looping forever.\n if (err.httpStatus === 403) {\n logger.info(\"TURN access unavailable for this account: stopping credentials checks\");\n if (this.checkTurnServersIntervalID !== null) global.clearInterval(this.checkTurnServersIntervalID);\n this.checkTurnServersIntervalID = null;\n }\n }\n // otherwise, if we failed for whatever reason, try again the next time we're called.\n }\n\n return credentialsGood;\n }\n\n /**\n * Set whether to allow a fallback ICE server should be used for negotiating a\n * WebRTC connection if the homeserver doesn't provide any servers. Defaults to\n * false.\n *\n * @param {boolean} allow\n */\n public setFallbackICEServerAllowed(allow: boolean) {\n this.fallbackICEServerAllowed = allow;\n }\n\n /**\n * Get whether to allow a fallback ICE server should be used for negotiating a\n * WebRTC connection if the homeserver doesn't provide any servers. Defaults to\n * false.\n *\n * @returns {boolean}\n */\n public isFallbackICEServerAllowed(): boolean {\n return this.fallbackICEServerAllowed;\n }\n\n /**\n * Determines if the current user is an administrator of the Synapse homeserver.\n * Returns false if untrue or the homeserver does not appear to be a Synapse\n * homeserver. This function is implementation specific and may change\n * as a result.\n * @return {boolean} true if the user appears to be a Synapse administrator.\n */\n public isSynapseAdministrator(): Promise {\n const path = utils.encodeUri(\n \"/_synapse/admin/v1/users/$userId/admin\",\n { $userId: this.getUserId() },\n );\n return this.http.authedRequest(\n undefined, 'GET', path, undefined, undefined, { prefix: '' },\n ).then(r => r['admin']); // pull out the specific boolean we want\n }\n\n /**\n * Performs a whois lookup on a user using Synapse's administrator API.\n * This function is implementation specific and may change as a\n * result.\n * @param {string} userId the User ID to look up.\n * @return {object} the whois response - see Synapse docs for information.\n */\n public whoisSynapseUser(userId: string): Promise {\n const path = utils.encodeUri(\n \"/_synapse/admin/v1/whois/$userId\",\n { $userId: userId },\n );\n return this.http.authedRequest(undefined, 'GET', path, undefined, undefined, { prefix: '' });\n }\n\n /**\n * Deactivates a user using Synapse's administrator API. This\n * function is implementation specific and may change as a result.\n * @param {string} userId the User ID to deactivate.\n * @return {object} the deactivate response - see Synapse docs for information.\n */\n public deactivateSynapseUser(userId: string): Promise {\n const path = utils.encodeUri(\n \"/_synapse/admin/v1/deactivate/$userId\",\n { $userId: userId },\n );\n return this.http.authedRequest(\n undefined, 'POST', path, undefined, undefined, { prefix: '' },\n );\n }\n\n private async fetchClientWellKnown(): Promise {\n // `getRawClientConfig` does not throw or reject on network errors, instead\n // it absorbs errors and returns `{}`.\n this.clientWellKnownPromise = AutoDiscovery.getRawClientConfig(this.getDomain());\n this.clientWellKnown = await this.clientWellKnownPromise;\n this.emit(\"WellKnown.client\", this.clientWellKnown);\n }\n\n public getClientWellKnown(): IClientWellKnown {\n return this.clientWellKnown;\n }\n\n public waitForClientWellKnown(): Promise {\n return this.clientWellKnownPromise;\n }\n\n /**\n * store client options with boolean/string/numeric values\n * to know in the next session what flags the sync data was\n * created with (e.g. lazy loading)\n * @param {object} opts the complete set of client options\n * @return {Promise} for store operation\n */\n public storeClientOptions(): Promise { // XXX: Intended private, used in code\n const primTypes = [\"boolean\", \"string\", \"number\"];\n const serializableOpts = Object.entries(this.clientOpts)\n .filter(([key, value]) => {\n return primTypes.includes(typeof value);\n })\n .reduce((obj, [key, value]) => {\n obj[key] = value;\n return obj;\n }, {});\n return this.store.storeClientOptions(serializableOpts);\n }\n\n /**\n * Gets a set of room IDs in common with another user\n * @param {string} userId The userId to check.\n * @return {Promise} Resolves to a set of rooms\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public async _unstable_getSharedRooms(userId: string): Promise { // eslint-disable-line\n if (!(await this.doesServerSupportUnstableFeature(\"uk.half-shot.msc2666\"))) {\n throw Error('Server does not support shared_rooms API');\n }\n const path = utils.encodeUri(\"/uk.half-shot.msc2666/user/shared_rooms/$userId\", {\n $userId: userId,\n });\n const res = await this.http.authedRequest(\n undefined, \"GET\", path, undefined, undefined,\n { prefix: PREFIX_UNSTABLE },\n );\n return res.joined;\n }\n\n /**\n * Get the API versions supported by the server, along with any\n * unstable APIs it supports\n * @return {Promise} The server /versions response\n */\n public getVersions(): Promise {\n if (this.serverVersionsPromise) {\n return this.serverVersionsPromise;\n }\n\n this.serverVersionsPromise = this.http.request(\n undefined, // callback\n \"GET\", \"/_matrix/client/versions\",\n undefined, // queryParams\n undefined, // data\n {\n prefix: '',\n },\n ).catch((e) => {\n // Need to unset this if it fails, otherwise we'll never retry\n this.serverVersionsPromise = null;\n // but rethrow the exception to anything that was waiting\n throw e;\n });\n\n return this.serverVersionsPromise;\n }\n\n /**\n * Check if a particular spec version is supported by the server.\n * @param {string} version The spec version (such as \"r0.5.0\") to check for.\n * @return {Promise} Whether it is supported\n */\n public async isVersionSupported(version: string): Promise {\n const { versions } = await this.getVersions();\n return versions && versions.includes(version);\n }\n\n /**\n * Query the server to see if it support members lazy loading\n * @return {Promise} true if server supports lazy loading\n */\n public async doesServerSupportLazyLoading(): Promise {\n const response = await this.getVersions();\n if (!response) return false;\n\n const versions = response[\"versions\"];\n const unstableFeatures = response[\"unstable_features\"];\n\n return (versions && versions.includes(\"r0.5.0\"))\n || (unstableFeatures && unstableFeatures[\"m.lazy_load_members\"]);\n }\n\n /**\n * Query the server to see if the `id_server` parameter is required\n * when registering with an 3pid, adding a 3pid or resetting password.\n * @return {Promise} true if id_server parameter is required\n */\n public async doesServerRequireIdServerParam(): Promise {\n const response = await this.getVersions();\n if (!response) return true;\n\n const versions = response[\"versions\"];\n\n // Supporting r0.6.0 is the same as having the flag set to false\n if (versions && versions.includes(\"r0.6.0\")) {\n return false;\n }\n\n const unstableFeatures = response[\"unstable_features\"];\n if (!unstableFeatures) return true;\n if (unstableFeatures[\"m.require_identity_server\"] === undefined) {\n return true;\n } else {\n return unstableFeatures[\"m.require_identity_server\"];\n }\n }\n\n /**\n * Query the server to see if the `id_access_token` parameter can be safely\n * passed to the homeserver. Some homeservers may trigger errors if they are not\n * prepared for the new parameter.\n * @return {Promise} true if id_access_token can be sent\n */\n public async doesServerAcceptIdentityAccessToken(): Promise {\n const response = await this.getVersions();\n if (!response) return false;\n\n const versions = response[\"versions\"];\n const unstableFeatures = response[\"unstable_features\"];\n return (versions && versions.includes(\"r0.6.0\"))\n || (unstableFeatures && unstableFeatures[\"m.id_access_token\"]);\n }\n\n /**\n * Query the server to see if it supports separate 3PID add and bind functions.\n * This affects the sequence of API calls clients should use for these operations,\n * so it's helpful to be able to check for support.\n * @return {Promise} true if separate functions are supported\n */\n public async doesServerSupportSeparateAddAndBind(): Promise {\n const response = await this.getVersions();\n if (!response) return false;\n\n const versions = response[\"versions\"];\n const unstableFeatures = response[\"unstable_features\"];\n\n return (versions && versions.includes(\"r0.6.0\"))\n || (unstableFeatures && unstableFeatures[\"m.separate_add_and_bind\"]);\n }\n\n /**\n * Query the server to see if it lists support for an unstable feature\n * in the /versions response\n * @param {string} feature the feature name\n * @return {Promise} true if the feature is supported\n */\n public async doesServerSupportUnstableFeature(feature: string): Promise {\n const response = await this.getVersions();\n if (!response) return false;\n const unstableFeatures = response[\"unstable_features\"];\n return unstableFeatures && !!unstableFeatures[feature];\n }\n\n /**\n * Query the server to see if it is forcing encryption to be enabled for\n * a given room preset, based on the /versions response.\n * @param {Preset} presetName The name of the preset to check.\n * @returns {Promise} true if the server is forcing encryption\n * for the preset.\n */\n public async doesServerForceEncryptionForPreset(presetName: Preset): Promise {\n const response = await this.getVersions();\n if (!response) return false;\n const unstableFeatures = response[\"unstable_features\"];\n\n // The preset name in the versions response will be without the _chat suffix.\n const versionsPresetName = presetName.includes(\"_chat\")\n ? presetName.substring(0, presetName.indexOf(\"_chat\"))\n : presetName;\n\n return unstableFeatures && !!unstableFeatures[`io.element.e2ee_forced.${versionsPresetName}`];\n }\n\n /**\n * Get if lazy loading members is being used.\n * @return {boolean} Whether or not members are lazy loaded by this client\n */\n public hasLazyLoadMembersEnabled(): boolean {\n return !!this.clientOpts.lazyLoadMembers;\n }\n\n /**\n * Set a function which is called when /sync returns a 'limited' response.\n * It is called with a room ID and returns a boolean. It should return 'true' if the SDK\n * can SAFELY remove events from this room. It may not be safe to remove events if there\n * are other references to the timelines for this room, e.g because the client is\n * actively viewing events in this room.\n * Default: returns false.\n * @param {Function} cb The callback which will be invoked.\n */\n public setCanResetTimelineCallback(cb: ResetTimelineCallback) {\n this.canResetTimelineCallback = cb;\n }\n\n /**\n * Get the callback set via `setCanResetTimelineCallback`.\n * @return {?Function} The callback or null\n */\n public getCanResetTimelineCallback(): ResetTimelineCallback {\n return this.canResetTimelineCallback;\n }\n\n /**\n * Returns relations for a given event. Handles encryption transparently,\n * with the caveat that the amount of events returned might be 0, even though you get a nextBatch.\n * When the returned promise resolves, all messages should have finished trying to decrypt.\n * @param {string} roomId the room of the event\n * @param {string} eventId the id of the event\n * @param {string} relationType the rel_type of the relations requested\n * @param {string} eventType the event type of the relations requested\n * @param {Object} opts options with optional values for the request.\n * @param {Object} opts.from the pagination token returned from a previous request as `nextBatch` to return following relations.\n * @return {Object} an object with `events` as `MatrixEvent[]` and optionally `nextBatch` if more relations are available.\n */\n public async relations(\n roomId: string,\n eventId: string,\n relationType: string,\n eventType: string,\n opts: { from: string },\n ): Promise<{ originalEvent: MatrixEvent, events: MatrixEvent[], nextBatch?: string }> {\n const fetchedEventType = this.getEncryptedIfNeededEventType(roomId, eventType);\n const result = await this.fetchRelations(\n roomId,\n eventId,\n relationType,\n fetchedEventType,\n opts);\n const mapper = this.getEventMapper();\n let originalEvent;\n if (result.original_event) {\n originalEvent = mapper(result.original_event);\n }\n let events = result.chunk.map(mapper);\n if (fetchedEventType === EventType.RoomMessageEncrypted) {\n const allEvents = originalEvent ? events.concat(originalEvent) : events;\n await Promise.all(allEvents.map(e => {\n return new Promise(resolve => e.once(\"Event.decrypted\", resolve));\n }));\n events = events.filter(e => e.getType() === eventType);\n }\n if (originalEvent && relationType === RelationType.Replace) {\n events = events.filter(e => e.getSender() === originalEvent.getSender());\n }\n return {\n originalEvent,\n events,\n nextBatch: result.next_batch,\n };\n }\n\n /**\n * The app may wish to see if we have a key cached without\n * triggering a user interaction.\n * @return {object}\n */\n public getCrossSigningCacheCallbacks(): ICacheCallbacks {\n // XXX: Private member access\n return this.crypto?.crossSigningInfo.getCacheCallbacks();\n }\n\n /**\n * Generates a random string suitable for use as a client secret. This\n * method is experimental and may change.\n * @return {string} A new client secret\n */\n public generateClientSecret(): string {\n return randomString(32);\n }\n\n /**\n * Attempts to decrypt an event\n * @param {MatrixEvent} event The event to decrypt\n * @returns {Promise} A decryption promise\n * @param {object} options\n * @param {boolean} options.isRetry True if this is a retry (enables more logging)\n * @param {boolean} options.emit Emits \"event.decrypted\" if set to true\n */\n public decryptEventIfNeeded(event: MatrixEvent, options?: IDecryptOptions): Promise {\n if (event.shouldAttemptDecryption()) {\n event.attemptDecryption(this.crypto, options);\n }\n\n if (event.isBeingDecrypted()) {\n return event.getDecryptionPromise();\n } else {\n return Promise.resolve();\n }\n }\n\n private termsUrlForService(serviceType: SERVICE_TYPES, baseUrl: string) {\n switch (serviceType) {\n case SERVICE_TYPES.IS:\n return baseUrl + PREFIX_IDENTITY_V2 + '/terms';\n case SERVICE_TYPES.IM:\n return baseUrl + '/_matrix/integrations/v1/terms';\n default:\n throw new Error('Unsupported service type');\n }\n }\n\n /**\n * Get the Homeserver URL of this client\n * @return {string} Homeserver URL of this client\n */\n public getHomeserverUrl(): string {\n return this.baseUrl;\n }\n\n /**\n * Get the identity server URL of this client\n * @param {boolean} stripProto whether or not to strip the protocol from the URL\n * @return {string} Identity server URL of this client\n */\n public getIdentityServerUrl(stripProto = false): string {\n if (stripProto && (this.idBaseUrl.startsWith(\"http://\") ||\n this.idBaseUrl.startsWith(\"https://\"))) {\n return this.idBaseUrl.split(\"://\")[1];\n }\n return this.idBaseUrl;\n }\n\n /**\n * Set the identity server URL of this client\n * @param {string} url New identity server URL\n */\n public setIdentityServerUrl(url: string) {\n this.idBaseUrl = utils.ensureNoTrailingSlash(url);\n this.http.setIdBaseUrl(this.idBaseUrl);\n }\n\n /**\n * Get the access token associated with this account.\n * @return {?String} The access_token or null\n */\n public getAccessToken(): string {\n return this.http.opts.accessToken || null;\n }\n\n /**\n * @return {boolean} true if there is a valid access_token for this client.\n */\n public isLoggedIn(): boolean {\n return this.http.opts.accessToken !== undefined;\n }\n\n /**\n * Make up a new transaction id\n *\n * @return {string} a new, unique, transaction id\n */\n public makeTxnId(): string {\n return \"m\" + new Date().getTime() + \".\" + (this.txnCtr++);\n }\n\n /**\n * Check whether a username is available prior to registration. An error response\n * indicates an invalid/unavailable username.\n * @param {string} username The username to check the availability of.\n * @return {Promise} Resolves: to `true`.\n */\n public isUsernameAvailable(username: string): Promise {\n return this.http.authedRequest(\n undefined, \"GET\", '/register/available', { username: username },\n ).then((response) => {\n return response.available;\n });\n }\n\n /**\n * @param {string} username\n * @param {string} password\n * @param {string} sessionId\n * @param {Object} auth\n * @param {Object} bindThreepids Set key 'email' to true to bind any email\n * threepid uses during registration in the identity server. Set 'msisdn' to\n * true to bind msisdn.\n * @param {string} guestAccessToken\n * @param {string} inhibitLogin\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: TODO\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public register(\n username: string,\n password: string,\n sessionId: string,\n auth: any,\n bindThreepids: any,\n guestAccessToken: string,\n inhibitLogin: boolean,\n callback?: Callback,\n ): Promise { // TODO: Types (many)\n // backwards compat\n if (bindThreepids === true) {\n bindThreepids = { email: true };\n } else if (bindThreepids === null || bindThreepids === undefined) {\n bindThreepids = {};\n }\n if (typeof inhibitLogin === 'function') {\n callback = inhibitLogin;\n inhibitLogin = undefined;\n }\n\n if (sessionId) {\n auth.session = sessionId;\n }\n\n const params: any = {\n auth: auth,\n };\n if (username !== undefined && username !== null) {\n params.username = username;\n }\n if (password !== undefined && password !== null) {\n params.password = password;\n }\n if (bindThreepids.email) {\n params.bind_email = true;\n }\n if (bindThreepids.msisdn) {\n params.bind_msisdn = true;\n }\n if (guestAccessToken !== undefined && guestAccessToken !== null) {\n params.guest_access_token = guestAccessToken;\n }\n if (inhibitLogin !== undefined && inhibitLogin !== null) {\n params.inhibit_login = inhibitLogin;\n }\n // Temporary parameter added to make the register endpoint advertise\n // msisdn flows. This exists because there are clients that break\n // when given stages they don't recognise. This parameter will cease\n // to be necessary once these old clients are gone.\n // Only send it if we send any params at all (the password param is\n // mandatory, so if we send any params, we'll send the password param)\n if (password !== undefined && password !== null) {\n params.x_show_msisdn = true;\n }\n\n return this.registerRequest(params, undefined, callback);\n }\n\n /**\n * Register a guest account.\n * This method returns the auth info needed to create a new authenticated client,\n * Remember to call `setGuest(true)` on the (guest-)authenticated client, e.g:\n * ```javascript\n * const tmpClient = await sdk.createClient(MATRIX_INSTANCE);\n * const { user_id, device_id, access_token } = tmpClient.registerGuest();\n * const client = createClient({\n * baseUrl: MATRIX_INSTANCE,\n * accessToken: access_token,\n * userId: user_id,\n * deviceId: device_id,\n * })\n * client.setGuest(true);\n * ```\n *\n * @param {Object=} opts Registration options\n * @param {Object} opts.body JSON HTTP body to provide.\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: JSON object that contains:\n * { user_id, device_id, access_token, home_server }\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public registerGuest(opts: { body?: any }, callback?: Callback): Promise { // TODO: Types\n opts = opts || {};\n opts.body = opts.body || {};\n return this.registerRequest(opts.body, \"guest\", callback);\n }\n\n /**\n * @param {Object} data parameters for registration request\n * @param {string=} kind type of user to register. may be \"guest\"\n * @param {module:client.callback=} callback\n * @return {Promise} Resolves: to the /register response\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public registerRequest(data: any, kind?: string, callback?: Callback): Promise { // TODO: Types\n const params: any = {};\n if (kind) {\n params.kind = kind;\n }\n\n return this.http.request(callback, \"POST\", \"/register\", params, data);\n }\n\n /**\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: TODO\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public loginFlows(callback?: Callback): Promise { // TODO: Types\n return this.http.request(callback, \"GET\", \"/login\");\n }\n\n /**\n * @param {string} loginType\n * @param {Object} data\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: TODO\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public login(loginType: string, data: any, callback?: Callback): Promise { // TODO: Types\n const loginData = {\n type: loginType,\n };\n\n // merge data into loginData\n utils.extend(loginData, data);\n\n return this.http.authedRequest(\n (error, response) => {\n if (response && response.access_token && response.user_id) {\n this.http.opts.accessToken = response.access_token;\n this.credentials = {\n userId: response.user_id,\n };\n }\n\n if (callback) {\n callback(error, response);\n }\n }, \"POST\", \"/login\", undefined, loginData,\n );\n }\n\n /**\n * @param {string} user\n * @param {string} password\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: TODO\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public loginWithPassword(user: string, password: string, callback?: Callback): Promise { // TODO: Types\n return this.login(\"m.login.password\", {\n user: user,\n password: password,\n }, callback);\n }\n\n /**\n * @param {string} relayState URL Callback after SAML2 Authentication\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: TODO\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public loginWithSAML2(relayState: string, callback?: Callback): Promise { // TODO: Types\n return this.login(\"m.login.saml2\", {\n relay_state: relayState,\n }, callback);\n }\n\n /**\n * @param {string} redirectUrl The URL to redirect to after the HS\n * authenticates with CAS.\n * @return {string} The HS URL to hit to begin the CAS login process.\n */\n public getCasLoginUrl(redirectUrl: string): string {\n return this.getSsoLoginUrl(redirectUrl, \"cas\");\n }\n\n /**\n * @param {string} redirectUrl The URL to redirect to after the HS\n * authenticates with the SSO.\n * @param {string} loginType The type of SSO login we are doing (sso or cas).\n * Defaults to 'sso'.\n * @param {string} idpId The ID of the Identity Provider being targeted, optional.\n * @return {string} The HS URL to hit to begin the SSO login process.\n */\n public getSsoLoginUrl(redirectUrl: string, loginType = \"sso\", idpId?: string): string {\n let url = \"/login/\" + loginType + \"/redirect\";\n if (idpId) {\n url += \"/\" + idpId;\n }\n\n return this.http.getUrl(url, { redirectUrl }, PREFIX_R0);\n }\n\n /**\n * @param {string} token Login token previously received from homeserver\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: TODO\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public loginWithToken(token: string, callback?: Callback): Promise { // TODO: Types\n return this.login(\"m.login.token\", {\n token: token,\n }, callback);\n }\n\n /**\n * Logs out the current session.\n * Obviously, further calls that require authorisation should fail after this\n * method is called. The state of the MatrixClient object is not affected:\n * it is up to the caller to either reset or destroy the MatrixClient after\n * this method succeeds.\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: On success, the empty object\n */\n public logout(callback?: Callback): Promise<{}> {\n return this.http.authedRequest(\n callback, \"POST\", '/logout',\n );\n }\n\n /**\n * Deactivates the logged-in account.\n * Obviously, further calls that require authorisation should fail after this\n * method is called. The state of the MatrixClient object is not affected:\n * it is up to the caller to either reset or destroy the MatrixClient after\n * this method succeeds.\n * @param {object} auth Optional. Auth data to supply for User-Interactive auth.\n * @param {boolean} erase Optional. If set, send as `erase` attribute in the\n * JSON request body, indicating whether the account should be erased. Defaults\n * to false.\n * @return {Promise} Resolves: On success, the empty object\n */\n public deactivateAccount(auth?: any, erase?: boolean): Promise<{}> {\n if (typeof (erase) === 'function') {\n throw new Error('deactivateAccount no longer accepts a callback parameter');\n }\n\n const body: any = {};\n if (auth) {\n body.auth = auth;\n }\n if (erase !== undefined) {\n body.erase = erase;\n }\n\n return this.http.authedRequest(undefined, \"POST\", '/account/deactivate', undefined, body);\n }\n\n /**\n * Get the fallback URL to use for unknown interactive-auth stages.\n *\n * @param {string} loginType the type of stage being attempted\n * @param {string} authSessionId the auth session ID provided by the homeserver\n *\n * @return {string} HS URL to hit to for the fallback interface\n */\n public getFallbackAuthUrl(loginType: string, authSessionId: string): string {\n const path = utils.encodeUri(\"/auth/$loginType/fallback/web\", {\n $loginType: loginType,\n });\n\n return this.http.getUrl(path, {\n session: authSessionId,\n }, PREFIX_R0);\n }\n\n /**\n * Create a new room.\n * @param {Object} options a list of options to pass to the /createRoom API.\n * @param {string} options.room_alias_name The alias localpart to assign to\n * this room.\n * @param {string} options.visibility Either 'public' or 'private'.\n * @param {string[]} options.invite A list of user IDs to invite to this room.\n * @param {string} options.name The name to give this room.\n * @param {string} options.topic The topic to give this room.\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: {room_id: {string}}\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public async createRoom(\n options: ICreateRoomOpts,\n callback?: Callback,\n ): Promise<{ room_id: string }> { // eslint-disable-line camelcase\n // some valid options include: room_alias_name, visibility, invite\n\n // inject the id_access_token if inviting 3rd party addresses\n const invitesNeedingToken = (options.invite_3pid || [])\n .filter(i => !i.id_access_token);\n if (\n invitesNeedingToken.length > 0 &&\n this.identityServer &&\n this.identityServer.getAccessToken &&\n await this.doesServerAcceptIdentityAccessToken()\n ) {\n const identityAccessToken = await this.identityServer.getAccessToken();\n if (identityAccessToken) {\n for (const invite of invitesNeedingToken) {\n invite.id_access_token = identityAccessToken;\n }\n }\n }\n\n return this.http.authedRequest(callback, \"POST\", \"/createRoom\", undefined, options);\n }\n\n /**\n * Fetches relations for a given event\n * @param {string} roomId the room of the event\n * @param {string} eventId the id of the event\n * @param {string} relationType the rel_type of the relations requested\n * @param {string} eventType the event type of the relations requested\n * @param {Object} opts options with optional values for the request.\n * @param {Object} opts.from the pagination token returned from a previous request as `next_batch` to return following relations.\n * @return {Object} the response, with chunk and next_batch.\n */\n public async fetchRelations(\n roomId: string,\n eventId: string,\n relationType: string,\n eventType: string,\n opts: { from: string },\n ): Promise { // TODO: Types\n const queryParams: any = {};\n if (opts.from) {\n queryParams.from = opts.from;\n }\n const queryString = utils.encodeParams(queryParams);\n const path = utils.encodeUri(\n \"/rooms/$roomId/relations/$eventId/$relationType/$eventType?\" + queryString, {\n $roomId: roomId,\n $eventId: eventId,\n $relationType: relationType,\n $eventType: eventType,\n });\n return await this.http.authedRequest(\n undefined, \"GET\", path, null, null, {\n prefix: PREFIX_UNSTABLE,\n },\n );\n }\n\n /**\n * @param {string} roomId\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: TODO\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public roomState(roomId: string, callback?: Callback): Promise {\n const path = utils.encodeUri(\"/rooms/$roomId/state\", { $roomId: roomId });\n return this.http.authedRequest(callback, \"GET\", path);\n }\n\n /**\n * Get an event in a room by its event id.\n * @param {string} roomId\n * @param {string} eventId\n * @param {module:client.callback} callback Optional.\n *\n * @return {Promise} Resolves to an object containing the event.\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public fetchRoomEvent(\n roomId: string,\n eventId: string,\n callback?: Callback,\n ): Promise {\n const path = utils.encodeUri(\n \"/rooms/$roomId/event/$eventId\", {\n $roomId: roomId,\n $eventId: eventId,\n },\n );\n return this.http.authedRequest(callback, \"GET\", path);\n }\n\n /**\n * @param {string} roomId\n * @param {string} includeMembership the membership type to include in the response\n * @param {string} excludeMembership the membership type to exclude from the response\n * @param {string} atEventId the id of the event for which moment in the timeline the members should be returned for\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: dictionary of userid to profile information\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public members(\n roomId: string,\n includeMembership?: string[],\n excludeMembership?: string[],\n atEventId?: string,\n callback?: Callback,\n ): Promise<{ [userId: string]: IStateEventWithRoomId }> {\n const queryParams: any = {};\n if (includeMembership) {\n queryParams.membership = includeMembership;\n }\n if (excludeMembership) {\n queryParams.not_membership = excludeMembership;\n }\n if (atEventId) {\n queryParams.at = atEventId;\n }\n\n const queryString = utils.encodeParams(queryParams);\n\n const path = utils.encodeUri(\"/rooms/$roomId/members?\" + queryString,\n { $roomId: roomId });\n return this.http.authedRequest(callback, \"GET\", path);\n }\n\n /**\n * Upgrades a room to a new protocol version\n * @param {string} roomId\n * @param {string} newVersion The target version to upgrade to\n * @return {Promise} Resolves: Object with key 'replacement_room'\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public upgradeRoom(\n roomId: string,\n newVersion: string,\n ): Promise<{ replacement_room: string }> { // eslint-disable-line camelcase\n const path = utils.encodeUri(\"/rooms/$roomId/upgrade\", { $roomId: roomId });\n return this.http.authedRequest(\n undefined, \"POST\", path, undefined, { new_version: newVersion },\n );\n }\n\n /**\n * Retrieve a state event.\n * @param {string} roomId\n * @param {string} eventType\n * @param {string} stateKey\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: TODO\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public getStateEvent(\n roomId: string,\n eventType: string,\n stateKey: string,\n callback?: Callback,\n ): Promise {\n const pathParams = {\n $roomId: roomId,\n $eventType: eventType,\n $stateKey: stateKey,\n };\n let path = utils.encodeUri(\"/rooms/$roomId/state/$eventType\", pathParams);\n if (stateKey !== undefined) {\n path = utils.encodeUri(path + \"/$stateKey\", pathParams);\n }\n return this.http.authedRequest(\n callback, \"GET\", path,\n );\n }\n\n /**\n * @param {string} roomId\n * @param {string} eventType\n * @param {Object} content\n * @param {string} stateKey\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: TODO\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public sendStateEvent(\n roomId: string,\n eventType: string,\n content: any,\n stateKey = \"\",\n callback?: Callback,\n ): Promise {\n const pathParams = {\n $roomId: roomId,\n $eventType: eventType,\n $stateKey: stateKey,\n };\n let path = utils.encodeUri(\"/rooms/$roomId/state/$eventType\", pathParams);\n if (stateKey !== undefined) {\n path = utils.encodeUri(path + \"/$stateKey\", pathParams);\n }\n return this.http.authedRequest(callback, \"PUT\", path, undefined, content);\n }\n\n /**\n * @param {string} roomId\n * @param {Number} limit\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: TODO\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public roomInitialSync(roomId: string, limit: number, callback?: Callback): Promise {\n if (utils.isFunction(limit)) {\n callback = limit as any as Callback; // legacy\n limit = undefined;\n }\n const path = utils.encodeUri(\"/rooms/$roomId/initialSync\",\n { $roomId: roomId },\n );\n if (!limit) {\n limit = 30;\n }\n return this.http.authedRequest(\n callback, \"GET\", path, { limit: limit },\n );\n }\n\n /**\n * Set a marker to indicate the point in a room before which the user has read every\n * event. This can be retrieved from room account data (the event type is `m.fully_read`)\n * and displayed as a horizontal line in the timeline that is visually distinct to the\n * position of the user's own read receipt.\n * @param {string} roomId ID of the room that has been read\n * @param {string} rmEventId ID of the event that has been read\n * @param {string} rrEventId ID of the event tracked by the read receipt. This is here\n * for convenience because the RR and the RM are commonly updated at the same time as\n * each other. Optional.\n * @param {object} opts Options for the read markers.\n * @param {object} opts.hidden True to hide the read receipt from other users. This\n * property is currently unstable and may change in the future.\n * @return {Promise} Resolves: the empty object, {}.\n */\n public setRoomReadMarkersHttpRequest(\n roomId: string,\n rmEventId: string,\n rrEventId: string,\n opts: { hidden?: boolean },\n ): Promise<{}> {\n const path = utils.encodeUri(\"/rooms/$roomId/read_markers\", {\n $roomId: roomId,\n });\n\n const content = {\n \"m.fully_read\": rmEventId,\n \"m.read\": rrEventId,\n \"org.matrix.msc2285.hidden\": Boolean(opts ? opts.hidden : false),\n };\n\n return this.http.authedRequest(undefined, \"POST\", path, undefined, content);\n }\n\n /**\n * @return {Promise} Resolves: A list of the user's current rooms\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public getJoinedRooms(): Promise {\n const path = utils.encodeUri(\"/joined_rooms\", {});\n return this.http.authedRequest(undefined, \"GET\", path);\n }\n\n /**\n * Retrieve membership info. for a room.\n * @param {string} roomId ID of the room to get membership for\n * @return {Promise} Resolves: A list of currently joined users\n * and their profile data.\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public getJoinedRoomMembers(roomId: string): Promise {\n const path = utils.encodeUri(\"/rooms/$roomId/joined_members\", {\n $roomId: roomId,\n });\n return this.http.authedRequest(undefined, \"GET\", path);\n }\n\n /**\n * @param {Object} options Options for this request\n * @param {string} options.server The remote server to query for the room list.\n * Optional. If unspecified, get the local home\n * server's public room list.\n * @param {number} options.limit Maximum number of entries to return\n * @param {string} options.since Token to paginate from\n * @param {object} options.filter Filter parameters\n * @param {string} options.filter.generic_search_term String to search for\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: TODO\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public publicRooms(options: IRoomDirectoryOptions, callback?: Callback): Promise {\n if (typeof (options) == 'function') {\n callback = options;\n options = {};\n }\n if (options === undefined) {\n options = {};\n }\n\n const queryParams: any = {};\n if (options.server) {\n queryParams.server = options.server;\n delete options.server;\n }\n\n if (Object.keys(options).length === 0 && Object.keys(queryParams).length === 0) {\n return this.http.authedRequest(callback, \"GET\", \"/publicRooms\");\n } else {\n return this.http.authedRequest(callback, \"POST\", \"/publicRooms\", queryParams, options);\n }\n }\n\n /**\n * Create an alias to room ID mapping.\n * @param {string} alias The room alias to create.\n * @param {string} roomId The room ID to link the alias to.\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: an empty object {}\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public createAlias(alias: string, roomId: string, callback?: Callback): Promise<{}> {\n const path = utils.encodeUri(\"/directory/room/$alias\", {\n $alias: alias,\n });\n const data = {\n room_id: roomId,\n };\n return this.http.authedRequest(callback, \"PUT\", path, undefined, data);\n }\n\n /**\n * Delete an alias to room ID mapping. This alias must be on your local server\n * and you must have sufficient access to do this operation.\n * @param {string} alias The room alias to delete.\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: an empty object.\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public deleteAlias(alias: string, callback?: Callback): Promise<{}> {\n const path = utils.encodeUri(\"/directory/room/$alias\", {\n $alias: alias,\n });\n return this.http.authedRequest(callback, \"DELETE\", path, undefined, undefined);\n }\n\n /**\n * @param {string} roomId\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: an object with an `aliases` property, containing an array of local aliases\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public unstableGetLocalAliases(roomId: string, callback?: Callback): Promise<{ aliases: string[] }> {\n const path = utils.encodeUri(\"/rooms/$roomId/aliases\",\n { $roomId: roomId });\n const prefix = PREFIX_UNSTABLE + \"/org.matrix.msc2432\";\n return this.http.authedRequest(callback, \"GET\", path, null, null, { prefix });\n }\n\n /**\n * Get room info for the given alias.\n * @param {string} alias The room alias to resolve.\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: Object with room_id and servers.\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public getRoomIdForAlias(\n alias: string,\n callback?: Callback,\n ): Promise<{ room_id: string, servers: string[] }> { // eslint-disable-line camelcase\n // TODO: deprecate this or resolveRoomAlias\n const path = utils.encodeUri(\"/directory/room/$alias\", {\n $alias: alias,\n });\n return this.http.authedRequest(callback, \"GET\", path);\n }\n\n /**\n * @param {string} roomAlias\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: Object with room_id and servers.\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n // eslint-disable-next-line camelcase\n public resolveRoomAlias(roomAlias: string, callback?: Callback): Promise<{ room_id: string, servers: string[] }> {\n // TODO: deprecate this or getRoomIdForAlias\n const path = utils.encodeUri(\"/directory/room/$alias\", { $alias: roomAlias });\n return this.http.request(callback, \"GET\", path);\n }\n\n /**\n * Get the visibility of a room in the current HS's room directory\n * @param {string} roomId\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: TODO\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public getRoomDirectoryVisibility(roomId: string, callback?: Callback): Promise<{ visibility: Visibility }> {\n const path = utils.encodeUri(\"/directory/list/room/$roomId\", {\n $roomId: roomId,\n });\n return this.http.authedRequest(callback, \"GET\", path);\n }\n\n /**\n * Set the visbility of a room in the current HS's room directory\n * @param {string} roomId\n * @param {string} visibility \"public\" to make the room visible\n * in the public directory, or \"private\" to make\n * it invisible.\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: result object\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public setRoomDirectoryVisibility(roomId: string, visibility: Visibility, callback?: Callback): Promise<{}> {\n const path = utils.encodeUri(\"/directory/list/room/$roomId\", {\n $roomId: roomId,\n });\n return this.http.authedRequest(callback, \"PUT\", path, undefined, { visibility });\n }\n\n /**\n * Set the visbility of a room bridged to a 3rd party network in\n * the current HS's room directory.\n * @param {string} networkId the network ID of the 3rd party\n * instance under which this room is published under.\n * @param {string} roomId\n * @param {string} visibility \"public\" to make the room visible\n * in the public directory, or \"private\" to make\n * it invisible.\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: result object\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public setRoomDirectoryVisibilityAppService(\n networkId: string,\n roomId: string,\n visibility: \"public\" | \"private\",\n callback?: Callback,\n ): Promise { // TODO: Types\n const path = utils.encodeUri(\"/directory/list/appservice/$networkId/$roomId\", {\n $networkId: networkId,\n $roomId: roomId,\n });\n return this.http.authedRequest(\n callback, \"PUT\", path, undefined, { \"visibility\": visibility },\n );\n }\n\n /**\n * Query the user directory with a term matching user IDs, display names and domains.\n * @param {object} opts options\n * @param {string} opts.term the term with which to search.\n * @param {number} opts.limit the maximum number of results to return. The server will\n * apply a limit if unspecified.\n * @return {Promise} Resolves: an array of results.\n */\n public searchUserDirectory(opts: { term: string, limit?: number }): Promise {\n const body: any = {\n search_term: opts.term,\n };\n\n if (opts.limit !== undefined) {\n body.limit = opts.limit;\n }\n\n return this.http.authedRequest(undefined, \"POST\", \"/user_directory/search\", undefined, body);\n }\n\n /**\n * Upload a file to the media repository on the homeserver.\n *\n * @param {object} file The object to upload. On a browser, something that\n * can be sent to XMLHttpRequest.send (typically a File). Under node.js,\n * a a Buffer, String or ReadStream.\n *\n * @param {object} opts options object\n *\n * @param {string=} opts.name Name to give the file on the server. Defaults\n * to file.name.\n *\n * @param {boolean=} opts.includeFilename if false will not send the filename,\n * e.g for encrypted file uploads where filename leaks are undesirable.\n * Defaults to true.\n *\n * @param {string=} opts.type Content-type for the upload. Defaults to\n * file.type, or applicaton/octet-stream.\n *\n * @param {boolean=} opts.rawResponse Return the raw body, rather than\n * parsing the JSON. Defaults to false (except on node.js, where it\n * defaults to true for backwards compatibility).\n *\n * @param {boolean=} opts.onlyContentUri Just return the content URI,\n * rather than the whole body. Defaults to false (except on browsers,\n * where it defaults to true for backwards compatibility). Ignored if\n * opts.rawResponse is true.\n *\n * @param {Function=} opts.callback Deprecated. Optional. The callback to\n * invoke on success/failure. See the promise return values for more\n * information.\n *\n * @param {Function=} opts.progressHandler Optional. Called when a chunk of\n * data has been uploaded, with an object containing the fields `loaded`\n * (number of bytes transferred) and `total` (total size, if known).\n *\n * @return {Promise} Resolves to response object, as\n * determined by this.opts.onlyData, opts.rawResponse, and\n * opts.onlyContentUri. Rejects with an error (usually a MatrixError).\n */\n public uploadContent(\n file: File | String | Buffer | ReadStream | Blob,\n opts?: IUploadOpts,\n ): IAbortablePromise { // TODO: Advanced types\n return this.http.uploadContent(file, opts);\n }\n\n /**\n * Cancel a file upload in progress\n * @param {Promise} promise The promise returned from uploadContent\n * @return {boolean} true if canceled, otherwise false\n */\n public cancelUpload(promise: IAbortablePromise): boolean {\n return this.http.cancelUpload(promise);\n }\n\n /**\n * Get a list of all file uploads in progress\n * @return {array} Array of objects representing current uploads.\n * Currently in progress is element 0. Keys:\n * - promise: The promise associated with the upload\n * - loaded: Number of bytes uploaded\n * - total: Total number of bytes to upload\n */\n public getCurrentUploads(): { promise: Promise, loaded: number, total: number }[] { // TODO: Advanced types (promise)\n return this.http.getCurrentUploads();\n }\n\n /**\n * @param {string} userId\n * @param {string} info The kind of info to retrieve (e.g. 'displayname',\n * 'avatar_url').\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: TODO\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public getProfileInfo(\n userId: string,\n info?: string,\n callback?: Callback,\n // eslint-disable-next-line camelcase\n ): Promise<{ avatar_url?: string, displayname?: string }> {\n if (utils.isFunction(info)) {\n callback = info as any as Callback; // legacy\n info = undefined;\n }\n\n const path = info ?\n utils.encodeUri(\"/profile/$userId/$info\",\n { $userId: userId, $info: info }) :\n utils.encodeUri(\"/profile/$userId\",\n { $userId: userId });\n return this.http.authedRequest(callback, \"GET\", path);\n }\n\n /**\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves to a list of the user's threepids.\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public getThreePids(callback?: Callback): Promise<{ threepids: IThreepid[] }> {\n const path = \"/account/3pid\";\n return this.http.authedRequest(callback, \"GET\", path, undefined, undefined);\n }\n\n /**\n * Add a 3PID to your homeserver account and optionally bind it to an identity\n * server as well. An identity server is required as part of the `creds` object.\n *\n * This API is deprecated, and you should instead use `addThreePidOnly`\n * for homeservers that support it.\n *\n * @param {Object} creds\n * @param {boolean} bind\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: on success\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public addThreePid(creds: any, bind: boolean, callback?: Callback): Promise { // TODO: Types\n const path = \"/account/3pid\";\n const data = {\n 'threePidCreds': creds,\n 'bind': bind,\n };\n return this.http.authedRequest(\n callback, \"POST\", path, null, data,\n );\n }\n\n /**\n * Add a 3PID to your homeserver account. This API does not use an identity\n * server, as the homeserver is expected to handle 3PID ownership validation.\n *\n * You can check whether a homeserver supports this API via\n * `doesServerSupportSeparateAddAndBind`.\n *\n * @param {Object} data A object with 3PID validation data from having called\n * `account/3pid//requestToken` on the homeserver.\n * @return {Promise} Resolves: on success\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public async addThreePidOnly(data: IAddThreePidOnlyBody): Promise<{}> {\n const path = \"/account/3pid/add\";\n const prefix = await this.isVersionSupported(\"r0.6.0\") ? PREFIX_R0 : PREFIX_UNSTABLE;\n return this.http.authedRequest(undefined, \"POST\", path, null, data, { prefix });\n }\n\n /**\n * Bind a 3PID for discovery onto an identity server via the homeserver. The\n * identity server handles 3PID ownership validation and the homeserver records\n * the new binding to track where all 3PIDs for the account are bound.\n *\n * You can check whether a homeserver supports this API via\n * `doesServerSupportSeparateAddAndBind`.\n *\n * @param {Object} data A object with 3PID validation data from having called\n * `validate//requestToken` on the identity server. It should also\n * contain `id_server` and `id_access_token` fields as well.\n * @return {Promise} Resolves: on success\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public async bindThreePid(data: IBindThreePidBody): Promise<{}> {\n const path = \"/account/3pid/bind\";\n const prefix = await this.isVersionSupported(\"r0.6.0\") ?\n PREFIX_R0 : PREFIX_UNSTABLE;\n return this.http.authedRequest(\n undefined, \"POST\", path, null, data, { prefix },\n );\n }\n\n /**\n * Unbind a 3PID for discovery on an identity server via the homeserver. The\n * homeserver removes its record of the binding to keep an updated record of\n * where all 3PIDs for the account are bound.\n *\n * @param {string} medium The threepid medium (eg. 'email')\n * @param {string} address The threepid address (eg. 'bob@example.com')\n * this must be as returned by getThreePids.\n * @return {Promise} Resolves: on success\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public async unbindThreePid(\n medium: string,\n address: string,\n // eslint-disable-next-line camelcase\n ): Promise<{ id_server_unbind_result: IdServerUnbindResult }> {\n const path = \"/account/3pid/unbind\";\n const data = {\n medium,\n address,\n id_server: this.getIdentityServerUrl(true),\n };\n const prefix = await this.isVersionSupported(\"r0.6.0\") ? PREFIX_R0 : PREFIX_UNSTABLE;\n return this.http.authedRequest(undefined, \"POST\", path, null, data, { prefix });\n }\n\n /**\n * @param {string} medium The threepid medium (eg. 'email')\n * @param {string} address The threepid address (eg. 'bob@example.com')\n * this must be as returned by getThreePids.\n * @return {Promise} Resolves: The server response on success\n * (generally the empty JSON object)\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public deleteThreePid(\n medium: string,\n address: string,\n // eslint-disable-next-line camelcase\n ): Promise<{ id_server_unbind_result: IdServerUnbindResult }> {\n const path = \"/account/3pid/delete\";\n return this.http.authedRequest(undefined, \"POST\", path, null, { medium, address });\n }\n\n /**\n * Make a request to change your password.\n * @param {Object} authDict\n * @param {string} newPassword The new desired password.\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: TODO\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public setPassword(authDict: any, newPassword: string, callback?: Callback): Promise { // TODO: Types\n const path = \"/account/password\";\n const data = {\n 'auth': authDict,\n 'new_password': newPassword,\n };\n\n return this.http.authedRequest(\n callback, \"POST\", path, null, data,\n );\n }\n\n /**\n * Gets all devices recorded for the logged-in user\n * @return {Promise} Resolves: result object\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public getDevices(): Promise<{ devices: IMyDevice[] }> {\n return this.http.authedRequest(undefined, 'GET', \"/devices\", undefined, undefined);\n }\n\n /**\n * Gets specific device details for the logged-in user\n * @param {string} deviceId device to query\n * @return {Promise} Resolves: result object\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public getDevice(deviceId: string): Promise {\n const path = utils.encodeUri(\"/devices/$device_id\", {\n $device_id: deviceId,\n });\n return this.http.authedRequest(undefined, 'GET', path, undefined, undefined);\n }\n\n /**\n * Update the given device\n *\n * @param {string} deviceId device to update\n * @param {Object} body body of request\n * @return {Promise} Resolves: result object\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n // eslint-disable-next-line camelcase\n public setDeviceDetails(deviceId: string, body: { display_name: string }): Promise<{}> {\n const path = utils.encodeUri(\"/devices/$device_id\", {\n $device_id: deviceId,\n });\n\n return this.http.authedRequest(undefined, \"PUT\", path, undefined, body);\n }\n\n /**\n * Delete the given device\n *\n * @param {string} deviceId device to delete\n * @param {object} auth Optional. Auth data to supply for User-Interactive auth.\n * @return {Promise} Resolves: result object\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public deleteDevice(deviceId: string, auth?: any): Promise { // TODO: Types\n const path = utils.encodeUri(\"/devices/$device_id\", {\n $device_id: deviceId,\n });\n\n const body: any = {};\n\n if (auth) {\n body.auth = auth;\n }\n\n return this.http.authedRequest(undefined, \"DELETE\", path, undefined, body);\n }\n\n /**\n * Delete multiple device\n *\n * @param {string[]} devices IDs of the devices to delete\n * @param {object} auth Optional. Auth data to supply for User-Interactive auth.\n * @return {Promise} Resolves: result object\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public deleteMultipleDevices(devices: string[], auth?: any): Promise { // TODO: Types\n const body: any = { devices };\n\n if (auth) {\n body.auth = auth;\n }\n\n const path = \"/delete_devices\";\n return this.http.authedRequest(undefined, \"POST\", path, undefined, body);\n }\n\n /**\n * Gets all pushers registered for the logged-in user\n *\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: Array of objects representing pushers\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public getPushers(callback?: Callback): Promise<{ pushers: IPusher[] }> {\n const path = \"/pushers\";\n return this.http.authedRequest(callback, \"GET\", path, undefined, undefined);\n }\n\n /**\n * Adds a new pusher or updates an existing pusher\n *\n * @param {IPusherRequest} pusher Object representing a pusher\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: Empty json object on success\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public setPusher(pusher: IPusherRequest, callback?: Callback): Promise<{}> {\n const path = \"/pushers/set\";\n return this.http.authedRequest(callback, \"POST\", path, null, pusher);\n }\n\n /**\n * Get the push rules for the account from the server.\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves to the push rules.\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public getPushRules(callback?: Callback): Promise {\n return this.http.authedRequest(callback, \"GET\", \"/pushrules/\").then(rules => {\n return PushProcessor.rewriteDefaultRules(rules);\n });\n }\n\n /**\n * @param {string} scope\n * @param {string} kind\n * @param {string} ruleId\n * @param {Object} body\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: an empty object {}\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public addPushRule(\n scope: string,\n kind: PushRuleKind,\n ruleId: Exclude,\n body: any,\n callback?: Callback,\n ): Promise { // TODO: Types\n // NB. Scope not uri encoded because devices need the '/'\n const path = utils.encodeUri(\"/pushrules/\" + scope + \"/$kind/$ruleId\", {\n $kind: kind,\n $ruleId: ruleId,\n });\n return this.http.authedRequest(callback, \"PUT\", path, undefined, body);\n }\n\n /**\n * @param {string} scope\n * @param {string} kind\n * @param {string} ruleId\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: an empty object {}\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public deletePushRule(\n scope: string,\n kind: PushRuleKind,\n ruleId: Exclude,\n callback?: Callback,\n ): Promise { // TODO: Types\n // NB. Scope not uri encoded because devices need the '/'\n const path = utils.encodeUri(\"/pushrules/\" + scope + \"/$kind/$ruleId\", {\n $kind: kind,\n $ruleId: ruleId,\n });\n return this.http.authedRequest(callback, \"DELETE\", path);\n }\n\n /**\n * Enable or disable a push notification rule.\n * @param {string} scope\n * @param {string} kind\n * @param {string} ruleId\n * @param {boolean} enabled\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: result object\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public setPushRuleEnabled(\n scope: string,\n kind: PushRuleKind,\n ruleId: RuleId | string,\n enabled: boolean,\n callback?: Callback,\n ): Promise<{}> {\n const path = utils.encodeUri(\"/pushrules/\" + scope + \"/$kind/$ruleId/enabled\", {\n $kind: kind,\n $ruleId: ruleId,\n });\n return this.http.authedRequest(\n callback, \"PUT\", path, undefined, { \"enabled\": enabled },\n );\n }\n\n /**\n * Set the actions for a push notification rule.\n * @param {string} scope\n * @param {string} kind\n * @param {string} ruleId\n * @param {array} actions\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: result object\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public setPushRuleActions(\n scope: string,\n kind: PushRuleKind,\n ruleId: RuleId | string,\n actions: PushRuleAction[],\n callback?: Callback,\n ): Promise<{}> {\n const path = utils.encodeUri(\"/pushrules/\" + scope + \"/$kind/$ruleId/actions\", {\n $kind: kind,\n $ruleId: ruleId,\n });\n return this.http.authedRequest(\n callback, \"PUT\", path, undefined, { \"actions\": actions },\n );\n }\n\n /**\n * Perform a server-side search.\n * @param {Object} opts\n * @param {string} opts.next_batch the batch token to pass in the query string\n * @param {Object} opts.body the JSON object to pass to the request body.\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: TODO\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public search(\n opts: { body: ISearchRequestBody, next_batch?: string }, // eslint-disable-line camelcase\n callback?: Callback,\n ): Promise {\n const queryParams: any = {};\n if (opts.next_batch) {\n queryParams.next_batch = opts.next_batch;\n }\n return this.http.authedRequest(callback, \"POST\", \"/search\", queryParams, opts.body);\n }\n\n /**\n * Upload keys\n *\n * @param {Object} content body of upload request\n *\n * @param {Object=} opts this method no longer takes any opts,\n * used to take opts.device_id but this was not removed from the spec as a redundant parameter\n *\n * @param {module:client.callback=} callback\n *\n * @return {Promise} Resolves: result object. Rejects: with\n * an error response ({@link module:http-api.MatrixError}).\n */\n public uploadKeysRequest(\n content: IUploadKeysRequest,\n opts?: void,\n callback?: Callback,\n ): Promise {\n return this.http.authedRequest(callback, \"POST\", \"/keys/upload\", undefined, content);\n }\n\n public uploadKeySignatures(content: KeySignatures): Promise {\n return this.http.authedRequest(\n undefined, \"POST\", '/keys/signatures/upload', undefined,\n content, {\n prefix: PREFIX_UNSTABLE,\n },\n );\n }\n\n /**\n * Download device keys\n *\n * @param {string[]} userIds list of users to get keys for\n *\n * @param {Object=} opts\n *\n * @param {string=} opts.token sync token to pass in the query request, to help\n * the HS give the most recent results\n *\n * @return {Promise} Resolves: result object. Rejects: with\n * an error response ({@link module:http-api.MatrixError}).\n */\n public downloadKeysForUsers(userIds: string[], opts: { token?: string }): Promise {\n if (utils.isFunction(opts)) {\n // opts used to be 'callback'.\n throw new Error('downloadKeysForUsers no longer accepts a callback parameter');\n }\n opts = opts || {};\n\n const content: any = {\n device_keys: {},\n };\n if ('token' in opts) {\n content.token = opts.token;\n }\n userIds.forEach((u) => {\n content.device_keys[u] = [];\n });\n\n return this.http.authedRequest(undefined, \"POST\", \"/keys/query\", undefined, content);\n }\n\n /**\n * Claim one-time keys\n *\n * @param {string[]} devices a list of [userId, deviceId] pairs\n *\n * @param {string} [keyAlgorithm = signed_curve25519] desired key type\n *\n * @param {number} [timeout] the time (in milliseconds) to wait for keys from remote\n * servers\n *\n * @return {Promise} Resolves: result object. Rejects: with\n * an error response ({@link module:http-api.MatrixError}).\n */\n public claimOneTimeKeys(\n devices: string[],\n keyAlgorithm = \"signed_curve25519\",\n timeout?: number,\n ): Promise {\n const queries = {};\n\n if (keyAlgorithm === undefined) {\n keyAlgorithm = \"signed_curve25519\";\n }\n\n for (let i = 0; i < devices.length; ++i) {\n const userId = devices[i][0];\n const deviceId = devices[i][1];\n const query = queries[userId] || {};\n queries[userId] = query;\n query[deviceId] = keyAlgorithm;\n }\n const content: any = { one_time_keys: queries };\n if (timeout) {\n content.timeout = timeout;\n }\n const path = \"/keys/claim\";\n return this.http.authedRequest(undefined, \"POST\", path, undefined, content);\n }\n\n /**\n * Ask the server for a list of users who have changed their device lists\n * between a pair of sync tokens\n *\n * @param {string} oldToken\n * @param {string} newToken\n *\n * @return {Promise} Resolves: result object. Rejects: with\n * an error response ({@link module:http-api.MatrixError}).\n */\n public getKeyChanges(oldToken: string, newToken: string): Promise<{ changed: string[], left: string[] }> {\n const qps = {\n from: oldToken,\n to: newToken,\n };\n\n const path = \"/keys/changes\";\n return this.http.authedRequest(undefined, \"GET\", path, qps, undefined);\n }\n\n public uploadDeviceSigningKeys(auth: any, keys: CrossSigningKeys): Promise<{}> { // TODO: types\n const data = Object.assign({}, keys);\n if (auth) Object.assign(data, { auth });\n return this.http.authedRequest(\n undefined, \"POST\", \"/keys/device_signing/upload\", undefined, data, {\n prefix: PREFIX_UNSTABLE,\n },\n );\n }\n\n /**\n * Register with an identity server using the OpenID token from the user's\n * Homeserver, which can be retrieved via\n * {@link module:client~MatrixClient#getOpenIdToken}.\n *\n * Note that the `/account/register` endpoint (as well as IS authentication in\n * general) was added as part of the v2 API version.\n *\n * @param {object} hsOpenIdToken\n * @return {Promise} Resolves: with object containing an Identity\n * Server access token.\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public registerWithIdentityServer(hsOpenIdToken: any): Promise { // TODO: Types\n if (!this.idBaseUrl) {\n throw new Error(\"No identity server base URL set\");\n }\n\n const uri = this.idBaseUrl + PREFIX_IDENTITY_V2 + \"/account/register\";\n return this.http.requestOtherUrl(\n undefined, \"POST\", uri,\n null, hsOpenIdToken,\n );\n }\n\n /**\n * Requests an email verification token directly from an identity server.\n *\n * This API is used as part of binding an email for discovery on an identity\n * server. The validation data that results should be passed to the\n * `bindThreePid` method to complete the binding process.\n *\n * @param {string} email The email address to request a token for\n * @param {string} clientSecret A secret binary string generated by the client.\n * It is recommended this be around 16 ASCII characters.\n * @param {number} sendAttempt If an identity server sees a duplicate request\n * with the same sendAttempt, it will not send another email.\n * To request another email to be sent, use a larger value for\n * the sendAttempt param as was used in the previous request.\n * @param {string} nextLink Optional If specified, the client will be redirected\n * to this link after validation.\n * @param {module:client.callback} callback Optional.\n * @param {string} identityAccessToken The `access_token` field of the identity\n * server `/account/register` response (see {@link registerWithIdentityServer}).\n *\n * @return {Promise} Resolves: TODO\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n * @throws Error if no identity server is set\n */\n public async requestEmailToken(\n email: string,\n clientSecret: string,\n sendAttempt: number,\n nextLink: string,\n callback?: Callback,\n identityAccessToken?: string,\n ): Promise { // TODO: Types\n const params = {\n client_secret: clientSecret,\n email: email,\n send_attempt: sendAttempt,\n next_link: nextLink,\n };\n\n return await this.http.idServerRequest(\n callback, \"POST\", \"/validate/email/requestToken\",\n params, PREFIX_IDENTITY_V2, identityAccessToken,\n );\n }\n\n /**\n * Requests a MSISDN verification token directly from an identity server.\n *\n * This API is used as part of binding a MSISDN for discovery on an identity\n * server. The validation data that results should be passed to the\n * `bindThreePid` method to complete the binding process.\n *\n * @param {string} phoneCountry The ISO 3166-1 alpha-2 code for the country in\n * which phoneNumber should be parsed relative to.\n * @param {string} phoneNumber The phone number, in national or international\n * format\n * @param {string} clientSecret A secret binary string generated by the client.\n * It is recommended this be around 16 ASCII characters.\n * @param {number} sendAttempt If an identity server sees a duplicate request\n * with the same sendAttempt, it will not send another SMS.\n * To request another SMS to be sent, use a larger value for\n * the sendAttempt param as was used in the previous request.\n * @param {string} nextLink Optional If specified, the client will be redirected\n * to this link after validation.\n * @param {module:client.callback} callback Optional.\n * @param {string} identityAccessToken The `access_token` field of the Identity\n * Server `/account/register` response (see {@link registerWithIdentityServer}).\n *\n * @return {Promise} Resolves: TODO\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n * @throws Error if no identity server is set\n */\n public async requestMsisdnToken(\n phoneCountry: string,\n phoneNumber: string,\n clientSecret: string,\n sendAttempt: number,\n nextLink: string,\n callback?: Callback,\n identityAccessToken?: string,\n ): Promise { // TODO: Types\n const params = {\n client_secret: clientSecret,\n country: phoneCountry,\n phone_number: phoneNumber,\n send_attempt: sendAttempt,\n next_link: nextLink,\n };\n\n return await this.http.idServerRequest(\n callback, \"POST\", \"/validate/msisdn/requestToken\",\n params, PREFIX_IDENTITY_V2, identityAccessToken,\n );\n }\n\n /**\n * Submits a MSISDN token to the identity server\n *\n * This is used when submitting the code sent by SMS to a phone number.\n * The identity server has an equivalent API for email but the js-sdk does\n * not expose this, since email is normally validated by the user clicking\n * a link rather than entering a code.\n *\n * @param {string} sid The sid given in the response to requestToken\n * @param {string} clientSecret A secret binary string generated by the client.\n * This must be the same value submitted in the requestToken call.\n * @param {string} msisdnToken The MSISDN token, as enetered by the user.\n * @param {string} identityAccessToken The `access_token` field of the Identity\n * Server `/account/register` response (see {@link registerWithIdentityServer}).\n *\n * @return {Promise} Resolves: Object, currently with no parameters.\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n * @throws Error if No identity server is set\n */\n public async submitMsisdnToken(\n sid: string,\n clientSecret: string,\n msisdnToken: string,\n identityAccessToken: string,\n ): Promise { // TODO: Types\n const params = {\n sid: sid,\n client_secret: clientSecret,\n token: msisdnToken,\n };\n\n return await this.http.idServerRequest(\n undefined, \"POST\", \"/validate/msisdn/submitToken\",\n params, PREFIX_IDENTITY_V2, identityAccessToken,\n );\n }\n\n /**\n * Submits a MSISDN token to an arbitrary URL.\n *\n * This is used when submitting the code sent by SMS to a phone number in the\n * newer 3PID flow where the homeserver validates 3PID ownership (as part of\n * `requestAdd3pidMsisdnToken`). The homeserver response may include a\n * `submit_url` to specify where the token should be sent, and this helper can\n * be used to pass the token to this URL.\n *\n * @param {string} url The URL to submit the token to\n * @param {string} sid The sid given in the response to requestToken\n * @param {string} clientSecret A secret binary string generated by the client.\n * This must be the same value submitted in the requestToken call.\n * @param {string} msisdnToken The MSISDN token, as enetered by the user.\n *\n * @return {Promise} Resolves: Object, currently with no parameters.\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public submitMsisdnTokenOtherUrl(\n url: string,\n sid: string,\n clientSecret: string,\n msisdnToken: string,\n ): Promise { // TODO: Types\n const params = {\n sid: sid,\n client_secret: clientSecret,\n token: msisdnToken,\n };\n\n return this.http.requestOtherUrl(\n undefined, \"POST\", url, undefined, params,\n );\n }\n\n /**\n * Gets the V2 hashing information from the identity server. Primarily useful for\n * lookups.\n * @param {string} identityAccessToken The access token for the identity server.\n * @returns {Promise} The hashing information for the identity server.\n */\n public getIdentityHashDetails(identityAccessToken: string): Promise { // TODO: Types\n return this.http.idServerRequest(\n undefined, \"GET\", \"/hash_details\",\n null, PREFIX_IDENTITY_V2, identityAccessToken,\n );\n }\n\n /**\n * Performs a hashed lookup of addresses against the identity server. This is\n * only supported on identity servers which have at least the version 2 API.\n * @param {Array>} addressPairs An array of 2 element arrays.\n * The first element of each pair is the address, the second is the 3PID medium.\n * Eg: [\"email@example.org\", \"email\"]\n * @param {string} identityAccessToken The access token for the identity server.\n * @returns {Promise>} A collection of address mappings to\n * found MXIDs. Results where no user could be found will not be listed.\n */\n public async identityHashedLookup(\n addressPairs: [string, string][],\n identityAccessToken: string,\n ): Promise<{ address: string, mxid: string }[]> {\n const params = {\n // addresses: [\"email@example.org\", \"10005550000\"],\n // algorithm: \"sha256\",\n // pepper: \"abc123\"\n };\n\n // Get hash information first before trying to do a lookup\n const hashes = await this.getIdentityHashDetails(identityAccessToken);\n if (!hashes || !hashes['lookup_pepper'] || !hashes['algorithms']) {\n throw new Error(\"Unsupported identity server: bad response\");\n }\n\n params['pepper'] = hashes['lookup_pepper'];\n\n const localMapping = {\n // hashed identifier => plain text address\n // For use in this function's return format\n };\n\n // When picking an algorithm, we pick the hashed over no hashes\n if (hashes['algorithms'].includes('sha256')) {\n // Abuse the olm hashing\n const olmutil = new global.Olm.Utility();\n params[\"addresses\"] = addressPairs.map(p => {\n const addr = p[0].toLowerCase(); // lowercase to get consistent hashes\n const med = p[1].toLowerCase();\n const hashed = olmutil.sha256(`${addr} ${med} ${params['pepper']}`)\n .replace(/\\+/g, '-').replace(/\\//g, '_'); // URL-safe base64\n // Map the hash to a known (case-sensitive) address. We use the case\n // sensitive version because the caller might be expecting that.\n localMapping[hashed] = p[0];\n return hashed;\n });\n params[\"algorithm\"] = \"sha256\";\n } else if (hashes['algorithms'].includes('none')) {\n params[\"addresses\"] = addressPairs.map(p => {\n const addr = p[0].toLowerCase(); // lowercase to get consistent hashes\n const med = p[1].toLowerCase();\n const unhashed = `${addr} ${med}`;\n // Map the unhashed values to a known (case-sensitive) address. We use\n // the case sensitive version because the caller might be expecting that.\n localMapping[unhashed] = p[0];\n return unhashed;\n });\n params[\"algorithm\"] = \"none\";\n } else {\n throw new Error(\"Unsupported identity server: unknown hash algorithm\");\n }\n\n const response = await this.http.idServerRequest(\n undefined, \"POST\", \"/lookup\",\n params, PREFIX_IDENTITY_V2, identityAccessToken,\n );\n\n if (!response || !response['mappings']) return []; // no results\n\n const foundAddresses = [/* {address: \"plain@example.org\", mxid} */];\n for (const hashed of Object.keys(response['mappings'])) {\n const mxid = response['mappings'][hashed];\n const plainAddress = localMapping[hashed];\n if (!plainAddress) {\n throw new Error(\"Identity server returned more results than expected\");\n }\n\n foundAddresses.push({ address: plainAddress, mxid });\n }\n return foundAddresses;\n }\n\n /**\n * Looks up the public Matrix ID mapping for a given 3rd party\n * identifier from the identity server\n *\n * @param {string} medium The medium of the threepid, eg. 'email'\n * @param {string} address The textual address of the threepid\n * @param {module:client.callback} callback Optional.\n * @param {string} identityAccessToken The `access_token` field of the Identity\n * Server `/account/register` response (see {@link registerWithIdentityServer}).\n *\n * @return {Promise} Resolves: A threepid mapping\n * object or the empty object if no mapping\n * exists\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public async lookupThreePid(\n medium: string,\n address: string,\n callback?: Callback,\n identityAccessToken?: string,\n ): Promise { // TODO: Types\n // Note: we're using the V2 API by calling this function, but our\n // function contract requires a V1 response. We therefore have to\n // convert it manually.\n const response = await this.identityHashedLookup(\n [[address, medium]], identityAccessToken,\n );\n const result = response.find(p => p.address === address);\n if (!result) {\n if (callback) callback(null, {});\n return {};\n }\n\n const mapping = {\n address,\n medium,\n mxid: result.mxid,\n\n // We can't reasonably fill these parameters:\n // not_before\n // not_after\n // ts\n // signatures\n };\n\n if (callback) callback(null, mapping);\n return mapping;\n }\n\n /**\n * Looks up the public Matrix ID mappings for multiple 3PIDs.\n *\n * @param {Array.>} query Array of arrays containing\n * [medium, address]\n * @param {string} identityAccessToken The `access_token` field of the Identity\n * Server `/account/register` response (see {@link registerWithIdentityServer}).\n *\n * @return {Promise} Resolves: Lookup results from IS.\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public async bulkLookupThreePids(query: [string, string][], identityAccessToken: string): Promise { // TODO: Types\n // Note: we're using the V2 API by calling this function, but our\n // function contract requires a V1 response. We therefore have to\n // convert it manually.\n const response = await this.identityHashedLookup(\n // We have to reverse the query order to get [address, medium] pairs\n query.map(p => [p[1], p[0]]), identityAccessToken,\n );\n\n const v1results = [];\n for (const mapping of response) {\n const originalQuery = query.find(p => p[1] === mapping.address);\n if (!originalQuery) {\n throw new Error(\"Identity sever returned unexpected results\");\n }\n\n v1results.push([\n originalQuery[0], // medium\n mapping.address,\n mapping.mxid,\n ]);\n }\n\n return { threepids: v1results };\n }\n\n /**\n * Get account info from the identity server. This is useful as a neutral check\n * to verify that other APIs are likely to approve access by testing that the\n * token is valid, terms have been agreed, etc.\n *\n * @param {string} identityAccessToken The `access_token` field of the Identity\n * Server `/account/register` response (see {@link registerWithIdentityServer}).\n *\n * @return {Promise} Resolves: an object with account info.\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public getIdentityAccount(identityAccessToken: string): Promise { // TODO: Types\n return this.http.idServerRequest(\n undefined, \"GET\", \"/account\",\n undefined, PREFIX_IDENTITY_V2, identityAccessToken,\n );\n }\n\n /**\n * Send an event to a specific list of devices\n *\n * @param {string} eventType type of event to send\n * @param {Object.>} contentMap\n * content to send. Map from user_id to device_id to content object.\n * @param {string=} txnId transaction id. One will be made up if not\n * supplied.\n * @return {Promise} Resolves to the result object\n */\n public sendToDevice(\n eventType: string,\n contentMap: { [userId: string]: { [deviceId: string]: Record } },\n txnId?: string,\n ): Promise<{}> {\n const path = utils.encodeUri(\"/sendToDevice/$eventType/$txnId\", {\n $eventType: eventType,\n $txnId: txnId ? txnId : this.makeTxnId(),\n });\n\n const body = {\n messages: contentMap,\n };\n\n const targets = Object.keys(contentMap).reduce((obj, key) => {\n obj[key] = Object.keys(contentMap[key]);\n return obj;\n }, {});\n logger.log(`PUT ${path}`, targets);\n\n return this.http.authedRequest(undefined, \"PUT\", path, undefined, body);\n }\n\n /**\n * Get the third party protocols that can be reached using\n * this HS\n * @return {Promise} Resolves to the result object\n */\n public getThirdpartyProtocols(): Promise<{ [protocol: string]: IProtocol }> {\n return this.http.authedRequest(\n undefined, \"GET\", \"/thirdparty/protocols\", undefined, undefined,\n ).then((response) => {\n // sanity check\n if (!response || typeof (response) !== 'object') {\n throw new Error(`/thirdparty/protocols did not return an object: ${response}`);\n }\n return response;\n });\n }\n\n /**\n * Get information on how a specific place on a third party protocol\n * may be reached.\n * @param {string} protocol The protocol given in getThirdpartyProtocols()\n * @param {object} params Protocol-specific parameters, as given in the\n * response to getThirdpartyProtocols()\n * @return {Promise} Resolves to the result object\n */\n public getThirdpartyLocation(\n protocol: string,\n params: { searchFields?: string[] },\n ): Promise {\n const path = utils.encodeUri(\"/thirdparty/location/$protocol\", {\n $protocol: protocol,\n });\n\n return this.http.authedRequest(undefined, \"GET\", path, params, undefined);\n }\n\n /**\n * Get information on how a specific user on a third party protocol\n * may be reached.\n * @param {string} protocol The protocol given in getThirdpartyProtocols()\n * @param {object} params Protocol-specific parameters, as given in the\n * response to getThirdpartyProtocols()\n * @return {Promise} Resolves to the result object\n */\n public getThirdpartyUser(protocol: string, params: any): Promise { // TODO: Types\n const path = utils.encodeUri(\"/thirdparty/user/$protocol\", {\n $protocol: protocol,\n });\n\n return this.http.authedRequest(undefined, \"GET\", path, params, undefined);\n }\n\n public getTerms(serviceType: SERVICE_TYPES, baseUrl: string): Promise { // TODO: Types\n const url = this.termsUrlForService(serviceType, baseUrl);\n return this.http.requestOtherUrl(undefined, 'GET', url);\n }\n\n public agreeToTerms(\n serviceType: SERVICE_TYPES,\n baseUrl: string,\n accessToken: string,\n termsUrls: string[],\n ): Promise { // TODO: Types\n const url = this.termsUrlForService(serviceType, baseUrl);\n const headers = {\n Authorization: \"Bearer \" + accessToken,\n };\n return this.http.requestOtherUrl(undefined, 'POST', url, null, { user_accepts: termsUrls }, { headers });\n }\n\n /**\n * Reports an event as inappropriate to the server, which may then notify the appropriate people.\n * @param {string} roomId The room in which the event being reported is located.\n * @param {string} eventId The event to report.\n * @param {number} score The score to rate this content as where -100 is most offensive and 0 is inoffensive.\n * @param {string} reason The reason the content is being reported. May be blank.\n * @returns {Promise} Resolves to an empty object if successful\n */\n public reportEvent(roomId: string, eventId: string, score: number, reason: string): Promise<{}> {\n const path = utils.encodeUri(\"/rooms/$roomId/report/$eventId\", {\n $roomId: roomId,\n $eventId: eventId,\n });\n\n return this.http.authedRequest(undefined, \"POST\", path, null, { score, reason });\n }\n\n /**\n * Fetches or paginates a summary of a space as defined by MSC2946\n * @param {string} roomId The ID of the space-room to use as the root of the summary.\n * @param {number?} maxRoomsPerSpace The maximum number of rooms to return per subspace.\n * @param {boolean?} suggestedOnly Whether to only return rooms with suggested=true.\n * @param {boolean?} autoJoinOnly Whether to only return rooms with auto_join=true.\n * @param {number?} limit The maximum number of rooms to return in total.\n * @param {string?} batch The opaque token to paginate a previous summary request.\n * @returns {Promise} the response, with next_batch, rooms, events fields.\n */\n public getSpaceSummary(\n roomId: string,\n maxRoomsPerSpace?: number,\n suggestedOnly?: boolean,\n autoJoinOnly?: boolean,\n limit?: number,\n batch?: string,\n ): Promise<{\n rooms: ISpaceSummaryRoom[];\n events: ISpaceSummaryEvent[];\n }> {\n const path = utils.encodeUri(\"/rooms/$roomId/spaces\", {\n $roomId: roomId,\n });\n\n return this.http.authedRequest(undefined, \"POST\", path, null, {\n max_rooms_per_space: maxRoomsPerSpace,\n suggested_only: suggestedOnly,\n auto_join_only: autoJoinOnly,\n limit,\n batch,\n }, {\n prefix: \"/_matrix/client/unstable/org.matrix.msc2946\",\n });\n }\n\n /**\n * Creates a new file tree space with the given name. The client will pick\n * defaults for how it expects to be able to support the remaining API offered\n * by the returned class.\n *\n * Note that this is UNSTABLE and may have breaking changes without notice.\n * @param {string} name The name of the tree space.\n * @returns {Promise} Resolves to the created space.\n */\n public async unstableCreateFileTree(name: string): Promise {\n const { room_id: roomId } = await this.createRoom({\n name: name,\n preset: Preset.PrivateChat,\n power_level_content_override: {\n ...DEFAULT_TREE_POWER_LEVELS_TEMPLATE,\n users: {\n [this.getUserId()]: 100,\n },\n },\n creation_content: {\n [RoomCreateTypeField]: RoomType.Space,\n },\n initial_state: [\n {\n type: UNSTABLE_MSC3088_PURPOSE.name,\n state_key: UNSTABLE_MSC3089_TREE_SUBTYPE.name,\n content: {\n [UNSTABLE_MSC3088_ENABLED.name]: true,\n },\n },\n {\n type: EventType.RoomEncryption,\n state_key: \"\",\n content: {\n algorithm: olmlib.MEGOLM_ALGORITHM,\n },\n },\n ],\n });\n return new MSC3089TreeSpace(this, roomId);\n }\n\n /**\n * Gets a reference to a tree space, if the room ID given is a tree space. If the room\n * does not appear to be a tree space then null is returned.\n *\n * Note that this is UNSTABLE and may have breaking changes without notice.\n * @param {string} roomId The room ID to get a tree space reference for.\n * @returns {MSC3089TreeSpace} The tree space, or null if not a tree space.\n */\n public unstableGetFileTreeSpace(roomId: string): MSC3089TreeSpace {\n const room = this.getRoom(roomId);\n if (!room) return null;\n\n const createEvent = room.currentState.getStateEvents(EventType.RoomCreate, \"\");\n const purposeEvent = room.currentState.getStateEvents(\n UNSTABLE_MSC3088_PURPOSE.name,\n UNSTABLE_MSC3089_TREE_SUBTYPE.name);\n\n if (!createEvent) throw new Error(\"Expected single room create event\");\n\n if (!purposeEvent?.getContent()?.[UNSTABLE_MSC3088_ENABLED.name]) return null;\n if (createEvent.getContent()?.[RoomCreateTypeField] !== RoomType.Space) return null;\n\n return new MSC3089TreeSpace(this, roomId);\n }\n\n // TODO: Remove this warning, alongside the functions\n // See https://github.com/vector-im/element-web/issues/17532\n // ======================================================\n // ** ANCIENT APIS BELOW **\n // ======================================================\n\n /**\n * @param {string} groupId\n * @return {Promise} Resolves: Group summary object\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public getGroupSummary(groupId: string): Promise {\n const path = utils.encodeUri(\"/groups/$groupId/summary\", { $groupId: groupId });\n return this.http.authedRequest(undefined, \"GET\", path);\n }\n\n /**\n * @param {string} groupId\n * @return {Promise} Resolves: Group profile object\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public getGroupProfile(groupId: string): Promise {\n const path = utils.encodeUri(\"/groups/$groupId/profile\", { $groupId: groupId });\n return this.http.authedRequest(undefined, \"GET\", path);\n }\n\n /**\n * @param {string} groupId\n * @param {Object} profile The group profile object\n * @param {string=} profile.name Name of the group\n * @param {string=} profile.avatar_url MXC avatar URL\n * @param {string=} profile.short_description A short description of the room\n * @param {string=} profile.long_description A longer HTML description of the room\n * @return {Promise} Resolves: Empty object\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public setGroupProfile(groupId: string, profile: any): Promise {\n const path = utils.encodeUri(\"/groups/$groupId/profile\", { $groupId: groupId });\n return this.http.authedRequest(\n undefined, \"POST\", path, undefined, profile,\n );\n }\n\n /**\n * @param {string} groupId\n * @param {object} policy The join policy for the group. Must include at\n * least a 'type' field which is 'open' if anyone can join the group\n * the group without prior approval, or 'invite' if an invite is\n * required to join.\n * @return {Promise} Resolves: Empty object\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public setGroupJoinPolicy(groupId: string, policy: any): Promise {\n const path = utils.encodeUri(\n \"/groups/$groupId/settings/m.join_policy\",\n { $groupId: groupId },\n );\n return this.http.authedRequest(\n undefined, \"PUT\", path, undefined, {\n 'm.join_policy': policy,\n },\n );\n }\n\n /**\n * @param {string} groupId\n * @return {Promise} Resolves: Group users list object\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public getGroupUsers(groupId: string): Promise {\n const path = utils.encodeUri(\"/groups/$groupId/users\", { $groupId: groupId });\n return this.http.authedRequest(undefined, \"GET\", path);\n }\n\n /**\n * @param {string} groupId\n * @return {Promise} Resolves: Group users list object\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public getGroupInvitedUsers(groupId: string): Promise {\n const path = utils.encodeUri(\"/groups/$groupId/invited_users\", { $groupId: groupId });\n return this.http.authedRequest(undefined, \"GET\", path);\n }\n\n /**\n * @param {string} groupId\n * @return {Promise} Resolves: Group rooms list object\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public getGroupRooms(groupId: string): Promise {\n const path = utils.encodeUri(\"/groups/$groupId/rooms\", { $groupId: groupId });\n return this.http.authedRequest(undefined, \"GET\", path);\n }\n\n /**\n * @param {string} groupId\n * @param {string} userId\n * @return {Promise} Resolves: Empty object\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public inviteUserToGroup(groupId: string, userId: string): Promise {\n const path = utils.encodeUri(\n \"/groups/$groupId/admin/users/invite/$userId\",\n { $groupId: groupId, $userId: userId },\n );\n return this.http.authedRequest(undefined, \"PUT\", path, undefined, {});\n }\n\n /**\n * @param {string} groupId\n * @param {string} userId\n * @return {Promise} Resolves: Empty object\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public removeUserFromGroup(groupId: string, userId: string): Promise {\n const path = utils.encodeUri(\n \"/groups/$groupId/admin/users/remove/$userId\",\n { $groupId: groupId, $userId: userId },\n );\n return this.http.authedRequest(undefined, \"PUT\", path, undefined, {});\n }\n\n /**\n * @param {string} groupId\n * @param {string} userId\n * @param {string} roleId Optional.\n * @return {Promise} Resolves: Empty object\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public addUserToGroupSummary(groupId: string, userId: string, roleId: string): Promise {\n const path = utils.encodeUri(\n roleId ?\n \"/groups/$groupId/summary/$roleId/users/$userId\" :\n \"/groups/$groupId/summary/users/$userId\",\n { $groupId: groupId, $roleId: roleId, $userId: userId },\n );\n return this.http.authedRequest(undefined, \"PUT\", path, undefined, {});\n }\n\n /**\n * @param {string} groupId\n * @param {string} userId\n * @return {Promise} Resolves: Empty object\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public removeUserFromGroupSummary(groupId: string, userId: string): Promise {\n const path = utils.encodeUri(\n \"/groups/$groupId/summary/users/$userId\",\n { $groupId: groupId, $userId: userId },\n );\n return this.http.authedRequest(undefined, \"DELETE\", path, undefined, {});\n }\n\n /**\n * @param {string} groupId\n * @param {string} roomId\n * @param {string} categoryId Optional.\n * @return {Promise} Resolves: Empty object\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public addRoomToGroupSummary(groupId: string, roomId: string, categoryId: string): Promise {\n const path = utils.encodeUri(\n categoryId ?\n \"/groups/$groupId/summary/$categoryId/rooms/$roomId\" :\n \"/groups/$groupId/summary/rooms/$roomId\",\n { $groupId: groupId, $categoryId: categoryId, $roomId: roomId },\n );\n return this.http.authedRequest(undefined, \"PUT\", path, undefined, {});\n }\n\n /**\n * @param {string} groupId\n * @param {string} roomId\n * @return {Promise} Resolves: Empty object\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public removeRoomFromGroupSummary(groupId: string, roomId: string): Promise {\n const path = utils.encodeUri(\n \"/groups/$groupId/summary/rooms/$roomId\",\n { $groupId: groupId, $roomId: roomId },\n );\n return this.http.authedRequest(undefined, \"DELETE\", path, undefined, {});\n }\n\n /**\n * @param {string} groupId\n * @param {string} roomId\n * @param {boolean} isPublic Whether the room-group association is visible to non-members\n * @return {Promise} Resolves: Empty object\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public addRoomToGroup(groupId: string, roomId: string, isPublic: boolean): Promise {\n if (isPublic === undefined) {\n isPublic = true;\n }\n const path = utils.encodeUri(\n \"/groups/$groupId/admin/rooms/$roomId\",\n { $groupId: groupId, $roomId: roomId },\n );\n return this.http.authedRequest(undefined, \"PUT\", path, undefined,\n { \"m.visibility\": { type: isPublic ? \"public\" : \"private\" } },\n );\n }\n\n /**\n * Configure the visibility of a room-group association.\n * @param {string} groupId\n * @param {string} roomId\n * @param {boolean} isPublic Whether the room-group association is visible to non-members\n * @return {Promise} Resolves: Empty object\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public updateGroupRoomVisibility(groupId: string, roomId: string, isPublic: boolean): Promise {\n // NB: The /config API is generic but there's not much point in exposing this yet as synapse\n // is the only server to implement this. In future we should consider an API that allows\n // arbitrary configuration, i.e. \"config/$configKey\".\n\n const path = utils.encodeUri(\n \"/groups/$groupId/admin/rooms/$roomId/config/m.visibility\",\n { $groupId: groupId, $roomId: roomId },\n );\n return this.http.authedRequest(undefined, \"PUT\", path, undefined,\n { type: isPublic ? \"public\" : \"private\" },\n );\n }\n\n /**\n * @param {string} groupId\n * @param {string} roomId\n * @return {Promise} Resolves: Empty object\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public removeRoomFromGroup(groupId: string, roomId: string): Promise {\n const path = utils.encodeUri(\n \"/groups/$groupId/admin/rooms/$roomId\",\n { $groupId: groupId, $roomId: roomId },\n );\n return this.http.authedRequest(undefined, \"DELETE\", path, undefined, {});\n }\n\n /**\n * @param {string} groupId\n * @param {Object} opts Additional options to send alongside the acceptance.\n * @return {Promise} Resolves: Empty object\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public acceptGroupInvite(groupId: string, opts = null): Promise {\n const path = utils.encodeUri(\n \"/groups/$groupId/self/accept_invite\",\n { $groupId: groupId },\n );\n return this.http.authedRequest(undefined, \"PUT\", path, undefined, opts || {});\n }\n\n /**\n * @param {string} groupId\n * @return {Promise} Resolves: Empty object\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public joinGroup(groupId: string): Promise {\n const path = utils.encodeUri(\n \"/groups/$groupId/self/join\",\n { $groupId: groupId },\n );\n return this.http.authedRequest(undefined, \"PUT\", path, undefined, {});\n }\n\n /**\n * @param {string} groupId\n * @return {Promise} Resolves: Empty object\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public leaveGroup(groupId: string): Promise {\n const path = utils.encodeUri(\n \"/groups/$groupId/self/leave\",\n { $groupId: groupId },\n );\n return this.http.authedRequest(undefined, \"PUT\", path, undefined, {});\n }\n\n /**\n * @return {Promise} Resolves: The groups to which the user is joined\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public getJoinedGroups(): Promise {\n const path = utils.encodeUri(\"/joined_groups\", {});\n return this.http.authedRequest(undefined, \"GET\", path);\n }\n\n /**\n * @param {Object} content Request content\n * @param {string} content.localpart The local part of the desired group ID\n * @param {Object} content.profile Group profile object\n * @return {Promise} Resolves: Object with key group_id: id of the created group\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public createGroup(content: any): Promise {\n const path = utils.encodeUri(\"/create_group\", {});\n return this.http.authedRequest(\n undefined, \"POST\", path, undefined, content,\n );\n }\n\n /**\n * @param {string[]} userIds List of user IDs\n * @return {Promise} Resolves: Object as exmaple below\n *\n * {\n * \"users\": {\n * \"@bob:example.com\": {\n * \"+example:example.com\"\n * }\n * }\n * }\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public getPublicisedGroups(userIds: string[]): Promise {\n const path = utils.encodeUri(\"/publicised_groups\", {});\n return this.http.authedRequest(\n undefined, \"POST\", path, undefined, { user_ids: userIds },\n );\n }\n\n /**\n * @param {string} groupId\n * @param {boolean} isPublic Whether the user's membership of this group is made public\n * @return {Promise} Resolves: Empty object\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public setGroupPublicity(groupId: string, isPublic: boolean): Promise {\n const path = utils.encodeUri(\n \"/groups/$groupId/self/update_publicity\",\n { $groupId: groupId },\n );\n return this.http.authedRequest(undefined, \"PUT\", path, undefined, {\n publicise: isPublic,\n });\n }\n}\n\n/**\n * Fires whenever the SDK receives a new event.\n *

\n * This is only fired for live events received via /sync - it is not fired for\n * events received over context, search, or pagination APIs.\n *\n * @event module:client~MatrixClient#\"event\"\n * @param {MatrixEvent} event The matrix event which caused this event to fire.\n * @example\n * matrixClient.on(\"event\", function(event){\n * var sender = event.getSender();\n * });\n */\n\n/**\n * Fires whenever the SDK receives a new to-device event.\n * @event module:client~MatrixClient#\"toDeviceEvent\"\n * @param {MatrixEvent} event The matrix event which caused this event to fire.\n * @example\n * matrixClient.on(\"toDeviceEvent\", function(event){\n * var sender = event.getSender();\n * });\n */\n\n/**\n * Fires whenever the SDK's syncing state is updated. The state can be one of:\n *

    \n *\n *
  • PREPARED: The client has synced with the server at least once and is\n * ready for methods to be called on it. This will be immediately followed by\n * a state of SYNCING. This is the equivalent of \"syncComplete\" in the\n * previous API.
  • \n *\n *
  • CATCHUP: The client has detected the connection to the server might be\n * available again and will now try to do a sync again. As this sync might take\n * a long time (depending how long ago was last synced, and general server\n * performance) the client is put in this mode so the UI can reflect trying\n * to catch up with the server after losing connection.
  • \n *\n *
  • SYNCING : The client is currently polling for new events from the server.\n * This will be called after processing latest events from a sync.
  • \n *\n *
  • ERROR : The client has had a problem syncing with the server. If this is\n * called before PREPARED then there was a problem performing the initial\n * sync. If this is called after PREPARED then there was a problem polling\n * the server for updates. This may be called multiple times even if the state is\n * already ERROR. This is the equivalent of \"syncError\" in the previous\n * API.
  • \n *\n *
  • RECONNECTING: The sync connection has dropped, but not (yet) in a way that\n * should be considered erroneous.\n *
  • \n *\n *
  • STOPPED: The client has stopped syncing with server due to stopClient\n * being called.\n *
  • \n *
\n * State transition diagram:\n *
\n *                                          +---->STOPPED\n *                                          |\n *              +----->PREPARED -------> SYNCING <--+\n *              |                        ^  |  ^    |\n *              |      CATCHUP ----------+  |  |    |\n *              |        ^                  V  |    |\n *   null ------+        |  +------- RECONNECTING   |\n *              |        V  V                       |\n *              +------->ERROR ---------------------+\n *\n * NB: 'null' will never be emitted by this event.\n *\n * 
\n * Transitions:\n *
    \n *\n *
  • null -> PREPARED : Occurs when the initial sync is completed\n * first time. This involves setting up filters and obtaining push rules.\n *\n *
  • null -> ERROR : Occurs when the initial sync failed first time.\n *\n *
  • ERROR -> PREPARED : Occurs when the initial sync succeeds\n * after previously failing.\n *\n *
  • PREPARED -> SYNCING : Occurs immediately after transitioning\n * to PREPARED. Starts listening for live updates rather than catching up.\n *\n *
  • SYNCING -> RECONNECTING : Occurs when the live update fails.\n *\n *
  • RECONNECTING -> RECONNECTING : Can occur if the update calls\n * continue to fail, but the keepalive calls (to /versions) succeed.\n *\n *
  • RECONNECTING -> ERROR : Occurs when the keepalive call also fails\n *\n *
  • ERROR -> SYNCING : Occurs when the client has performed a\n * live update after having previously failed.\n *\n *
  • ERROR -> ERROR : Occurs when the client has failed to keepalive\n * for a second time or more.
  • \n *\n *
  • SYNCING -> SYNCING : Occurs when the client has performed a live\n * update. This is called after processing.
  • \n *\n *
  • * -> STOPPED : Occurs once the client has stopped syncing or\n * trying to sync after stopClient has been called.
  • \n *
\n *\n * @event module:client~MatrixClient#\"sync\"\n *\n * @param {string} state An enum representing the syncing state. One of \"PREPARED\",\n * \"SYNCING\", \"ERROR\", \"STOPPED\".\n *\n * @param {?string} prevState An enum representing the previous syncing state.\n * One of \"PREPARED\", \"SYNCING\", \"ERROR\", \"STOPPED\" or null.\n *\n * @param {?Object} data Data about this transition.\n *\n * @param {MatrixError} data.error The matrix error if state=ERROR.\n *\n * @param {String} data.oldSyncToken The 'since' token passed to /sync.\n * null for the first successful sync since this client was\n * started. Only present if state=PREPARED or\n * state=SYNCING.\n *\n * @param {String} data.nextSyncToken The 'next_batch' result from /sync, which\n * will become the 'since' token for the next call to /sync. Only present if\n * state=PREPARED or state=SYNCING.\n *\n * @param {boolean} data.catchingUp True if we are working our way through a\n * backlog of events after connecting. Only present if state=SYNCING.\n *\n * @example\n * matrixClient.on(\"sync\", function(state, prevState, data) {\n * switch (state) {\n * case \"ERROR\":\n * // update UI to say \"Connection Lost\"\n * break;\n * case \"SYNCING\":\n * // update UI to remove any \"Connection Lost\" message\n * break;\n * case \"PREPARED\":\n * // the client instance is ready to be queried.\n * var rooms = matrixClient.getRooms();\n * break;\n * }\n * });\n */\n\n/**\n * Fires whenever the sdk learns about a new group. This event\n * is experimental and may change.\n * @event module:client~MatrixClient#\"Group\"\n * @param {Group} group The newly created, fully populated group.\n * @example\n * matrixClient.on(\"Group\", function(group){\n * var groupId = group.groupId;\n * });\n */\n\n/**\n * Fires whenever a new Room is added. This will fire when you are invited to a\n * room, as well as when you join a room. This event is experimental and\n * may change.\n * @event module:client~MatrixClient#\"Room\"\n * @param {Room} room The newly created, fully populated room.\n * @example\n * matrixClient.on(\"Room\", function(room){\n * var roomId = room.roomId;\n * });\n */\n\n/**\n * Fires whenever a Room is removed. This will fire when you forget a room.\n * This event is experimental and may change.\n * @event module:client~MatrixClient#\"deleteRoom\"\n * @param {string} roomId The deleted room ID.\n * @example\n * matrixClient.on(\"deleteRoom\", function(roomId){\n * // update UI from getRooms()\n * });\n */\n\n/**\n * Fires whenever an incoming call arrives.\n * @event module:client~MatrixClient#\"Call.incoming\"\n * @param {module:webrtc/call~MatrixCall} call The incoming call.\n * @example\n * matrixClient.on(\"Call.incoming\", function(call){\n * call.answer(); // auto-answer\n * });\n */\n\n/**\n * Fires whenever the login session the JS SDK is using is no\n * longer valid and the user must log in again.\n * NB. This only fires when action is required from the user, not\n * when then login session can be renewed by using a refresh token.\n * @event module:client~MatrixClient#\"Session.logged_out\"\n * @example\n * matrixClient.on(\"Session.logged_out\", function(errorObj){\n * // show the login screen\n * });\n */\n\n/**\n * Fires when the JS SDK receives a M_CONSENT_NOT_GIVEN error in response\n * to a HTTP request.\n * @event module:client~MatrixClient#\"no_consent\"\n * @example\n * matrixClient.on(\"no_consent\", function(message, contentUri) {\n * console.info(message + ' Go to ' + contentUri);\n * });\n */\n\n/**\n * Fires when a device is marked as verified/unverified/blocked/unblocked by\n * {@link module:client~MatrixClient#setDeviceVerified|MatrixClient.setDeviceVerified} or\n * {@link module:client~MatrixClient#setDeviceBlocked|MatrixClient.setDeviceBlocked}.\n *\n * @event module:client~MatrixClient#\"deviceVerificationChanged\"\n * @param {string} userId the owner of the verified device\n * @param {string} deviceId the id of the verified device\n * @param {module:crypto/deviceinfo} deviceInfo updated device information\n */\n\n/**\n * Fires when the trust status of a user changes\n * If userId is the userId of the logged in user, this indicated a change\n * in the trust status of the cross-signing data on the account.\n *\n * The cross-signing API is currently UNSTABLE and may change without notice.\n *\n * @event module:client~MatrixClient#\"userTrustStatusChanged\"\n * @param {string} userId the userId of the user in question\n * @param {UserTrustLevel} trustLevel The new trust level of the user\n */\n\n/**\n * Fires when the user's cross-signing keys have changed or cross-signing\n * has been enabled/disabled. The client can use getStoredCrossSigningForUser\n * with the user ID of the logged in user to check if cross-signing is\n * enabled on the account. If enabled, it can test whether the current key\n * is trusted using with checkUserTrust with the user ID of the logged\n * in user. The checkOwnCrossSigningTrust function may be used to reconcile\n * the trust in the account key.\n *\n * The cross-signing API is currently UNSTABLE and may change without notice.\n *\n * @event module:client~MatrixClient#\"crossSigning.keysChanged\"\n */\n\n/**\n * Fires whenever new user-scoped account_data is added.\n * @event module:client~MatrixClient#\"accountData\"\n * @param {MatrixEvent} event The event describing the account_data just added\n * @param {MatrixEvent} event The previous account data, if known.\n * @example\n * matrixClient.on(\"accountData\", function(event, oldEvent){\n * myAccountData[event.type] = event.content;\n * });\n */\n\n/**\n * Fires whenever the stored devices for a user have changed\n * @event module:client~MatrixClient#\"crypto.devicesUpdated\"\n * @param {String[]} users A list of user IDs that were updated\n * @param {boolean} initialFetch If true, the store was empty (apart\n * from our own device) and has been seeded.\n */\n\n/**\n * Fires whenever the stored devices for a user will be updated\n * @event module:client~MatrixClient#\"crypto.willUpdateDevices\"\n * @param {String[]} users A list of user IDs that will be updated\n * @param {boolean} initialFetch If true, the store is empty (apart\n * from our own device) and is being seeded.\n */\n\n/**\n * Fires whenever the status of e2e key backup changes, as returned by getKeyBackupEnabled()\n * @event module:client~MatrixClient#\"crypto.keyBackupStatus\"\n * @param {boolean} enabled true if key backup has been enabled, otherwise false\n * @example\n * matrixClient.on(\"crypto.keyBackupStatus\", function(enabled){\n * if (enabled) {\n * [...]\n * }\n * });\n */\n\n/**\n * Fires when we want to suggest to the user that they restore their megolm keys\n * from backup or by cross-signing the device.\n *\n * @event module:client~MatrixClient#\"crypto.suggestKeyRestore\"\n */\n\n/**\n * Fires when a key verification is requested.\n * @event module:client~MatrixClient#\"crypto.verification.request\"\n * @param {object} data\n * @param {MatrixEvent} data.event the original verification request message\n * @param {Array} data.methods the verification methods that can be used\n * @param {Number} data.timeout the amount of milliseconds that should be waited\n * before cancelling the request automatically.\n * @param {Function} data.beginKeyVerification a function to call if a key\n * verification should be performed. The function takes one argument: the\n * name of the key verification method (taken from data.methods) to use.\n * @param {Function} data.cancel a function to call if the key verification is\n * rejected.\n */\n\n/**\n * Fires when a key verification is requested with an unknown method.\n * @event module:client~MatrixClient#\"crypto.verification.request.unknown\"\n * @param {string} userId the user ID who requested the key verification\n * @param {Function} cancel a function that will send a cancellation message to\n * reject the key verification.\n */\n\n/**\n * Fires when a secret request has been cancelled. If the client is prompting\n * the user to ask whether they want to share a secret, the prompt can be\n * dismissed.\n *\n * The Secure Secret Storage API is currently UNSTABLE and may change without notice.\n *\n * @event module:client~MatrixClient#\"crypto.secrets.requestCancelled\"\n * @param {object} data\n * @param {string} data.user_id The user ID of the client that had requested the secret.\n * @param {string} data.device_id The device ID of the client that had requested the\n * secret.\n * @param {string} data.request_id The ID of the original request.\n */\n\n/**\n * Fires when the client .well-known info is fetched.\n *\n * @event module:client~MatrixClient#\"WellKnown.client\"\n * @param {object} data The JSON object returned by the server\n */\n", + "/*\nCopyright 2015-2021 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n/**\n * This is an internal module. See {@link MatrixClient} for the public class.\n * @module client\n */\n\nimport { EventEmitter } from \"events\";\nimport { ISyncStateData, SyncApi } from \"./sync\";\nimport { EventStatus, IContent, IDecryptOptions, IEvent, MatrixEvent } from \"./models/event\";\nimport { StubStore } from \"./store/stub\";\nimport { createNewMatrixCall, MatrixCall, ConstraintsType, getUserMediaContraints } from \"./webrtc/call\";\nimport { Filter, IFilterDefinition } from \"./filter\";\nimport { CallEventHandler } from './webrtc/callEventHandler';\nimport * as utils from './utils';\nimport { sleep } from './utils';\nimport { Group } from \"./models/group\";\nimport { Direction, EventTimeline } from \"./models/event-timeline\";\nimport { IActionsObject, PushProcessor } from \"./pushprocessor\";\nimport { AutoDiscovery } from \"./autodiscovery\";\nimport * as olmlib from \"./crypto/olmlib\";\nimport { decodeBase64, encodeBase64 } from \"./crypto/olmlib\";\nimport { ReEmitter } from './ReEmitter';\nimport { IRoomEncryption, RoomList } from './crypto/RoomList';\nimport { logger } from './logger';\nimport { SERVICE_TYPES } from './service-types';\nimport {\n MatrixError,\n MatrixHttpApi,\n PREFIX_IDENTITY_V2,\n PREFIX_MEDIA_R0,\n PREFIX_R0,\n PREFIX_UNSTABLE,\n retryNetworkOperation,\n} from \"./http-api\";\nimport {\n Crypto,\n fixBackupKey,\n IBootstrapCrossSigningOpts,\n ICheckOwnCrossSigningTrustOpts,\n IMegolmSessionData,\n isCryptoAvailable,\n VerificationMethod,\n} from './crypto';\nimport { DeviceInfo, IDevice } from \"./crypto/deviceinfo\";\nimport { decodeRecoveryKey } from './crypto/recoverykey';\nimport { keyFromAuthData } from './crypto/key_passphrase';\nimport { User } from \"./models/user\";\nimport { getHttpUriForMxc } from \"./content-repo\";\nimport { SearchResult } from \"./models/search-result\";\nimport {\n DEHYDRATION_ALGORITHM,\n IDehydratedDevice,\n IDehydratedDeviceKeyInfo,\n IDeviceKeys,\n IOneTimeKey,\n} from \"./crypto/dehydration\";\nimport {\n IKeyBackupInfo,\n IKeyBackupPrepareOpts,\n IKeyBackupRestoreOpts,\n IKeyBackupRestoreResult,\n IKeyBackupSession,\n} from \"./crypto/keybackup\";\nimport { IIdentityServerProvider } from \"./@types/IIdentityServerProvider\";\nimport type Request from \"request\";\nimport { MatrixScheduler } from \"./scheduler\";\nimport { ICryptoCallbacks, IMinimalEvent, IRoomEvent, IStateEvent, NotificationCountType } from \"./matrix\";\nimport {\n CrossSigningKey,\n IAddSecretStorageKeyOpts,\n ICreateSecretStorageOpts,\n IEncryptedEventInfo,\n IImportRoomKeysOpts,\n IRecoveryKey,\n ISecretStorageKeyInfo,\n} from \"./crypto/api\";\nimport { SyncState } from \"./sync.api\";\nimport { EventTimelineSet } from \"./models/event-timeline-set\";\nimport { VerificationRequest } from \"./crypto/verification/request/VerificationRequest\";\nimport { Base as Verification } from \"./crypto/verification/Base\";\nimport * as ContentHelpers from \"./content-helpers\";\nimport { CrossSigningInfo, DeviceTrustLevel, ICacheCallbacks, UserTrustLevel } from \"./crypto/CrossSigning\";\nimport { Room } from \"./models/room\";\nimport {\n IAddThreePidOnlyBody,\n IBindThreePidBody,\n ICreateRoomOpts,\n IEventSearchOpts,\n IGuestAccessOpts,\n IJoinRoomOpts,\n IPaginateOpts,\n IPresenceOpts,\n IRedactOpts,\n IRoomDirectoryOptions,\n ISearchOpts,\n ISendEventResponse,\n IUploadOpts,\n} from \"./@types/requests\";\nimport {\n EventType,\n MsgType,\n RelationType,\n RoomCreateTypeField,\n RoomType,\n UNSTABLE_MSC3088_ENABLED,\n UNSTABLE_MSC3088_PURPOSE,\n UNSTABLE_MSC3089_TREE_SUBTYPE,\n} from \"./@types/event\";\nimport { IAbortablePromise, IdServerUnbindResult, IImageInfo, Preset, Visibility } from \"./@types/partials\";\nimport { EventMapper, eventMapperFor, MapperOpts } from \"./event-mapper\";\nimport { randomString } from \"./randomstring\";\nimport { ReadStream } from \"fs\";\nimport { WebStorageSessionStore } from \"./store/session/webstorage\";\nimport { BackupManager, IKeyBackup, IKeyBackupCheck, IPreparedKeyBackupVersion, TrustInfo } from \"./crypto/backup\";\nimport { DEFAULT_TREE_POWER_LEVELS_TEMPLATE, MSC3089TreeSpace } from \"./models/MSC3089TreeSpace\";\nimport { ISignatures } from \"./@types/signed\";\nimport { IStore } from \"./store\";\nimport { ISecretRequest } from \"./crypto/SecretStorage\";\nimport {\n IEventWithRoomId,\n ISearchRequestBody,\n ISearchResponse,\n ISearchResults,\n IStateEventWithRoomId,\n SearchOrderBy,\n} from \"./@types/search\";\nimport { ISynapseAdminDeactivateResponse, ISynapseAdminWhoisResponse } from \"./@types/synapse\";\nimport { IHierarchyRoom, ISpaceSummaryEvent, ISpaceSummaryRoom } from \"./@types/spaces\";\nimport { IPusher, IPusherRequest, IPushRules, PushRuleAction, PushRuleKind, RuleId } from \"./@types/PushRules\";\nimport { IThreepid } from \"./@types/threepids\";\nimport { CryptoStore } from \"./crypto/store/base\";\n\nexport type Store = IStore;\nexport type SessionStore = WebStorageSessionStore;\n\nexport type Callback = (err: Error | any | null, data?: any) => void;\nexport type ResetTimelineCallback = (roomId: string) => boolean;\n\nconst SCROLLBACK_DELAY_MS = 3000;\nexport const CRYPTO_ENABLED: boolean = isCryptoAvailable();\nconst CAPABILITIES_CACHE_MS = 21600000; // 6 hours - an arbitrary value\nconst TURN_CHECK_INTERVAL = 10 * 60 * 1000; // poll for turn credentials every 10 minutes\n\ninterface IOlmDevice {\n pickledAccount: string;\n sessions: Array>;\n pickleKey: string;\n}\n\ninterface IExportedDevice {\n olmDevice: IOlmDevice;\n userId: string;\n deviceId: string;\n}\n\nexport interface IKeysUploadResponse {\n one_time_key_counts: { // eslint-disable-line camelcase\n [algorithm: string]: number;\n };\n}\n\nexport interface ICreateClientOpts {\n baseUrl: string;\n\n idBaseUrl?: string;\n\n /**\n * The data store used for sync data from the homeserver. If not specified,\n * this client will not store any HTTP responses. The `createClient` helper\n * will create a default store if needed.\n */\n store?: Store;\n\n /**\n * A store to be used for end-to-end crypto session data. If not specified,\n * end-to-end crypto will be disabled. The `createClient` helper will create\n * a default store if needed.\n */\n cryptoStore?: CryptoStore;\n\n /**\n * The scheduler to use. If not\n * specified, this client will not retry requests on failure. This client\n * will supply its own processing function to\n * {@link module:scheduler~MatrixScheduler#setProcessFunction}.\n */\n scheduler?: MatrixScheduler;\n\n /**\n * The function to invoke for HTTP\n * requests. The value of this property is typically require(\"request\")\n * as it returns a function which meets the required interface. See\n * {@link requestFunction} for more information.\n */\n request?: Request;\n\n userId?: string;\n\n /**\n * A unique identifier for this device; used for tracking things like crypto\n * keys and access tokens. If not specified, end-to-end encryption will be\n * disabled.\n */\n deviceId?: string;\n\n accessToken?: string;\n\n /**\n * Identity server provider to retrieve the user's access token when accessing\n * the identity server. See also https://github.com/vector-im/element-web/issues/10615\n * which seeks to replace the previous approach of manual access tokens params\n * with this callback throughout the SDK.\n */\n identityServer?: IIdentityServerProvider;\n\n /**\n * The default maximum amount of\n * time to wait before timing out HTTP requests. If not specified, there is no timeout.\n */\n localTimeoutMs?: number;\n\n /**\n * Set to true to use\n * Authorization header instead of query param to send the access token to the server.\n *\n * Default false.\n */\n useAuthorizationHeader?: boolean;\n\n /**\n * Set to true to enable\n * improved timeline support ({@link module:client~MatrixClient#getEventTimeline getEventTimeline}). It is\n * disabled by default for compatibility with older clients - in particular to\n * maintain support for back-paginating the live timeline after a '/sync'\n * result with a gap.\n */\n timelineSupport?: boolean;\n\n /**\n * Extra query parameters to append\n * to all requests with this client. Useful for application services which require\n * ?user_id=.\n */\n queryParams?: Record;\n\n /**\n * Device data exported with\n * \"exportDevice\" method that must be imported to recreate this device.\n * Should only be useful for devices with end-to-end crypto enabled.\n * If provided, deviceId and userId should **NOT** be provided at the top\n * level (they are present in the exported data).\n */\n deviceToImport?: IExportedDevice;\n\n /**\n * Key used to pickle olm objects or other sensitive data.\n */\n pickleKey?: string;\n\n /**\n * A store to be used for end-to-end crypto session data. Most data has been\n * migrated out of here to `cryptoStore` instead. If not specified,\n * end-to-end crypto will be disabled. The `createClient` helper\n * _will not_ create this store at the moment.\n */\n sessionStore?: SessionStore;\n\n /**\n * Set to true to enable client-side aggregation of event relations\n * via `EventTimelineSet#getRelationsForEvent`.\n * This feature is currently unstable and the API may change without notice.\n */\n unstableClientRelationAggregation?: boolean;\n\n verificationMethods?: Array;\n\n /**\n * Whether relaying calls through a TURN server should be forced. Default false.\n */\n forceTURN?: boolean;\n\n /**\n * Up to this many ICE candidates will be gathered when an incoming call arrives.\n * Gathering does not send data to the caller, but will communicate with the configured TURN\n * server. Default 0.\n */\n iceCandidatePoolSize?: number;\n\n /**\n * True to advertise support for call transfers to other parties on Matrix calls. Default false.\n */\n supportsCallTransfer?: boolean;\n\n /**\n * Whether to allow a fallback ICE server should be used for negotiating a\n * WebRTC connection if the homeserver doesn't provide any servers. Defaults to false.\n */\n fallbackICEServerAllowed?: boolean;\n\n cryptoCallbacks?: ICryptoCallbacks;\n}\n\nexport interface IMatrixClientCreateOpts extends ICreateClientOpts {\n /**\n * Whether to allow sending messages to encrypted rooms when encryption\n * is not available internally within this SDK. This is useful if you are using an external\n * E2E proxy, for example. Defaults to false.\n */\n usingExternalCrypto?: boolean;\n}\n\nexport enum PendingEventOrdering {\n Chronological = \"chronological\",\n Detached = \"detached\",\n}\n\nexport interface IStartClientOpts {\n /**\n * The event limit= to apply to initial sync. Default: 8.\n */\n initialSyncLimit?: number;\n\n /**\n * True to put archived=true on the /initialSync request. Default: false.\n */\n includeArchivedRooms?: boolean;\n\n /**\n * True to do /profile requests on every invite event if the displayname/avatar_url is not known for this user ID. Default: false.\n */\n resolveInvitesToProfiles?: boolean;\n\n /**\n * Controls where pending messages appear in a room's timeline. If \"chronological\", messages will\n * appear in the timeline when the call to sendEvent was made. If \"detached\",\n * pending messages will appear in a separate list, accessbile via {@link module:models/room#getPendingEvents}.\n * Default: \"chronological\".\n */\n pendingEventOrdering?: PendingEventOrdering;\n\n /**\n * The number of milliseconds to wait on /sync. Default: 30000 (30 seconds).\n */\n pollTimeout?: number;\n\n /**\n * The filter to apply to /sync calls. This will override the opts.initialSyncLimit, which would\n * normally result in a timeline limit filter.\n */\n filter?: Filter;\n\n /**\n * True to perform syncing without automatically updating presence.\n */\n disablePresence?: boolean;\n\n /**\n * True to not load all membership events during initial sync but fetch them when needed by calling\n * `loadOutOfBandMembers` This will override the filter option at this moment.\n */\n lazyLoadMembers?: boolean;\n\n /**\n * The number of seconds between polls to /.well-known/matrix/client, undefined to disable.\n * This should be in the order of hours. Default: undefined.\n */\n clientWellKnownPollPeriod?: number;\n\n /**\n * @experimental\n */\n experimentalThreadSupport?: boolean;\n}\n\nexport interface IStoredClientOpts extends IStartClientOpts {\n crypto: Crypto;\n canResetEntireTimeline: ResetTimelineCallback;\n}\n\nexport enum RoomVersionStability {\n Stable = \"stable\",\n Unstable = \"unstable\",\n}\n\nexport interface IRoomCapability { // MSC3244\n preferred: string | null;\n support: string[];\n}\n\nexport interface IRoomVersionsCapability {\n default: string;\n available: Record;\n \"org.matrix.msc3244.room_capabilities\"?: Record; // MSC3244\n}\n\nexport interface IChangePasswordCapability {\n enabled: boolean;\n}\n\ninterface ICapabilities {\n [key: string]: any;\n \"m.change_password\"?: IChangePasswordCapability;\n \"m.room_versions\"?: IRoomVersionsCapability;\n}\n\n/* eslint-disable camelcase */\nexport interface ICrossSigningKey {\n keys: { [algorithm: string]: string };\n signatures?: ISignatures;\n usage: string[];\n user_id: string;\n}\n\nenum CrossSigningKeyType {\n MasterKey = \"master_key\",\n SelfSigningKey = \"self_signing_key\",\n UserSigningKey = \"user_signing_key\",\n}\n\nexport type CrossSigningKeys = Record;\n\nexport interface ISignedKey {\n keys: Record;\n signatures: ISignatures;\n user_id: string;\n algorithms: string[];\n device_id: string;\n}\n\nexport type KeySignatures = Record>;\ninterface IUploadKeySignaturesResponse {\n failures: Record>;\n}\n\nexport interface IPreviewUrlResponse {\n [key: string]: string | number;\n \"og:title\": string;\n \"og:type\": string;\n \"og:url\": string;\n \"og:image\"?: string;\n \"og:image:type\"?: string;\n \"og:image:height\"?: number;\n \"og:image:width\"?: number;\n \"og:description\"?: string;\n \"matrix:image:size\"?: number;\n}\n\ninterface ITurnServerResponse {\n uris: string[];\n username: string;\n password: string;\n ttl: number;\n}\n\ninterface ITurnServer {\n urls: string[];\n username: string;\n credential: string;\n}\n\ninterface IServerVersions {\n versions: string;\n unstable_features: Record;\n}\n\ninterface IClientWellKnown {\n [key: string]: any;\n \"m.homeserver\": {\n base_url: string;\n };\n \"m.identity_server\"?: {\n base_url: string;\n };\n}\n\ninterface IKeyBackupPath {\n path: string;\n queryData?: {\n version: string;\n };\n}\n\ninterface IMediaConfig {\n [key: string]: any; // extensible\n \"m.upload.size\"?: number;\n}\n\ninterface IThirdPartySigned {\n sender: string;\n mxid: string;\n token: string;\n signatures: ISignatures;\n}\n\ninterface IJoinRequestBody {\n third_party_signed?: IThirdPartySigned;\n}\n\ninterface ITagMetadata {\n [key: string]: any;\n order: number;\n}\n\ninterface IMessagesResponse {\n start: string;\n end: string;\n chunk: IRoomEvent[];\n state: IStateEvent[];\n}\n\nexport interface IRequestTokenResponse {\n sid: string;\n submit_url?: string;\n}\n\ninterface IRequestMsisdnTokenResponse extends IRequestTokenResponse {\n msisdn: string;\n success: boolean;\n intl_fmt: string;\n}\n\ninterface IUploadKeysRequest {\n device_keys?: Required;\n one_time_keys?: {\n [userId: string]: {\n [deviceId: string]: number;\n };\n };\n \"org.matrix.msc2732.fallback_keys\"?: Record;\n}\n\ninterface IOpenIDToken {\n access_token: string;\n token_type: \"Bearer\" | string;\n matrix_server_name: string;\n expires_in: number;\n}\n\ninterface IRoomInitialSyncResponse {\n room_id: string;\n membership: \"invite\" | \"join\" | \"leave\" | \"ban\";\n messages?: {\n start?: string;\n end?: string;\n chunk: IEventWithRoomId[];\n };\n state?: IStateEventWithRoomId[];\n visibility: Visibility;\n account_data?: IMinimalEvent[];\n presence: Partial; // legacy and undocumented, api is deprecated so this won't get attention\n}\n\ninterface IJoinedMembersResponse {\n joined: {\n [userId: string]: {\n display_name: string;\n avatar_url: string;\n };\n };\n}\n\nexport interface IPublicRoomsChunkRoom {\n room_id: string;\n name?: string;\n avatar_url?: string;\n topic?: string;\n canonical_alias?: string;\n aliases?: string[];\n world_readable: boolean;\n guest_can_join: boolean;\n num_joined_members: number;\n}\n\ninterface IPublicRoomsResponse {\n chunk: IPublicRoomsChunkRoom[];\n next_batch?: string;\n prev_batch?: string;\n total_room_count_estimate?: number;\n}\n\ninterface IUserDirectoryResponse {\n results: {\n user_id: string;\n display_name?: string;\n avatar_url?: string;\n }[];\n limited: boolean;\n}\n\nexport interface IMyDevice {\n device_id: string;\n display_name?: string;\n last_seen_ip?: string;\n last_seen_ts?: number;\n}\n\ninterface IDownloadKeyResult {\n failures: { [serverName: string]: object };\n device_keys: {\n [userId: string]: {\n [deviceId: string]: IDeviceKeys & {\n unsigned?: {\n device_display_name: string;\n };\n };\n };\n };\n}\n\ninterface IClaimOTKsResult {\n failures: { [serverName: string]: object };\n one_time_keys: {\n [userId: string]: {\n [deviceId: string]: string;\n };\n };\n}\n\nexport interface IFieldType {\n regexp: string;\n placeholder: string;\n}\n\nexport interface IInstance {\n desc: string;\n icon?: string;\n fields: object;\n network_id: string;\n // XXX: this is undocumented but we rely on it: https://github.com/matrix-org/matrix-doc/issues/3203\n instance_id: string;\n}\n\nexport interface IProtocol {\n user_fields: string[];\n location_fields: string[];\n icon: string;\n field_types: Record;\n instances: IInstance[];\n}\n\ninterface IThirdPartyLocation {\n alias: string;\n protocol: string;\n fields: object;\n}\n\ninterface IThirdPartyUser {\n userid: string;\n protocol: string;\n fields: object;\n}\n/* eslint-enable camelcase */\n\n/**\n * Represents a Matrix Client. Only directly construct this if you want to use\n * custom modules. Normally, {@link createClient} should be used\n * as it specifies 'sensible' defaults for these modules.\n */\nexport class MatrixClient extends EventEmitter {\n public static readonly RESTORE_BACKUP_ERROR_BAD_KEY = 'RESTORE_BACKUP_ERROR_BAD_KEY';\n\n public reEmitter = new ReEmitter(this);\n public olmVersion: string = null; // populated after initCrypto\n public usingExternalCrypto = false;\n public store: Store;\n public deviceId?: string;\n public credentials: { userId?: string };\n public pickleKey: string;\n public scheduler: MatrixScheduler;\n public clientRunning = false;\n public timelineSupport = false;\n public urlPreviewCache: { [key: string]: Promise } = {};\n public unstableClientRelationAggregation = false;\n public identityServer: IIdentityServerProvider;\n public sessionStore: SessionStore; // XXX: Intended private, used in code.\n public http: MatrixHttpApi; // XXX: Intended private, used in code.\n public crypto: Crypto; // XXX: Intended private, used in code.\n public cryptoCallbacks: ICryptoCallbacks; // XXX: Intended private, used in code.\n public callEventHandler: CallEventHandler; // XXX: Intended private, used in code.\n public supportsCallTransfer = false; // XXX: Intended private, used in code.\n public forceTURN = false; // XXX: Intended private, used in code.\n public iceCandidatePoolSize = 0; // XXX: Intended private, used in code.\n public idBaseUrl: string;\n public baseUrl: string;\n private localAVStreamType: ConstraintsType;\n private localAVStream: MediaStream;\n\n // Note: these are all `protected` to let downstream consumers make mistakes if they want to.\n // We don't technically support this usage, but have reasons to do this.\n\n protected canSupportVoip = false;\n protected peekSync: SyncApi = null;\n protected isGuestAccount = false;\n protected ongoingScrollbacks: {[roomId: string]: {promise?: Promise, errorTs?: number}} = {};\n protected notifTimelineSet: EventTimelineSet = null;\n protected cryptoStore: CryptoStore;\n protected verificationMethods: VerificationMethod[];\n protected fallbackICEServerAllowed = false;\n protected roomList: RoomList;\n protected syncApi: SyncApi;\n public pushRules: any; // TODO: Types\n protected syncLeftRoomsPromise: Promise;\n protected syncedLeftRooms = false;\n protected clientOpts: IStoredClientOpts;\n protected clientWellKnownIntervalID: number;\n protected canResetTimelineCallback: ResetTimelineCallback;\n\n // The pushprocessor caches useful things, so keep one and re-use it\n protected pushProcessor = new PushProcessor(this);\n\n // Promise to a response of the server's /versions response\n // TODO: This should expire: https://github.com/matrix-org/matrix-js-sdk/issues/1020\n protected serverVersionsPromise: Promise;\n\n protected cachedCapabilities: {\n capabilities: ICapabilities;\n expiration: number;\n };\n protected clientWellKnown: IClientWellKnown;\n protected clientWellKnownPromise: Promise;\n protected turnServers: ITurnServer[] = [];\n protected turnServersExpiry = 0;\n protected checkTurnServersIntervalID: number;\n protected exportedOlmDeviceToImport: IOlmDevice;\n protected txnCtr = 0;\n\n constructor(opts: IMatrixClientCreateOpts) {\n super();\n\n opts.baseUrl = utils.ensureNoTrailingSlash(opts.baseUrl);\n opts.idBaseUrl = utils.ensureNoTrailingSlash(opts.idBaseUrl);\n\n this.baseUrl = opts.baseUrl;\n this.idBaseUrl = opts.idBaseUrl;\n\n this.usingExternalCrypto = opts.usingExternalCrypto;\n this.store = opts.store || new StubStore();\n this.deviceId = opts.deviceId || null;\n\n const userId = opts.userId || null;\n this.credentials = { userId };\n\n this.http = new MatrixHttpApi(this, {\n baseUrl: opts.baseUrl,\n idBaseUrl: opts.idBaseUrl,\n accessToken: opts.accessToken,\n request: opts.request,\n prefix: PREFIX_R0,\n onlyData: true,\n extraParams: opts.queryParams,\n localTimeoutMs: opts.localTimeoutMs,\n useAuthorizationHeader: opts.useAuthorizationHeader,\n });\n\n if (opts.deviceToImport) {\n if (this.deviceId) {\n logger.warn(\n 'not importing device because device ID is provided to ' +\n 'constructor independently of exported data',\n );\n } else if (this.credentials.userId) {\n logger.warn(\n 'not importing device because user ID is provided to ' +\n 'constructor independently of exported data',\n );\n } else if (!opts.deviceToImport.deviceId) {\n logger.warn('not importing device because no device ID in exported data');\n } else {\n this.deviceId = opts.deviceToImport.deviceId;\n this.credentials.userId = opts.deviceToImport.userId;\n // will be used during async initialization of the crypto\n this.exportedOlmDeviceToImport = opts.deviceToImport.olmDevice;\n }\n } else if (opts.pickleKey) {\n this.pickleKey = opts.pickleKey;\n }\n\n this.scheduler = opts.scheduler;\n if (this.scheduler) {\n this.scheduler.setProcessFunction(async (eventToSend) => {\n const room = this.getRoom(eventToSend.getRoomId());\n if (eventToSend.status !== EventStatus.SENDING) {\n this.updatePendingEventStatus(room, eventToSend, EventStatus.SENDING);\n }\n const res = await this.sendEventHttpRequest(eventToSend);\n if (room) {\n // ensure we update pending event before the next scheduler run so that any listeners to event id\n // updates on the synchronous event emitter get a chance to run first.\n room.updatePendingEvent(eventToSend, EventStatus.SENT, res.event_id);\n }\n return res;\n });\n }\n\n // try constructing a MatrixCall to see if we are running in an environment\n // which has WebRTC. If we are, listen for and handle m.call.* events.\n const call = createNewMatrixCall(this, undefined, undefined);\n if (call) {\n this.callEventHandler = new CallEventHandler(this);\n this.canSupportVoip = true;\n // Start listening for calls after the initial sync is done\n // We do not need to backfill the call event buffer\n // with encrypted events that might never get decrypted\n this.on(\"sync\", this.startCallEventHandler);\n }\n\n this.timelineSupport = Boolean(opts.timelineSupport);\n this.unstableClientRelationAggregation = !!opts.unstableClientRelationAggregation;\n\n this.cryptoStore = opts.cryptoStore;\n this.sessionStore = opts.sessionStore;\n this.verificationMethods = opts.verificationMethods;\n this.cryptoCallbacks = opts.cryptoCallbacks || {};\n\n this.forceTURN = opts.forceTURN || false;\n this.iceCandidatePoolSize = opts.iceCandidatePoolSize === undefined ? 0 : opts.iceCandidatePoolSize;\n this.supportsCallTransfer = opts.supportsCallTransfer || false;\n this.fallbackICEServerAllowed = opts.fallbackICEServerAllowed || false;\n\n // List of which rooms have encryption enabled: separate from crypto because\n // we still want to know which rooms are encrypted even if crypto is disabled:\n // we don't want to start sending unencrypted events to them.\n this.roomList = new RoomList(this.cryptoStore);\n\n // The SDK doesn't really provide a clean way for events to recalculate the push\n // actions for themselves, so we have to kinda help them out when they are encrypted.\n // We do this so that push rules are correctly executed on events in their decrypted\n // state, such as highlights when the user's name is mentioned.\n this.on(\"Event.decrypted\", (event) => {\n const oldActions = event.getPushActions();\n const actions = this.pushProcessor.actionsForEvent(event);\n event.setPushActions(actions); // Might as well while we're here\n\n const room = this.getRoom(event.getRoomId());\n if (!room) return;\n\n const currentCount = room.getUnreadNotificationCount(NotificationCountType.Highlight);\n\n // Ensure the unread counts are kept up to date if the event is encrypted\n // We also want to make sure that the notification count goes up if we already\n // have encrypted events to avoid other code from resetting 'highlight' to zero.\n const oldHighlight = oldActions && oldActions.tweaks\n ? !!oldActions.tweaks.highlight : false;\n const newHighlight = actions && actions.tweaks\n ? !!actions.tweaks.highlight : false;\n if (oldHighlight !== newHighlight || currentCount > 0) {\n // TODO: Handle mentions received while the client is offline\n // See also https://github.com/vector-im/element-web/issues/9069\n if (!room.hasUserReadEvent(this.getUserId(), event.getId())) {\n let newCount = currentCount;\n if (newHighlight && !oldHighlight) newCount++;\n if (!newHighlight && oldHighlight) newCount--;\n room.setUnreadNotificationCount(NotificationCountType.Highlight, newCount);\n\n // Fix 'Mentions Only' rooms from not having the right badge count\n const totalCount = room.getUnreadNotificationCount(NotificationCountType.Total);\n if (totalCount < newCount) {\n room.setUnreadNotificationCount(NotificationCountType.Total, newCount);\n }\n }\n }\n });\n\n // Like above, we have to listen for read receipts from ourselves in order to\n // correctly handle notification counts on encrypted rooms.\n // This fixes https://github.com/vector-im/element-web/issues/9421\n this.on(\"Room.receipt\", (event, room) => {\n if (room && this.isRoomEncrypted(room.roomId)) {\n // Figure out if we've read something or if it's just informational\n const content = event.getContent();\n const isSelf = Object.keys(content).filter(eid => {\n return Object.keys(content[eid]['m.read']).includes(this.getUserId());\n }).length > 0;\n\n if (!isSelf) return;\n\n // Work backwards to determine how many events are unread. We also set\n // a limit for how back we'll look to avoid spinning CPU for too long.\n // If we hit the limit, we assume the count is unchanged.\n const maxHistory = 20;\n const events = room.getLiveTimeline().getEvents();\n\n let highlightCount = 0;\n\n for (let i = events.length - 1; i >= 0; i--) {\n if (i === events.length - maxHistory) return; // limit reached\n\n const event = events[i];\n\n if (room.hasUserReadEvent(this.getUserId(), event.getId())) {\n // If the user has read the event, then the counting is done.\n break;\n }\n\n const pushActions = this.getPushActionsForEvent(event);\n highlightCount += pushActions.tweaks &&\n pushActions.tweaks.highlight ? 1 : 0;\n }\n\n // Note: we don't need to handle 'total' notifications because the counts\n // will come from the server.\n room.setUnreadNotificationCount(\"highlight\", highlightCount);\n }\n });\n }\n\n /**\n * High level helper method to begin syncing and poll for new events. To listen for these\n * events, add a listener for {@link module:client~MatrixClient#event:\"event\"}\n * via {@link module:client~MatrixClient#on}. Alternatively, listen for specific\n * state change events.\n * @param {Object=} opts Options to apply when syncing.\n */\n public async startClient(opts: IStartClientOpts) {\n if (this.clientRunning) {\n // client is already running.\n return;\n }\n this.clientRunning = true;\n // backwards compat for when 'opts' was 'historyLen'.\n if (typeof opts === \"number\") {\n opts = {\n initialSyncLimit: opts,\n };\n }\n\n // Create our own user object artificially (instead of waiting for sync)\n // so it's always available, even if the user is not in any rooms etc.\n const userId = this.getUserId();\n if (userId) {\n this.store.storeUser(new User(userId));\n }\n\n if (this.crypto) {\n this.crypto.uploadDeviceKeys();\n this.crypto.start();\n }\n\n // periodically poll for turn servers if we support voip\n if (this.canSupportVoip) {\n this.checkTurnServersIntervalID = setInterval(() => {\n this.checkTurnServers();\n }, TURN_CHECK_INTERVAL);\n // noinspection ES6MissingAwait\n this.checkTurnServers();\n }\n\n if (this.syncApi) {\n // This shouldn't happen since we thought the client was not running\n logger.error(\"Still have sync object whilst not running: stopping old one\");\n this.syncApi.stop();\n }\n\n // shallow-copy the opts dict before modifying and storing it\n this.clientOpts = Object.assign({}, opts) as IStoredClientOpts;\n this.clientOpts.crypto = this.crypto;\n this.clientOpts.canResetEntireTimeline = (roomId) => {\n if (!this.canResetTimelineCallback) {\n return false;\n }\n return this.canResetTimelineCallback(roomId);\n };\n this.syncApi = new SyncApi(this, this.clientOpts);\n this.syncApi.sync();\n\n if (this.clientOpts.clientWellKnownPollPeriod !== undefined) {\n this.clientWellKnownIntervalID = setInterval(() => {\n this.fetchClientWellKnown();\n }, 1000 * this.clientOpts.clientWellKnownPollPeriod);\n this.fetchClientWellKnown();\n }\n }\n\n /**\n * High level helper method to stop the client from polling and allow a\n * clean shutdown.\n */\n public stopClient() {\n logger.log('stopping MatrixClient');\n\n this.clientRunning = false;\n\n this.syncApi?.stop();\n this.syncApi = null;\n\n this.crypto?.stop();\n this.peekSync?.stopPeeking();\n\n this.callEventHandler?.stop();\n this.callEventHandler = null;\n\n global.clearInterval(this.checkTurnServersIntervalID);\n if (this.clientWellKnownIntervalID !== undefined) {\n global.clearInterval(this.clientWellKnownIntervalID);\n }\n }\n\n /**\n * Try to rehydrate a device if available. The client must have been\n * initialized with a `cryptoCallback.getDehydrationKey` option, and this\n * function must be called before initCrypto and startClient are called.\n *\n * @return {Promise} Resolves to undefined if a device could not be dehydrated, or\n * to the new device ID if the dehydration was successful.\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public async rehydrateDevice(): Promise {\n if (this.crypto) {\n throw new Error(\"Cannot rehydrate device after crypto is initialized\");\n }\n\n if (!this.cryptoCallbacks.getDehydrationKey) {\n return;\n }\n\n const getDeviceResult = await this.getDehydratedDevice();\n if (!getDeviceResult) {\n return;\n }\n\n if (!getDeviceResult.device_data || !getDeviceResult.device_id) {\n logger.info(\"no dehydrated device found\");\n return;\n }\n\n const account = new global.Olm.Account();\n try {\n const deviceData = getDeviceResult.device_data;\n if (deviceData.algorithm !== DEHYDRATION_ALGORITHM) {\n logger.warn(\"Wrong algorithm for dehydrated device\");\n return;\n }\n logger.log(\"unpickling dehydrated device\");\n const key = await this.cryptoCallbacks.getDehydrationKey(\n deviceData,\n (k) => {\n // copy the key so that it doesn't get clobbered\n account.unpickle(new Uint8Array(k), deviceData.account);\n },\n );\n account.unpickle(key, deviceData.account);\n logger.log(\"unpickled device\");\n\n const rehydrateResult = await this.http.authedRequest(\n undefined,\n \"POST\",\n \"/dehydrated_device/claim\",\n undefined,\n {\n device_id: getDeviceResult.device_id,\n },\n {\n prefix: \"/_matrix/client/unstable/org.matrix.msc2697.v2\",\n },\n );\n\n if (rehydrateResult.success === true) {\n this.deviceId = getDeviceResult.device_id;\n logger.info(\"using dehydrated device\");\n const pickleKey = this.pickleKey || \"DEFAULT_KEY\";\n this.exportedOlmDeviceToImport = {\n pickledAccount: account.pickle(pickleKey),\n sessions: [],\n pickleKey: pickleKey,\n };\n account.free();\n return this.deviceId;\n } else {\n account.free();\n logger.info(\"not using dehydrated device\");\n return;\n }\n } catch (e) {\n account.free();\n logger.warn(\"could not unpickle\", e);\n }\n }\n\n /**\n * Get the current dehydrated device, if any\n * @return {Promise} A promise of an object containing the dehydrated device\n */\n public async getDehydratedDevice(): Promise {\n try {\n return await this.http.authedRequest(\n undefined,\n \"GET\",\n \"/dehydrated_device\",\n undefined, undefined,\n {\n prefix: \"/_matrix/client/unstable/org.matrix.msc2697.v2\",\n },\n );\n } catch (e) {\n logger.info(\"could not get dehydrated device\", e.toString());\n return;\n }\n }\n\n /**\n * Set the dehydration key. This will also periodically dehydrate devices to\n * the server.\n *\n * @param {Uint8Array} key the dehydration key\n * @param {IDehydratedDeviceKeyInfo} [keyInfo] Information about the key. Primarily for\n * information about how to generate the key from a passphrase.\n * @param {string} [deviceDisplayName] The device display name for the\n * dehydrated device.\n * @return {Promise} A promise that resolves when the dehydrated device is stored.\n */\n public async setDehydrationKey(\n key: Uint8Array,\n keyInfo: IDehydratedDeviceKeyInfo,\n deviceDisplayName?: string,\n ): Promise {\n if (!this.crypto) {\n logger.warn('not dehydrating device if crypto is not enabled');\n return;\n }\n // XXX: Private member access.\n return await this.crypto.dehydrationManager.setKeyAndQueueDehydration(\n key, keyInfo, deviceDisplayName,\n );\n }\n\n /**\n * Creates a new dehydrated device (without queuing periodic dehydration)\n * @param {Uint8Array} key the dehydration key\n * @param {IDehydratedDeviceKeyInfo} [keyInfo] Information about the key. Primarily for\n * information about how to generate the key from a passphrase.\n * @param {string} [deviceDisplayName] The device display name for the\n * dehydrated device.\n * @return {Promise} the device id of the newly created dehydrated device\n */\n public async createDehydratedDevice(\n key: Uint8Array,\n keyInfo: IDehydratedDeviceKeyInfo,\n deviceDisplayName?: string,\n ): Promise {\n if (!this.crypto) {\n logger.warn('not dehydrating device if crypto is not enabled');\n return;\n }\n await this.crypto.dehydrationManager.setKey(\n key, keyInfo, deviceDisplayName,\n );\n // XXX: Private member access.\n return await this.crypto.dehydrationManager.dehydrateDevice();\n }\n\n public async exportDevice(): Promise {\n if (!this.crypto) {\n logger.warn('not exporting device if crypto is not enabled');\n return;\n }\n return {\n userId: this.credentials.userId,\n deviceId: this.deviceId,\n // XXX: Private member access.\n olmDevice: await this.crypto.olmDevice.export(),\n };\n }\n\n /**\n * Clear any data out of the persistent stores used by the client.\n *\n * @returns {Promise} Promise which resolves when the stores have been cleared.\n */\n public clearStores(): Promise {\n if (this.clientRunning) {\n throw new Error(\"Cannot clear stores while client is running\");\n }\n\n const promises = [];\n\n promises.push(this.store.deleteAllData());\n if (this.cryptoStore) {\n promises.push(this.cryptoStore.deleteAllData());\n }\n return Promise.all(promises).then(); // .then to fix types\n }\n\n /**\n * Get the user-id of the logged-in user\n *\n * @return {?string} MXID for the logged-in user, or null if not logged in\n */\n public getUserId(): string {\n if (this.credentials && this.credentials.userId) {\n return this.credentials.userId;\n }\n return null;\n }\n\n /**\n * Get the domain for this client's MXID\n * @return {?string} Domain of this MXID\n */\n public getDomain(): string {\n if (this.credentials && this.credentials.userId) {\n return this.credentials.userId.replace(/^.*?:/, '');\n }\n return null;\n }\n\n /**\n * Get the local part of the current user ID e.g. \"foo\" in \"@foo:bar\".\n * @return {?string} The user ID localpart or null.\n */\n public getUserIdLocalpart(): string {\n if (this.credentials && this.credentials.userId) {\n return this.credentials.userId.split(\":\")[0].substring(1);\n }\n return null;\n }\n\n /**\n * Get the device ID of this client\n * @return {?string} device ID\n */\n public getDeviceId(): string {\n return this.deviceId;\n }\n\n /**\n * Check if the runtime environment supports VoIP calling.\n * @return {boolean} True if VoIP is supported.\n */\n public supportsVoip(): boolean {\n return this.canSupportVoip;\n }\n\n /**\n * Set whether VoIP calls are forced to use only TURN\n * candidates. This is the same as the forceTURN option\n * when creating the client.\n * @param {boolean} force True to force use of TURN servers\n */\n public setForceTURN(force: boolean) {\n this.forceTURN = force;\n }\n\n /**\n * Set whether to advertise transfer support to other parties on Matrix calls.\n * @param {boolean} support True to advertise the 'm.call.transferee' capability\n */\n public setSupportsCallTransfer(support: boolean) {\n this.supportsCallTransfer = support;\n }\n\n public async getLocalVideoStream() {\n if (this.localAVStreamType === ConstraintsType.Video) {\n return this.localAVStream.clone();\n }\n\n const constraints = getUserMediaContraints(ConstraintsType.Video);\n logger.log(\"Getting user media with constraints\", constraints);\n const mediaStream = await navigator.mediaDevices.getUserMedia(constraints);\n this.localAVStreamType = ConstraintsType.Video;\n this.localAVStream = mediaStream;\n return mediaStream;\n }\n\n public async getLocalAudioStream() {\n if (this.localAVStreamType === ConstraintsType.Audio) {\n return this.localAVStream.clone();\n }\n\n const constraints = getUserMediaContraints(ConstraintsType.Audio);\n logger.log(\"Getting user media with constraints\", constraints);\n const mediaStream = await navigator.mediaDevices.getUserMedia(constraints);\n this.localAVStreamType = ConstraintsType.Audio;\n this.localAVStream = mediaStream;\n return mediaStream;\n }\n\n public stopLocalMediaStream() {\n if (this.localAVStream) {\n for (const track of this.localAVStream.getTracks()) {\n track.stop();\n }\n\n this.localAVStreamType = null;\n this.localAVStream = null;\n }\n }\n\n /**\n * Creates a new call.\n * The place*Call methods on the returned call can be used to actually place a call\n *\n * @param {string} roomId The room the call is to be placed in.\n * @param {string} invitee The user to call in the given room.\n * @return {MatrixCall} the call or null if the browser doesn't support calling.\n */\n public createCall(roomId: string, invitee?: string): MatrixCall {\n return createNewMatrixCall(this, roomId, { invitee });\n }\n\n /**\n * Get the current sync state.\n * @return {?SyncState} the sync state, which may be null.\n * @see module:client~MatrixClient#event:\"sync\"\n */\n public getSyncState(): SyncState {\n if (!this.syncApi) {\n return null;\n }\n return this.syncApi.getSyncState();\n }\n\n /**\n * Returns the additional data object associated with\n * the current sync state, or null if there is no\n * such data.\n * Sync errors, if available, are put in the 'error' key of\n * this object.\n * @return {?Object}\n */\n public getSyncStateData(): ISyncStateData | null {\n if (!this.syncApi) {\n return null;\n }\n return this.syncApi.getSyncStateData();\n }\n\n /**\n * Whether the initial sync has completed.\n * @return {boolean} True if at least one sync has happened.\n */\n public isInitialSyncComplete(): boolean {\n const state = this.getSyncState();\n if (!state) {\n return false;\n }\n return state === SyncState.Prepared || state === SyncState.Syncing;\n }\n\n /**\n * Return whether the client is configured for a guest account.\n * @return {boolean} True if this is a guest access_token (or no token is supplied).\n */\n public isGuest(): boolean {\n return this.isGuestAccount;\n }\n\n /**\n * Set whether this client is a guest account. This method is experimental\n * and may change without warning.\n * @param {boolean} guest True if this is a guest account.\n */\n public setGuest(guest: boolean) {\n // EXPERIMENTAL:\n // If the token is a macaroon, it should be encoded in it that it is a 'guest'\n // access token, which means that the SDK can determine this entirely without\n // the dev manually flipping this flag.\n this.isGuestAccount = guest;\n }\n\n /**\n * Return the provided scheduler, if any.\n * @return {?module:scheduler~MatrixScheduler} The scheduler or null\n */\n public getScheduler(): MatrixScheduler {\n return this.scheduler;\n }\n\n /**\n * Retry a backed off syncing request immediately. This should only be used when\n * the user explicitly attempts to retry their lost connection.\n * @return {boolean} True if this resulted in a request being retried.\n */\n public retryImmediately(): boolean {\n return this.syncApi.retryImmediately();\n }\n\n /**\n * Return the global notification EventTimelineSet, if any\n *\n * @return {EventTimelineSet} the globl notification EventTimelineSet\n */\n public getNotifTimelineSet(): EventTimelineSet {\n return this.notifTimelineSet;\n }\n\n /**\n * Set the global notification EventTimelineSet\n *\n * @param {EventTimelineSet} set\n */\n public setNotifTimelineSet(set: EventTimelineSet) {\n this.notifTimelineSet = set;\n }\n\n /**\n * Gets the capabilities of the homeserver. Always returns an object of\n * capability keys and their options, which may be empty.\n * @param {boolean} fresh True to ignore any cached values.\n * @return {Promise} Resolves to the capabilities of the homeserver\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public getCapabilities(fresh = false): Promise {\n const now = new Date().getTime();\n\n if (this.cachedCapabilities && !fresh) {\n if (now < this.cachedCapabilities.expiration) {\n logger.log(\"Returning cached capabilities\");\n return Promise.resolve(this.cachedCapabilities.capabilities);\n }\n }\n\n // We swallow errors because we need a default object anyhow\n return this.http.authedRequest(\n undefined, \"GET\", \"/capabilities\",\n ).catch((e) => {\n logger.error(e);\n return null; // otherwise consume the error\n }).then((r) => {\n if (!r) r = {};\n const capabilities: ICapabilities = r[\"capabilities\"] || {};\n\n // If the capabilities missed the cache, cache it for a shorter amount\n // of time to try and refresh them later.\n const cacheMs = Object.keys(capabilities).length\n ? CAPABILITIES_CACHE_MS\n : 60000 + (Math.random() * 5000);\n\n this.cachedCapabilities = {\n capabilities,\n expiration: now + cacheMs,\n };\n\n logger.log(\"Caching capabilities: \", capabilities);\n return capabilities;\n });\n }\n\n /**\n * Initialise support for end-to-end encryption in this client\n *\n * You should call this method after creating the matrixclient, but *before*\n * calling `startClient`, if you want to support end-to-end encryption.\n *\n * It will return a Promise which will resolve when the crypto layer has been\n * successfully initialised.\n */\n public async initCrypto(): Promise {\n if (!isCryptoAvailable()) {\n throw new Error(\n `End-to-end encryption not supported in this js-sdk build: did ` +\n `you remember to load the olm library?`,\n );\n }\n\n if (this.crypto) {\n logger.warn(\"Attempt to re-initialise e2e encryption on MatrixClient\");\n return;\n }\n\n if (!this.sessionStore) {\n // this is temporary, the sessionstore is supposed to be going away\n throw new Error(`Cannot enable encryption: no sessionStore provided`);\n }\n if (!this.cryptoStore) {\n // the cryptostore is provided by sdk.createClient, so this shouldn't happen\n throw new Error(`Cannot enable encryption: no cryptoStore provided`);\n }\n\n logger.log(\"Crypto: Starting up crypto store...\");\n await this.cryptoStore.startup();\n\n // initialise the list of encrypted rooms (whether or not crypto is enabled)\n logger.log(\"Crypto: initialising roomlist...\");\n await this.roomList.init();\n\n const userId = this.getUserId();\n if (userId === null) {\n throw new Error(\n `Cannot enable encryption on MatrixClient with unknown userId: ` +\n `ensure userId is passed in createClient().`,\n );\n }\n if (this.deviceId === null) {\n throw new Error(\n `Cannot enable encryption on MatrixClient with unknown deviceId: ` +\n `ensure deviceId is passed in createClient().`,\n );\n }\n\n const crypto = new Crypto(\n this,\n this.sessionStore,\n userId, this.deviceId,\n this.store,\n this.cryptoStore,\n this.roomList,\n this.verificationMethods,\n );\n\n this.reEmitter.reEmit(crypto, [\n \"crypto.keyBackupFailed\",\n \"crypto.keyBackupSessionsRemaining\",\n \"crypto.roomKeyRequest\",\n \"crypto.roomKeyRequestCancellation\",\n \"crypto.warning\",\n \"crypto.devicesUpdated\",\n \"crypto.willUpdateDevices\",\n \"deviceVerificationChanged\",\n \"userTrustStatusChanged\",\n \"crossSigning.keysChanged\",\n ]);\n\n logger.log(\"Crypto: initialising crypto object...\");\n await crypto.init({\n exportedOlmDevice: this.exportedOlmDeviceToImport,\n pickleKey: this.pickleKey,\n });\n delete this.exportedOlmDeviceToImport;\n\n this.olmVersion = Crypto.getOlmVersion();\n\n // if crypto initialisation was successful, tell it to attach its event\n // handlers.\n crypto.registerEventHandlers(this);\n this.crypto = crypto;\n }\n\n /**\n * Is end-to-end crypto enabled for this client.\n * @return {boolean} True if end-to-end is enabled.\n */\n public isCryptoEnabled(): boolean {\n return !!this.crypto;\n }\n\n /**\n * Get the Ed25519 key for this device\n *\n * @return {?string} base64-encoded ed25519 key. Null if crypto is\n * disabled.\n */\n public getDeviceEd25519Key(): string {\n if (!this.crypto) return null;\n return this.crypto.getDeviceEd25519Key();\n }\n\n /**\n * Get the Curve25519 key for this device\n *\n * @return {?string} base64-encoded curve25519 key. Null if crypto is\n * disabled.\n */\n public getDeviceCurve25519Key(): string {\n if (!this.crypto) return null;\n return this.crypto.getDeviceCurve25519Key();\n }\n\n /**\n * Upload the device keys to the homeserver.\n * @return {Promise} A promise that will resolve when the keys are uploaded.\n */\n public async uploadKeys(): Promise {\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n\n await this.crypto.uploadDeviceKeys();\n }\n\n /**\n * Download the keys for a list of users and stores the keys in the session\n * store.\n * @param {Array} userIds The users to fetch.\n * @param {boolean} forceDownload Always download the keys even if cached.\n *\n * @return {Promise} A promise which resolves to a map userId->deviceId->{@link\n * module:crypto~DeviceInfo|DeviceInfo}.\n */\n public downloadKeys(\n userIds: string[],\n forceDownload?: boolean,\n ): Promise>> {\n if (!this.crypto) {\n return Promise.reject(new Error(\"End-to-end encryption disabled\"));\n }\n return this.crypto.downloadKeys(userIds, forceDownload);\n }\n\n /**\n * Get the stored device keys for a user id\n *\n * @param {string} userId the user to list keys for.\n *\n * @return {module:crypto/deviceinfo[]} list of devices\n */\n public getStoredDevicesForUser(userId: string): DeviceInfo[] {\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n return this.crypto.getStoredDevicesForUser(userId) || [];\n }\n\n /**\n * Get the stored device key for a user id and device id\n *\n * @param {string} userId the user to list keys for.\n * @param {string} deviceId unique identifier for the device\n *\n * @return {module:crypto/deviceinfo} device or null\n */\n public getStoredDevice(userId: string, deviceId: string): DeviceInfo {\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n return this.crypto.getStoredDevice(userId, deviceId) || null;\n }\n\n /**\n * Mark the given device as verified\n *\n * @param {string} userId owner of the device\n * @param {string} deviceId unique identifier for the device or user's\n * cross-signing public key ID.\n *\n * @param {boolean=} verified whether to mark the device as verified. defaults\n * to 'true'.\n *\n * @returns {Promise}\n *\n * @fires module:client~event:MatrixClient\"deviceVerificationChanged\"\n */\n public setDeviceVerified(userId: string, deviceId: string, verified = true): Promise {\n const prom = this.setDeviceVerification(userId, deviceId, verified, null, null);\n\n // if one of the user's own devices is being marked as verified / unverified,\n // check the key backup status, since whether or not we use this depends on\n // whether it has a signature from a verified device\n if (userId == this.credentials.userId) {\n this.checkKeyBackup();\n }\n return prom;\n }\n\n /**\n * Mark the given device as blocked/unblocked\n *\n * @param {string} userId owner of the device\n * @param {string} deviceId unique identifier for the device or user's\n * cross-signing public key ID.\n *\n * @param {boolean=} blocked whether to mark the device as blocked. defaults\n * to 'true'.\n *\n * @returns {Promise}\n *\n * @fires module:client~event:MatrixClient\"deviceVerificationChanged\"\n */\n public setDeviceBlocked(userId: string, deviceId: string, blocked = true): Promise {\n return this.setDeviceVerification(userId, deviceId, null, blocked, null);\n }\n\n /**\n * Mark the given device as known/unknown\n *\n * @param {string} userId owner of the device\n * @param {string} deviceId unique identifier for the device or user's\n * cross-signing public key ID.\n *\n * @param {boolean=} known whether to mark the device as known. defaults\n * to 'true'.\n *\n * @returns {Promise}\n *\n * @fires module:client~event:MatrixClient\"deviceVerificationChanged\"\n */\n public setDeviceKnown(userId: string, deviceId: string, known = true): Promise {\n return this.setDeviceVerification(userId, deviceId, null, null, known);\n }\n\n private async setDeviceVerification(\n userId: string,\n deviceId: string,\n verified: boolean,\n blocked: boolean,\n known: boolean,\n ): Promise {\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n await this.crypto.setDeviceVerification(userId, deviceId, verified, blocked, known);\n }\n\n /**\n * Request a key verification from another user, using a DM.\n *\n * @param {string} userId the user to request verification with\n * @param {string} roomId the room to use for verification\n *\n * @returns {Promise} resolves to a VerificationRequest\n * when the request has been sent to the other party.\n */\n public requestVerificationDM(userId: string, roomId: string): Promise {\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n return this.crypto.requestVerificationDM(userId, roomId);\n }\n\n /**\n * Finds a DM verification request that is already in progress for the given room id\n *\n * @param {string} roomId the room to use for verification\n *\n * @returns {module:crypto/verification/request/VerificationRequest?} the VerificationRequest that is in progress, if any\n */\n public findVerificationRequestDMInProgress(roomId: string): VerificationRequest {\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n return this.crypto.findVerificationRequestDMInProgress(roomId);\n }\n\n /**\n * Returns all to-device verification requests that are already in progress for the given user id\n *\n * @param {string} userId the ID of the user to query\n *\n * @returns {module:crypto/verification/request/VerificationRequest[]} the VerificationRequests that are in progress\n */\n public getVerificationRequestsToDeviceInProgress(userId: string): VerificationRequest[] {\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n return this.crypto.getVerificationRequestsToDeviceInProgress(userId);\n }\n\n /**\n * Request a key verification from another user.\n *\n * @param {string} userId the user to request verification with\n * @param {Array} devices array of device IDs to send requests to. Defaults to\n * all devices owned by the user\n *\n * @returns {Promise} resolves to a VerificationRequest\n * when the request has been sent to the other party.\n */\n public requestVerification(userId: string, devices?: string[]): Promise {\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n return this.crypto.requestVerification(userId, devices);\n }\n\n /**\n * Begin a key verification.\n *\n * @param {string} method the verification method to use\n * @param {string} userId the user to verify keys with\n * @param {string} deviceId the device to verify\n *\n * @returns {Verification} a verification object\n */\n public beginKeyVerification(method: string, userId: string, deviceId: string): Verification {\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n return this.crypto.beginKeyVerification(method, userId, deviceId);\n }\n\n public checkSecretStorageKey(key: Uint8Array, info: ISecretStorageKeyInfo): Promise {\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n return this.crypto.checkSecretStorageKey(key, info);\n }\n\n /**\n * Set the global override for whether the client should ever send encrypted\n * messages to unverified devices. This provides the default for rooms which\n * do not specify a value.\n *\n * @param {boolean} value whether to blacklist all unverified devices by default\n */\n public setGlobalBlacklistUnverifiedDevices(value: boolean) {\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n return this.crypto.setGlobalBlacklistUnverifiedDevices(value);\n }\n\n /**\n * @return {boolean} whether to blacklist all unverified devices by default\n */\n public getGlobalBlacklistUnverifiedDevices(): boolean {\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n return this.crypto.getGlobalBlacklistUnverifiedDevices();\n }\n\n /**\n * Set whether sendMessage in a room with unknown and unverified devices\n * should throw an error and not send them message. This has 'Global' for\n * symmetry with setGlobalBlacklistUnverifiedDevices but there is currently\n * no room-level equivalent for this setting.\n *\n * This API is currently UNSTABLE and may change or be removed without notice.\n *\n * @param {boolean} value whether error on unknown devices\n */\n public setGlobalErrorOnUnknownDevices(value: boolean) {\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n return this.crypto.setGlobalErrorOnUnknownDevices(value);\n }\n\n /**\n * @return {boolean} whether to error on unknown devices\n *\n * This API is currently UNSTABLE and may change or be removed without notice.\n */\n public getGlobalErrorOnUnknownDevices(): boolean {\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n return this.crypto.getGlobalErrorOnUnknownDevices();\n }\n\n /**\n * Get the user's cross-signing key ID.\n *\n * The cross-signing API is currently UNSTABLE and may change without notice.\n *\n * @param {CrossSigningKey} [type=master] The type of key to get the ID of. One of\n * \"master\", \"self_signing\", or \"user_signing\". Defaults to \"master\".\n *\n * @returns {string} the key ID\n */\n public getCrossSigningId(type: CrossSigningKey | string = CrossSigningKey.Master): string {\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n return this.crypto.getCrossSigningId(type);\n }\n\n /**\n * Get the cross signing information for a given user.\n *\n * The cross-signing API is currently UNSTABLE and may change without notice.\n *\n * @param {string} userId the user ID to get the cross-signing info for.\n *\n * @returns {CrossSigningInfo} the cross signing information for the user.\n */\n public getStoredCrossSigningForUser(userId: string): CrossSigningInfo {\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n return this.crypto.getStoredCrossSigningForUser(userId);\n }\n\n /**\n * Check whether a given user is trusted.\n *\n * The cross-signing API is currently UNSTABLE and may change without notice.\n *\n * @param {string} userId The ID of the user to check.\n *\n * @returns {UserTrustLevel}\n */\n public checkUserTrust(userId: string): UserTrustLevel {\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n return this.crypto.checkUserTrust(userId);\n }\n\n /**\n * Check whether a given device is trusted.\n *\n * The cross-signing API is currently UNSTABLE and may change without notice.\n *\n * @function module:client~MatrixClient#checkDeviceTrust\n * @param {string} userId The ID of the user whose devices is to be checked.\n * @param {string} deviceId The ID of the device to check\n *\n * @returns {DeviceTrustLevel}\n */\n public checkDeviceTrust(userId: string, deviceId: string): DeviceTrustLevel {\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n return this.crypto.checkDeviceTrust(userId, deviceId);\n }\n\n /**\n * Check the copy of our cross-signing key that we have in the device list and\n * see if we can get the private key. If so, mark it as trusted.\n * @param {Object} opts ICheckOwnCrossSigningTrustOpts object\n */\n public checkOwnCrossSigningTrust(opts?: ICheckOwnCrossSigningTrustOpts): Promise {\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n return this.crypto.checkOwnCrossSigningTrust(opts);\n }\n\n /**\n * Checks that a given cross-signing private key matches a given public key.\n * This can be used by the getCrossSigningKey callback to verify that the\n * private key it is about to supply is the one that was requested.\n * @param {Uint8Array} privateKey The private key\n * @param {string} expectedPublicKey The public key\n * @returns {boolean} true if the key matches, otherwise false\n */\n public checkCrossSigningPrivateKey(privateKey: Uint8Array, expectedPublicKey: string): boolean {\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n return this.crypto.checkCrossSigningPrivateKey(privateKey, expectedPublicKey);\n }\n\n public legacyDeviceVerification(\n userId: string,\n deviceId: string,\n method: VerificationMethod,\n ): Promise {\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n return this.crypto.legacyDeviceVerification(userId, deviceId, method);\n }\n\n /**\n * Perform any background tasks that can be done before a message is ready to\n * send, in order to speed up sending of the message.\n * @param {module:models/room} room the room the event is in\n */\n public prepareToEncrypt(room: Room) {\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n return this.crypto.prepareToEncrypt(room);\n }\n\n /**\n * Checks whether cross signing:\n * - is enabled on this account and trusted by this device\n * - has private keys either cached locally or stored in secret storage\n *\n * If this function returns false, bootstrapCrossSigning() can be used\n * to fix things such that it returns true. That is to say, after\n * bootstrapCrossSigning() completes successfully, this function should\n * return true.\n * @return {boolean} True if cross-signing is ready to be used on this device\n */\n public isCrossSigningReady(): Promise {\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n return this.crypto.isCrossSigningReady();\n }\n\n /**\n * Bootstrap cross-signing by creating keys if needed. If everything is already\n * set up, then no changes are made, so this is safe to run to ensure\n * cross-signing is ready for use.\n *\n * This function:\n * - creates new cross-signing keys if they are not found locally cached nor in\n * secret storage (if it has been setup)\n *\n * The cross-signing API is currently UNSTABLE and may change without notice.\n *\n * @param {function} opts.authUploadDeviceSigningKeys Function\n * called to await an interactive auth flow when uploading device signing keys.\n * @param {boolean} [opts.setupNewCrossSigning] Optional. Reset even if keys\n * already exist.\n * Args:\n * {function} A function that makes the request requiring auth. Receives the\n * auth data as an object. Can be called multiple times, first with an empty\n * authDict, to obtain the flows.\n */\n public bootstrapCrossSigning(opts: IBootstrapCrossSigningOpts) {\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n return this.crypto.bootstrapCrossSigning(opts);\n }\n\n /**\n * Whether to trust a others users signatures of their devices.\n * If false, devices will only be considered 'verified' if we have\n * verified that device individually (effectively disabling cross-signing).\n *\n * Default: true\n *\n * @return {boolean} True if trusting cross-signed devices\n */\n public getCryptoTrustCrossSignedDevices(): boolean {\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n return this.crypto.getCryptoTrustCrossSignedDevices();\n }\n\n /**\n * See getCryptoTrustCrossSignedDevices\n\n * This may be set before initCrypto() is called to ensure no races occur.\n *\n * @param {boolean} val True to trust cross-signed devices\n */\n public setCryptoTrustCrossSignedDevices(val: boolean) {\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n return this.crypto.setCryptoTrustCrossSignedDevices(val);\n }\n\n /**\n * Counts the number of end to end session keys that are waiting to be backed up\n * @returns {Promise} Resolves to the number of sessions requiring backup\n */\n public countSessionsNeedingBackup(): Promise {\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n return this.crypto.countSessionsNeedingBackup();\n }\n\n /**\n * Get information about the encryption of an event\n *\n * @param {module:models/event.MatrixEvent} event event to be checked\n * @returns {IEncryptedEventInfo} The event information.\n */\n public getEventEncryptionInfo(event: MatrixEvent): IEncryptedEventInfo {\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n return this.crypto.getEventEncryptionInfo(event);\n }\n\n /**\n * Create a recovery key from a user-supplied passphrase.\n *\n * The Secure Secret Storage API is currently UNSTABLE and may change without notice.\n *\n * @param {string} password Passphrase string that can be entered by the user\n * when restoring the backup as an alternative to entering the recovery key.\n * Optional.\n * @returns {Promise} Object with public key metadata, encoded private\n * recovery key which should be disposed of after displaying to the user,\n * and raw private key to avoid round tripping if needed.\n */\n public createRecoveryKeyFromPassphrase(password: string): Promise {\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n return this.crypto.createRecoveryKeyFromPassphrase(password);\n }\n\n /**\n * Checks whether secret storage:\n * - is enabled on this account\n * - is storing cross-signing private keys\n * - is storing session backup key (if enabled)\n *\n * If this function returns false, bootstrapSecretStorage() can be used\n * to fix things such that it returns true. That is to say, after\n * bootstrapSecretStorage() completes successfully, this function should\n * return true.\n *\n * The Secure Secret Storage API is currently UNSTABLE and may change without notice.\n *\n * @return {boolean} True if secret storage is ready to be used on this device\n */\n public isSecretStorageReady(): Promise {\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n return this.crypto.isSecretStorageReady();\n }\n\n /**\n * Bootstrap Secure Secret Storage if needed by creating a default key. If everything is\n * already set up, then no changes are made, so this is safe to run to ensure secret\n * storage is ready for use.\n *\n * This function\n * - creates a new Secure Secret Storage key if no default key exists\n * - if a key backup exists, it is migrated to store the key in the Secret\n * Storage\n * - creates a backup if none exists, and one is requested\n * - migrates Secure Secret Storage to use the latest algorithm, if an outdated\n * algorithm is found\n *\n * @param opts\n */\n public bootstrapSecretStorage(opts: ICreateSecretStorageOpts): Promise {\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n return this.crypto.bootstrapSecretStorage(opts);\n }\n\n /**\n * Add a key for encrypting secrets.\n *\n * The Secure Secret Storage API is currently UNSTABLE and may change without notice.\n *\n * @param {string} algorithm the algorithm used by the key\n * @param {object} opts the options for the algorithm. The properties used\n * depend on the algorithm given.\n * @param {string} [keyName] the name of the key. If not given, a random name will be generated.\n *\n * @return {object} An object with:\n * keyId: {string} the ID of the key\n * keyInfo: {object} details about the key (iv, mac, passphrase)\n */\n public addSecretStorageKey(\n algorithm: string,\n opts: IAddSecretStorageKeyOpts,\n keyName?: string,\n ): Promise<{keyId: string, keyInfo: ISecretStorageKeyInfo}> {\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n return this.crypto.addSecretStorageKey(algorithm, opts, keyName);\n }\n\n /**\n * Check whether we have a key with a given ID.\n *\n * The Secure Secret Storage API is currently UNSTABLE and may change without notice.\n *\n * @param {string} [keyId = default key's ID] The ID of the key to check\n * for. Defaults to the default key ID if not provided.\n * @return {boolean} Whether we have the key.\n */\n public hasSecretStorageKey(keyId?: string): Promise {\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n return this.crypto.hasSecretStorageKey(keyId);\n }\n\n /**\n * Store an encrypted secret on the server.\n *\n * The Secure Secret Storage API is currently UNSTABLE and may change without notice.\n *\n * @param {string} name The name of the secret\n * @param {string} secret The secret contents.\n * @param {Array} keys The IDs of the keys to use to encrypt the secret or null/undefined\n * to use the default (will throw if no default key is set).\n */\n public storeSecret(name: string, secret: string, keys?: string[]) {\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n return this.crypto.storeSecret(name, secret, keys);\n }\n\n /**\n * Get a secret from storage.\n *\n * The Secure Secret Storage API is currently UNSTABLE and may change without notice.\n *\n * @param {string} name the name of the secret\n *\n * @return {string} the contents of the secret\n */\n public getSecret(name: string): Promise {\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n return this.crypto.getSecret(name);\n }\n\n /**\n * Check if a secret is stored on the server.\n *\n * The Secure Secret Storage API is currently UNSTABLE and may change without notice.\n *\n * @param {string} name the name of the secret\n * @param {boolean} checkKey check if the secret is encrypted by a trusted\n * key\n *\n * @return {object?} map of key name to key info the secret is encrypted\n * with, or null if it is not present or not encrypted with a trusted\n * key\n */\n public isSecretStored(name: string, checkKey: boolean): Promise> {\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n return this.crypto.isSecretStored(name, checkKey);\n }\n\n /**\n * Request a secret from another device.\n *\n * The Secure Secret Storage API is currently UNSTABLE and may change without notice.\n *\n * @param {string} name the name of the secret to request\n * @param {string[]} devices the devices to request the secret from\n *\n * @return {ISecretRequest} the secret request object\n */\n public requestSecret(name: string, devices: string[]): ISecretRequest {\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n return this.crypto.requestSecret(name, devices);\n }\n\n /**\n * Get the current default key ID for encrypting secrets.\n *\n * The Secure Secret Storage API is currently UNSTABLE and may change without notice.\n *\n * @return {string} The default key ID or null if no default key ID is set\n */\n public getDefaultSecretStorageKeyId(): Promise {\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n return this.crypto.getDefaultSecretStorageKeyId();\n }\n\n /**\n * Set the current default key ID for encrypting secrets.\n *\n * The Secure Secret Storage API is currently UNSTABLE and may change without notice.\n *\n * @param {string} keyId The new default key ID\n */\n public setDefaultSecretStorageKeyId(keyId: string) {\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n return this.crypto.setDefaultSecretStorageKeyId(keyId);\n }\n\n /**\n * Checks that a given secret storage private key matches a given public key.\n * This can be used by the getSecretStorageKey callback to verify that the\n * private key it is about to supply is the one that was requested.\n *\n * The Secure Secret Storage API is currently UNSTABLE and may change without notice.\n *\n * @param {Uint8Array} privateKey The private key\n * @param {string} expectedPublicKey The public key\n * @returns {boolean} true if the key matches, otherwise false\n */\n public checkSecretStoragePrivateKey(privateKey: Uint8Array, expectedPublicKey: string): boolean {\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n return this.crypto.checkSecretStoragePrivateKey(privateKey, expectedPublicKey);\n }\n\n /**\n * Get e2e information on the device that sent an event\n *\n * @param {MatrixEvent} event event to be checked\n *\n * @return {Promise}\n */\n public async getEventSenderDeviceInfo(event: MatrixEvent): Promise {\n if (!this.crypto) {\n return null;\n }\n return this.crypto.getEventSenderDeviceInfo(event);\n }\n\n /**\n * Check if the sender of an event is verified\n *\n * @param {MatrixEvent} event event to be checked\n *\n * @return {boolean} true if the sender of this event has been verified using\n * {@link module:client~MatrixClient#setDeviceVerified|setDeviceVerified}.\n */\n public async isEventSenderVerified(event: MatrixEvent): Promise {\n const device = await this.getEventSenderDeviceInfo(event);\n if (!device) {\n return false;\n }\n return device.isVerified();\n }\n\n /**\n * Cancel a room key request for this event if one is ongoing and resend the\n * request.\n * @param {MatrixEvent} event event of which to cancel and resend the room\n * key request.\n * @return {Promise} A promise that will resolve when the key request is queued\n */\n public cancelAndResendEventRoomKeyRequest(event: MatrixEvent): Promise {\n return event.cancelAndResendKeyRequest(this.crypto, this.getUserId());\n }\n\n /**\n * Enable end-to-end encryption for a room. This does not modify room state.\n * Any messages sent before the returned promise resolves will be sent unencrypted.\n * @param {string} roomId The room ID to enable encryption in.\n * @param {object} config The encryption config for the room.\n * @return {Promise} A promise that will resolve when encryption is set up.\n */\n public setRoomEncryption(roomId: string, config: IRoomEncryption): Promise {\n if (!this.crypto) {\n throw new Error(\"End-to-End encryption disabled\");\n }\n return this.crypto.setRoomEncryption(roomId, config);\n }\n\n /**\n * Whether encryption is enabled for a room.\n * @param {string} roomId the room id to query.\n * @return {boolean} whether encryption is enabled.\n */\n public isRoomEncrypted(roomId: string): boolean {\n const room = this.getRoom(roomId);\n if (!room) {\n // we don't know about this room, so can't determine if it should be\n // encrypted. Let's assume not.\n return false;\n }\n\n // if there is an 'm.room.encryption' event in this room, it should be\n // encrypted (independently of whether we actually support encryption)\n const ev = room.currentState.getStateEvents(EventType.RoomEncryption, \"\");\n if (ev) {\n return true;\n }\n\n // we don't have an m.room.encrypted event, but that might be because\n // the server is hiding it from us. Check the store to see if it was\n // previously encrypted.\n return this.roomList.isRoomEncrypted(roomId);\n }\n\n /**\n * Forces the current outbound group session to be discarded such\n * that another one will be created next time an event is sent.\n *\n * @param {string} roomId The ID of the room to discard the session for\n *\n * This should not normally be necessary.\n */\n public forceDiscardSession(roomId: string) {\n if (!this.crypto) {\n throw new Error(\"End-to-End encryption disabled\");\n }\n this.crypto.forceDiscardSession(roomId);\n }\n\n /**\n * Get a list containing all of the room keys\n *\n * This should be encrypted before returning it to the user.\n *\n * @return {Promise} a promise which resolves to a list of\n * session export objects\n */\n public exportRoomKeys(): Promise {\n if (!this.crypto) {\n return Promise.reject(new Error(\"End-to-end encryption disabled\"));\n }\n return this.crypto.exportRoomKeys();\n }\n\n /**\n * Import a list of room keys previously exported by exportRoomKeys\n *\n * @param {Object[]} keys a list of session export objects\n * @param {Object} opts\n * @param {Function} opts.progressCallback called with an object that has a \"stage\" param\n *\n * @return {Promise} a promise which resolves when the keys\n * have been imported\n */\n public importRoomKeys(keys: IMegolmSessionData[], opts: IImportRoomKeysOpts): Promise {\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n return this.crypto.importRoomKeys(keys, opts);\n }\n\n /**\n * Force a re-check of the local key backup status against\n * what's on the server.\n *\n * @returns {Object} Object with backup info (as returned by\n * getKeyBackupVersion) in backupInfo and\n * trust information (as returned by isKeyBackupTrusted)\n * in trustInfo.\n */\n public checkKeyBackup(): Promise {\n return this.crypto.backupManager.checkKeyBackup();\n }\n\n /**\n * Get information about the current key backup.\n * @returns {Promise} Information object from API or null\n */\n public async getKeyBackupVersion(): Promise {\n let res;\n try {\n res = await this.http.authedRequest(\n undefined, \"GET\", \"/room_keys/version\", undefined, undefined,\n { prefix: PREFIX_UNSTABLE },\n );\n } catch (e) {\n if (e.errcode === 'M_NOT_FOUND') {\n return null;\n } else {\n throw e;\n }\n }\n try {\n BackupManager.checkBackupVersion(res);\n } catch (e) {\n throw e;\n }\n return res;\n }\n\n /**\n * @param {object} info key backup info dict from getKeyBackupVersion()\n * @return {object} {\n * usable: [bool], // is the backup trusted, true iff there is a sig that is valid & from a trusted device\n * sigs: [\n * valid: [bool],\n * device: [DeviceInfo],\n * ]\n * }\n */\n public isKeyBackupTrusted(info: IKeyBackupInfo): Promise {\n return this.crypto.backupManager.isKeyBackupTrusted(info);\n }\n\n /**\n * @returns {boolean} true if the client is configured to back up keys to\n * the server, otherwise false. If we haven't completed a successful check\n * of key backup status yet, returns null.\n */\n public getKeyBackupEnabled(): boolean {\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n return this.crypto.backupManager.getKeyBackupEnabled();\n }\n\n /**\n * Enable backing up of keys, using data previously returned from\n * getKeyBackupVersion.\n *\n * @param {object} info Backup information object as returned by getKeyBackupVersion\n * @returns {Promise} Resolves when complete.\n */\n public enableKeyBackup(info: IKeyBackupInfo): Promise {\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n\n return this.crypto.backupManager.enableKeyBackup(info);\n }\n\n /**\n * Disable backing up of keys.\n */\n public disableKeyBackup() {\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n\n this.crypto.backupManager.disableKeyBackup();\n }\n\n /**\n * Set up the data required to create a new backup version. The backup version\n * will not be created and enabled until createKeyBackupVersion is called.\n *\n * @param {string} password Passphrase string that can be entered by the user\n * when restoring the backup as an alternative to entering the recovery key.\n * Optional.\n * @param {boolean} [opts.secureSecretStorage = false] Whether to use Secure\n * Secret Storage to store the key encrypting key backups.\n * Optional, defaults to false.\n *\n * @returns {Promise} Object that can be passed to createKeyBackupVersion and\n * additionally has a 'recovery_key' member with the user-facing recovery key string.\n */\n // TODO: Verify types\n public async prepareKeyBackupVersion(\n password: string,\n opts: IKeyBackupPrepareOpts = { secureSecretStorage: false },\n ): Promise> {\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n\n // eslint-disable-next-line camelcase\n const { algorithm, auth_data, recovery_key, privateKey } =\n await this.crypto.backupManager.prepareKeyBackupVersion(password);\n\n if (opts.secureSecretStorage) {\n await this.storeSecret(\"m.megolm_backup.v1\", encodeBase64(privateKey));\n logger.info(\"Key backup private key stored in secret storage\");\n }\n\n return {\n algorithm,\n auth_data,\n recovery_key,\n };\n }\n\n /**\n * Check whether the key backup private key is stored in secret storage.\n * @return {Promise} map of key name to key info the secret is\n * encrypted with, or null if it is not present or not encrypted with a\n * trusted key\n */\n public isKeyBackupKeyStored(): Promise> {\n return Promise.resolve(this.isSecretStored(\"m.megolm_backup.v1\", false /* checkKey */));\n }\n\n /**\n * Create a new key backup version and enable it, using the information return\n * from prepareKeyBackupVersion.\n *\n * @param {object} info Info object from prepareKeyBackupVersion\n * @returns {Promise} Object with 'version' param indicating the version created\n */\n // TODO: Fix types\n public async createKeyBackupVersion(info: IKeyBackupInfo): Promise {\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n\n await this.crypto.backupManager.createKeyBackupVersion(info);\n\n const data = {\n algorithm: info.algorithm,\n auth_data: info.auth_data,\n };\n\n // Sign the backup auth data with the device key for backwards compat with\n // older devices with cross-signing. This can probably go away very soon in\n // favour of just signing with the cross-singing master key.\n // XXX: Private member access\n await this.crypto.signObject(data.auth_data);\n\n if (\n this.cryptoCallbacks.getCrossSigningKey &&\n // XXX: Private member access\n this.crypto.crossSigningInfo.getId()\n ) {\n // now also sign the auth data with the cross-signing master key\n // we check for the callback explicitly here because we still want to be able\n // to create an un-cross-signed key backup if there is a cross-signing key but\n // no callback supplied.\n // XXX: Private member access\n await this.crypto.crossSigningInfo.signObject(data.auth_data, \"master\");\n }\n\n const res = await this.http.authedRequest(\n undefined, \"POST\", \"/room_keys/version\", undefined, data,\n { prefix: PREFIX_UNSTABLE },\n );\n\n // We could assume everything's okay and enable directly, but this ensures\n // we run the same signature verification that will be used for future\n // sessions.\n await this.checkKeyBackup();\n if (!this.getKeyBackupEnabled()) {\n logger.error(\"Key backup not usable even though we just created it\");\n }\n\n return res;\n }\n\n public deleteKeyBackupVersion(version: string): Promise {\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n\n // If we're currently backing up to this backup... stop.\n // (We start using it automatically in createKeyBackupVersion\n // so this is symmetrical).\n if (this.crypto.backupManager.version) {\n this.crypto.backupManager.disableKeyBackup();\n }\n\n const path = utils.encodeUri(\"/room_keys/version/$version\", {\n $version: version,\n });\n\n return this.http.authedRequest(\n undefined, \"DELETE\", path, undefined, undefined,\n { prefix: PREFIX_UNSTABLE },\n );\n }\n\n private makeKeyBackupPath(roomId: string, sessionId: string, version: string): IKeyBackupPath {\n let path;\n if (sessionId !== undefined) {\n path = utils.encodeUri(\"/room_keys/keys/$roomId/$sessionId\", {\n $roomId: roomId,\n $sessionId: sessionId,\n });\n } else if (roomId !== undefined) {\n path = utils.encodeUri(\"/room_keys/keys/$roomId\", {\n $roomId: roomId,\n });\n } else {\n path = \"/room_keys/keys\";\n }\n const queryData = version === undefined ? undefined : { version };\n return { path, queryData };\n }\n\n /**\n * Back up session keys to the homeserver.\n * @param {string} roomId ID of the room that the keys are for Optional.\n * @param {string} sessionId ID of the session that the keys are for Optional.\n * @param {number} version backup version Optional.\n * @param {object} data Object keys to send\n * @return {Promise} a promise that will resolve when the keys\n * are uploaded\n */\n public sendKeyBackup(roomId: string, sessionId: string, version: string, data: IKeyBackup): Promise {\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n\n const path = this.makeKeyBackupPath(roomId, sessionId, version);\n return this.http.authedRequest(\n undefined, \"PUT\", path.path, path.queryData, data,\n { prefix: PREFIX_UNSTABLE },\n );\n }\n\n /**\n * Marks all group sessions as needing to be backed up and schedules them to\n * upload in the background as soon as possible.\n */\n public async scheduleAllGroupSessionsForBackup() {\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n\n await this.crypto.backupManager.scheduleAllGroupSessionsForBackup();\n }\n\n /**\n * Marks all group sessions as needing to be backed up without scheduling\n * them to upload in the background.\n * @returns {Promise} Resolves to the number of sessions requiring a backup.\n */\n public flagAllGroupSessionsForBackup(): Promise {\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n\n return this.crypto.backupManager.flagAllGroupSessionsForBackup();\n }\n\n public isValidRecoveryKey(recoveryKey: string): boolean {\n try {\n decodeRecoveryKey(recoveryKey);\n return true;\n } catch (e) {\n return false;\n }\n }\n\n /**\n * Get the raw key for a key backup from the password\n * Used when migrating key backups into SSSS\n *\n * The cross-signing API is currently UNSTABLE and may change without notice.\n *\n * @param {string} password Passphrase\n * @param {object} backupInfo Backup metadata from `checkKeyBackup`\n * @return {Promise} key backup key\n */\n public keyBackupKeyFromPassword(password: string, backupInfo: IKeyBackupInfo): Promise {\n return keyFromAuthData(backupInfo.auth_data, password);\n }\n\n /**\n * Get the raw key for a key backup from the recovery key\n * Used when migrating key backups into SSSS\n *\n * The cross-signing API is currently UNSTABLE and may change without notice.\n *\n * @param {string} recoveryKey The recovery key\n * @return {Uint8Array} key backup key\n */\n public keyBackupKeyFromRecoveryKey(recoveryKey: string): Uint8Array {\n return decodeRecoveryKey(recoveryKey);\n }\n\n /**\n * Restore from an existing key backup via a passphrase.\n *\n * @param {string} password Passphrase\n * @param {string} [targetRoomId] Room ID to target a specific room.\n * Restores all rooms if omitted.\n * @param {string} [targetSessionId] Session ID to target a specific session.\n * Restores all sessions if omitted.\n * @param {object} backupInfo Backup metadata from `checkKeyBackup`\n * @param {object} opts Optional params such as callbacks\n * @return {Promise} Status of restoration with `total` and `imported`\n * key counts.\n */\n // TODO: Types\n public async restoreKeyBackupWithPassword(\n password: string,\n targetRoomId: string,\n targetSessionId: string,\n backupInfo: IKeyBackupInfo,\n opts: IKeyBackupRestoreOpts,\n ): Promise {\n const privKey = await keyFromAuthData(backupInfo.auth_data, password);\n return this.restoreKeyBackup(\n privKey, targetRoomId, targetSessionId, backupInfo, opts,\n );\n }\n\n /**\n * Restore from an existing key backup via a private key stored in secret\n * storage.\n *\n * @param {object} backupInfo Backup metadata from `checkKeyBackup`\n * @param {string} [targetRoomId] Room ID to target a specific room.\n * Restores all rooms if omitted.\n * @param {string} [targetSessionId] Session ID to target a specific session.\n * Restores all sessions if omitted.\n * @param {object} opts Optional params such as callbacks\n * @return {Promise} Status of restoration with `total` and `imported`\n * key counts.\n */\n // TODO: Types\n public async restoreKeyBackupWithSecretStorage(\n backupInfo: IKeyBackupInfo,\n targetRoomId?: string,\n targetSessionId?: string,\n opts?: IKeyBackupRestoreOpts,\n ): Promise {\n const storedKey = await this.getSecret(\"m.megolm_backup.v1\");\n\n // ensure that the key is in the right format. If not, fix the key and\n // store the fixed version\n const fixedKey = fixBackupKey(storedKey);\n if (fixedKey) {\n const [keyId] = await this.crypto.getSecretStorageKey();\n await this.storeSecret(\"m.megolm_backup.v1\", fixedKey, [keyId]);\n }\n\n const privKey = decodeBase64(fixedKey || storedKey);\n return this.restoreKeyBackup(\n privKey, targetRoomId, targetSessionId, backupInfo, opts,\n );\n }\n\n /**\n * Restore from an existing key backup via an encoded recovery key.\n *\n * @param {string} recoveryKey Encoded recovery key\n * @param {string} [targetRoomId] Room ID to target a specific room.\n * Restores all rooms if omitted.\n * @param {string} [targetSessionId] Session ID to target a specific session.\n * Restores all sessions if omitted.\n * @param {object} backupInfo Backup metadata from `checkKeyBackup`\n * @param {object} opts Optional params such as callbacks\n\n * @return {Promise} Status of restoration with `total` and `imported`\n * key counts.\n */\n // TODO: Types\n public restoreKeyBackupWithRecoveryKey(\n recoveryKey: string,\n targetRoomId: string,\n targetSessionId: string,\n backupInfo: IKeyBackupInfo,\n opts: IKeyBackupRestoreOpts,\n ): Promise {\n const privKey = decodeRecoveryKey(recoveryKey);\n return this.restoreKeyBackup(privKey, targetRoomId, targetSessionId, backupInfo, opts);\n }\n\n // TODO: Types\n public async restoreKeyBackupWithCache(\n targetRoomId: string,\n targetSessionId: string,\n backupInfo: IKeyBackupInfo,\n opts?: IKeyBackupRestoreOpts,\n ): Promise {\n const privKey = await this.crypto.getSessionBackupPrivateKey();\n if (!privKey) {\n throw new Error(\"Couldn't get key\");\n }\n return this.restoreKeyBackup(privKey, targetRoomId, targetSessionId, backupInfo, opts);\n }\n\n private async restoreKeyBackup(\n privKey: ArrayLike,\n targetRoomId: string,\n targetSessionId: string,\n backupInfo: IKeyBackupInfo,\n opts?: IKeyBackupRestoreOpts,\n ): Promise {\n const cacheCompleteCallback = opts?.cacheCompleteCallback;\n const progressCallback = opts?.progressCallback;\n\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n\n let totalKeyCount = 0;\n let keys = [];\n\n const path = this.makeKeyBackupPath(targetRoomId, targetSessionId, backupInfo.version);\n\n const algorithm = await BackupManager.makeAlgorithm(backupInfo, async () => { return privKey; });\n\n const untrusted = algorithm.untrusted;\n\n try {\n // If the pubkey computed from the private data we've been given\n // doesn't match the one in the auth_data, the user has entered\n // a different recovery key / the wrong passphrase.\n if (!await algorithm.keyMatches(privKey)) {\n return Promise.reject(new MatrixError({ errcode: MatrixClient.RESTORE_BACKUP_ERROR_BAD_KEY }));\n }\n\n // Cache the key, if possible.\n // This is async.\n this.crypto.storeSessionBackupPrivateKey(privKey)\n .catch((e) => {\n logger.warn(\"Error caching session backup key:\", e);\n }).then(cacheCompleteCallback);\n\n if (progressCallback) {\n progressCallback({\n stage: \"fetch\",\n });\n }\n\n const res = await this.http.authedRequest(\n undefined, \"GET\", path.path, path.queryData, undefined,\n { prefix: PREFIX_UNSTABLE },\n );\n\n if (res.rooms) {\n // TODO: Types\n for (const [roomId, roomData] of Object.entries(res.rooms)) {\n if (!roomData.sessions) continue;\n\n totalKeyCount += Object.keys(roomData.sessions).length;\n const roomKeys = await algorithm.decryptSessions(roomData.sessions);\n for (const k of roomKeys) {\n k.room_id = roomId;\n keys.push(k);\n }\n }\n } else if (res.sessions) {\n totalKeyCount = Object.keys(res.sessions).length;\n keys = await algorithm.decryptSessions(res.sessions);\n for (const k of keys) {\n k.room_id = targetRoomId;\n }\n } else {\n totalKeyCount = 1;\n try {\n const [key] = await algorithm.decryptSessions({\n [targetSessionId]: res,\n });\n key.room_id = targetRoomId;\n key.session_id = targetSessionId;\n keys.push(key);\n } catch (e) {\n logger.log(\"Failed to decrypt megolm session from backup\", e);\n }\n }\n } finally {\n algorithm.free();\n }\n\n await this.importRoomKeys(keys, {\n progressCallback,\n untrusted,\n source: \"backup\",\n });\n\n await this.checkKeyBackup();\n\n return { total: totalKeyCount, imported: keys.length };\n }\n\n public deleteKeysFromBackup(roomId: string, sessionId: string, version: string): Promise {\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n\n const path = this.makeKeyBackupPath(roomId, sessionId, version);\n return this.http.authedRequest(\n undefined, \"DELETE\", path.path, path.queryData, undefined,\n { prefix: PREFIX_UNSTABLE },\n );\n }\n\n /**\n * Share shared-history decryption keys with the given users.\n *\n * @param {string} roomId the room for which keys should be shared.\n * @param {array} userIds a list of users to share with. The keys will be sent to\n * all of the user's current devices.\n */\n public async sendSharedHistoryKeys(roomId: string, userIds: string[]) {\n if (!this.crypto) {\n throw new Error(\"End-to-end encryption disabled\");\n }\n\n const roomEncryption = this.roomList.getRoomEncryption(roomId);\n if (!roomEncryption) {\n // unknown room, or unencrypted room\n logger.error(\"Unknown room. Not sharing decryption keys\");\n return;\n }\n\n const deviceInfos = await this.crypto.downloadKeys(userIds);\n const devicesByUser = {};\n for (const [userId, devices] of Object.entries(deviceInfos)) {\n devicesByUser[userId] = Object.values(devices);\n }\n\n // XXX: Private member access\n const alg = this.crypto.getRoomDecryptor(roomId, roomEncryption.algorithm);\n if (alg.sendSharedHistoryInboundSessions) {\n await alg.sendSharedHistoryInboundSessions(devicesByUser);\n } else {\n logger.warn(\"Algorithm does not support sharing previous keys\", roomEncryption.algorithm);\n }\n }\n\n /**\n * Get the group for the given group ID.\n * This function will return a valid group for any group for which a Group event\n * has been emitted.\n * @param {string} groupId The group ID\n * @return {Group} The Group or null if the group is not known or there is no data store.\n * @deprecated groups/communities never made it to the spec and support for them is being discontinued.\n */\n public getGroup(groupId: string): Group {\n return this.store.getGroup(groupId);\n }\n\n /**\n * Retrieve all known groups.\n * @return {Group[]} A list of groups, or an empty list if there is no data store.\n * @deprecated groups/communities never made it to the spec and support for them is being discontinued.\n */\n public getGroups(): Group[] {\n return this.store.getGroups();\n }\n\n /**\n * Get the config for the media repository.\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves with an object containing the config.\n */\n public getMediaConfig(callback?: Callback): Promise {\n return this.http.authedRequest(\n callback, \"GET\", \"/config\", undefined, undefined, {\n prefix: PREFIX_MEDIA_R0,\n },\n );\n }\n\n /**\n * Get the room for the given room ID.\n * This function will return a valid room for any room for which a Room event\n * has been emitted. Note in particular that other events, eg. RoomState.members\n * will be emitted for a room before this function will return the given room.\n * @param {string} roomId The room ID\n * @return {Room} The Room or null if it doesn't exist or there is no data store.\n */\n public getRoom(roomId: string): Room {\n return this.store.getRoom(roomId);\n }\n\n /**\n * Retrieve all known rooms.\n * @return {Room[]} A list of rooms, or an empty list if there is no data store.\n */\n public getRooms(): Room[] {\n return this.store.getRooms();\n }\n\n /**\n * Retrieve all rooms that should be displayed to the user\n * This is essentially getRooms() with some rooms filtered out, eg. old versions\n * of rooms that have been replaced or (in future) other rooms that have been\n * marked at the protocol level as not to be displayed to the user.\n * @return {Room[]} A list of rooms, or an empty list if there is no data store.\n */\n public getVisibleRooms(): Room[] {\n const allRooms = this.store.getRooms();\n\n const replacedRooms = new Set();\n for (const r of allRooms) {\n const createEvent = r.currentState.getStateEvents(EventType.RoomCreate, '');\n // invites are included in this list and we don't know their create events yet\n if (createEvent) {\n const predecessor = createEvent.getContent()['predecessor'];\n if (predecessor && predecessor['room_id']) {\n replacedRooms.add(predecessor['room_id']);\n }\n }\n }\n\n return allRooms.filter((r) => {\n const tombstone = r.currentState.getStateEvents(EventType.RoomTombstone, '');\n if (tombstone && replacedRooms.has(r.roomId)) {\n return false;\n }\n return true;\n });\n }\n\n /**\n * Retrieve a user.\n * @param {string} userId The user ID to retrieve.\n * @return {?User} A user or null if there is no data store or the user does\n * not exist.\n */\n public getUser(userId: string): User {\n return this.store.getUser(userId);\n }\n\n /**\n * Retrieve all known users.\n * @return {User[]} A list of users, or an empty list if there is no data store.\n */\n public getUsers(): User[] {\n return this.store.getUsers();\n }\n\n /**\n * Set account data event for the current user.\n * It will retry the request up to 5 times.\n * @param {string} eventType The event type\n * @param {Object} content the contents object for the event\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: an empty object\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public setAccountData(eventType: EventType | string, content: IContent, callback?: Callback): Promise<{}> {\n const path = utils.encodeUri(\"/user/$userId/account_data/$type\", {\n $userId: this.credentials.userId,\n $type: eventType,\n });\n const promise = retryNetworkOperation(5, () => {\n return this.http.authedRequest(undefined, \"PUT\", path, undefined, content);\n });\n if (callback) {\n promise.then(result => callback(null, result), callback);\n }\n return promise;\n }\n\n /**\n * Get account data event of given type for the current user.\n * @param {string} eventType The event type\n * @return {?object} The contents of the given account data event\n */\n public getAccountData(eventType: string): MatrixEvent {\n return this.store.getAccountData(eventType);\n }\n\n /**\n * Get account data event of given type for the current user. This variant\n * gets account data directly from the homeserver if the local store is not\n * ready, which can be useful very early in startup before the initial sync.\n * @param {string} eventType The event type\n * @return {Promise} Resolves: The contents of the given account\n * data event.\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public async getAccountDataFromServer(eventType: string): Promise> {\n if (this.isInitialSyncComplete()) {\n const event = this.store.getAccountData(eventType);\n if (!event) {\n return null;\n }\n // The network version below returns just the content, so this branch\n // does the same to match.\n return event.getContent();\n }\n const path = utils.encodeUri(\"/user/$userId/account_data/$type\", {\n $userId: this.credentials.userId,\n $type: eventType,\n });\n try {\n return await this.http.authedRequest(\n undefined, \"GET\", path, undefined,\n );\n } catch (e) {\n if (e.data && e.data.errcode === 'M_NOT_FOUND') {\n return null;\n }\n throw e;\n }\n }\n\n /**\n * Gets the users that are ignored by this client\n * @returns {string[]} The array of users that are ignored (empty if none)\n */\n public getIgnoredUsers(): string[] {\n const event = this.getAccountData(\"m.ignored_user_list\");\n if (!event || !event.getContent() || !event.getContent()[\"ignored_users\"]) return [];\n return Object.keys(event.getContent()[\"ignored_users\"]);\n }\n\n /**\n * Sets the users that the current user should ignore.\n * @param {string[]} userIds the user IDs to ignore\n * @param {module:client.callback} [callback] Optional.\n * @return {Promise} Resolves: an empty object\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public setIgnoredUsers(userIds: string[], callback?: Callback): Promise<{}> {\n const content = { ignored_users: {} };\n userIds.map((u) => content.ignored_users[u] = {});\n return this.setAccountData(\"m.ignored_user_list\", content, callback);\n }\n\n /**\n * Gets whether or not a specific user is being ignored by this client.\n * @param {string} userId the user ID to check\n * @returns {boolean} true if the user is ignored, false otherwise\n */\n public isUserIgnored(userId: string): boolean {\n return this.getIgnoredUsers().includes(userId);\n }\n\n /**\n * Join a room. If you have already joined the room, this will no-op.\n * @param {string} roomIdOrAlias The room ID or room alias to join.\n * @param {Object} opts Options when joining the room.\n * @param {boolean} opts.syncRoom True to do a room initial sync on the resulting\n * room. If false, the returned Room object will have no current state.\n * Default: true.\n * @param {boolean} opts.inviteSignUrl If the caller has a keypair 3pid invite, the signing URL is passed in this parameter.\n * @param {string[]} opts.viaServers The server names to try and join through in addition to those that are automatically chosen.\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: Room object.\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public async joinRoom(roomIdOrAlias: string, opts?: IJoinRoomOpts, callback?: Callback): Promise {\n // to help people when upgrading..\n if (utils.isFunction(opts)) {\n throw new Error(\"Expected 'opts' object, got function.\");\n }\n opts = opts || {};\n if (opts.syncRoom === undefined) {\n opts.syncRoom = true;\n }\n\n const room = this.getRoom(roomIdOrAlias);\n if (room && room.hasMembershipState(this.credentials.userId, \"join\")) {\n return Promise.resolve(room);\n }\n\n let signPromise: Promise = Promise.resolve();\n\n if (opts.inviteSignUrl) {\n signPromise = this.http.requestOtherUrl(\n undefined, 'POST',\n opts.inviteSignUrl, { mxid: this.credentials.userId },\n );\n }\n\n const queryString = {};\n if (opts.viaServers) {\n queryString[\"server_name\"] = opts.viaServers;\n }\n\n const reqOpts = { qsStringifyOptions: { arrayFormat: 'repeat' } };\n\n try {\n const data: IJoinRequestBody = {};\n const signedInviteObj = await signPromise;\n if (signedInviteObj) {\n data.third_party_signed = signedInviteObj;\n }\n\n const path = utils.encodeUri(\"/join/$roomid\", { $roomid: roomIdOrAlias });\n const res = await this.http.authedRequest(undefined, \"POST\", path, queryString, data, reqOpts);\n\n const roomId = res['room_id'];\n const syncApi = new SyncApi(this, this.clientOpts);\n const room = syncApi.createRoom(roomId);\n if (opts.syncRoom) {\n // v2 will do this for us\n // return syncApi.syncRoom(room);\n }\n callback?.(null, room);\n return room;\n } catch (e) {\n callback?.(e);\n throw e; // rethrow for reject\n }\n }\n\n /**\n * Resend an event.\n * @param {MatrixEvent} event The event to resend.\n * @param {Room} room Optional. The room the event is in. Will update the\n * timeline entry if provided.\n * @return {Promise} Resolves: to an ISendEventResponse object\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public resendEvent(event: MatrixEvent, room: Room): Promise {\n this.updatePendingEventStatus(room, event, EventStatus.SENDING);\n return this.encryptAndSendEvent(room, event);\n }\n\n /**\n * Cancel a queued or unsent event.\n *\n * @param {MatrixEvent} event Event to cancel\n * @throws Error if the event is not in QUEUED or NOT_SENT state\n */\n public cancelPendingEvent(event: MatrixEvent) {\n if ([EventStatus.QUEUED, EventStatus.NOT_SENT].indexOf(event.status) < 0) {\n throw new Error(\"cannot cancel an event with status \" + event.status);\n }\n\n // first tell the scheduler to forget about it, if it's queued\n if (this.scheduler) {\n this.scheduler.removeEventFromQueue(event);\n }\n\n // then tell the room about the change of state, which will remove it\n // from the room's list of pending events.\n const room = this.getRoom(event.getRoomId());\n this.updatePendingEventStatus(room, event, EventStatus.CANCELLED);\n }\n\n /**\n * @param {string} roomId\n * @param {string} name\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: TODO\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public setRoomName(roomId: string, name: string, callback?: Callback): Promise {\n return this.sendStateEvent(roomId, EventType.RoomName, { name: name }, undefined, callback);\n }\n\n /**\n * @param {string} roomId\n * @param {string} topic\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: TODO\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public setRoomTopic(roomId: string, topic: string, callback?: Callback): Promise {\n return this.sendStateEvent(roomId, EventType.RoomTopic, { topic: topic }, undefined, callback);\n }\n\n /**\n * @param {string} roomId\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: TODO\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public getRoomTags(roomId: string, callback?: Callback): Promise { // TODO: Types\n const path = utils.encodeUri(\"/user/$userId/rooms/$roomId/tags/\", {\n $userId: this.credentials.userId,\n $roomId: roomId,\n });\n return this.http.authedRequest(\n callback, \"GET\", path, undefined,\n );\n }\n\n /**\n * @param {string} roomId\n * @param {string} tagName name of room tag to be set\n * @param {object} metadata associated with that tag to be stored\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: to an empty object\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public setRoomTag(roomId: string, tagName: string, metadata: ITagMetadata, callback?: Callback): Promise<{}> {\n const path = utils.encodeUri(\"/user/$userId/rooms/$roomId/tags/$tag\", {\n $userId: this.credentials.userId,\n $roomId: roomId,\n $tag: tagName,\n });\n return this.http.authedRequest(callback, \"PUT\", path, undefined, metadata);\n }\n\n /**\n * @param {string} roomId\n * @param {string} tagName name of room tag to be removed\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: TODO\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public deleteRoomTag(roomId: string, tagName: string, callback?: Callback): Promise {\n const path = utils.encodeUri(\"/user/$userId/rooms/$roomId/tags/$tag\", {\n $userId: this.credentials.userId,\n $roomId: roomId,\n $tag: tagName,\n });\n return this.http.authedRequest(\n callback, \"DELETE\", path, undefined, undefined,\n );\n }\n\n /**\n * @param {string} roomId\n * @param {string} eventType event type to be set\n * @param {object} content event content\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: to an empty object {}\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public setRoomAccountData(\n roomId: string,\n eventType: string,\n content: Record,\n callback?: Callback,\n ): Promise<{}> {\n const path = utils.encodeUri(\"/user/$userId/rooms/$roomId/account_data/$type\", {\n $userId: this.credentials.userId,\n $roomId: roomId,\n $type: eventType,\n });\n return this.http.authedRequest(callback, \"PUT\", path, undefined, content);\n }\n\n /**\n * Set a user's power level.\n * @param {string} roomId\n * @param {string} userId\n * @param {Number} powerLevel\n * @param {MatrixEvent} event\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: to an ISendEventResponse object\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public setPowerLevel(\n roomId: string,\n userId: string,\n powerLevel: number,\n event: MatrixEvent,\n callback?: Callback,\n ): Promise {\n let content = {\n users: {},\n };\n if (event?.getType() === EventType.RoomPowerLevels) {\n // take a copy of the content to ensure we don't corrupt\n // existing client state with a failed power level change\n content = utils.deepCopy(event.getContent()) as typeof content;\n }\n content.users[userId] = powerLevel;\n const path = utils.encodeUri(\"/rooms/$roomId/state/m.room.power_levels\", {\n $roomId: roomId,\n });\n return this.http.authedRequest(callback, \"PUT\", path, undefined, content);\n }\n\n /**\n * @param {string} roomId\n * @param {string} eventType\n * @param {Object} content\n * @param {string} txnId Optional.\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: to an empty object {}\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public sendEvent(\n roomId: string,\n eventType: string,\n content: IContent,\n txnId?: string,\n callback?: Callback,\n ): Promise {\n return this.sendCompleteEvent(roomId, { type: eventType, content }, txnId, callback);\n }\n\n /**\n * @param {string} roomId\n * @param {object} eventObject An object with the partial structure of an event, to which event_id, user_id, room_id and origin_server_ts will be added.\n * @param {string} txnId the txnId.\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: to an empty object {}\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n private sendCompleteEvent(\n roomId: string,\n eventObject: any,\n txnId: string,\n callback?: Callback,\n ): Promise {\n if (utils.isFunction(txnId)) {\n callback = txnId as any as Callback; // convert for legacy\n txnId = undefined;\n }\n\n if (!txnId) {\n txnId = this.makeTxnId();\n }\n\n // we always construct a MatrixEvent when sending because the store and\n // scheduler use them. We'll extract the params back out if it turns out\n // the client has no scheduler or store.\n const localEvent = new MatrixEvent(Object.assign(eventObject, {\n event_id: \"~\" + roomId + \":\" + txnId,\n user_id: this.credentials.userId,\n sender: this.credentials.userId,\n room_id: roomId,\n origin_server_ts: new Date().getTime(),\n }));\n\n const room = this.getRoom(roomId);\n\n // if this is a relation or redaction of an event\n // that hasn't been sent yet (e.g. with a local id starting with a ~)\n // then listen for the remote echo of that event so that by the time\n // this event does get sent, we have the correct event_id\n const targetId = localEvent.getAssociatedId();\n if (targetId && targetId.startsWith(\"~\")) {\n const target = room.getPendingEvents().find(e => e.getId() === targetId);\n target.once(\"Event.localEventIdReplaced\", () => {\n localEvent.updateAssociatedId(target.getId());\n });\n }\n\n const type = localEvent.getType();\n logger.log(`sendEvent of type ${type} in ${roomId} with txnId ${txnId}`);\n\n localEvent.setTxnId(txnId);\n localEvent.setStatus(EventStatus.SENDING);\n\n // add this event immediately to the local store as 'sending'.\n if (room) {\n room.addPendingEvent(localEvent, txnId);\n }\n\n // addPendingEvent can change the state to NOT_SENT if it believes\n // that there's other events that have failed. We won't bother to\n // try sending the event if the state has changed as such.\n if (localEvent.status === EventStatus.NOT_SENT) {\n return Promise.reject(new Error(\"Event blocked by other events not yet sent\"));\n }\n\n return this.encryptAndSendEvent(room, localEvent, callback);\n }\n\n /**\n * encrypts the event if necessary; adds the event to the queue, or sends it; marks the event as sent/unsent\n * @param room\n * @param event\n * @param callback\n * @returns {Promise} returns a promise which resolves with the result of the send request\n * @private\n */\n private encryptAndSendEvent(room: Room, event: MatrixEvent, callback?: Callback): Promise {\n // Add an extra Promise.resolve() to turn synchronous exceptions into promise rejections,\n // so that we can handle synchronous and asynchronous exceptions with the\n // same code path.\n return Promise.resolve().then(() => {\n const encryptionPromise = this.encryptEventIfNeeded(event, room);\n if (!encryptionPromise) return null;\n\n this.updatePendingEventStatus(room, event, EventStatus.ENCRYPTING);\n return encryptionPromise.then(() => this.updatePendingEventStatus(room, event, EventStatus.SENDING));\n }).then(() => {\n let promise: Promise;\n if (this.scheduler) {\n // if this returns a promise then the scheduler has control now and will\n // resolve/reject when it is done. Internally, the scheduler will invoke\n // processFn which is set to this._sendEventHttpRequest so the same code\n // path is executed regardless.\n promise = this.scheduler.queueEvent(event);\n if (promise && this.scheduler.getQueueForEvent(event).length > 1) {\n // event is processed FIFO so if the length is 2 or more we know\n // this event is stuck behind an earlier event.\n this.updatePendingEventStatus(room, event, EventStatus.QUEUED);\n }\n }\n\n if (!promise) {\n promise = this.sendEventHttpRequest(event);\n if (room) {\n promise = promise.then(res => {\n room.updatePendingEvent(event, EventStatus.SENT, res['event_id']);\n return res;\n });\n }\n }\n\n return promise;\n }).then(res => {\n callback?.(null, res);\n return res;\n }).catch(err => {\n logger.error(\"Error sending event\", err.stack || err);\n try {\n // set the error on the event before we update the status:\n // updating the status emits the event, so the state should be\n // consistent at that point.\n event.error = err;\n this.updatePendingEventStatus(room, event, EventStatus.NOT_SENT);\n // also put the event object on the error: the caller will need this\n // to resend or cancel the event\n err.event = event;\n\n callback?.(err);\n } catch (e) {\n logger.error(\"Exception in error handler!\", e.stack || err);\n }\n throw err;\n });\n }\n\n private encryptEventIfNeeded(event: MatrixEvent, room?: Room): Promise | null {\n if (event.isEncrypted()) {\n // this event has already been encrypted; this happens if the\n // encryption step succeeded, but the send step failed on the first\n // attempt.\n return null;\n }\n\n if (!this.isRoomEncrypted(event.getRoomId())) {\n return null;\n }\n\n if (!this.crypto && this.usingExternalCrypto) {\n // The client has opted to allow sending messages to encrypted\n // rooms even if the room is encrypted, and we haven't setup\n // crypto. This is useful for users of matrix-org/pantalaimon\n return null;\n }\n\n if (event.getType() === EventType.Reaction) {\n // For reactions, there is a very little gained by encrypting the entire\n // event, as relation data is already kept in the clear. Event\n // encryption for a reaction effectively only obscures the event type,\n // but the purpose is still obvious from the relation data, so nothing\n // is really gained. It also causes quite a few problems, such as:\n // * triggers notifications via default push rules\n // * prevents server-side bundling for reactions\n // The reaction key / content / emoji value does warrant encrypting, but\n // this will be handled separately by encrypting just this value.\n // See https://github.com/matrix-org/matrix-doc/pull/1849#pullrequestreview-248763642\n return null;\n }\n\n if (!this.crypto) {\n throw new Error(\n \"This room is configured to use encryption, but your client does \" +\n \"not support encryption.\",\n );\n }\n\n return this.crypto.encryptEvent(event, room);\n }\n\n /**\n * Returns the eventType that should be used taking encryption into account\n * for a given eventType.\n * @param {MatrixClient} client the client\n * @param {string} roomId the room for the events `eventType` relates to\n * @param {string} eventType the event type\n * @return {string} the event type taking encryption into account\n */\n private getEncryptedIfNeededEventType(roomId: string, eventType: string): string {\n if (eventType === EventType.Reaction) return eventType;\n return this.isRoomEncrypted(roomId) ? EventType.RoomMessageEncrypted : eventType;\n }\n\n private updatePendingEventStatus(room: Room | null, event: MatrixEvent, newStatus: EventStatus) {\n if (room) {\n room.updatePendingEvent(event, newStatus);\n } else {\n event.setStatus(newStatus);\n }\n }\n\n private sendEventHttpRequest(event: MatrixEvent): Promise {\n let txnId = event.getTxnId();\n if (!txnId) {\n txnId = this.makeTxnId();\n event.setTxnId(txnId);\n }\n\n const pathParams = {\n $roomId: event.getRoomId(),\n $eventType: event.getWireType(),\n $stateKey: event.getStateKey(),\n $txnId: txnId,\n };\n\n let path;\n\n if (event.isState()) {\n let pathTemplate = \"/rooms/$roomId/state/$eventType\";\n if (event.getStateKey() && event.getStateKey().length > 0) {\n pathTemplate = \"/rooms/$roomId/state/$eventType/$stateKey\";\n }\n path = utils.encodeUri(pathTemplate, pathParams);\n } else if (event.isRedaction()) {\n const pathTemplate = `/rooms/$roomId/redact/$redactsEventId/$txnId`;\n path = utils.encodeUri(pathTemplate, Object.assign({\n $redactsEventId: event.event.redacts,\n }, pathParams));\n } else {\n path = utils.encodeUri(\"/rooms/$roomId/send/$eventType/$txnId\", pathParams);\n }\n\n return this.http.authedRequest(\n undefined, \"PUT\", path, undefined, event.getWireContent(),\n ).then((res) => {\n logger.log(`Event sent to ${event.getRoomId()} with event id ${res.event_id}`);\n return res;\n });\n }\n\n /**\n * @param {string} roomId\n * @param {string} eventId\n * @param {string} [txnId] transaction id. One will be made up if not\n * supplied.\n * @param {object|module:client.callback} cbOrOpts\n * Options to pass on, may contain `reason`.\n * Can be callback for backwards compatibility.\n * @return {Promise} Resolves: TODO\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public redactEvent(\n roomId: string,\n eventId: string,\n txnId?: string,\n cbOrOpts?: Callback | IRedactOpts,\n ): Promise {\n const opts = typeof (cbOrOpts) === 'object' ? cbOrOpts : {};\n const reason = opts.reason;\n const callback = typeof (cbOrOpts) === 'function' ? cbOrOpts : undefined;\n return this.sendCompleteEvent(roomId, {\n type: EventType.RoomRedaction,\n content: { reason: reason },\n redacts: eventId,\n }, txnId, callback);\n }\n\n /**\n * @param {string} roomId\n * @param {Object} content\n * @param {string} txnId Optional.\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: to an ISendEventResponse object\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public sendMessage(\n roomId: string,\n content: IContent,\n txnId?: string,\n callback?: Callback,\n ): Promise {\n if (utils.isFunction(txnId)) {\n callback = txnId as any as Callback; // for legacy\n txnId = undefined;\n }\n return this.sendEvent(roomId, EventType.RoomMessage, content, txnId, callback);\n }\n\n /**\n * @param {string} roomId\n * @param {string} body\n * @param {string} txnId Optional.\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: to an empty object {}\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public sendTextMessage(\n roomId: string,\n body: string,\n txnId?: string,\n callback?: Callback,\n ): Promise {\n const content = ContentHelpers.makeTextMessage(body);\n return this.sendMessage(roomId, content, txnId, callback);\n }\n\n /**\n * @param {string} roomId\n * @param {string} body\n * @param {string} txnId Optional.\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: to a ISendEventResponse object\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public sendNotice(roomId: string, body: string, txnId?: string, callback?: Callback): Promise {\n const content = ContentHelpers.makeNotice(body);\n return this.sendMessage(roomId, content, txnId, callback);\n }\n\n /**\n * @param {string} roomId\n * @param {string} body\n * @param {string} txnId Optional.\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: to a ISendEventResponse object\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public sendEmoteMessage(\n roomId: string,\n body: string,\n txnId?: string,\n callback?: Callback,\n ): Promise {\n const content = ContentHelpers.makeEmoteMessage(body);\n return this.sendMessage(roomId, content, txnId, callback);\n }\n\n /**\n * @param {string} roomId\n * @param {string} url\n * @param {Object} info\n * @param {string} text\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: to a ISendEventResponse object\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public sendImageMessage(\n roomId: string,\n url: string,\n info?: IImageInfo,\n text = \"Image\",\n callback?: Callback,\n ): Promise {\n if (utils.isFunction(text)) {\n callback = text as any as Callback; // legacy\n text = undefined;\n }\n const content = {\n msgtype: MsgType.Image,\n url: url,\n info: info,\n body: text,\n };\n return this.sendMessage(roomId, content, undefined, callback);\n }\n\n /**\n * @param {string} roomId\n * @param {string} url\n * @param {Object} info\n * @param {string} text\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: to a ISendEventResponse object\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public sendStickerMessage(\n roomId: string,\n url: string,\n info?: IImageInfo,\n text = \"Sticker\",\n callback?: Callback,\n ): Promise {\n if (utils.isFunction(text)) {\n callback = text as any as Callback; // legacy\n text = undefined;\n }\n const content = {\n url: url,\n info: info,\n body: text,\n };\n return this.sendEvent(roomId, EventType.Sticker, content, undefined, callback);\n }\n\n /**\n * @param {string} roomId\n * @param {string} body\n * @param {string} htmlBody\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: to a ISendEventResponse object\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public sendHtmlMessage(\n roomId: string,\n body: string,\n htmlBody: string,\n callback?: Callback,\n ): Promise {\n const content = ContentHelpers.makeHtmlMessage(body, htmlBody);\n return this.sendMessage(roomId, content, undefined, callback);\n }\n\n /**\n * @param {string} roomId\n * @param {string} body\n * @param {string} htmlBody\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: to a ISendEventResponse object\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public sendHtmlNotice(\n roomId: string,\n body: string,\n htmlBody: string,\n callback?: Callback,\n ): Promise {\n const content = ContentHelpers.makeHtmlNotice(body, htmlBody);\n return this.sendMessage(roomId, content, undefined, callback);\n }\n\n /**\n * @param {string} roomId\n * @param {string} body\n * @param {string} htmlBody\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: to a ISendEventResponse object\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public sendHtmlEmote(\n roomId: string,\n body: string,\n htmlBody: string,\n callback?: Callback,\n ): Promise {\n const content = ContentHelpers.makeHtmlEmote(body, htmlBody);\n return this.sendMessage(roomId, content, undefined, callback);\n }\n\n /**\n * Send a receipt.\n * @param {Event} event The event being acknowledged\n * @param {string} receiptType The kind of receipt e.g. \"m.read\"\n * @param {object} body Additional content to send alongside the receipt.\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: to an empty object {}\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public sendReceipt(event: MatrixEvent, receiptType: string, body: any, callback?: Callback): Promise<{}> {\n if (typeof (body) === 'function') {\n callback = body as any as Callback; // legacy\n body = {};\n }\n\n if (this.isGuest()) {\n return Promise.resolve({}); // guests cannot send receipts so don't bother.\n }\n\n const path = utils.encodeUri(\"/rooms/$roomId/receipt/$receiptType/$eventId\", {\n $roomId: event.getRoomId(),\n $receiptType: receiptType,\n $eventId: event.getId(),\n });\n const promise = this.http.authedRequest(callback, \"POST\", path, undefined, body || {});\n\n const room = this.getRoom(event.getRoomId());\n if (room) {\n room.addLocalEchoReceipt(this.credentials.userId, event, receiptType);\n }\n return promise;\n }\n\n /**\n * Send a read receipt.\n * @param {Event} event The event that has been read.\n * @param {object} opts The options for the read receipt.\n * @param {boolean} opts.hidden True to prevent the receipt from being sent to\n * other users and homeservers. Default false (send to everyone). This\n * property is unstable and may change in the future.\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: to an empty object\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public async sendReadReceipt(event: MatrixEvent, opts?: { hidden?: boolean }, callback?: Callback): Promise<{}> {\n if (typeof (opts) === 'function') {\n callback = opts as any as Callback; // legacy\n opts = {};\n }\n if (!opts) opts = {};\n\n const eventId = event.getId();\n const room = this.getRoom(event.getRoomId());\n if (room && room.hasPendingEvent(eventId)) {\n throw new Error(`Cannot set read receipt to a pending event (${eventId})`);\n }\n\n const addlContent = {\n \"org.matrix.msc2285.hidden\": Boolean(opts.hidden),\n };\n\n return this.sendReceipt(event, \"m.read\", addlContent, callback);\n }\n\n /**\n * Set a marker to indicate the point in a room before which the user has read every\n * event. This can be retrieved from room account data (the event type is `m.fully_read`)\n * and displayed as a horizontal line in the timeline that is visually distinct to the\n * position of the user's own read receipt.\n * @param {string} roomId ID of the room that has been read\n * @param {string} rmEventId ID of the event that has been read\n * @param {MatrixEvent} rrEvent the event tracked by the read receipt. This is here for\n * convenience because the RR and the RM are commonly updated at the same time as each\n * other. The local echo of this receipt will be done if set. Optional.\n * @param {object} opts Options for the read markers\n * @param {object} opts.hidden True to hide the receipt from other users and homeservers.\n * This property is unstable and may change in the future.\n * @return {Promise} Resolves: the empty object, {}.\n */\n public async setRoomReadMarkers(\n roomId: string,\n rmEventId: string,\n rrEvent: MatrixEvent,\n opts: { hidden?: boolean },\n ): Promise<{}> {\n const room = this.getRoom(roomId);\n if (room && room.hasPendingEvent(rmEventId)) {\n throw new Error(`Cannot set read marker to a pending event (${rmEventId})`);\n }\n\n // Add the optional RR update, do local echo like `sendReceipt`\n let rrEventId;\n if (rrEvent) {\n rrEventId = rrEvent.getId();\n if (room && room.hasPendingEvent(rrEventId)) {\n throw new Error(`Cannot set read receipt to a pending event (${rrEventId})`);\n }\n if (room) {\n room.addLocalEchoReceipt(this.credentials.userId, rrEvent, \"m.read\");\n }\n }\n\n return this.setRoomReadMarkersHttpRequest(roomId, rmEventId, rrEventId, opts);\n }\n\n /**\n * Get a preview of the given URL as of (roughly) the given point in time,\n * described as an object with OpenGraph keys and associated values.\n * Attributes may be synthesized where actual OG metadata is lacking.\n * Caches results to prevent hammering the server.\n * @param {string} url The URL to get preview data for\n * @param {Number} ts The preferred point in time that the preview should\n * describe (ms since epoch). The preview returned will either be the most\n * recent one preceding this timestamp if available, or failing that the next\n * most recent available preview.\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: Object of OG metadata.\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n * May return synthesized attributes if the URL lacked OG meta.\n */\n public getUrlPreview(url: string, ts: number, callback?: Callback): Promise {\n // bucket the timestamp to the nearest minute to prevent excessive spam to the server\n // Surely 60-second accuracy is enough for anyone.\n ts = Math.floor(ts / 60000) * 60000;\n\n const parsed = new URL(url);\n parsed.hash = \"\"; // strip the hash as it won't affect the preview\n url = parsed.toString();\n\n const key = ts + \"_\" + url;\n\n // If there's already a request in flight (or we've handled it), return that instead.\n const cachedPreview = this.urlPreviewCache[key];\n if (cachedPreview) {\n if (callback) {\n cachedPreview.then(callback).catch(callback);\n }\n return cachedPreview;\n }\n\n const resp = this.http.authedRequest(\n callback, \"GET\", \"/preview_url\", {\n url: url,\n ts: ts,\n }, undefined, {\n prefix: PREFIX_MEDIA_R0,\n },\n );\n // TODO: Expire the URL preview cache sometimes\n this.urlPreviewCache[key] = resp;\n return resp;\n }\n\n /**\n * @param {string} roomId\n * @param {boolean} isTyping\n * @param {Number} timeoutMs\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: to an empty object {}\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public sendTyping(roomId: string, isTyping: boolean, timeoutMs: number, callback?: Callback): Promise<{}> {\n if (this.isGuest()) {\n return Promise.resolve({}); // guests cannot send typing notifications so don't bother.\n }\n\n const path = utils.encodeUri(\"/rooms/$roomId/typing/$userId\", {\n $roomId: roomId,\n $userId: this.credentials.userId,\n });\n const data: any = {\n typing: isTyping,\n };\n if (isTyping) {\n data.timeout = timeoutMs ? timeoutMs : 20000;\n }\n return this.http.authedRequest(callback, \"PUT\", path, undefined, data);\n }\n\n /**\n * Determines the history of room upgrades for a given room, as far as the\n * client can see. Returns an array of Rooms where the first entry is the\n * oldest and the last entry is the newest (likely current) room. If the\n * provided room is not found, this returns an empty list. This works in\n * both directions, looking for older and newer rooms of the given room.\n * @param {string} roomId The room ID to search from\n * @param {boolean} verifyLinks If true, the function will only return rooms\n * which can be proven to be linked. For example, rooms which have a create\n * event pointing to an old room which the client is not aware of or doesn't\n * have a matching tombstone would not be returned.\n * @return {Room[]} An array of rooms representing the upgrade\n * history.\n */\n public getRoomUpgradeHistory(roomId: string, verifyLinks = false): Room[] {\n let currentRoom = this.getRoom(roomId);\n if (!currentRoom) return [];\n\n const upgradeHistory = [currentRoom];\n\n // Work backwards first, looking at create events.\n let createEvent = currentRoom.currentState.getStateEvents(EventType.RoomCreate, \"\");\n while (createEvent) {\n logger.log(`Looking at ${createEvent.getId()}`);\n const predecessor = createEvent.getContent()['predecessor'];\n if (predecessor && predecessor['room_id']) {\n logger.log(`Looking at predecessor ${predecessor['room_id']}`);\n const refRoom = this.getRoom(predecessor['room_id']);\n if (!refRoom) break; // end of the chain\n\n if (verifyLinks) {\n const tombstone = refRoom.currentState.getStateEvents(EventType.RoomTombstone, \"\");\n\n if (!tombstone\n || tombstone.getContent()['replacement_room'] !== refRoom.roomId) {\n break;\n }\n }\n\n // Insert at the front because we're working backwards from the currentRoom\n upgradeHistory.splice(0, 0, refRoom);\n createEvent = refRoom.currentState.getStateEvents(EventType.RoomCreate, \"\");\n } else {\n // No further create events to look at\n break;\n }\n }\n\n // Work forwards next, looking at tombstone events\n let tombstoneEvent = currentRoom.currentState.getStateEvents(EventType.RoomTombstone, \"\");\n while (tombstoneEvent) {\n const refRoom = this.getRoom(tombstoneEvent.getContent()['replacement_room']);\n if (!refRoom) break; // end of the chain\n if (refRoom.roomId === currentRoom.roomId) break; // Tombstone is referencing it's own room\n\n if (verifyLinks) {\n createEvent = refRoom.currentState.getStateEvents(EventType.RoomCreate, \"\");\n if (!createEvent || !createEvent.getContent()['predecessor']) break;\n\n const predecessor = createEvent.getContent()['predecessor'];\n if (predecessor['room_id'] !== currentRoom.roomId) break;\n }\n\n // Push to the end because we're looking forwards\n upgradeHistory.push(refRoom);\n const roomIds = new Set(upgradeHistory.map((ref) => ref.roomId));\n if (roomIds.size < upgradeHistory.length) {\n // The last room added to the list introduced a previous roomId\n // To avoid recursion, return the last rooms - 1\n return upgradeHistory.slice(0, upgradeHistory.length - 1);\n }\n\n // Set the current room to the reference room so we know where we're at\n currentRoom = refRoom;\n tombstoneEvent = currentRoom.currentState.getStateEvents(EventType.RoomTombstone, \"\");\n }\n\n return upgradeHistory;\n }\n\n /**\n * @param {string} roomId\n * @param {string} userId\n * @param {module:client.callback} callback Optional.\n * @param {string} reason Optional.\n * @return {Promise} Resolves: {} an empty object.\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public invite(roomId: string, userId: string, callback?: Callback, reason?: string): Promise<{}> {\n return this.membershipChange(roomId, userId, \"invite\", reason, callback);\n }\n\n /**\n * Invite a user to a room based on their email address.\n * @param {string} roomId The room to invite the user to.\n * @param {string} email The email address to invite.\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: {} an empty object.\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public inviteByEmail(roomId: string, email: string, callback?: Callback): Promise<{}> {\n return this.inviteByThreePid(roomId, \"email\", email, callback);\n }\n\n /**\n * Invite a user to a room based on a third-party identifier.\n * @param {string} roomId The room to invite the user to.\n * @param {string} medium The medium to invite the user e.g. \"email\".\n * @param {string} address The address for the specified medium.\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: {} an empty object.\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public async inviteByThreePid(roomId: string, medium: string, address: string, callback?: Callback): Promise<{}> {\n const path = utils.encodeUri(\n \"/rooms/$roomId/invite\",\n { $roomId: roomId },\n );\n\n const identityServerUrl = this.getIdentityServerUrl(true);\n if (!identityServerUrl) {\n return Promise.reject(new MatrixError({\n error: \"No supplied identity server URL\",\n errcode: \"ORG.MATRIX.JSSDK_MISSING_PARAM\",\n }));\n }\n const params = {\n id_server: identityServerUrl,\n medium: medium,\n address: address,\n };\n\n if (\n this.identityServer &&\n this.identityServer.getAccessToken &&\n await this.doesServerAcceptIdentityAccessToken()\n ) {\n const identityAccessToken = await this.identityServer.getAccessToken();\n if (identityAccessToken) {\n params['id_access_token'] = identityAccessToken;\n }\n }\n\n return this.http.authedRequest(callback, \"POST\", path, undefined, params);\n }\n\n /**\n * @param {string} roomId\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: {} an empty object.\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public leave(roomId: string, callback?: Callback): Promise<{}> {\n return this.membershipChange(roomId, undefined, \"leave\", undefined, callback);\n }\n\n /**\n * Leaves all rooms in the chain of room upgrades based on the given room. By\n * default, this will leave all the previous and upgraded rooms, including the\n * given room. To only leave the given room and any previous rooms, keeping the\n * upgraded (modern) rooms untouched supply `false` to `includeFuture`.\n * @param {string} roomId The room ID to start leaving at\n * @param {boolean} includeFuture If true, the whole chain (past and future) of\n * upgraded rooms will be left.\n * @return {Promise} Resolves when completed with an object keyed\n * by room ID and value of the error encountered when leaving or null.\n */\n public leaveRoomChain(\n roomId: string,\n includeFuture = true,\n ): Promise<{ [roomId: string]: Error | MatrixError | null }> {\n const upgradeHistory = this.getRoomUpgradeHistory(roomId);\n\n let eligibleToLeave = upgradeHistory;\n if (!includeFuture) {\n eligibleToLeave = [];\n for (const room of upgradeHistory) {\n eligibleToLeave.push(room);\n if (room.roomId === roomId) {\n break;\n }\n }\n }\n\n const populationResults = {}; // {roomId: Error}\n const promises = [];\n\n const doLeave = (roomId) => {\n return this.leave(roomId).then(() => {\n populationResults[roomId] = null;\n }).catch((err) => {\n populationResults[roomId] = err;\n return null; // suppress error\n });\n };\n\n for (const room of eligibleToLeave) {\n promises.push(doLeave(room.roomId));\n }\n\n return Promise.all(promises).then(() => populationResults);\n }\n\n /**\n * @param {string} roomId\n * @param {string} userId\n * @param {string} reason Optional.\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: TODO\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public ban(roomId: string, userId: string, reason?: string, callback?: Callback) {\n return this.membershipChange(roomId, userId, \"ban\", reason, callback);\n }\n\n /**\n * @param {string} roomId\n * @param {boolean} deleteRoom True to delete the room from the store on success.\n * Default: true.\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: {} an empty object.\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public forget(roomId: string, deleteRoom?: boolean, callback?: Callback): Promise<{}> {\n if (deleteRoom === undefined) {\n deleteRoom = true;\n }\n const promise = this.membershipChange(roomId, undefined, \"forget\", undefined,\n callback);\n if (!deleteRoom) {\n return promise;\n }\n return promise.then((response) => {\n this.store.removeRoom(roomId);\n this.emit(\"deleteRoom\", roomId);\n return response;\n });\n }\n\n /**\n * @param {string} roomId\n * @param {string} userId\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: Object (currently empty)\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public unban(roomId: string, userId: string, callback?: Callback): Promise {\n // unbanning != set their state to leave: this used to be\n // the case, but was then changed so that leaving was always\n // a revoking of privilege, otherwise two people racing to\n // kick / ban someone could end up banning and then un-banning\n // them.\n const path = utils.encodeUri(\"/rooms/$roomId/unban\", {\n $roomId: roomId,\n });\n const data = {\n user_id: userId,\n };\n return this.http.authedRequest(\n callback, \"POST\", path, undefined, data,\n );\n }\n\n /**\n * @param {string} roomId\n * @param {string} userId\n * @param {string} reason Optional.\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: {} an empty object.\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public kick(roomId: string, userId: string, reason?: string, callback?: Callback): Promise<{}> {\n return this.setMembershipState(roomId, userId, \"leave\", reason, callback);\n }\n\n /**\n * This is an internal method.\n * @param {MatrixClient} client\n * @param {string} roomId\n * @param {string} userId\n * @param {string} membershipValue\n * @param {string} reason\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: TODO\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n private setMembershipState(\n roomId: string,\n userId: string,\n membershipValue: string,\n reason?: string,\n callback?: Callback,\n ) {\n if (utils.isFunction(reason)) {\n callback = reason as any as Callback; // legacy\n reason = undefined;\n }\n\n const path = utils.encodeUri(\n \"/rooms/$roomId/state/m.room.member/$userId\",\n { $roomId: roomId, $userId: userId },\n );\n\n return this.http.authedRequest(callback, \"PUT\", path, undefined, {\n membership: membershipValue,\n reason: reason,\n });\n }\n\n private membershipChange(\n roomId: string,\n userId: string,\n membership: string,\n reason?: string,\n callback?: Callback,\n ): Promise<{}> {\n if (utils.isFunction(reason)) {\n callback = reason as any as Callback; // legacy\n reason = undefined;\n }\n\n const path = utils.encodeUri(\"/rooms/$room_id/$membership\", {\n $room_id: roomId,\n $membership: membership,\n });\n return this.http.authedRequest(\n callback, \"POST\", path, undefined, {\n user_id: userId, // may be undefined e.g. on leave\n reason: reason,\n },\n );\n }\n\n /**\n * Obtain a dict of actions which should be performed for this event according\n * to the push rules for this user. Caches the dict on the event.\n * @param {MatrixEvent} event The event to get push actions for.\n * @return {module:pushprocessor~PushAction} A dict of actions to perform.\n */\n public getPushActionsForEvent(event: MatrixEvent): IActionsObject {\n if (!event.getPushActions()) {\n event.setPushActions(this.pushProcessor.actionsForEvent(event));\n }\n return event.getPushActions();\n }\n\n /**\n * @param {string} info The kind of info to set (e.g. 'avatar_url')\n * @param {Object} data The JSON object to set.\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: to an empty object {}\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n // eslint-disable-next-line camelcase\n public setProfileInfo(info: \"avatar_url\", data: { avatar_url: string }, callback?: Callback): Promise<{}>;\n public setProfileInfo(info: \"displayname\", data: { displayname: string }, callback?: Callback): Promise<{}>;\n public setProfileInfo(info: \"avatar_url\" | \"displayname\", data: object, callback?: Callback): Promise<{}> {\n const path = utils.encodeUri(\"/profile/$userId/$info\", {\n $userId: this.credentials.userId,\n $info: info,\n });\n return this.http.authedRequest(callback, \"PUT\", path, undefined, data);\n }\n\n /**\n * @param {string} name\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: {} an empty object.\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public async setDisplayName(name: string, callback?: Callback): Promise<{}> {\n const prom = await this.setProfileInfo(\"displayname\", { displayname: name }, callback);\n // XXX: synthesise a profile update for ourselves because Synapse is broken and won't\n const user = this.getUser(this.getUserId());\n if (user) {\n user.displayName = name;\n user.emit(\"User.displayName\", user.events.presence, user);\n }\n return prom;\n }\n\n /**\n * @param {string} url\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: {} an empty object.\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public async setAvatarUrl(url: string, callback?: Callback): Promise<{}> {\n const prom = await this.setProfileInfo(\"avatar_url\", { avatar_url: url }, callback);\n // XXX: synthesise a profile update for ourselves because Synapse is broken and won't\n const user = this.getUser(this.getUserId());\n if (user) {\n user.avatarUrl = url;\n user.emit(\"User.avatarUrl\", user.events.presence, user);\n }\n return prom;\n }\n\n /**\n * Turn an MXC URL into an HTTP one. This method is experimental and\n * may change.\n * @param {string} mxcUrl The MXC URL\n * @param {Number} width The desired width of the thumbnail.\n * @param {Number} height The desired height of the thumbnail.\n * @param {string} resizeMethod The thumbnail resize method to use, either\n * \"crop\" or \"scale\".\n * @param {Boolean} allowDirectLinks If true, return any non-mxc URLs\n * directly. Fetching such URLs will leak information about the user to\n * anyone they share a room with. If false, will return null for such URLs.\n * @return {?string} the avatar URL or null.\n */\n public mxcUrlToHttp(\n mxcUrl: string,\n width?: number,\n height?: number,\n resizeMethod?: string,\n allowDirectLinks?: boolean,\n ): string | null {\n return getHttpUriForMxc(this.baseUrl, mxcUrl, width, height, resizeMethod, allowDirectLinks);\n }\n\n /**\n * Sets a new status message for the user. The message may be null/falsey\n * to clear the message.\n * @param {string} newMessage The new message to set.\n * @return {Promise} Resolves: to nothing\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public _unstable_setStatusMessage(newMessage: string): Promise { // eslint-disable-line\n const type = \"im.vector.user_status\";\n return Promise.all(this.getRooms().map(async (room) => {\n const isJoined = room.getMyMembership() === \"join\";\n const looksLikeDm = room.getInvitedAndJoinedMemberCount() === 2;\n if (!isJoined || !looksLikeDm) return;\n // Check power level separately as it's a bit more expensive.\n const maySend = room.currentState.mayClientSendStateEvent(type, this);\n if (!maySend) return;\n await this.sendStateEvent(room.roomId, type, { status: newMessage }, this.getUserId());\n })).then(); // .then to fix return type\n }\n\n /**\n * @param {Object} opts Options to apply\n * @param {string} opts.presence One of \"online\", \"offline\" or \"unavailable\"\n * @param {string} opts.status_msg The status message to attach.\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: TODO\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n * @throws If 'presence' isn't a valid presence enum value.\n */\n public setPresence(opts: IPresenceOpts, callback?: Callback): Promise {\n const path = utils.encodeUri(\"/presence/$userId/status\", {\n $userId: this.credentials.userId,\n });\n\n if (typeof opts === \"string\") {\n opts = { presence: opts }; // legacy\n }\n\n const validStates = [\"offline\", \"online\", \"unavailable\"];\n if (validStates.indexOf(opts.presence) === -1) {\n throw new Error(\"Bad presence value: \" + opts.presence);\n }\n return this.http.authedRequest(\n callback, \"PUT\", path, undefined, opts,\n );\n }\n\n /**\n * @param {string} userId The user to get presence for\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: The presence state for this user.\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public getPresence(userId: string, callback?: Callback): Promise { // TODO: Types\n const path = utils.encodeUri(\"/presence/$userId/status\", {\n $userId: userId,\n });\n\n return this.http.authedRequest(callback, \"GET\", path, undefined, undefined);\n }\n\n /**\n * Retrieve older messages from the given room and put them in the timeline.\n *\n * If this is called multiple times whilst a request is ongoing, the same\n * Promise will be returned. If there was a problem requesting scrollback, there\n * will be a small delay before another request can be made (to prevent tight-looping\n * when there is no connection).\n *\n * @param {Room} room The room to get older messages in.\n * @param {Integer} limit Optional. The maximum number of previous events to\n * pull in. Default: 30.\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: Room. If you are at the beginning\n * of the timeline, Room.oldState.paginationToken will be\n * null.\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public scrollback(room: Room, limit: number, callback?: Callback): Promise {\n if (utils.isFunction(limit)) {\n callback = limit as any as Callback; // legacy\n limit = undefined;\n }\n limit = limit || 30;\n let timeToWaitMs = 0;\n\n let info = this.ongoingScrollbacks[room.roomId] || {};\n if (info.promise) {\n return info.promise;\n } else if (info.errorTs) {\n const timeWaitedMs = Date.now() - info.errorTs;\n timeToWaitMs = Math.max(SCROLLBACK_DELAY_MS - timeWaitedMs, 0);\n }\n\n if (room.oldState.paginationToken === null) {\n return Promise.resolve(room); // already at the start.\n }\n // attempt to grab more events from the store first\n const numAdded = this.store.scrollback(room, limit).length;\n if (numAdded === limit) {\n // store contained everything we needed.\n return Promise.resolve(room);\n }\n // reduce the required number of events appropriately\n limit = limit - numAdded;\n\n const prom = new Promise((resolve, reject) => {\n // wait for a time before doing this request\n // (which may be 0 in order not to special case the code paths)\n sleep(timeToWaitMs).then(() => {\n return this.createMessagesRequest(\n room.roomId,\n room.oldState.paginationToken,\n limit,\n Direction.Backward,\n );\n }).then((res: IMessagesResponse) => {\n const matrixEvents = res.chunk.map(this.getEventMapper());\n if (res.state) {\n const stateEvents = res.state.map(this.getEventMapper());\n room.currentState.setUnknownStateEvents(stateEvents);\n }\n room.addEventsToTimeline(matrixEvents, true, room.getLiveTimeline());\n room.oldState.paginationToken = res.end;\n if (res.chunk.length === 0) {\n room.oldState.paginationToken = null;\n }\n this.store.storeEvents(room, matrixEvents, res.end, true);\n this.ongoingScrollbacks[room.roomId] = null;\n callback?.(null, room);\n resolve(room);\n }).catch((err) => {\n this.ongoingScrollbacks[room.roomId] = {\n errorTs: Date.now(),\n };\n callback?.(err);\n reject(err);\n });\n });\n\n info = {\n promise: prom,\n errorTs: null,\n };\n\n this.ongoingScrollbacks[room.roomId] = info;\n return prom;\n }\n\n /**\n * @param {object} [options]\n * @param {boolean} options.preventReEmit don't re-emit events emitted on an event mapped by this mapper on the client\n * @param {boolean} options.decrypt decrypt event proactively\n * @return {Function}\n */\n public getEventMapper(options?: MapperOpts): EventMapper {\n return eventMapperFor(this, options || {});\n }\n\n /**\n * Get an EventTimeline for the given event\n *\n *

If the EventTimelineSet object already has the given event in its store, the\n * corresponding timeline will be returned. Otherwise, a /context request is\n * made, and used to construct an EventTimeline.\n *\n * @param {EventTimelineSet} timelineSet The timelineSet to look for the event in\n * @param {string} eventId The ID of the event to look for\n *\n * @return {Promise} Resolves:\n * {@link module:models/event-timeline~EventTimeline} including the given\n * event\n */\n public getEventTimeline(timelineSet: EventTimelineSet, eventId: string): Promise {\n // don't allow any timeline support unless it's been enabled.\n if (!this.timelineSupport) {\n throw new Error(\"timeline support is disabled. Set the 'timelineSupport'\" +\n \" parameter to true when creating MatrixClient to enable\" +\n \" it.\");\n }\n\n if (timelineSet.getTimelineForEvent(eventId)) {\n return Promise.resolve(timelineSet.getTimelineForEvent(eventId));\n }\n\n const path = utils.encodeUri(\n \"/rooms/$roomId/context/$eventId\", {\n $roomId: timelineSet.room.roomId,\n $eventId: eventId,\n },\n );\n\n let params = undefined;\n if (this.clientOpts.lazyLoadMembers) {\n params = { filter: JSON.stringify(Filter.LAZY_LOADING_MESSAGES_FILTER) };\n }\n\n // TODO: we should implement a backoff (as per scrollback()) to deal more\n // nicely with HTTP errors.\n const promise = this.http.authedRequest(undefined, \"GET\", path, params).then((res) => {\n if (!res.event) {\n throw new Error(\"'event' not in '/context' result - homeserver too old?\");\n }\n\n // by the time the request completes, the event might have ended up in\n // the timeline.\n if (timelineSet.getTimelineForEvent(eventId)) {\n return timelineSet.getTimelineForEvent(eventId);\n }\n\n // we start with the last event, since that's the point at which we\n // have known state.\n // events_after is already backwards; events_before is forwards.\n res.events_after.reverse();\n const events = res.events_after\n .concat([res.event])\n .concat(res.events_before);\n const matrixEvents = events.map(this.getEventMapper());\n\n let timeline = timelineSet.getTimelineForEvent(matrixEvents[0].getId());\n if (!timeline) {\n timeline = timelineSet.addTimeline();\n timeline.initialiseState(res.state.map(this.getEventMapper()));\n timeline.getState(EventTimeline.FORWARDS).paginationToken = res.end;\n } else {\n const stateEvents = res.state.map(this.getEventMapper());\n timeline.getState(EventTimeline.BACKWARDS).setUnknownStateEvents(stateEvents);\n }\n timelineSet.addEventsToTimeline(matrixEvents, true, timeline, res.start);\n\n // there is no guarantee that the event ended up in \"timeline\" (we\n // might have switched to a neighbouring timeline) - so check the\n // room's index again. On the other hand, there's no guarantee the\n // event ended up anywhere, if it was later redacted, so we just\n // return the timeline we first thought of.\n return timelineSet.getTimelineForEvent(eventId) || timeline;\n });\n return promise;\n }\n\n /**\n * Makes a request to /messages with the appropriate lazy loading filter set.\n * XXX: if we do get rid of scrollback (as it's not used at the moment),\n * we could inline this method again in paginateEventTimeline as that would\n * then be the only call-site\n * @param {string} roomId\n * @param {string} fromToken\n * @param {number} limit the maximum amount of events the retrieve\n * @param {string} dir 'f' or 'b'\n * @param {Filter} timelineFilter the timeline filter to pass\n * @return {Promise}\n */\n // XXX: Intended private, used in code.\n public createMessagesRequest(\n roomId: string,\n fromToken: string,\n limit: number,\n dir: Direction,\n timelineFilter?: Filter,\n ): Promise {\n const path = utils.encodeUri(\"/rooms/$roomId/messages\", { $roomId: roomId });\n if (limit === undefined) {\n limit = 30;\n }\n const params: Record = {\n from: fromToken,\n limit: limit,\n dir: dir,\n };\n\n let filter = null;\n if (this.clientOpts.lazyLoadMembers) {\n // create a shallow copy of LAZY_LOADING_MESSAGES_FILTER,\n // so the timelineFilter doesn't get written into it below\n filter = Object.assign({}, Filter.LAZY_LOADING_MESSAGES_FILTER);\n }\n if (timelineFilter) {\n // XXX: it's horrific that /messages' filter parameter doesn't match\n // /sync's one - see https://matrix.org/jira/browse/SPEC-451\n filter = filter || {};\n Object.assign(filter, timelineFilter.getRoomTimelineFilterComponent()?.toJSON());\n }\n if (filter) {\n params.filter = JSON.stringify(filter);\n }\n return this.http.authedRequest(undefined, \"GET\", path, params);\n }\n\n /**\n * Take an EventTimeline, and back/forward-fill results.\n *\n * @param {module:models/event-timeline~EventTimeline} eventTimeline timeline\n * object to be updated\n * @param {Object} [opts]\n * @param {boolean} [opts.backwards = false] true to fill backwards,\n * false to go forwards\n * @param {number} [opts.limit = 30] number of events to request\n *\n * @return {Promise} Resolves to a boolean: false if there are no\n * events and we reached either end of the timeline; else true.\n */\n public paginateEventTimeline(eventTimeline: EventTimeline, opts: IPaginateOpts): Promise {\n const isNotifTimeline = (eventTimeline.getTimelineSet() === this.notifTimelineSet);\n\n // TODO: we should implement a backoff (as per scrollback()) to deal more\n // nicely with HTTP errors.\n opts = opts || {};\n const backwards = opts.backwards || false;\n\n if (isNotifTimeline) {\n if (!backwards) {\n throw new Error(\"paginateNotifTimeline can only paginate backwards\");\n }\n }\n\n const dir = backwards ? EventTimeline.BACKWARDS : EventTimeline.FORWARDS;\n\n const token = eventTimeline.getPaginationToken(dir);\n if (!token) {\n // no token - no results.\n return Promise.resolve(false);\n }\n\n const pendingRequest = eventTimeline.paginationRequests[dir];\n\n if (pendingRequest) {\n // already a request in progress - return the existing promise\n return pendingRequest;\n }\n\n let path;\n let params;\n let promise;\n\n if (isNotifTimeline) {\n path = \"/notifications\";\n params = {\n limit: ('limit' in opts) ? opts.limit : 30,\n only: 'highlight',\n };\n\n if (token && token !== \"end\") {\n params.from = token;\n }\n\n promise = this.http.authedRequest(\n undefined, \"GET\", path, params, undefined,\n ).then((res) => {\n const token = res.next_token;\n const matrixEvents = [];\n\n for (let i = 0; i < res.notifications.length; i++) {\n const notification = res.notifications[i];\n const event = this.getEventMapper()(notification.event);\n event.setPushActions(\n PushProcessor.actionListToActionsObject(notification.actions),\n );\n event.event.room_id = notification.room_id; // XXX: gutwrenching\n matrixEvents[i] = event;\n }\n\n eventTimeline.getTimelineSet()\n .addEventsToTimeline(matrixEvents, backwards, eventTimeline, token);\n\n // if we've hit the end of the timeline, we need to stop trying to\n // paginate. We need to keep the 'forwards' token though, to make sure\n // we can recover from gappy syncs.\n if (backwards && !res.next_token) {\n eventTimeline.setPaginationToken(null, dir);\n }\n return res.next_token ? true : false;\n }).finally(() => {\n eventTimeline.paginationRequests[dir] = null;\n });\n eventTimeline.paginationRequests[dir] = promise;\n } else {\n const room = this.getRoom(eventTimeline.getRoomId());\n if (!room) {\n throw new Error(\"Unknown room \" + eventTimeline.getRoomId());\n }\n\n promise = this.createMessagesRequest(\n eventTimeline.getRoomId(),\n token,\n opts.limit,\n dir,\n eventTimeline.getFilter());\n promise.then((res) => {\n if (res.state) {\n const roomState = eventTimeline.getState(dir);\n const stateEvents = res.state.map(this.getEventMapper());\n roomState.setUnknownStateEvents(stateEvents);\n }\n const token = res.end;\n const matrixEvents = res.chunk.map(this.getEventMapper());\n eventTimeline.getTimelineSet()\n .addEventsToTimeline(matrixEvents, backwards, eventTimeline, token);\n\n // if we've hit the end of the timeline, we need to stop trying to\n // paginate. We need to keep the 'forwards' token though, to make sure\n // we can recover from gappy syncs.\n if (backwards && res.end == res.start) {\n eventTimeline.setPaginationToken(null, dir);\n }\n return res.end != res.start;\n }).finally(() => {\n eventTimeline.paginationRequests[dir] = null;\n });\n eventTimeline.paginationRequests[dir] = promise;\n }\n\n return promise;\n }\n\n /**\n * Reset the notifTimelineSet entirely, paginating in some historical notifs as\n * a starting point for subsequent pagination.\n */\n public resetNotifTimelineSet() {\n if (!this.notifTimelineSet) {\n return;\n }\n\n // FIXME: This thing is a total hack, and results in duplicate events being\n // added to the timeline both from /sync and /notifications, and lots of\n // slow and wasteful processing and pagination. The correct solution is to\n // extend /messages or /search or something to filter on notifications.\n\n // use the fictitious token 'end'. in practice we would ideally give it\n // the oldest backwards pagination token from /sync, but /sync doesn't\n // know about /notifications, so we have no choice but to start paginating\n // from the current point in time. This may well overlap with historical\n // notifs which are then inserted into the timeline by /sync responses.\n this.notifTimelineSet.resetLiveTimeline('end', null);\n\n // we could try to paginate a single event at this point in order to get\n // a more valid pagination token, but it just ends up with an out of order\n // timeline. given what a mess this is and given we're going to have duplicate\n // events anyway, just leave it with the dummy token for now.\n /*\n this.paginateNotifTimeline(this._notifTimelineSet.getLiveTimeline(), {\n backwards: true,\n limit: 1\n });\n */\n }\n\n /**\n * Peek into a room and receive updates about the room. This only works if the\n * history visibility for the room is world_readable.\n * @param {String} roomId The room to attempt to peek into.\n * @return {Promise} Resolves: Room object\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public peekInRoom(roomId: string): Promise {\n if (this.peekSync) {\n this.peekSync.stopPeeking();\n }\n this.peekSync = new SyncApi(this, this.clientOpts);\n return this.peekSync.peek(roomId);\n }\n\n /**\n * Stop any ongoing room peeking.\n */\n public stopPeeking() {\n if (this.peekSync) {\n this.peekSync.stopPeeking();\n this.peekSync = null;\n }\n }\n\n /**\n * Set r/w flags for guest access in a room.\n * @param {string} roomId The room to configure guest access in.\n * @param {Object} opts Options\n * @param {boolean} opts.allowJoin True to allow guests to join this room. This\n * implicitly gives guests write access. If false or not given, guests are\n * explicitly forbidden from joining the room.\n * @param {boolean} opts.allowRead True to set history visibility to\n * be world_readable. This gives guests read access *from this point forward*.\n * If false or not given, history visibility is not modified.\n * @return {Promise} Resolves: TODO\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public setGuestAccess(roomId: string, opts: IGuestAccessOpts): Promise {\n const writePromise = this.sendStateEvent(roomId, EventType.RoomGuestAccess, {\n guest_access: opts.allowJoin ? \"can_join\" : \"forbidden\",\n }, \"\");\n\n let readPromise: Promise = Promise.resolve(undefined);\n if (opts.allowRead) {\n readPromise = this.sendStateEvent(roomId, EventType.RoomHistoryVisibility, {\n history_visibility: \"world_readable\",\n }, \"\");\n }\n\n return Promise.all([readPromise, writePromise]).then(); // .then() to hide results for contract\n }\n\n /**\n * Requests an email verification token for the purposes of registration.\n * This API requests a token from the homeserver.\n * The doesServerRequireIdServerParam() method can be used to determine if\n * the server requires the id_server parameter to be provided.\n *\n * Parameters and return value are as for requestEmailToken\n\n * @param {string} email As requestEmailToken\n * @param {string} clientSecret As requestEmailToken\n * @param {number} sendAttempt As requestEmailToken\n * @param {string} nextLink As requestEmailToken\n * @return {Promise} Resolves: As requestEmailToken\n */\n public requestRegisterEmailToken(\n email: string,\n clientSecret: string,\n sendAttempt: number,\n nextLink?: string,\n ): Promise {\n return this.requestTokenFromEndpoint(\n \"/register/email/requestToken\",\n {\n email: email,\n client_secret: clientSecret,\n send_attempt: sendAttempt,\n next_link: nextLink,\n },\n );\n }\n\n /**\n * Requests a text message verification token for the purposes of registration.\n * This API requests a token from the homeserver.\n * The doesServerRequireIdServerParam() method can be used to determine if\n * the server requires the id_server parameter to be provided.\n *\n * @param {string} phoneCountry The ISO 3166-1 alpha-2 code for the country in which\n * phoneNumber should be parsed relative to.\n * @param {string} phoneNumber The phone number, in national or international format\n * @param {string} clientSecret As requestEmailToken\n * @param {number} sendAttempt As requestEmailToken\n * @param {string} nextLink As requestEmailToken\n * @return {Promise} Resolves: As requestEmailToken\n */\n public requestRegisterMsisdnToken(\n phoneCountry: string,\n phoneNumber: string,\n clientSecret: string,\n sendAttempt: number,\n nextLink?: string,\n ): Promise {\n return this.requestTokenFromEndpoint(\n \"/register/msisdn/requestToken\",\n {\n country: phoneCountry,\n phone_number: phoneNumber,\n client_secret: clientSecret,\n send_attempt: sendAttempt,\n next_link: nextLink,\n },\n );\n }\n\n /**\n * Requests an email verification token for the purposes of adding a\n * third party identifier to an account.\n * This API requests a token from the homeserver.\n * The doesServerRequireIdServerParam() method can be used to determine if\n * the server requires the id_server parameter to be provided.\n * If an account with the given email address already exists and is\n * associated with an account other than the one the user is authed as,\n * it will either send an email to the address informing them of this\n * or return M_THREEPID_IN_USE (which one is up to the homeserver).\n *\n * @param {string} email As requestEmailToken\n * @param {string} clientSecret As requestEmailToken\n * @param {number} sendAttempt As requestEmailToken\n * @param {string} nextLink As requestEmailToken\n * @return {Promise} Resolves: As requestEmailToken\n */\n public requestAdd3pidEmailToken(\n email: string,\n clientSecret: string,\n sendAttempt: number,\n nextLink: string,\n ): Promise {\n return this.requestTokenFromEndpoint(\n \"/account/3pid/email/requestToken\",\n {\n email: email,\n client_secret: clientSecret,\n send_attempt: sendAttempt,\n next_link: nextLink,\n },\n );\n }\n\n /**\n * Requests a text message verification token for the purposes of adding a\n * third party identifier to an account.\n * This API proxies the identity server /validate/email/requestToken API,\n * adding specific behaviour for the addition of phone numbers to an\n * account, as requestAdd3pidEmailToken.\n *\n * @param {string} phoneCountry As requestRegisterMsisdnToken\n * @param {string} phoneNumber As requestRegisterMsisdnToken\n * @param {string} clientSecret As requestEmailToken\n * @param {number} sendAttempt As requestEmailToken\n * @param {string} nextLink As requestEmailToken\n * @return {Promise} Resolves: As requestEmailToken\n */\n public requestAdd3pidMsisdnToken(\n phoneCountry: string,\n phoneNumber: string,\n clientSecret: string,\n sendAttempt: number,\n nextLink: string,\n ): Promise {\n return this.requestTokenFromEndpoint(\n \"/account/3pid/msisdn/requestToken\",\n {\n country: phoneCountry,\n phone_number: phoneNumber,\n client_secret: clientSecret,\n send_attempt: sendAttempt,\n next_link: nextLink,\n },\n );\n }\n\n /**\n * Requests an email verification token for the purposes of resetting\n * the password on an account.\n * This API proxies the identity server /validate/email/requestToken API,\n * adding specific behaviour for the password resetting. Specifically,\n * if no account with the given email address exists, it may either\n * return M_THREEPID_NOT_FOUND or send an email\n * to the address informing them of this (which one is up to the homeserver).\n *\n * requestEmailToken calls the equivalent API directly on the identity server,\n * therefore bypassing the password reset specific logic.\n *\n * @param {string} email As requestEmailToken\n * @param {string} clientSecret As requestEmailToken\n * @param {number} sendAttempt As requestEmailToken\n * @param {string} nextLink As requestEmailToken\n * @param {module:client.callback} callback Optional. As requestEmailToken\n * @return {Promise} Resolves: As requestEmailToken\n */\n public requestPasswordEmailToken(\n email: string,\n clientSecret: string,\n sendAttempt: number,\n nextLink?: string,\n ): Promise {\n return this.requestTokenFromEndpoint(\n \"/account/password/email/requestToken\",\n {\n email: email,\n client_secret: clientSecret,\n send_attempt: sendAttempt,\n next_link: nextLink,\n },\n );\n }\n\n /**\n * Requests a text message verification token for the purposes of resetting\n * the password on an account.\n * This API proxies the identity server /validate/email/requestToken API,\n * adding specific behaviour for the password resetting, as requestPasswordEmailToken.\n *\n * @param {string} phoneCountry As requestRegisterMsisdnToken\n * @param {string} phoneNumber As requestRegisterMsisdnToken\n * @param {string} clientSecret As requestEmailToken\n * @param {number} sendAttempt As requestEmailToken\n * @param {string} nextLink As requestEmailToken\n * @return {Promise} Resolves: As requestEmailToken\n */\n public requestPasswordMsisdnToken(\n phoneCountry: string,\n phoneNumber: string,\n clientSecret: string,\n sendAttempt: number,\n nextLink: string,\n ): Promise {\n return this.requestTokenFromEndpoint(\n \"/account/password/msisdn/requestToken\",\n {\n country: phoneCountry,\n phone_number: phoneNumber,\n client_secret: clientSecret,\n send_attempt: sendAttempt,\n next_link: nextLink,\n },\n );\n }\n\n /**\n * Internal utility function for requesting validation tokens from usage-specific\n * requestToken endpoints.\n *\n * @param {string} endpoint The endpoint to send the request to\n * @param {object} params Parameters for the POST request\n * @return {Promise} Resolves: As requestEmailToken\n */\n private async requestTokenFromEndpoint(\n endpoint: string,\n params: Record,\n ): Promise {\n const postParams = Object.assign({}, params);\n\n // If the HS supports separate add and bind, then requestToken endpoints\n // don't need an IS as they are all validated by the HS directly.\n if (!await this.doesServerSupportSeparateAddAndBind() && this.idBaseUrl) {\n const idServerUrl = new URL(this.idBaseUrl);\n postParams.id_server = idServerUrl.host;\n\n if (\n this.identityServer &&\n this.identityServer.getAccessToken &&\n await this.doesServerAcceptIdentityAccessToken()\n ) {\n const identityAccessToken = await this.identityServer.getAccessToken();\n if (identityAccessToken) {\n postParams.id_access_token = identityAccessToken;\n }\n }\n }\n\n return this.http.request(undefined, \"POST\", endpoint, undefined, postParams);\n }\n\n /**\n * Get the room-kind push rule associated with a room.\n * @param {string} scope \"global\" or device-specific.\n * @param {string} roomId the id of the room.\n * @return {object} the rule or undefined.\n */\n public getRoomPushRule(scope: string, roomId: string): any { // TODO: Types\n // There can be only room-kind push rule per room\n // and its id is the room id.\n if (this.pushRules) {\n for (let i = 0; i < this.pushRules[scope].room.length; i++) {\n const rule = this.pushRules[scope].room[i];\n if (rule.rule_id === roomId) {\n return rule;\n }\n }\n } else {\n throw new Error(\n \"SyncApi.sync() must be done before accessing to push rules.\",\n );\n }\n }\n\n /**\n * Set a room-kind muting push rule in a room.\n * The operation also updates MatrixClient.pushRules at the end.\n * @param {string} scope \"global\" or device-specific.\n * @param {string} roomId the id of the room.\n * @param {boolean} mute the mute state.\n * @return {Promise} Resolves: result object\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public setRoomMutePushRule(scope: string, roomId: string, mute: boolean): Promise | void {\n let deferred;\n let hasDontNotifyRule;\n\n // Get the existing room-kind push rule if any\n const roomPushRule = this.getRoomPushRule(scope, roomId);\n if (roomPushRule) {\n if (0 <= roomPushRule.actions.indexOf(\"dont_notify\")) {\n hasDontNotifyRule = true;\n }\n }\n\n if (!mute) {\n // Remove the rule only if it is a muting rule\n if (hasDontNotifyRule) {\n deferred = this.deletePushRule(scope, PushRuleKind.RoomSpecific, roomPushRule.rule_id);\n }\n } else {\n if (!roomPushRule) {\n deferred = this.addPushRule(scope, PushRuleKind.RoomSpecific, roomId, {\n actions: [\"dont_notify\"],\n });\n } else if (!hasDontNotifyRule) {\n // Remove the existing one before setting the mute push rule\n // This is a workaround to SYN-590 (Push rule update fails)\n deferred = utils.defer();\n this.deletePushRule(scope, PushRuleKind.RoomSpecific, roomPushRule.rule_id)\n .then(() => {\n this.addPushRule(scope, PushRuleKind.RoomSpecific, roomId, {\n actions: [\"dont_notify\"],\n }).then(() => {\n deferred.resolve();\n }).catch((err) => {\n deferred.reject(err);\n });\n }).catch((err) => {\n deferred.reject(err);\n });\n\n deferred = deferred.promise;\n }\n }\n\n if (deferred) {\n return new Promise((resolve, reject) => {\n // Update this.pushRules when the operation completes\n deferred.then(() => {\n this.getPushRules().then((result) => {\n this.pushRules = result;\n resolve();\n }).catch((err) => {\n reject(err);\n });\n }).catch((err) => {\n // Update it even if the previous operation fails. This can help the\n // app to recover when push settings has been modifed from another client\n this.getPushRules().then((result) => {\n this.pushRules = result;\n reject(err);\n }).catch((err2) => {\n reject(err);\n });\n });\n });\n }\n }\n\n public searchMessageText(opts: ISearchOpts, callback?: Callback): Promise {\n const roomEvents: ISearchRequestBody[\"search_categories\"][\"room_events\"] = {\n search_term: opts.query,\n };\n\n if ('keys' in opts) {\n roomEvents.keys = opts.keys;\n }\n\n return this.search({\n body: {\n search_categories: {\n room_events: roomEvents,\n },\n },\n }, callback);\n }\n\n /**\n * Perform a server-side search for room events.\n *\n * The returned promise resolves to an object containing the fields:\n *\n * * {number} count: estimate of the number of results\n * * {string} next_batch: token for back-pagination; if undefined, there are\n * no more results\n * * {Array} highlights: a list of words to highlight from the stemming\n * algorithm\n * * {Array} results: a list of results\n *\n * Each entry in the results list is a {module:models/search-result.SearchResult}.\n *\n * @param {Object} opts\n * @param {string} opts.term the term to search for\n * @param {Object} opts.filter a JSON filter object to pass in the request\n * @return {Promise} Resolves: result object\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public searchRoomEvents(opts: IEventSearchOpts): Promise {\n // TODO: support groups\n\n const body = {\n search_categories: {\n room_events: {\n search_term: opts.term,\n filter: opts.filter,\n order_by: SearchOrderBy.Recent,\n event_context: {\n before_limit: 1,\n after_limit: 1,\n include_profile: true,\n },\n },\n },\n };\n\n const searchResults: ISearchResults = {\n _query: body,\n results: [],\n highlights: [],\n };\n\n return this.search({ body: body }).then(res => this.processRoomEventsSearch(searchResults, res));\n }\n\n /**\n * Take a result from an earlier searchRoomEvents call, and backfill results.\n *\n * @param {object} searchResults the results object to be updated\n * @return {Promise} Resolves: updated result object\n * @return {Error} Rejects: with an error response.\n */\n public backPaginateRoomEventsSearch(searchResults: T): Promise {\n // TODO: we should implement a backoff (as per scrollback()) to deal more\n // nicely with HTTP errors.\n\n if (!searchResults.next_batch) {\n return Promise.reject(new Error(\"Cannot backpaginate event search any further\"));\n }\n\n if (searchResults.pendingRequest) {\n // already a request in progress - return the existing promise\n return searchResults.pendingRequest as Promise;\n }\n\n const searchOpts = {\n body: searchResults._query,\n next_batch: searchResults.next_batch,\n };\n\n const promise = this.search(searchOpts)\n .then(res => this.processRoomEventsSearch(searchResults, res))\n .finally(() => {\n searchResults.pendingRequest = null;\n });\n searchResults.pendingRequest = promise;\n\n return promise;\n }\n\n /**\n * helper for searchRoomEvents and backPaginateRoomEventsSearch. Processes the\n * response from the API call and updates the searchResults\n *\n * @param {Object} searchResults\n * @param {Object} response\n * @return {Object} searchResults\n * @private\n */\n // XXX: Intended private, used in code\n public processRoomEventsSearch(searchResults: T, response: ISearchResponse): T {\n const roomEvents = response.search_categories.room_events;\n\n searchResults.count = roomEvents.count;\n searchResults.next_batch = roomEvents.next_batch;\n\n // combine the highlight list with our existing list; build an object\n // to avoid O(N^2) fail\n const highlights = {};\n roomEvents.highlights.forEach((hl) => {\n highlights[hl] = 1;\n });\n searchResults.highlights.forEach((hl) => {\n highlights[hl] = 1;\n });\n\n // turn it back into a list.\n searchResults.highlights = Object.keys(highlights);\n\n // append the new results to our existing results\n const resultsLength = roomEvents.results ? roomEvents.results.length : 0;\n for (let i = 0; i < resultsLength; i++) {\n const sr = SearchResult.fromJson(roomEvents.results[i], this.getEventMapper());\n searchResults.results.push(sr);\n }\n return searchResults;\n }\n\n /**\n * Populate the store with rooms the user has left.\n * @return {Promise} Resolves: TODO - Resolved when the rooms have\n * been added to the data store.\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public syncLeftRooms(): Promise {\n // Guard against multiple calls whilst ongoing and multiple calls post success\n if (this.syncedLeftRooms) {\n return Promise.resolve([]); // don't call syncRooms again if it succeeded.\n }\n if (this.syncLeftRoomsPromise) {\n return this.syncLeftRoomsPromise; // return the ongoing request\n }\n const syncApi = new SyncApi(this, this.clientOpts);\n this.syncLeftRoomsPromise = syncApi.syncLeftRooms();\n\n // cleanup locks\n this.syncLeftRoomsPromise.then((res) => {\n logger.log(\"Marking success of sync left room request\");\n this.syncedLeftRooms = true; // flip the bit on success\n }).finally(() => {\n this.syncLeftRoomsPromise = null; // cleanup ongoing request state\n });\n\n return this.syncLeftRoomsPromise;\n }\n\n /**\n * Create a new filter.\n * @param {Object} content The HTTP body for the request\n * @return {Filter} Resolves to a Filter object.\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public createFilter(content: IFilterDefinition): Promise {\n const path = utils.encodeUri(\"/user/$userId/filter\", {\n $userId: this.credentials.userId,\n });\n return this.http.authedRequest(undefined, \"POST\", path, undefined, content).then((response) => {\n // persist the filter\n const filter = Filter.fromJson(\n this.credentials.userId, response.filter_id, content,\n );\n this.store.storeFilter(filter);\n return filter;\n });\n }\n\n /**\n * Retrieve a filter.\n * @param {string} userId The user ID of the filter owner\n * @param {string} filterId The filter ID to retrieve\n * @param {boolean} allowCached True to allow cached filters to be returned.\n * Default: True.\n * @return {Promise} Resolves: a Filter object\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public getFilter(userId: string, filterId: string, allowCached: boolean): Promise {\n if (allowCached) {\n const filter = this.store.getFilter(userId, filterId);\n if (filter) {\n return Promise.resolve(filter);\n }\n }\n\n const path = utils.encodeUri(\"/user/$userId/filter/$filterId\", {\n $userId: userId,\n $filterId: filterId,\n });\n\n return this.http.authedRequest(\n undefined, \"GET\", path, undefined, undefined,\n ).then((response) => {\n // persist the filter\n const filter = Filter.fromJson(\n userId, filterId, response,\n );\n this.store.storeFilter(filter);\n return filter;\n });\n }\n\n /**\n * @param {string} filterName\n * @param {Filter} filter\n * @return {Promise} Filter ID\n */\n public async getOrCreateFilter(filterName: string, filter: Filter): Promise {\n const filterId = this.store.getFilterIdByName(filterName);\n let existingId = undefined;\n\n if (filterId) {\n // check that the existing filter matches our expectations\n try {\n const existingFilter =\n await this.getFilter(this.credentials.userId, filterId, true);\n if (existingFilter) {\n const oldDef = existingFilter.getDefinition();\n const newDef = filter.getDefinition();\n\n if (utils.deepCompare(oldDef, newDef)) {\n // super, just use that.\n // debuglog(\"Using existing filter ID %s: %s\", filterId,\n // JSON.stringify(oldDef));\n existingId = filterId;\n }\n }\n } catch (error) {\n // Synapse currently returns the following when the filter cannot be found:\n // {\n // errcode: \"M_UNKNOWN\",\n // name: \"M_UNKNOWN\",\n // message: \"No row found\",\n // }\n if (error.errcode !== \"M_UNKNOWN\" && error.errcode !== \"M_NOT_FOUND\") {\n throw error;\n }\n }\n // if the filter doesn't exist anymore on the server, remove from store\n if (!existingId) {\n this.store.setFilterIdByName(filterName, undefined);\n }\n }\n\n if (existingId) {\n return existingId;\n }\n\n // create a new filter\n const createdFilter = await this.createFilter(filter.getDefinition());\n\n // debuglog(\"Created new filter ID %s: %s\", createdFilter.filterId,\n // JSON.stringify(createdFilter.getDefinition()));\n this.store.setFilterIdByName(filterName, createdFilter.filterId);\n return createdFilter.filterId;\n }\n\n /**\n * Gets a bearer token from the homeserver that the user can\n * present to a third party in order to prove their ownership\n * of the Matrix account they are logged into.\n * @return {Promise} Resolves: Token object\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public getOpenIdToken(): Promise {\n const path = utils.encodeUri(\"/user/$userId/openid/request_token\", {\n $userId: this.credentials.userId,\n });\n\n return this.http.authedRequest(\n undefined, \"POST\", path, undefined, {},\n );\n }\n\n private startCallEventHandler = (): void => {\n if (this.isInitialSyncComplete()) {\n this.callEventHandler.start();\n this.off(\"sync\", this.startCallEventHandler);\n }\n };\n\n /**\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: ITurnServerResponse object\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public turnServer(callback?: Callback): Promise {\n return this.http.authedRequest(callback, \"GET\", \"/voip/turnServer\");\n }\n\n /**\n * Get the TURN servers for this homeserver.\n * @return {Array} The servers or an empty list.\n */\n public getTurnServers(): ITurnServer[] {\n return this.turnServers || [];\n }\n\n /**\n * Get the unix timestamp (in seconds) at which the current\n * TURN credentials (from getTurnServers) expire\n * @return {number} The expiry timestamp, in seconds, or null if no credentials\n */\n public getTurnServersExpiry(): number | null {\n return this.turnServersExpiry;\n }\n\n // XXX: Intended private, used in code.\n public async checkTurnServers(): Promise {\n if (!this.canSupportVoip) {\n return;\n }\n\n let credentialsGood = false;\n const remainingTime = this.turnServersExpiry - Date.now();\n if (remainingTime > TURN_CHECK_INTERVAL) {\n logger.debug(\"TURN creds are valid for another \" + remainingTime + \" ms: not fetching new ones.\");\n credentialsGood = true;\n } else {\n logger.debug(\"Fetching new TURN credentials\");\n try {\n const res = await this.turnServer();\n if (res.uris) {\n logger.log(\"Got TURN URIs: \" + res.uris + \" refresh in \" + res.ttl + \" secs\");\n // map the response to a format that can be fed to RTCPeerConnection\n const servers: ITurnServer = {\n urls: res.uris,\n username: res.username,\n credential: res.password,\n };\n this.turnServers = [servers];\n // The TTL is in seconds but we work in ms\n this.turnServersExpiry = Date.now() + (res.ttl * 1000);\n credentialsGood = true;\n }\n } catch (err) {\n logger.error(\"Failed to get TURN URIs\", err);\n // If we get a 403, there's no point in looping forever.\n if (err.httpStatus === 403) {\n logger.info(\"TURN access unavailable for this account: stopping credentials checks\");\n if (this.checkTurnServersIntervalID !== null) global.clearInterval(this.checkTurnServersIntervalID);\n this.checkTurnServersIntervalID = null;\n }\n }\n // otherwise, if we failed for whatever reason, try again the next time we're called.\n }\n\n return credentialsGood;\n }\n\n /**\n * Set whether to allow a fallback ICE server should be used for negotiating a\n * WebRTC connection if the homeserver doesn't provide any servers. Defaults to\n * false.\n *\n * @param {boolean} allow\n */\n public setFallbackICEServerAllowed(allow: boolean) {\n this.fallbackICEServerAllowed = allow;\n }\n\n /**\n * Get whether to allow a fallback ICE server should be used for negotiating a\n * WebRTC connection if the homeserver doesn't provide any servers. Defaults to\n * false.\n *\n * @returns {boolean}\n */\n public isFallbackICEServerAllowed(): boolean {\n return this.fallbackICEServerAllowed;\n }\n\n /**\n * Determines if the current user is an administrator of the Synapse homeserver.\n * Returns false if untrue or the homeserver does not appear to be a Synapse\n * homeserver. This function is implementation specific and may change\n * as a result.\n * @return {boolean} true if the user appears to be a Synapse administrator.\n */\n public isSynapseAdministrator(): Promise {\n const path = utils.encodeUri(\n \"/_synapse/admin/v1/users/$userId/admin\",\n { $userId: this.getUserId() },\n );\n return this.http.authedRequest(\n undefined, 'GET', path, undefined, undefined, { prefix: '' },\n ).then(r => r['admin']); // pull out the specific boolean we want\n }\n\n /**\n * Performs a whois lookup on a user using Synapse's administrator API.\n * This function is implementation specific and may change as a\n * result.\n * @param {string} userId the User ID to look up.\n * @return {object} the whois response - see Synapse docs for information.\n */\n public whoisSynapseUser(userId: string): Promise {\n const path = utils.encodeUri(\n \"/_synapse/admin/v1/whois/$userId\",\n { $userId: userId },\n );\n return this.http.authedRequest(undefined, 'GET', path, undefined, undefined, { prefix: '' });\n }\n\n /**\n * Deactivates a user using Synapse's administrator API. This\n * function is implementation specific and may change as a result.\n * @param {string} userId the User ID to deactivate.\n * @return {object} the deactivate response - see Synapse docs for information.\n */\n public deactivateSynapseUser(userId: string): Promise {\n const path = utils.encodeUri(\n \"/_synapse/admin/v1/deactivate/$userId\",\n { $userId: userId },\n );\n return this.http.authedRequest(\n undefined, 'POST', path, undefined, undefined, { prefix: '' },\n );\n }\n\n private async fetchClientWellKnown(): Promise {\n // `getRawClientConfig` does not throw or reject on network errors, instead\n // it absorbs errors and returns `{}`.\n this.clientWellKnownPromise = AutoDiscovery.getRawClientConfig(this.getDomain());\n this.clientWellKnown = await this.clientWellKnownPromise;\n this.emit(\"WellKnown.client\", this.clientWellKnown);\n }\n\n public getClientWellKnown(): IClientWellKnown {\n return this.clientWellKnown;\n }\n\n public waitForClientWellKnown(): Promise {\n return this.clientWellKnownPromise;\n }\n\n /**\n * store client options with boolean/string/numeric values\n * to know in the next session what flags the sync data was\n * created with (e.g. lazy loading)\n * @param {object} opts the complete set of client options\n * @return {Promise} for store operation\n */\n public storeClientOptions(): Promise { // XXX: Intended private, used in code\n const primTypes = [\"boolean\", \"string\", \"number\"];\n const serializableOpts = Object.entries(this.clientOpts)\n .filter(([key, value]) => {\n return primTypes.includes(typeof value);\n })\n .reduce((obj, [key, value]) => {\n obj[key] = value;\n return obj;\n }, {});\n return this.store.storeClientOptions(serializableOpts);\n }\n\n /**\n * Gets a set of room IDs in common with another user\n * @param {string} userId The userId to check.\n * @return {Promise} Resolves to a set of rooms\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public async _unstable_getSharedRooms(userId: string): Promise { // eslint-disable-line\n if (!(await this.doesServerSupportUnstableFeature(\"uk.half-shot.msc2666\"))) {\n throw Error('Server does not support shared_rooms API');\n }\n const path = utils.encodeUri(\"/uk.half-shot.msc2666/user/shared_rooms/$userId\", {\n $userId: userId,\n });\n const res = await this.http.authedRequest(\n undefined, \"GET\", path, undefined, undefined,\n { prefix: PREFIX_UNSTABLE },\n );\n return res.joined;\n }\n\n /**\n * Get the API versions supported by the server, along with any\n * unstable APIs it supports\n * @return {Promise} The server /versions response\n */\n public getVersions(): Promise {\n if (this.serverVersionsPromise) {\n return this.serverVersionsPromise;\n }\n\n this.serverVersionsPromise = this.http.request(\n undefined, // callback\n \"GET\", \"/_matrix/client/versions\",\n undefined, // queryParams\n undefined, // data\n {\n prefix: '',\n },\n ).catch((e) => {\n // Need to unset this if it fails, otherwise we'll never retry\n this.serverVersionsPromise = null;\n // but rethrow the exception to anything that was waiting\n throw e;\n });\n\n return this.serverVersionsPromise;\n }\n\n /**\n * Check if a particular spec version is supported by the server.\n * @param {string} version The spec version (such as \"r0.5.0\") to check for.\n * @return {Promise} Whether it is supported\n */\n public async isVersionSupported(version: string): Promise {\n const { versions } = await this.getVersions();\n return versions && versions.includes(version);\n }\n\n /**\n * Query the server to see if it support members lazy loading\n * @return {Promise} true if server supports lazy loading\n */\n public async doesServerSupportLazyLoading(): Promise {\n const response = await this.getVersions();\n if (!response) return false;\n\n const versions = response[\"versions\"];\n const unstableFeatures = response[\"unstable_features\"];\n\n return (versions && versions.includes(\"r0.5.0\"))\n || (unstableFeatures && unstableFeatures[\"m.lazy_load_members\"]);\n }\n\n /**\n * Query the server to see if the `id_server` parameter is required\n * when registering with an 3pid, adding a 3pid or resetting password.\n * @return {Promise} true if id_server parameter is required\n */\n public async doesServerRequireIdServerParam(): Promise {\n const response = await this.getVersions();\n if (!response) return true;\n\n const versions = response[\"versions\"];\n\n // Supporting r0.6.0 is the same as having the flag set to false\n if (versions && versions.includes(\"r0.6.0\")) {\n return false;\n }\n\n const unstableFeatures = response[\"unstable_features\"];\n if (!unstableFeatures) return true;\n if (unstableFeatures[\"m.require_identity_server\"] === undefined) {\n return true;\n } else {\n return unstableFeatures[\"m.require_identity_server\"];\n }\n }\n\n /**\n * Query the server to see if the `id_access_token` parameter can be safely\n * passed to the homeserver. Some homeservers may trigger errors if they are not\n * prepared for the new parameter.\n * @return {Promise} true if id_access_token can be sent\n */\n public async doesServerAcceptIdentityAccessToken(): Promise {\n const response = await this.getVersions();\n if (!response) return false;\n\n const versions = response[\"versions\"];\n const unstableFeatures = response[\"unstable_features\"];\n return (versions && versions.includes(\"r0.6.0\"))\n || (unstableFeatures && unstableFeatures[\"m.id_access_token\"]);\n }\n\n /**\n * Query the server to see if it supports separate 3PID add and bind functions.\n * This affects the sequence of API calls clients should use for these operations,\n * so it's helpful to be able to check for support.\n * @return {Promise} true if separate functions are supported\n */\n public async doesServerSupportSeparateAddAndBind(): Promise {\n const response = await this.getVersions();\n if (!response) return false;\n\n const versions = response[\"versions\"];\n const unstableFeatures = response[\"unstable_features\"];\n\n return (versions && versions.includes(\"r0.6.0\"))\n || (unstableFeatures && unstableFeatures[\"m.separate_add_and_bind\"]);\n }\n\n /**\n * Query the server to see if it lists support for an unstable feature\n * in the /versions response\n * @param {string} feature the feature name\n * @return {Promise} true if the feature is supported\n */\n public async doesServerSupportUnstableFeature(feature: string): Promise {\n const response = await this.getVersions();\n if (!response) return false;\n const unstableFeatures = response[\"unstable_features\"];\n return unstableFeatures && !!unstableFeatures[feature];\n }\n\n /**\n * Query the server to see if it is forcing encryption to be enabled for\n * a given room preset, based on the /versions response.\n * @param {Preset} presetName The name of the preset to check.\n * @returns {Promise} true if the server is forcing encryption\n * for the preset.\n */\n public async doesServerForceEncryptionForPreset(presetName: Preset): Promise {\n const response = await this.getVersions();\n if (!response) return false;\n const unstableFeatures = response[\"unstable_features\"];\n\n // The preset name in the versions response will be without the _chat suffix.\n const versionsPresetName = presetName.includes(\"_chat\")\n ? presetName.substring(0, presetName.indexOf(\"_chat\"))\n : presetName;\n\n return unstableFeatures && !!unstableFeatures[`io.element.e2ee_forced.${versionsPresetName}`];\n }\n\n /**\n * Get if lazy loading members is being used.\n * @return {boolean} Whether or not members are lazy loaded by this client\n */\n public hasLazyLoadMembersEnabled(): boolean {\n return !!this.clientOpts.lazyLoadMembers;\n }\n\n /**\n * Set a function which is called when /sync returns a 'limited' response.\n * It is called with a room ID and returns a boolean. It should return 'true' if the SDK\n * can SAFELY remove events from this room. It may not be safe to remove events if there\n * are other references to the timelines for this room, e.g because the client is\n * actively viewing events in this room.\n * Default: returns false.\n * @param {Function} cb The callback which will be invoked.\n */\n public setCanResetTimelineCallback(cb: ResetTimelineCallback) {\n this.canResetTimelineCallback = cb;\n }\n\n /**\n * Get the callback set via `setCanResetTimelineCallback`.\n * @return {?Function} The callback or null\n */\n public getCanResetTimelineCallback(): ResetTimelineCallback {\n return this.canResetTimelineCallback;\n }\n\n /**\n * Returns relations for a given event. Handles encryption transparently,\n * with the caveat that the amount of events returned might be 0, even though you get a nextBatch.\n * When the returned promise resolves, all messages should have finished trying to decrypt.\n * @param {string} roomId the room of the event\n * @param {string} eventId the id of the event\n * @param {string} relationType the rel_type of the relations requested\n * @param {string} eventType the event type of the relations requested\n * @param {Object} opts options with optional values for the request.\n * @param {Object} opts.from the pagination token returned from a previous request as `nextBatch` to return following relations.\n * @return {Object} an object with `events` as `MatrixEvent[]` and optionally `nextBatch` if more relations are available.\n */\n public async relations(\n roomId: string,\n eventId: string,\n relationType: string,\n eventType: string,\n opts: { from: string },\n ): Promise<{ originalEvent: MatrixEvent, events: MatrixEvent[], nextBatch?: string }> {\n const fetchedEventType = this.getEncryptedIfNeededEventType(roomId, eventType);\n const result = await this.fetchRelations(\n roomId,\n eventId,\n relationType,\n fetchedEventType,\n opts);\n const mapper = this.getEventMapper();\n let originalEvent;\n if (result.original_event) {\n originalEvent = mapper(result.original_event);\n }\n let events = result.chunk.map(mapper);\n if (fetchedEventType === EventType.RoomMessageEncrypted) {\n const allEvents = originalEvent ? events.concat(originalEvent) : events;\n await Promise.all(allEvents.map(e => {\n return new Promise(resolve => e.once(\"Event.decrypted\", resolve));\n }));\n events = events.filter(e => e.getType() === eventType);\n }\n if (originalEvent && relationType === RelationType.Replace) {\n events = events.filter(e => e.getSender() === originalEvent.getSender());\n }\n return {\n originalEvent,\n events,\n nextBatch: result.next_batch,\n };\n }\n\n /**\n * The app may wish to see if we have a key cached without\n * triggering a user interaction.\n * @return {object}\n */\n public getCrossSigningCacheCallbacks(): ICacheCallbacks {\n // XXX: Private member access\n return this.crypto?.crossSigningInfo.getCacheCallbacks();\n }\n\n /**\n * Generates a random string suitable for use as a client secret. This\n * method is experimental and may change.\n * @return {string} A new client secret\n */\n public generateClientSecret(): string {\n return randomString(32);\n }\n\n /**\n * Attempts to decrypt an event\n * @param {MatrixEvent} event The event to decrypt\n * @returns {Promise} A decryption promise\n * @param {object} options\n * @param {boolean} options.isRetry True if this is a retry (enables more logging)\n * @param {boolean} options.emit Emits \"event.decrypted\" if set to true\n */\n public decryptEventIfNeeded(event: MatrixEvent, options?: IDecryptOptions): Promise {\n if (event.shouldAttemptDecryption()) {\n event.attemptDecryption(this.crypto, options);\n }\n\n if (event.isBeingDecrypted()) {\n return event.getDecryptionPromise();\n } else {\n return Promise.resolve();\n }\n }\n\n private termsUrlForService(serviceType: SERVICE_TYPES, baseUrl: string) {\n switch (serviceType) {\n case SERVICE_TYPES.IS:\n return baseUrl + PREFIX_IDENTITY_V2 + '/terms';\n case SERVICE_TYPES.IM:\n return baseUrl + '/_matrix/integrations/v1/terms';\n default:\n throw new Error('Unsupported service type');\n }\n }\n\n /**\n * Get the Homeserver URL of this client\n * @return {string} Homeserver URL of this client\n */\n public getHomeserverUrl(): string {\n return this.baseUrl;\n }\n\n /**\n * Get the identity server URL of this client\n * @param {boolean} stripProto whether or not to strip the protocol from the URL\n * @return {string} Identity server URL of this client\n */\n public getIdentityServerUrl(stripProto = false): string {\n if (stripProto && (this.idBaseUrl.startsWith(\"http://\") ||\n this.idBaseUrl.startsWith(\"https://\"))) {\n return this.idBaseUrl.split(\"://\")[1];\n }\n return this.idBaseUrl;\n }\n\n /**\n * Set the identity server URL of this client\n * @param {string} url New identity server URL\n */\n public setIdentityServerUrl(url: string) {\n this.idBaseUrl = utils.ensureNoTrailingSlash(url);\n this.http.setIdBaseUrl(this.idBaseUrl);\n }\n\n /**\n * Get the access token associated with this account.\n * @return {?String} The access_token or null\n */\n public getAccessToken(): string {\n return this.http.opts.accessToken || null;\n }\n\n /**\n * @return {boolean} true if there is a valid access_token for this client.\n */\n public isLoggedIn(): boolean {\n return this.http.opts.accessToken !== undefined;\n }\n\n /**\n * Make up a new transaction id\n *\n * @return {string} a new, unique, transaction id\n */\n public makeTxnId(): string {\n return \"m\" + new Date().getTime() + \".\" + (this.txnCtr++);\n }\n\n /**\n * Check whether a username is available prior to registration. An error response\n * indicates an invalid/unavailable username.\n * @param {string} username The username to check the availability of.\n * @return {Promise} Resolves: to `true`.\n */\n public isUsernameAvailable(username: string): Promise {\n return this.http.authedRequest(\n undefined, \"GET\", '/register/available', { username: username },\n ).then((response) => {\n return response.available;\n });\n }\n\n /**\n * @param {string} username\n * @param {string} password\n * @param {string} sessionId\n * @param {Object} auth\n * @param {Object} bindThreepids Set key 'email' to true to bind any email\n * threepid uses during registration in the identity server. Set 'msisdn' to\n * true to bind msisdn.\n * @param {string} guestAccessToken\n * @param {string} inhibitLogin\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: TODO\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public register(\n username: string,\n password: string,\n sessionId: string,\n auth: any,\n bindThreepids: any,\n guestAccessToken: string,\n inhibitLogin: boolean,\n callback?: Callback,\n ): Promise { // TODO: Types (many)\n // backwards compat\n if (bindThreepids === true) {\n bindThreepids = { email: true };\n } else if (bindThreepids === null || bindThreepids === undefined) {\n bindThreepids = {};\n }\n if (typeof inhibitLogin === 'function') {\n callback = inhibitLogin;\n inhibitLogin = undefined;\n }\n\n if (sessionId) {\n auth.session = sessionId;\n }\n\n const params: any = {\n auth: auth,\n };\n if (username !== undefined && username !== null) {\n params.username = username;\n }\n if (password !== undefined && password !== null) {\n params.password = password;\n }\n if (bindThreepids.email) {\n params.bind_email = true;\n }\n if (bindThreepids.msisdn) {\n params.bind_msisdn = true;\n }\n if (guestAccessToken !== undefined && guestAccessToken !== null) {\n params.guest_access_token = guestAccessToken;\n }\n if (inhibitLogin !== undefined && inhibitLogin !== null) {\n params.inhibit_login = inhibitLogin;\n }\n // Temporary parameter added to make the register endpoint advertise\n // msisdn flows. This exists because there are clients that break\n // when given stages they don't recognise. This parameter will cease\n // to be necessary once these old clients are gone.\n // Only send it if we send any params at all (the password param is\n // mandatory, so if we send any params, we'll send the password param)\n if (password !== undefined && password !== null) {\n params.x_show_msisdn = true;\n }\n\n return this.registerRequest(params, undefined, callback);\n }\n\n /**\n * Register a guest account.\n * This method returns the auth info needed to create a new authenticated client,\n * Remember to call `setGuest(true)` on the (guest-)authenticated client, e.g:\n * ```javascript\n * const tmpClient = await sdk.createClient(MATRIX_INSTANCE);\n * const { user_id, device_id, access_token } = tmpClient.registerGuest();\n * const client = createClient({\n * baseUrl: MATRIX_INSTANCE,\n * accessToken: access_token,\n * userId: user_id,\n * deviceId: device_id,\n * })\n * client.setGuest(true);\n * ```\n *\n * @param {Object=} opts Registration options\n * @param {Object} opts.body JSON HTTP body to provide.\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: JSON object that contains:\n * { user_id, device_id, access_token, home_server }\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public registerGuest(opts: { body?: any }, callback?: Callback): Promise { // TODO: Types\n opts = opts || {};\n opts.body = opts.body || {};\n return this.registerRequest(opts.body, \"guest\", callback);\n }\n\n /**\n * @param {Object} data parameters for registration request\n * @param {string=} kind type of user to register. may be \"guest\"\n * @param {module:client.callback=} callback\n * @return {Promise} Resolves: to the /register response\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public registerRequest(data: any, kind?: string, callback?: Callback): Promise { // TODO: Types\n const params: any = {};\n if (kind) {\n params.kind = kind;\n }\n\n return this.http.request(callback, \"POST\", \"/register\", params, data);\n }\n\n /**\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: TODO\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public loginFlows(callback?: Callback): Promise { // TODO: Types\n return this.http.request(callback, \"GET\", \"/login\");\n }\n\n /**\n * @param {string} loginType\n * @param {Object} data\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: TODO\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public login(loginType: string, data: any, callback?: Callback): Promise { // TODO: Types\n const loginData = {\n type: loginType,\n };\n\n // merge data into loginData\n utils.extend(loginData, data);\n\n return this.http.authedRequest(\n (error, response) => {\n if (response && response.access_token && response.user_id) {\n this.http.opts.accessToken = response.access_token;\n this.credentials = {\n userId: response.user_id,\n };\n }\n\n if (callback) {\n callback(error, response);\n }\n }, \"POST\", \"/login\", undefined, loginData,\n );\n }\n\n /**\n * @param {string} user\n * @param {string} password\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: TODO\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public loginWithPassword(user: string, password: string, callback?: Callback): Promise { // TODO: Types\n return this.login(\"m.login.password\", {\n user: user,\n password: password,\n }, callback);\n }\n\n /**\n * @param {string} relayState URL Callback after SAML2 Authentication\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: TODO\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public loginWithSAML2(relayState: string, callback?: Callback): Promise { // TODO: Types\n return this.login(\"m.login.saml2\", {\n relay_state: relayState,\n }, callback);\n }\n\n /**\n * @param {string} redirectUrl The URL to redirect to after the HS\n * authenticates with CAS.\n * @return {string} The HS URL to hit to begin the CAS login process.\n */\n public getCasLoginUrl(redirectUrl: string): string {\n return this.getSsoLoginUrl(redirectUrl, \"cas\");\n }\n\n /**\n * @param {string} redirectUrl The URL to redirect to after the HS\n * authenticates with the SSO.\n * @param {string} loginType The type of SSO login we are doing (sso or cas).\n * Defaults to 'sso'.\n * @param {string} idpId The ID of the Identity Provider being targeted, optional.\n * @return {string} The HS URL to hit to begin the SSO login process.\n */\n public getSsoLoginUrl(redirectUrl: string, loginType = \"sso\", idpId?: string): string {\n let url = \"/login/\" + loginType + \"/redirect\";\n if (idpId) {\n url += \"/\" + idpId;\n }\n\n return this.http.getUrl(url, { redirectUrl }, PREFIX_R0);\n }\n\n /**\n * @param {string} token Login token previously received from homeserver\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: TODO\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public loginWithToken(token: string, callback?: Callback): Promise { // TODO: Types\n return this.login(\"m.login.token\", {\n token: token,\n }, callback);\n }\n\n /**\n * Logs out the current session.\n * Obviously, further calls that require authorisation should fail after this\n * method is called. The state of the MatrixClient object is not affected:\n * it is up to the caller to either reset or destroy the MatrixClient after\n * this method succeeds.\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: On success, the empty object\n */\n public logout(callback?: Callback): Promise<{}> {\n return this.http.authedRequest(\n callback, \"POST\", '/logout',\n );\n }\n\n /**\n * Deactivates the logged-in account.\n * Obviously, further calls that require authorisation should fail after this\n * method is called. The state of the MatrixClient object is not affected:\n * it is up to the caller to either reset or destroy the MatrixClient after\n * this method succeeds.\n * @param {object} auth Optional. Auth data to supply for User-Interactive auth.\n * @param {boolean} erase Optional. If set, send as `erase` attribute in the\n * JSON request body, indicating whether the account should be erased. Defaults\n * to false.\n * @return {Promise} Resolves: On success, the empty object\n */\n public deactivateAccount(auth?: any, erase?: boolean): Promise<{}> {\n if (typeof (erase) === 'function') {\n throw new Error('deactivateAccount no longer accepts a callback parameter');\n }\n\n const body: any = {};\n if (auth) {\n body.auth = auth;\n }\n if (erase !== undefined) {\n body.erase = erase;\n }\n\n return this.http.authedRequest(undefined, \"POST\", '/account/deactivate', undefined, body);\n }\n\n /**\n * Get the fallback URL to use for unknown interactive-auth stages.\n *\n * @param {string} loginType the type of stage being attempted\n * @param {string} authSessionId the auth session ID provided by the homeserver\n *\n * @return {string} HS URL to hit to for the fallback interface\n */\n public getFallbackAuthUrl(loginType: string, authSessionId: string): string {\n const path = utils.encodeUri(\"/auth/$loginType/fallback/web\", {\n $loginType: loginType,\n });\n\n return this.http.getUrl(path, {\n session: authSessionId,\n }, PREFIX_R0);\n }\n\n /**\n * Create a new room.\n * @param {Object} options a list of options to pass to the /createRoom API.\n * @param {string} options.room_alias_name The alias localpart to assign to\n * this room.\n * @param {string} options.visibility Either 'public' or 'private'.\n * @param {string[]} options.invite A list of user IDs to invite to this room.\n * @param {string} options.name The name to give this room.\n * @param {string} options.topic The topic to give this room.\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: {room_id: {string}}\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public async createRoom(\n options: ICreateRoomOpts,\n callback?: Callback,\n ): Promise<{ room_id: string }> { // eslint-disable-line camelcase\n // some valid options include: room_alias_name, visibility, invite\n\n // inject the id_access_token if inviting 3rd party addresses\n const invitesNeedingToken = (options.invite_3pid || [])\n .filter(i => !i.id_access_token);\n if (\n invitesNeedingToken.length > 0 &&\n this.identityServer &&\n this.identityServer.getAccessToken &&\n await this.doesServerAcceptIdentityAccessToken()\n ) {\n const identityAccessToken = await this.identityServer.getAccessToken();\n if (identityAccessToken) {\n for (const invite of invitesNeedingToken) {\n invite.id_access_token = identityAccessToken;\n }\n }\n }\n\n return this.http.authedRequest(callback, \"POST\", \"/createRoom\", undefined, options);\n }\n\n /**\n * Fetches relations for a given event\n * @param {string} roomId the room of the event\n * @param {string} eventId the id of the event\n * @param {string} relationType the rel_type of the relations requested\n * @param {string} eventType the event type of the relations requested\n * @param {Object} opts options with optional values for the request.\n * @param {Object} opts.from the pagination token returned from a previous request as `next_batch` to return following relations.\n * @return {Object} the response, with chunk and next_batch.\n */\n public async fetchRelations(\n roomId: string,\n eventId: string,\n relationType: string,\n eventType: string,\n opts: { from: string },\n ): Promise { // TODO: Types\n const queryParams: any = {};\n if (opts.from) {\n queryParams.from = opts.from;\n }\n const queryString = utils.encodeParams(queryParams);\n const path = utils.encodeUri(\n \"/rooms/$roomId/relations/$eventId/$relationType/$eventType?\" + queryString, {\n $roomId: roomId,\n $eventId: eventId,\n $relationType: relationType,\n $eventType: eventType,\n });\n return await this.http.authedRequest(\n undefined, \"GET\", path, null, null, {\n prefix: PREFIX_UNSTABLE,\n },\n );\n }\n\n /**\n * @param {string} roomId\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: TODO\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public roomState(roomId: string, callback?: Callback): Promise {\n const path = utils.encodeUri(\"/rooms/$roomId/state\", { $roomId: roomId });\n return this.http.authedRequest(callback, \"GET\", path);\n }\n\n /**\n * Get an event in a room by its event id.\n * @param {string} roomId\n * @param {string} eventId\n * @param {module:client.callback} callback Optional.\n *\n * @return {Promise} Resolves to an object containing the event.\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public fetchRoomEvent(\n roomId: string,\n eventId: string,\n callback?: Callback,\n ): Promise {\n const path = utils.encodeUri(\n \"/rooms/$roomId/event/$eventId\", {\n $roomId: roomId,\n $eventId: eventId,\n },\n );\n return this.http.authedRequest(callback, \"GET\", path);\n }\n\n /**\n * @param {string} roomId\n * @param {string} includeMembership the membership type to include in the response\n * @param {string} excludeMembership the membership type to exclude from the response\n * @param {string} atEventId the id of the event for which moment in the timeline the members should be returned for\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: dictionary of userid to profile information\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public members(\n roomId: string,\n includeMembership?: string[],\n excludeMembership?: string[],\n atEventId?: string,\n callback?: Callback,\n ): Promise<{ [userId: string]: IStateEventWithRoomId }> {\n const queryParams: any = {};\n if (includeMembership) {\n queryParams.membership = includeMembership;\n }\n if (excludeMembership) {\n queryParams.not_membership = excludeMembership;\n }\n if (atEventId) {\n queryParams.at = atEventId;\n }\n\n const queryString = utils.encodeParams(queryParams);\n\n const path = utils.encodeUri(\"/rooms/$roomId/members?\" + queryString,\n { $roomId: roomId });\n return this.http.authedRequest(callback, \"GET\", path);\n }\n\n /**\n * Upgrades a room to a new protocol version\n * @param {string} roomId\n * @param {string} newVersion The target version to upgrade to\n * @return {Promise} Resolves: Object with key 'replacement_room'\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public upgradeRoom(\n roomId: string,\n newVersion: string,\n ): Promise<{ replacement_room: string }> { // eslint-disable-line camelcase\n const path = utils.encodeUri(\"/rooms/$roomId/upgrade\", { $roomId: roomId });\n return this.http.authedRequest(\n undefined, \"POST\", path, undefined, { new_version: newVersion },\n );\n }\n\n /**\n * Retrieve a state event.\n * @param {string} roomId\n * @param {string} eventType\n * @param {string} stateKey\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: TODO\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public getStateEvent(\n roomId: string,\n eventType: string,\n stateKey: string,\n callback?: Callback,\n ): Promise {\n const pathParams = {\n $roomId: roomId,\n $eventType: eventType,\n $stateKey: stateKey,\n };\n let path = utils.encodeUri(\"/rooms/$roomId/state/$eventType\", pathParams);\n if (stateKey !== undefined) {\n path = utils.encodeUri(path + \"/$stateKey\", pathParams);\n }\n return this.http.authedRequest(\n callback, \"GET\", path,\n );\n }\n\n /**\n * @param {string} roomId\n * @param {string} eventType\n * @param {Object} content\n * @param {string} stateKey\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: TODO\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public sendStateEvent(\n roomId: string,\n eventType: string,\n content: any,\n stateKey = \"\",\n callback?: Callback,\n ): Promise {\n const pathParams = {\n $roomId: roomId,\n $eventType: eventType,\n $stateKey: stateKey,\n };\n let path = utils.encodeUri(\"/rooms/$roomId/state/$eventType\", pathParams);\n if (stateKey !== undefined) {\n path = utils.encodeUri(path + \"/$stateKey\", pathParams);\n }\n return this.http.authedRequest(callback, \"PUT\", path, undefined, content);\n }\n\n /**\n * @param {string} roomId\n * @param {Number} limit\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: TODO\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public roomInitialSync(roomId: string, limit: number, callback?: Callback): Promise {\n if (utils.isFunction(limit)) {\n callback = limit as any as Callback; // legacy\n limit = undefined;\n }\n const path = utils.encodeUri(\"/rooms/$roomId/initialSync\",\n { $roomId: roomId },\n );\n if (!limit) {\n limit = 30;\n }\n return this.http.authedRequest(\n callback, \"GET\", path, { limit: limit },\n );\n }\n\n /**\n * Set a marker to indicate the point in a room before which the user has read every\n * event. This can be retrieved from room account data (the event type is `m.fully_read`)\n * and displayed as a horizontal line in the timeline that is visually distinct to the\n * position of the user's own read receipt.\n * @param {string} roomId ID of the room that has been read\n * @param {string} rmEventId ID of the event that has been read\n * @param {string} rrEventId ID of the event tracked by the read receipt. This is here\n * for convenience because the RR and the RM are commonly updated at the same time as\n * each other. Optional.\n * @param {object} opts Options for the read markers.\n * @param {object} opts.hidden True to hide the read receipt from other users. This\n * property is currently unstable and may change in the future.\n * @return {Promise} Resolves: the empty object, {}.\n */\n public setRoomReadMarkersHttpRequest(\n roomId: string,\n rmEventId: string,\n rrEventId: string,\n opts: { hidden?: boolean },\n ): Promise<{}> {\n const path = utils.encodeUri(\"/rooms/$roomId/read_markers\", {\n $roomId: roomId,\n });\n\n const content = {\n \"m.fully_read\": rmEventId,\n \"m.read\": rrEventId,\n \"org.matrix.msc2285.hidden\": Boolean(opts ? opts.hidden : false),\n };\n\n return this.http.authedRequest(undefined, \"POST\", path, undefined, content);\n }\n\n /**\n * @return {Promise} Resolves: A list of the user's current rooms\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public getJoinedRooms(): Promise {\n const path = utils.encodeUri(\"/joined_rooms\", {});\n return this.http.authedRequest(undefined, \"GET\", path);\n }\n\n /**\n * Retrieve membership info. for a room.\n * @param {string} roomId ID of the room to get membership for\n * @return {Promise} Resolves: A list of currently joined users\n * and their profile data.\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public getJoinedRoomMembers(roomId: string): Promise {\n const path = utils.encodeUri(\"/rooms/$roomId/joined_members\", {\n $roomId: roomId,\n });\n return this.http.authedRequest(undefined, \"GET\", path);\n }\n\n /**\n * @param {Object} options Options for this request\n * @param {string} options.server The remote server to query for the room list.\n * Optional. If unspecified, get the local home\n * server's public room list.\n * @param {number} options.limit Maximum number of entries to return\n * @param {string} options.since Token to paginate from\n * @param {object} options.filter Filter parameters\n * @param {string} options.filter.generic_search_term String to search for\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: TODO\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public publicRooms(options: IRoomDirectoryOptions, callback?: Callback): Promise {\n if (typeof (options) == 'function') {\n callback = options;\n options = {};\n }\n if (options === undefined) {\n options = {};\n }\n\n const queryParams: any = {};\n if (options.server) {\n queryParams.server = options.server;\n delete options.server;\n }\n\n if (Object.keys(options).length === 0 && Object.keys(queryParams).length === 0) {\n return this.http.authedRequest(callback, \"GET\", \"/publicRooms\");\n } else {\n return this.http.authedRequest(callback, \"POST\", \"/publicRooms\", queryParams, options);\n }\n }\n\n /**\n * Create an alias to room ID mapping.\n * @param {string} alias The room alias to create.\n * @param {string} roomId The room ID to link the alias to.\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: an empty object {}\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public createAlias(alias: string, roomId: string, callback?: Callback): Promise<{}> {\n const path = utils.encodeUri(\"/directory/room/$alias\", {\n $alias: alias,\n });\n const data = {\n room_id: roomId,\n };\n return this.http.authedRequest(callback, \"PUT\", path, undefined, data);\n }\n\n /**\n * Delete an alias to room ID mapping. This alias must be on your local server\n * and you must have sufficient access to do this operation.\n * @param {string} alias The room alias to delete.\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: an empty object.\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public deleteAlias(alias: string, callback?: Callback): Promise<{}> {\n const path = utils.encodeUri(\"/directory/room/$alias\", {\n $alias: alias,\n });\n return this.http.authedRequest(callback, \"DELETE\", path, undefined, undefined);\n }\n\n /**\n * @param {string} roomId\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: an object with an `aliases` property, containing an array of local aliases\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public unstableGetLocalAliases(roomId: string, callback?: Callback): Promise<{ aliases: string[] }> {\n const path = utils.encodeUri(\"/rooms/$roomId/aliases\",\n { $roomId: roomId });\n const prefix = PREFIX_UNSTABLE + \"/org.matrix.msc2432\";\n return this.http.authedRequest(callback, \"GET\", path, null, null, { prefix });\n }\n\n /**\n * Get room info for the given alias.\n * @param {string} alias The room alias to resolve.\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: Object with room_id and servers.\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public getRoomIdForAlias(\n alias: string,\n callback?: Callback,\n ): Promise<{ room_id: string, servers: string[] }> { // eslint-disable-line camelcase\n // TODO: deprecate this or resolveRoomAlias\n const path = utils.encodeUri(\"/directory/room/$alias\", {\n $alias: alias,\n });\n return this.http.authedRequest(callback, \"GET\", path);\n }\n\n /**\n * @param {string} roomAlias\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: Object with room_id and servers.\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n // eslint-disable-next-line camelcase\n public resolveRoomAlias(roomAlias: string, callback?: Callback): Promise<{ room_id: string, servers: string[] }> {\n // TODO: deprecate this or getRoomIdForAlias\n const path = utils.encodeUri(\"/directory/room/$alias\", { $alias: roomAlias });\n return this.http.request(callback, \"GET\", path);\n }\n\n /**\n * Get the visibility of a room in the current HS's room directory\n * @param {string} roomId\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: TODO\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public getRoomDirectoryVisibility(roomId: string, callback?: Callback): Promise<{ visibility: Visibility }> {\n const path = utils.encodeUri(\"/directory/list/room/$roomId\", {\n $roomId: roomId,\n });\n return this.http.authedRequest(callback, \"GET\", path);\n }\n\n /**\n * Set the visbility of a room in the current HS's room directory\n * @param {string} roomId\n * @param {string} visibility \"public\" to make the room visible\n * in the public directory, or \"private\" to make\n * it invisible.\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: result object\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public setRoomDirectoryVisibility(roomId: string, visibility: Visibility, callback?: Callback): Promise<{}> {\n const path = utils.encodeUri(\"/directory/list/room/$roomId\", {\n $roomId: roomId,\n });\n return this.http.authedRequest(callback, \"PUT\", path, undefined, { visibility });\n }\n\n /**\n * Set the visbility of a room bridged to a 3rd party network in\n * the current HS's room directory.\n * @param {string} networkId the network ID of the 3rd party\n * instance under which this room is published under.\n * @param {string} roomId\n * @param {string} visibility \"public\" to make the room visible\n * in the public directory, or \"private\" to make\n * it invisible.\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: result object\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public setRoomDirectoryVisibilityAppService(\n networkId: string,\n roomId: string,\n visibility: \"public\" | \"private\",\n callback?: Callback,\n ): Promise { // TODO: Types\n const path = utils.encodeUri(\"/directory/list/appservice/$networkId/$roomId\", {\n $networkId: networkId,\n $roomId: roomId,\n });\n return this.http.authedRequest(\n callback, \"PUT\", path, undefined, { \"visibility\": visibility },\n );\n }\n\n /**\n * Query the user directory with a term matching user IDs, display names and domains.\n * @param {object} opts options\n * @param {string} opts.term the term with which to search.\n * @param {number} opts.limit the maximum number of results to return. The server will\n * apply a limit if unspecified.\n * @return {Promise} Resolves: an array of results.\n */\n public searchUserDirectory(opts: { term: string, limit?: number }): Promise {\n const body: any = {\n search_term: opts.term,\n };\n\n if (opts.limit !== undefined) {\n body.limit = opts.limit;\n }\n\n return this.http.authedRequest(undefined, \"POST\", \"/user_directory/search\", undefined, body);\n }\n\n /**\n * Upload a file to the media repository on the homeserver.\n *\n * @param {object} file The object to upload. On a browser, something that\n * can be sent to XMLHttpRequest.send (typically a File). Under node.js,\n * a a Buffer, String or ReadStream.\n *\n * @param {object} opts options object\n *\n * @param {string=} opts.name Name to give the file on the server. Defaults\n * to file.name.\n *\n * @param {boolean=} opts.includeFilename if false will not send the filename,\n * e.g for encrypted file uploads where filename leaks are undesirable.\n * Defaults to true.\n *\n * @param {string=} opts.type Content-type for the upload. Defaults to\n * file.type, or applicaton/octet-stream.\n *\n * @param {boolean=} opts.rawResponse Return the raw body, rather than\n * parsing the JSON. Defaults to false (except on node.js, where it\n * defaults to true for backwards compatibility).\n *\n * @param {boolean=} opts.onlyContentUri Just return the content URI,\n * rather than the whole body. Defaults to false (except on browsers,\n * where it defaults to true for backwards compatibility). Ignored if\n * opts.rawResponse is true.\n *\n * @param {Function=} opts.callback Deprecated. Optional. The callback to\n * invoke on success/failure. See the promise return values for more\n * information.\n *\n * @param {Function=} opts.progressHandler Optional. Called when a chunk of\n * data has been uploaded, with an object containing the fields `loaded`\n * (number of bytes transferred) and `total` (total size, if known).\n *\n * @return {Promise} Resolves to response object, as\n * determined by this.opts.onlyData, opts.rawResponse, and\n * opts.onlyContentUri. Rejects with an error (usually a MatrixError).\n */\n public uploadContent(\n file: File | String | Buffer | ReadStream | Blob,\n opts?: IUploadOpts,\n ): IAbortablePromise { // TODO: Advanced types\n return this.http.uploadContent(file, opts);\n }\n\n /**\n * Cancel a file upload in progress\n * @param {Promise} promise The promise returned from uploadContent\n * @return {boolean} true if canceled, otherwise false\n */\n public cancelUpload(promise: IAbortablePromise): boolean {\n return this.http.cancelUpload(promise);\n }\n\n /**\n * Get a list of all file uploads in progress\n * @return {array} Array of objects representing current uploads.\n * Currently in progress is element 0. Keys:\n * - promise: The promise associated with the upload\n * - loaded: Number of bytes uploaded\n * - total: Total number of bytes to upload\n */\n public getCurrentUploads(): { promise: Promise, loaded: number, total: number }[] { // TODO: Advanced types (promise)\n return this.http.getCurrentUploads();\n }\n\n /**\n * @param {string} userId\n * @param {string} info The kind of info to retrieve (e.g. 'displayname',\n * 'avatar_url').\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: TODO\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public getProfileInfo(\n userId: string,\n info?: string,\n callback?: Callback,\n // eslint-disable-next-line camelcase\n ): Promise<{ avatar_url?: string, displayname?: string }> {\n if (utils.isFunction(info)) {\n callback = info as any as Callback; // legacy\n info = undefined;\n }\n\n const path = info ?\n utils.encodeUri(\"/profile/$userId/$info\",\n { $userId: userId, $info: info }) :\n utils.encodeUri(\"/profile/$userId\",\n { $userId: userId });\n return this.http.authedRequest(callback, \"GET\", path);\n }\n\n /**\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves to a list of the user's threepids.\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public getThreePids(callback?: Callback): Promise<{ threepids: IThreepid[] }> {\n const path = \"/account/3pid\";\n return this.http.authedRequest(callback, \"GET\", path, undefined, undefined);\n }\n\n /**\n * Add a 3PID to your homeserver account and optionally bind it to an identity\n * server as well. An identity server is required as part of the `creds` object.\n *\n * This API is deprecated, and you should instead use `addThreePidOnly`\n * for homeservers that support it.\n *\n * @param {Object} creds\n * @param {boolean} bind\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: on success\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public addThreePid(creds: any, bind: boolean, callback?: Callback): Promise { // TODO: Types\n const path = \"/account/3pid\";\n const data = {\n 'threePidCreds': creds,\n 'bind': bind,\n };\n return this.http.authedRequest(\n callback, \"POST\", path, null, data,\n );\n }\n\n /**\n * Add a 3PID to your homeserver account. This API does not use an identity\n * server, as the homeserver is expected to handle 3PID ownership validation.\n *\n * You can check whether a homeserver supports this API via\n * `doesServerSupportSeparateAddAndBind`.\n *\n * @param {Object} data A object with 3PID validation data from having called\n * `account/3pid//requestToken` on the homeserver.\n * @return {Promise} Resolves: on success\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public async addThreePidOnly(data: IAddThreePidOnlyBody): Promise<{}> {\n const path = \"/account/3pid/add\";\n const prefix = await this.isVersionSupported(\"r0.6.0\") ? PREFIX_R0 : PREFIX_UNSTABLE;\n return this.http.authedRequest(undefined, \"POST\", path, null, data, { prefix });\n }\n\n /**\n * Bind a 3PID for discovery onto an identity server via the homeserver. The\n * identity server handles 3PID ownership validation and the homeserver records\n * the new binding to track where all 3PIDs for the account are bound.\n *\n * You can check whether a homeserver supports this API via\n * `doesServerSupportSeparateAddAndBind`.\n *\n * @param {Object} data A object with 3PID validation data from having called\n * `validate//requestToken` on the identity server. It should also\n * contain `id_server` and `id_access_token` fields as well.\n * @return {Promise} Resolves: on success\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public async bindThreePid(data: IBindThreePidBody): Promise<{}> {\n const path = \"/account/3pid/bind\";\n const prefix = await this.isVersionSupported(\"r0.6.0\") ?\n PREFIX_R0 : PREFIX_UNSTABLE;\n return this.http.authedRequest(\n undefined, \"POST\", path, null, data, { prefix },\n );\n }\n\n /**\n * Unbind a 3PID for discovery on an identity server via the homeserver. The\n * homeserver removes its record of the binding to keep an updated record of\n * where all 3PIDs for the account are bound.\n *\n * @param {string} medium The threepid medium (eg. 'email')\n * @param {string} address The threepid address (eg. 'bob@example.com')\n * this must be as returned by getThreePids.\n * @return {Promise} Resolves: on success\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public async unbindThreePid(\n medium: string,\n address: string,\n // eslint-disable-next-line camelcase\n ): Promise<{ id_server_unbind_result: IdServerUnbindResult }> {\n const path = \"/account/3pid/unbind\";\n const data = {\n medium,\n address,\n id_server: this.getIdentityServerUrl(true),\n };\n const prefix = await this.isVersionSupported(\"r0.6.0\") ? PREFIX_R0 : PREFIX_UNSTABLE;\n return this.http.authedRequest(undefined, \"POST\", path, null, data, { prefix });\n }\n\n /**\n * @param {string} medium The threepid medium (eg. 'email')\n * @param {string} address The threepid address (eg. 'bob@example.com')\n * this must be as returned by getThreePids.\n * @return {Promise} Resolves: The server response on success\n * (generally the empty JSON object)\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public deleteThreePid(\n medium: string,\n address: string,\n // eslint-disable-next-line camelcase\n ): Promise<{ id_server_unbind_result: IdServerUnbindResult }> {\n const path = \"/account/3pid/delete\";\n return this.http.authedRequest(undefined, \"POST\", path, null, { medium, address });\n }\n\n /**\n * Make a request to change your password.\n * @param {Object} authDict\n * @param {string} newPassword The new desired password.\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: TODO\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public setPassword(authDict: any, newPassword: string, callback?: Callback): Promise { // TODO: Types\n const path = \"/account/password\";\n const data = {\n 'auth': authDict,\n 'new_password': newPassword,\n };\n\n return this.http.authedRequest(\n callback, \"POST\", path, null, data,\n );\n }\n\n /**\n * Gets all devices recorded for the logged-in user\n * @return {Promise} Resolves: result object\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public getDevices(): Promise<{ devices: IMyDevice[] }> {\n return this.http.authedRequest(undefined, 'GET', \"/devices\", undefined, undefined);\n }\n\n /**\n * Gets specific device details for the logged-in user\n * @param {string} deviceId device to query\n * @return {Promise} Resolves: result object\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public getDevice(deviceId: string): Promise {\n const path = utils.encodeUri(\"/devices/$device_id\", {\n $device_id: deviceId,\n });\n return this.http.authedRequest(undefined, 'GET', path, undefined, undefined);\n }\n\n /**\n * Update the given device\n *\n * @param {string} deviceId device to update\n * @param {Object} body body of request\n * @return {Promise} Resolves: result object\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n // eslint-disable-next-line camelcase\n public setDeviceDetails(deviceId: string, body: { display_name: string }): Promise<{}> {\n const path = utils.encodeUri(\"/devices/$device_id\", {\n $device_id: deviceId,\n });\n\n return this.http.authedRequest(undefined, \"PUT\", path, undefined, body);\n }\n\n /**\n * Delete the given device\n *\n * @param {string} deviceId device to delete\n * @param {object} auth Optional. Auth data to supply for User-Interactive auth.\n * @return {Promise} Resolves: result object\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public deleteDevice(deviceId: string, auth?: any): Promise { // TODO: Types\n const path = utils.encodeUri(\"/devices/$device_id\", {\n $device_id: deviceId,\n });\n\n const body: any = {};\n\n if (auth) {\n body.auth = auth;\n }\n\n return this.http.authedRequest(undefined, \"DELETE\", path, undefined, body);\n }\n\n /**\n * Delete multiple device\n *\n * @param {string[]} devices IDs of the devices to delete\n * @param {object} auth Optional. Auth data to supply for User-Interactive auth.\n * @return {Promise} Resolves: result object\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public deleteMultipleDevices(devices: string[], auth?: any): Promise { // TODO: Types\n const body: any = { devices };\n\n if (auth) {\n body.auth = auth;\n }\n\n const path = \"/delete_devices\";\n return this.http.authedRequest(undefined, \"POST\", path, undefined, body);\n }\n\n /**\n * Gets all pushers registered for the logged-in user\n *\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: Array of objects representing pushers\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public getPushers(callback?: Callback): Promise<{ pushers: IPusher[] }> {\n const path = \"/pushers\";\n return this.http.authedRequest(callback, \"GET\", path, undefined, undefined);\n }\n\n /**\n * Adds a new pusher or updates an existing pusher\n *\n * @param {IPusherRequest} pusher Object representing a pusher\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: Empty json object on success\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public setPusher(pusher: IPusherRequest, callback?: Callback): Promise<{}> {\n const path = \"/pushers/set\";\n return this.http.authedRequest(callback, \"POST\", path, null, pusher);\n }\n\n /**\n * Get the push rules for the account from the server.\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves to the push rules.\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public getPushRules(callback?: Callback): Promise {\n return this.http.authedRequest(callback, \"GET\", \"/pushrules/\").then(rules => {\n return PushProcessor.rewriteDefaultRules(rules);\n });\n }\n\n /**\n * @param {string} scope\n * @param {string} kind\n * @param {string} ruleId\n * @param {Object} body\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: an empty object {}\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public addPushRule(\n scope: string,\n kind: PushRuleKind,\n ruleId: Exclude,\n body: any,\n callback?: Callback,\n ): Promise { // TODO: Types\n // NB. Scope not uri encoded because devices need the '/'\n const path = utils.encodeUri(\"/pushrules/\" + scope + \"/$kind/$ruleId\", {\n $kind: kind,\n $ruleId: ruleId,\n });\n return this.http.authedRequest(callback, \"PUT\", path, undefined, body);\n }\n\n /**\n * @param {string} scope\n * @param {string} kind\n * @param {string} ruleId\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: an empty object {}\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public deletePushRule(\n scope: string,\n kind: PushRuleKind,\n ruleId: Exclude,\n callback?: Callback,\n ): Promise { // TODO: Types\n // NB. Scope not uri encoded because devices need the '/'\n const path = utils.encodeUri(\"/pushrules/\" + scope + \"/$kind/$ruleId\", {\n $kind: kind,\n $ruleId: ruleId,\n });\n return this.http.authedRequest(callback, \"DELETE\", path);\n }\n\n /**\n * Enable or disable a push notification rule.\n * @param {string} scope\n * @param {string} kind\n * @param {string} ruleId\n * @param {boolean} enabled\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: result object\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public setPushRuleEnabled(\n scope: string,\n kind: PushRuleKind,\n ruleId: RuleId | string,\n enabled: boolean,\n callback?: Callback,\n ): Promise<{}> {\n const path = utils.encodeUri(\"/pushrules/\" + scope + \"/$kind/$ruleId/enabled\", {\n $kind: kind,\n $ruleId: ruleId,\n });\n return this.http.authedRequest(\n callback, \"PUT\", path, undefined, { \"enabled\": enabled },\n );\n }\n\n /**\n * Set the actions for a push notification rule.\n * @param {string} scope\n * @param {string} kind\n * @param {string} ruleId\n * @param {array} actions\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: result object\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public setPushRuleActions(\n scope: string,\n kind: PushRuleKind,\n ruleId: RuleId | string,\n actions: PushRuleAction[],\n callback?: Callback,\n ): Promise<{}> {\n const path = utils.encodeUri(\"/pushrules/\" + scope + \"/$kind/$ruleId/actions\", {\n $kind: kind,\n $ruleId: ruleId,\n });\n return this.http.authedRequest(\n callback, \"PUT\", path, undefined, { \"actions\": actions },\n );\n }\n\n /**\n * Perform a server-side search.\n * @param {Object} opts\n * @param {string} opts.next_batch the batch token to pass in the query string\n * @param {Object} opts.body the JSON object to pass to the request body.\n * @param {module:client.callback} callback Optional.\n * @return {Promise} Resolves: TODO\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public search(\n opts: { body: ISearchRequestBody, next_batch?: string }, // eslint-disable-line camelcase\n callback?: Callback,\n ): Promise {\n const queryParams: any = {};\n if (opts.next_batch) {\n queryParams.next_batch = opts.next_batch;\n }\n return this.http.authedRequest(callback, \"POST\", \"/search\", queryParams, opts.body);\n }\n\n /**\n * Upload keys\n *\n * @param {Object} content body of upload request\n *\n * @param {Object=} opts this method no longer takes any opts,\n * used to take opts.device_id but this was not removed from the spec as a redundant parameter\n *\n * @param {module:client.callback=} callback\n *\n * @return {Promise} Resolves: result object. Rejects: with\n * an error response ({@link module:http-api.MatrixError}).\n */\n public uploadKeysRequest(\n content: IUploadKeysRequest,\n opts?: void,\n callback?: Callback,\n ): Promise {\n return this.http.authedRequest(callback, \"POST\", \"/keys/upload\", undefined, content);\n }\n\n public uploadKeySignatures(content: KeySignatures): Promise {\n return this.http.authedRequest(\n undefined, \"POST\", '/keys/signatures/upload', undefined,\n content, {\n prefix: PREFIX_UNSTABLE,\n },\n );\n }\n\n /**\n * Download device keys\n *\n * @param {string[]} userIds list of users to get keys for\n *\n * @param {Object=} opts\n *\n * @param {string=} opts.token sync token to pass in the query request, to help\n * the HS give the most recent results\n *\n * @return {Promise} Resolves: result object. Rejects: with\n * an error response ({@link module:http-api.MatrixError}).\n */\n public downloadKeysForUsers(userIds: string[], opts: { token?: string }): Promise {\n if (utils.isFunction(opts)) {\n // opts used to be 'callback'.\n throw new Error('downloadKeysForUsers no longer accepts a callback parameter');\n }\n opts = opts || {};\n\n const content: any = {\n device_keys: {},\n };\n if ('token' in opts) {\n content.token = opts.token;\n }\n userIds.forEach((u) => {\n content.device_keys[u] = [];\n });\n\n return this.http.authedRequest(undefined, \"POST\", \"/keys/query\", undefined, content);\n }\n\n /**\n * Claim one-time keys\n *\n * @param {string[]} devices a list of [userId, deviceId] pairs\n *\n * @param {string} [keyAlgorithm = signed_curve25519] desired key type\n *\n * @param {number} [timeout] the time (in milliseconds) to wait for keys from remote\n * servers\n *\n * @return {Promise} Resolves: result object. Rejects: with\n * an error response ({@link module:http-api.MatrixError}).\n */\n public claimOneTimeKeys(\n devices: string[],\n keyAlgorithm = \"signed_curve25519\",\n timeout?: number,\n ): Promise {\n const queries = {};\n\n if (keyAlgorithm === undefined) {\n keyAlgorithm = \"signed_curve25519\";\n }\n\n for (let i = 0; i < devices.length; ++i) {\n const userId = devices[i][0];\n const deviceId = devices[i][1];\n const query = queries[userId] || {};\n queries[userId] = query;\n query[deviceId] = keyAlgorithm;\n }\n const content: any = { one_time_keys: queries };\n if (timeout) {\n content.timeout = timeout;\n }\n const path = \"/keys/claim\";\n return this.http.authedRequest(undefined, \"POST\", path, undefined, content);\n }\n\n /**\n * Ask the server for a list of users who have changed their device lists\n * between a pair of sync tokens\n *\n * @param {string} oldToken\n * @param {string} newToken\n *\n * @return {Promise} Resolves: result object. Rejects: with\n * an error response ({@link module:http-api.MatrixError}).\n */\n public getKeyChanges(oldToken: string, newToken: string): Promise<{ changed: string[], left: string[] }> {\n const qps = {\n from: oldToken,\n to: newToken,\n };\n\n const path = \"/keys/changes\";\n return this.http.authedRequest(undefined, \"GET\", path, qps, undefined);\n }\n\n public uploadDeviceSigningKeys(auth: any, keys: CrossSigningKeys): Promise<{}> { // TODO: types\n const data = Object.assign({}, keys);\n if (auth) Object.assign(data, { auth });\n return this.http.authedRequest(\n undefined, \"POST\", \"/keys/device_signing/upload\", undefined, data, {\n prefix: PREFIX_UNSTABLE,\n },\n );\n }\n\n /**\n * Register with an identity server using the OpenID token from the user's\n * Homeserver, which can be retrieved via\n * {@link module:client~MatrixClient#getOpenIdToken}.\n *\n * Note that the `/account/register` endpoint (as well as IS authentication in\n * general) was added as part of the v2 API version.\n *\n * @param {object} hsOpenIdToken\n * @return {Promise} Resolves: with object containing an Identity\n * Server access token.\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public registerWithIdentityServer(hsOpenIdToken: any): Promise { // TODO: Types\n if (!this.idBaseUrl) {\n throw new Error(\"No identity server base URL set\");\n }\n\n const uri = this.idBaseUrl + PREFIX_IDENTITY_V2 + \"/account/register\";\n return this.http.requestOtherUrl(\n undefined, \"POST\", uri,\n null, hsOpenIdToken,\n );\n }\n\n /**\n * Requests an email verification token directly from an identity server.\n *\n * This API is used as part of binding an email for discovery on an identity\n * server. The validation data that results should be passed to the\n * `bindThreePid` method to complete the binding process.\n *\n * @param {string} email The email address to request a token for\n * @param {string} clientSecret A secret binary string generated by the client.\n * It is recommended this be around 16 ASCII characters.\n * @param {number} sendAttempt If an identity server sees a duplicate request\n * with the same sendAttempt, it will not send another email.\n * To request another email to be sent, use a larger value for\n * the sendAttempt param as was used in the previous request.\n * @param {string} nextLink Optional If specified, the client will be redirected\n * to this link after validation.\n * @param {module:client.callback} callback Optional.\n * @param {string} identityAccessToken The `access_token` field of the identity\n * server `/account/register` response (see {@link registerWithIdentityServer}).\n *\n * @return {Promise} Resolves: TODO\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n * @throws Error if no identity server is set\n */\n public async requestEmailToken(\n email: string,\n clientSecret: string,\n sendAttempt: number,\n nextLink: string,\n callback?: Callback,\n identityAccessToken?: string,\n ): Promise { // TODO: Types\n const params = {\n client_secret: clientSecret,\n email: email,\n send_attempt: sendAttempt,\n next_link: nextLink,\n };\n\n return await this.http.idServerRequest(\n callback, \"POST\", \"/validate/email/requestToken\",\n params, PREFIX_IDENTITY_V2, identityAccessToken,\n );\n }\n\n /**\n * Requests a MSISDN verification token directly from an identity server.\n *\n * This API is used as part of binding a MSISDN for discovery on an identity\n * server. The validation data that results should be passed to the\n * `bindThreePid` method to complete the binding process.\n *\n * @param {string} phoneCountry The ISO 3166-1 alpha-2 code for the country in\n * which phoneNumber should be parsed relative to.\n * @param {string} phoneNumber The phone number, in national or international\n * format\n * @param {string} clientSecret A secret binary string generated by the client.\n * It is recommended this be around 16 ASCII characters.\n * @param {number} sendAttempt If an identity server sees a duplicate request\n * with the same sendAttempt, it will not send another SMS.\n * To request another SMS to be sent, use a larger value for\n * the sendAttempt param as was used in the previous request.\n * @param {string} nextLink Optional If specified, the client will be redirected\n * to this link after validation.\n * @param {module:client.callback} callback Optional.\n * @param {string} identityAccessToken The `access_token` field of the Identity\n * Server `/account/register` response (see {@link registerWithIdentityServer}).\n *\n * @return {Promise} Resolves: TODO\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n * @throws Error if no identity server is set\n */\n public async requestMsisdnToken(\n phoneCountry: string,\n phoneNumber: string,\n clientSecret: string,\n sendAttempt: number,\n nextLink: string,\n callback?: Callback,\n identityAccessToken?: string,\n ): Promise { // TODO: Types\n const params = {\n client_secret: clientSecret,\n country: phoneCountry,\n phone_number: phoneNumber,\n send_attempt: sendAttempt,\n next_link: nextLink,\n };\n\n return await this.http.idServerRequest(\n callback, \"POST\", \"/validate/msisdn/requestToken\",\n params, PREFIX_IDENTITY_V2, identityAccessToken,\n );\n }\n\n /**\n * Submits a MSISDN token to the identity server\n *\n * This is used when submitting the code sent by SMS to a phone number.\n * The identity server has an equivalent API for email but the js-sdk does\n * not expose this, since email is normally validated by the user clicking\n * a link rather than entering a code.\n *\n * @param {string} sid The sid given in the response to requestToken\n * @param {string} clientSecret A secret binary string generated by the client.\n * This must be the same value submitted in the requestToken call.\n * @param {string} msisdnToken The MSISDN token, as enetered by the user.\n * @param {string} identityAccessToken The `access_token` field of the Identity\n * Server `/account/register` response (see {@link registerWithIdentityServer}).\n *\n * @return {Promise} Resolves: Object, currently with no parameters.\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n * @throws Error if No identity server is set\n */\n public async submitMsisdnToken(\n sid: string,\n clientSecret: string,\n msisdnToken: string,\n identityAccessToken: string,\n ): Promise { // TODO: Types\n const params = {\n sid: sid,\n client_secret: clientSecret,\n token: msisdnToken,\n };\n\n return await this.http.idServerRequest(\n undefined, \"POST\", \"/validate/msisdn/submitToken\",\n params, PREFIX_IDENTITY_V2, identityAccessToken,\n );\n }\n\n /**\n * Submits a MSISDN token to an arbitrary URL.\n *\n * This is used when submitting the code sent by SMS to a phone number in the\n * newer 3PID flow where the homeserver validates 3PID ownership (as part of\n * `requestAdd3pidMsisdnToken`). The homeserver response may include a\n * `submit_url` to specify where the token should be sent, and this helper can\n * be used to pass the token to this URL.\n *\n * @param {string} url The URL to submit the token to\n * @param {string} sid The sid given in the response to requestToken\n * @param {string} clientSecret A secret binary string generated by the client.\n * This must be the same value submitted in the requestToken call.\n * @param {string} msisdnToken The MSISDN token, as enetered by the user.\n *\n * @return {Promise} Resolves: Object, currently with no parameters.\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public submitMsisdnTokenOtherUrl(\n url: string,\n sid: string,\n clientSecret: string,\n msisdnToken: string,\n ): Promise { // TODO: Types\n const params = {\n sid: sid,\n client_secret: clientSecret,\n token: msisdnToken,\n };\n\n return this.http.requestOtherUrl(\n undefined, \"POST\", url, undefined, params,\n );\n }\n\n /**\n * Gets the V2 hashing information from the identity server. Primarily useful for\n * lookups.\n * @param {string} identityAccessToken The access token for the identity server.\n * @returns {Promise} The hashing information for the identity server.\n */\n public getIdentityHashDetails(identityAccessToken: string): Promise { // TODO: Types\n return this.http.idServerRequest(\n undefined, \"GET\", \"/hash_details\",\n null, PREFIX_IDENTITY_V2, identityAccessToken,\n );\n }\n\n /**\n * Performs a hashed lookup of addresses against the identity server. This is\n * only supported on identity servers which have at least the version 2 API.\n * @param {Array>} addressPairs An array of 2 element arrays.\n * The first element of each pair is the address, the second is the 3PID medium.\n * Eg: [\"email@example.org\", \"email\"]\n * @param {string} identityAccessToken The access token for the identity server.\n * @returns {Promise>} A collection of address mappings to\n * found MXIDs. Results where no user could be found will not be listed.\n */\n public async identityHashedLookup(\n addressPairs: [string, string][],\n identityAccessToken: string,\n ): Promise<{ address: string, mxid: string }[]> {\n const params = {\n // addresses: [\"email@example.org\", \"10005550000\"],\n // algorithm: \"sha256\",\n // pepper: \"abc123\"\n };\n\n // Get hash information first before trying to do a lookup\n const hashes = await this.getIdentityHashDetails(identityAccessToken);\n if (!hashes || !hashes['lookup_pepper'] || !hashes['algorithms']) {\n throw new Error(\"Unsupported identity server: bad response\");\n }\n\n params['pepper'] = hashes['lookup_pepper'];\n\n const localMapping = {\n // hashed identifier => plain text address\n // For use in this function's return format\n };\n\n // When picking an algorithm, we pick the hashed over no hashes\n if (hashes['algorithms'].includes('sha256')) {\n // Abuse the olm hashing\n const olmutil = new global.Olm.Utility();\n params[\"addresses\"] = addressPairs.map(p => {\n const addr = p[0].toLowerCase(); // lowercase to get consistent hashes\n const med = p[1].toLowerCase();\n const hashed = olmutil.sha256(`${addr} ${med} ${params['pepper']}`)\n .replace(/\\+/g, '-').replace(/\\//g, '_'); // URL-safe base64\n // Map the hash to a known (case-sensitive) address. We use the case\n // sensitive version because the caller might be expecting that.\n localMapping[hashed] = p[0];\n return hashed;\n });\n params[\"algorithm\"] = \"sha256\";\n } else if (hashes['algorithms'].includes('none')) {\n params[\"addresses\"] = addressPairs.map(p => {\n const addr = p[0].toLowerCase(); // lowercase to get consistent hashes\n const med = p[1].toLowerCase();\n const unhashed = `${addr} ${med}`;\n // Map the unhashed values to a known (case-sensitive) address. We use\n // the case sensitive version because the caller might be expecting that.\n localMapping[unhashed] = p[0];\n return unhashed;\n });\n params[\"algorithm\"] = \"none\";\n } else {\n throw new Error(\"Unsupported identity server: unknown hash algorithm\");\n }\n\n const response = await this.http.idServerRequest(\n undefined, \"POST\", \"/lookup\",\n params, PREFIX_IDENTITY_V2, identityAccessToken,\n );\n\n if (!response || !response['mappings']) return []; // no results\n\n const foundAddresses = [/* {address: \"plain@example.org\", mxid} */];\n for (const hashed of Object.keys(response['mappings'])) {\n const mxid = response['mappings'][hashed];\n const plainAddress = localMapping[hashed];\n if (!plainAddress) {\n throw new Error(\"Identity server returned more results than expected\");\n }\n\n foundAddresses.push({ address: plainAddress, mxid });\n }\n return foundAddresses;\n }\n\n /**\n * Looks up the public Matrix ID mapping for a given 3rd party\n * identifier from the identity server\n *\n * @param {string} medium The medium of the threepid, eg. 'email'\n * @param {string} address The textual address of the threepid\n * @param {module:client.callback} callback Optional.\n * @param {string} identityAccessToken The `access_token` field of the Identity\n * Server `/account/register` response (see {@link registerWithIdentityServer}).\n *\n * @return {Promise} Resolves: A threepid mapping\n * object or the empty object if no mapping\n * exists\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public async lookupThreePid(\n medium: string,\n address: string,\n callback?: Callback,\n identityAccessToken?: string,\n ): Promise { // TODO: Types\n // Note: we're using the V2 API by calling this function, but our\n // function contract requires a V1 response. We therefore have to\n // convert it manually.\n const response = await this.identityHashedLookup(\n [[address, medium]], identityAccessToken,\n );\n const result = response.find(p => p.address === address);\n if (!result) {\n if (callback) callback(null, {});\n return {};\n }\n\n const mapping = {\n address,\n medium,\n mxid: result.mxid,\n\n // We can't reasonably fill these parameters:\n // not_before\n // not_after\n // ts\n // signatures\n };\n\n if (callback) callback(null, mapping);\n return mapping;\n }\n\n /**\n * Looks up the public Matrix ID mappings for multiple 3PIDs.\n *\n * @param {Array.>} query Array of arrays containing\n * [medium, address]\n * @param {string} identityAccessToken The `access_token` field of the Identity\n * Server `/account/register` response (see {@link registerWithIdentityServer}).\n *\n * @return {Promise} Resolves: Lookup results from IS.\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public async bulkLookupThreePids(query: [string, string][], identityAccessToken: string): Promise { // TODO: Types\n // Note: we're using the V2 API by calling this function, but our\n // function contract requires a V1 response. We therefore have to\n // convert it manually.\n const response = await this.identityHashedLookup(\n // We have to reverse the query order to get [address, medium] pairs\n query.map(p => [p[1], p[0]]), identityAccessToken,\n );\n\n const v1results = [];\n for (const mapping of response) {\n const originalQuery = query.find(p => p[1] === mapping.address);\n if (!originalQuery) {\n throw new Error(\"Identity sever returned unexpected results\");\n }\n\n v1results.push([\n originalQuery[0], // medium\n mapping.address,\n mapping.mxid,\n ]);\n }\n\n return { threepids: v1results };\n }\n\n /**\n * Get account info from the identity server. This is useful as a neutral check\n * to verify that other APIs are likely to approve access by testing that the\n * token is valid, terms have been agreed, etc.\n *\n * @param {string} identityAccessToken The `access_token` field of the Identity\n * Server `/account/register` response (see {@link registerWithIdentityServer}).\n *\n * @return {Promise} Resolves: an object with account info.\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n */\n public getIdentityAccount(identityAccessToken: string): Promise { // TODO: Types\n return this.http.idServerRequest(\n undefined, \"GET\", \"/account\",\n undefined, PREFIX_IDENTITY_V2, identityAccessToken,\n );\n }\n\n /**\n * Send an event to a specific list of devices\n *\n * @param {string} eventType type of event to send\n * @param {Object.>} contentMap\n * content to send. Map from user_id to device_id to content object.\n * @param {string=} txnId transaction id. One will be made up if not\n * supplied.\n * @return {Promise} Resolves to the result object\n */\n public sendToDevice(\n eventType: string,\n contentMap: { [userId: string]: { [deviceId: string]: Record } },\n txnId?: string,\n ): Promise<{}> {\n const path = utils.encodeUri(\"/sendToDevice/$eventType/$txnId\", {\n $eventType: eventType,\n $txnId: txnId ? txnId : this.makeTxnId(),\n });\n\n const body = {\n messages: contentMap,\n };\n\n const targets = Object.keys(contentMap).reduce((obj, key) => {\n obj[key] = Object.keys(contentMap[key]);\n return obj;\n }, {});\n logger.log(`PUT ${path}`, targets);\n\n return this.http.authedRequest(undefined, \"PUT\", path, undefined, body);\n }\n\n /**\n * Get the third party protocols that can be reached using\n * this HS\n * @return {Promise} Resolves to the result object\n */\n public getThirdpartyProtocols(): Promise<{ [protocol: string]: IProtocol }> {\n return this.http.authedRequest(\n undefined, \"GET\", \"/thirdparty/protocols\", undefined, undefined,\n ).then((response) => {\n // sanity check\n if (!response || typeof (response) !== 'object') {\n throw new Error(`/thirdparty/protocols did not return an object: ${response}`);\n }\n return response;\n });\n }\n\n /**\n * Get information on how a specific place on a third party protocol\n * may be reached.\n * @param {string} protocol The protocol given in getThirdpartyProtocols()\n * @param {object} params Protocol-specific parameters, as given in the\n * response to getThirdpartyProtocols()\n * @return {Promise} Resolves to the result object\n */\n public getThirdpartyLocation(\n protocol: string,\n params: { searchFields?: string[] },\n ): Promise {\n const path = utils.encodeUri(\"/thirdparty/location/$protocol\", {\n $protocol: protocol,\n });\n\n return this.http.authedRequest(undefined, \"GET\", path, params, undefined);\n }\n\n /**\n * Get information on how a specific user on a third party protocol\n * may be reached.\n * @param {string} protocol The protocol given in getThirdpartyProtocols()\n * @param {object} params Protocol-specific parameters, as given in the\n * response to getThirdpartyProtocols()\n * @return {Promise} Resolves to the result object\n */\n public getThirdpartyUser(protocol: string, params: any): Promise { // TODO: Types\n const path = utils.encodeUri(\"/thirdparty/user/$protocol\", {\n $protocol: protocol,\n });\n\n return this.http.authedRequest(undefined, \"GET\", path, params, undefined);\n }\n\n public getTerms(serviceType: SERVICE_TYPES, baseUrl: string): Promise { // TODO: Types\n const url = this.termsUrlForService(serviceType, baseUrl);\n return this.http.requestOtherUrl(undefined, 'GET', url);\n }\n\n public agreeToTerms(\n serviceType: SERVICE_TYPES,\n baseUrl: string,\n accessToken: string,\n termsUrls: string[],\n ): Promise { // TODO: Types\n const url = this.termsUrlForService(serviceType, baseUrl);\n const headers = {\n Authorization: \"Bearer \" + accessToken,\n };\n return this.http.requestOtherUrl(undefined, 'POST', url, null, { user_accepts: termsUrls }, { headers });\n }\n\n /**\n * Reports an event as inappropriate to the server, which may then notify the appropriate people.\n * @param {string} roomId The room in which the event being reported is located.\n * @param {string} eventId The event to report.\n * @param {number} score The score to rate this content as where -100 is most offensive and 0 is inoffensive.\n * @param {string} reason The reason the content is being reported. May be blank.\n * @returns {Promise} Resolves to an empty object if successful\n */\n public reportEvent(roomId: string, eventId: string, score: number, reason: string): Promise<{}> {\n const path = utils.encodeUri(\"/rooms/$roomId/report/$eventId\", {\n $roomId: roomId,\n $eventId: eventId,\n });\n\n return this.http.authedRequest(undefined, \"POST\", path, null, { score, reason });\n }\n\n /**\n * Fetches or paginates a summary of a space as defined by an initial version of MSC2946\n * @param {string} roomId The ID of the space-room to use as the root of the summary.\n * @param {number?} maxRoomsPerSpace The maximum number of rooms to return per subspace.\n * @param {boolean?} suggestedOnly Whether to only return rooms with suggested=true.\n * @param {boolean?} autoJoinOnly Whether to only return rooms with auto_join=true.\n * @param {number?} limit The maximum number of rooms to return in total.\n * @param {string?} batch The opaque token to paginate a previous summary request.\n * @returns {Promise} the response, with next_token, rooms fields.\n * @deprecated in favour of `getRoomHierarchy` due to the MSC changing paths.\n */\n public getSpaceSummary(\n roomId: string,\n maxRoomsPerSpace?: number,\n suggestedOnly?: boolean,\n autoJoinOnly?: boolean,\n limit?: number,\n batch?: string,\n ): Promise<{rooms: ISpaceSummaryRoom[], events: ISpaceSummaryEvent[]}> {\n const path = utils.encodeUri(\"/rooms/$roomId/spaces\", {\n $roomId: roomId,\n });\n\n return this.http.authedRequest(undefined, \"POST\", path, null, {\n max_rooms_per_space: maxRoomsPerSpace,\n suggested_only: suggestedOnly,\n auto_join_only: autoJoinOnly,\n limit,\n batch,\n }, {\n prefix: \"/_matrix/client/unstable/org.matrix.msc2946\",\n });\n }\n\n /**\n * Fetches or paginates a room hierarchy as defined by MSC2946.\n * Falls back gracefully to sourcing its data from `getSpaceSummary` if this API is not yet supported by the server.\n * @param {string} roomId The ID of the space-room to use as the root of the summary.\n * @param {number?} limit The maximum number of rooms to return per page.\n * @param {number?} maxDepth The maximum depth in the tree from the root room to return.\n * @param {boolean?} suggestedOnly Whether to only return rooms with suggested=true.\n * @param {string?} fromToken The opaque token to paginate a previous request.\n * @returns {Promise} the response, with next_batch & rooms fields.\n */\n public getRoomHierarchy(\n roomId: string,\n limit?: number,\n maxDepth?: number,\n suggestedOnly = false,\n fromToken?: string,\n ): Promise<{\n rooms: IHierarchyRoom[];\n next_batch?: string; // eslint-disable-line camelcase\n }> {\n const path = utils.encodeUri(\"/rooms/$roomId/hierarchy\", {\n $roomId: roomId,\n });\n\n return this.http.authedRequest(undefined, \"GET\", path, {\n suggested_only: suggestedOnly,\n max_depth: maxDepth,\n from: fromToken,\n limit,\n }, undefined, {\n prefix: \"/_matrix/client/unstable/org.matrix.msc2946\",\n }).catch(e => {\n if (e.errcode === \"M_UNRECOGNIZED\") {\n // fall back to the older space summary API as it exposes the same data just in a different shape.\n return this.getSpaceSummary(roomId, undefined, suggestedOnly, undefined, limit)\n .then(({ rooms, events }) => {\n // Translate response from `/spaces` to that we expect in this API.\n const roomMap = new Map(rooms.map(r => {\n return [r.room_id, { ...r, children_state: [] }];\n }));\n events.forEach(e => {\n roomMap.get(e.room_id)?.children_state.push(e);\n });\n\n return {\n rooms: Array.from(roomMap.values()),\n };\n });\n }\n\n throw e;\n });\n }\n\n /**\n * Creates a new file tree space with the given name. The client will pick\n * defaults for how it expects to be able to support the remaining API offered\n * by the returned class.\n *\n * Note that this is UNSTABLE and may have breaking changes without notice.\n * @param {string} name The name of the tree space.\n * @returns {Promise} Resolves to the created space.\n */\n public async unstableCreateFileTree(name: string): Promise {\n const { room_id: roomId } = await this.createRoom({\n name: name,\n preset: Preset.PrivateChat,\n power_level_content_override: {\n ...DEFAULT_TREE_POWER_LEVELS_TEMPLATE,\n users: {\n [this.getUserId()]: 100,\n },\n },\n creation_content: {\n [RoomCreateTypeField]: RoomType.Space,\n },\n initial_state: [\n {\n type: UNSTABLE_MSC3088_PURPOSE.name,\n state_key: UNSTABLE_MSC3089_TREE_SUBTYPE.name,\n content: {\n [UNSTABLE_MSC3088_ENABLED.name]: true,\n },\n },\n {\n type: EventType.RoomEncryption,\n state_key: \"\",\n content: {\n algorithm: olmlib.MEGOLM_ALGORITHM,\n },\n },\n ],\n });\n return new MSC3089TreeSpace(this, roomId);\n }\n\n /**\n * Gets a reference to a tree space, if the room ID given is a tree space. If the room\n * does not appear to be a tree space then null is returned.\n *\n * Note that this is UNSTABLE and may have breaking changes without notice.\n * @param {string} roomId The room ID to get a tree space reference for.\n * @returns {MSC3089TreeSpace} The tree space, or null if not a tree space.\n */\n public unstableGetFileTreeSpace(roomId: string): MSC3089TreeSpace {\n const room = this.getRoom(roomId);\n if (room?.getMyMembership() !== 'join') return null;\n\n const createEvent = room.currentState.getStateEvents(EventType.RoomCreate, \"\");\n const purposeEvent = room.currentState.getStateEvents(\n UNSTABLE_MSC3088_PURPOSE.name,\n UNSTABLE_MSC3089_TREE_SUBTYPE.name);\n\n if (!createEvent) throw new Error(\"Expected single room create event\");\n\n if (!purposeEvent?.getContent()?.[UNSTABLE_MSC3088_ENABLED.name]) return null;\n if (createEvent.getContent()?.[RoomCreateTypeField] !== RoomType.Space) return null;\n\n return new MSC3089TreeSpace(this, roomId);\n }\n\n // TODO: Remove this warning, alongside the functions\n // See https://github.com/vector-im/element-web/issues/17532\n // ======================================================\n // ** ANCIENT APIS BELOW **\n // ======================================================\n\n /**\n * @param {string} groupId\n * @return {Promise} Resolves: Group summary object\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n * @deprecated groups/communities never made it to the spec and support for them is being discontinued.\n */\n public getGroupSummary(groupId: string): Promise {\n const path = utils.encodeUri(\"/groups/$groupId/summary\", { $groupId: groupId });\n return this.http.authedRequest(undefined, \"GET\", path);\n }\n\n /**\n * @param {string} groupId\n * @return {Promise} Resolves: Group profile object\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n * @deprecated groups/communities never made it to the spec and support for them is being discontinued.\n */\n public getGroupProfile(groupId: string): Promise {\n const path = utils.encodeUri(\"/groups/$groupId/profile\", { $groupId: groupId });\n return this.http.authedRequest(undefined, \"GET\", path);\n }\n\n /**\n * @param {string} groupId\n * @param {Object} profile The group profile object\n * @param {string=} profile.name Name of the group\n * @param {string=} profile.avatar_url MXC avatar URL\n * @param {string=} profile.short_description A short description of the room\n * @param {string=} profile.long_description A longer HTML description of the room\n * @return {Promise} Resolves: Empty object\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n * @deprecated groups/communities never made it to the spec and support for them is being discontinued.\n */\n public setGroupProfile(groupId: string, profile: any): Promise {\n const path = utils.encodeUri(\"/groups/$groupId/profile\", { $groupId: groupId });\n return this.http.authedRequest(\n undefined, \"POST\", path, undefined, profile,\n );\n }\n\n /**\n * @param {string} groupId\n * @param {object} policy The join policy for the group. Must include at\n * least a 'type' field which is 'open' if anyone can join the group\n * the group without prior approval, or 'invite' if an invite is\n * required to join.\n * @return {Promise} Resolves: Empty object\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n * @deprecated groups/communities never made it to the spec and support for them is being discontinued.\n */\n public setGroupJoinPolicy(groupId: string, policy: any): Promise {\n const path = utils.encodeUri(\n \"/groups/$groupId/settings/m.join_policy\",\n { $groupId: groupId },\n );\n return this.http.authedRequest(\n undefined, \"PUT\", path, undefined, {\n 'm.join_policy': policy,\n },\n );\n }\n\n /**\n * @param {string} groupId\n * @return {Promise} Resolves: Group users list object\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n * @deprecated groups/communities never made it to the spec and support for them is being discontinued.\n */\n public getGroupUsers(groupId: string): Promise {\n const path = utils.encodeUri(\"/groups/$groupId/users\", { $groupId: groupId });\n return this.http.authedRequest(undefined, \"GET\", path);\n }\n\n /**\n * @param {string} groupId\n * @return {Promise} Resolves: Group users list object\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n * @deprecated groups/communities never made it to the spec and support for them is being discontinued.\n */\n public getGroupInvitedUsers(groupId: string): Promise {\n const path = utils.encodeUri(\"/groups/$groupId/invited_users\", { $groupId: groupId });\n return this.http.authedRequest(undefined, \"GET\", path);\n }\n\n /**\n * @param {string} groupId\n * @return {Promise} Resolves: Group rooms list object\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n * @deprecated groups/communities never made it to the spec and support for them is being discontinued.\n */\n public getGroupRooms(groupId: string): Promise {\n const path = utils.encodeUri(\"/groups/$groupId/rooms\", { $groupId: groupId });\n return this.http.authedRequest(undefined, \"GET\", path);\n }\n\n /**\n * @param {string} groupId\n * @param {string} userId\n * @return {Promise} Resolves: Empty object\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n * @deprecated groups/communities never made it to the spec and support for them is being discontinued.\n */\n public inviteUserToGroup(groupId: string, userId: string): Promise {\n const path = utils.encodeUri(\n \"/groups/$groupId/admin/users/invite/$userId\",\n { $groupId: groupId, $userId: userId },\n );\n return this.http.authedRequest(undefined, \"PUT\", path, undefined, {});\n }\n\n /**\n * @param {string} groupId\n * @param {string} userId\n * @return {Promise} Resolves: Empty object\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n * @deprecated groups/communities never made it to the spec and support for them is being discontinued.\n */\n public removeUserFromGroup(groupId: string, userId: string): Promise {\n const path = utils.encodeUri(\n \"/groups/$groupId/admin/users/remove/$userId\",\n { $groupId: groupId, $userId: userId },\n );\n return this.http.authedRequest(undefined, \"PUT\", path, undefined, {});\n }\n\n /**\n * @param {string} groupId\n * @param {string} userId\n * @param {string} roleId Optional.\n * @return {Promise} Resolves: Empty object\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n * @deprecated groups/communities never made it to the spec and support for them is being discontinued.\n */\n public addUserToGroupSummary(groupId: string, userId: string, roleId: string): Promise {\n const path = utils.encodeUri(\n roleId ?\n \"/groups/$groupId/summary/$roleId/users/$userId\" :\n \"/groups/$groupId/summary/users/$userId\",\n { $groupId: groupId, $roleId: roleId, $userId: userId },\n );\n return this.http.authedRequest(undefined, \"PUT\", path, undefined, {});\n }\n\n /**\n * @param {string} groupId\n * @param {string} userId\n * @return {Promise} Resolves: Empty object\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n * @deprecated groups/communities never made it to the spec and support for them is being discontinued.\n */\n public removeUserFromGroupSummary(groupId: string, userId: string): Promise {\n const path = utils.encodeUri(\n \"/groups/$groupId/summary/users/$userId\",\n { $groupId: groupId, $userId: userId },\n );\n return this.http.authedRequest(undefined, \"DELETE\", path, undefined, {});\n }\n\n /**\n * @param {string} groupId\n * @param {string} roomId\n * @param {string} categoryId Optional.\n * @return {Promise} Resolves: Empty object\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n * @deprecated groups/communities never made it to the spec and support for them is being discontinued.\n */\n public addRoomToGroupSummary(groupId: string, roomId: string, categoryId: string): Promise {\n const path = utils.encodeUri(\n categoryId ?\n \"/groups/$groupId/summary/$categoryId/rooms/$roomId\" :\n \"/groups/$groupId/summary/rooms/$roomId\",\n { $groupId: groupId, $categoryId: categoryId, $roomId: roomId },\n );\n return this.http.authedRequest(undefined, \"PUT\", path, undefined, {});\n }\n\n /**\n * @param {string} groupId\n * @param {string} roomId\n * @return {Promise} Resolves: Empty object\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n * @deprecated groups/communities never made it to the spec and support for them is being discontinued.\n */\n public removeRoomFromGroupSummary(groupId: string, roomId: string): Promise {\n const path = utils.encodeUri(\n \"/groups/$groupId/summary/rooms/$roomId\",\n { $groupId: groupId, $roomId: roomId },\n );\n return this.http.authedRequest(undefined, \"DELETE\", path, undefined, {});\n }\n\n /**\n * @param {string} groupId\n * @param {string} roomId\n * @param {boolean} isPublic Whether the room-group association is visible to non-members\n * @return {Promise} Resolves: Empty object\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n * @deprecated groups/communities never made it to the spec and support for them is being discontinued.\n */\n public addRoomToGroup(groupId: string, roomId: string, isPublic: boolean): Promise {\n if (isPublic === undefined) {\n isPublic = true;\n }\n const path = utils.encodeUri(\n \"/groups/$groupId/admin/rooms/$roomId\",\n { $groupId: groupId, $roomId: roomId },\n );\n return this.http.authedRequest(undefined, \"PUT\", path, undefined,\n { \"m.visibility\": { type: isPublic ? \"public\" : \"private\" } },\n );\n }\n\n /**\n * Configure the visibility of a room-group association.\n * @param {string} groupId\n * @param {string} roomId\n * @param {boolean} isPublic Whether the room-group association is visible to non-members\n * @return {Promise} Resolves: Empty object\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n * @deprecated groups/communities never made it to the spec and support for them is being discontinued.\n */\n public updateGroupRoomVisibility(groupId: string, roomId: string, isPublic: boolean): Promise {\n // NB: The /config API is generic but there's not much point in exposing this yet as synapse\n // is the only server to implement this. In future we should consider an API that allows\n // arbitrary configuration, i.e. \"config/$configKey\".\n\n const path = utils.encodeUri(\n \"/groups/$groupId/admin/rooms/$roomId/config/m.visibility\",\n { $groupId: groupId, $roomId: roomId },\n );\n return this.http.authedRequest(undefined, \"PUT\", path, undefined,\n { type: isPublic ? \"public\" : \"private\" },\n );\n }\n\n /**\n * @param {string} groupId\n * @param {string} roomId\n * @return {Promise} Resolves: Empty object\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n * @deprecated groups/communities never made it to the spec and support for them is being discontinued.\n */\n public removeRoomFromGroup(groupId: string, roomId: string): Promise {\n const path = utils.encodeUri(\n \"/groups/$groupId/admin/rooms/$roomId\",\n { $groupId: groupId, $roomId: roomId },\n );\n return this.http.authedRequest(undefined, \"DELETE\", path, undefined, {});\n }\n\n /**\n * @param {string} groupId\n * @param {Object} opts Additional options to send alongside the acceptance.\n * @return {Promise} Resolves: Empty object\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n * @deprecated groups/communities never made it to the spec and support for them is being discontinued.\n */\n public acceptGroupInvite(groupId: string, opts = null): Promise {\n const path = utils.encodeUri(\n \"/groups/$groupId/self/accept_invite\",\n { $groupId: groupId },\n );\n return this.http.authedRequest(undefined, \"PUT\", path, undefined, opts || {});\n }\n\n /**\n * @param {string} groupId\n * @return {Promise} Resolves: Empty object\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n * @deprecated groups/communities never made it to the spec and support for them is being discontinued.\n */\n public joinGroup(groupId: string): Promise {\n const path = utils.encodeUri(\n \"/groups/$groupId/self/join\",\n { $groupId: groupId },\n );\n return this.http.authedRequest(undefined, \"PUT\", path, undefined, {});\n }\n\n /**\n * @param {string} groupId\n * @return {Promise} Resolves: Empty object\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n * @deprecated groups/communities never made it to the spec and support for them is being discontinued.\n */\n public leaveGroup(groupId: string): Promise {\n const path = utils.encodeUri(\n \"/groups/$groupId/self/leave\",\n { $groupId: groupId },\n );\n return this.http.authedRequest(undefined, \"PUT\", path, undefined, {});\n }\n\n /**\n * @return {Promise} Resolves: The groups to which the user is joined\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n * @deprecated groups/communities never made it to the spec and support for them is being discontinued.\n */\n public getJoinedGroups(): Promise {\n const path = utils.encodeUri(\"/joined_groups\", {});\n return this.http.authedRequest(undefined, \"GET\", path);\n }\n\n /**\n * @param {Object} content Request content\n * @param {string} content.localpart The local part of the desired group ID\n * @param {Object} content.profile Group profile object\n * @return {Promise} Resolves: Object with key group_id: id of the created group\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n * @deprecated groups/communities never made it to the spec and support for them is being discontinued.\n */\n public createGroup(content: any): Promise {\n const path = utils.encodeUri(\"/create_group\", {});\n return this.http.authedRequest(\n undefined, \"POST\", path, undefined, content,\n );\n }\n\n /**\n * @param {string[]} userIds List of user IDs\n * @return {Promise} Resolves: Object as exmaple below\n *\n * {\n * \"users\": {\n * \"@bob:example.com\": {\n * \"+example:example.com\"\n * }\n * }\n * }\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n * @deprecated groups/communities never made it to the spec and support for them is being discontinued.\n */\n public getPublicisedGroups(userIds: string[]): Promise {\n const path = utils.encodeUri(\"/publicised_groups\", {});\n return this.http.authedRequest(\n undefined, \"POST\", path, undefined, { user_ids: userIds },\n );\n }\n\n /**\n * @param {string} groupId\n * @param {boolean} isPublic Whether the user's membership of this group is made public\n * @return {Promise} Resolves: Empty object\n * @return {module:http-api.MatrixError} Rejects: with an error response.\n * @deprecated groups/communities never made it to the spec and support for them is being discontinued.\n */\n public setGroupPublicity(groupId: string, isPublic: boolean): Promise {\n const path = utils.encodeUri(\n \"/groups/$groupId/self/update_publicity\",\n { $groupId: groupId },\n );\n return this.http.authedRequest(undefined, \"PUT\", path, undefined, {\n publicise: isPublic,\n });\n }\n}\n\n/**\n * Fires whenever the SDK receives a new event.\n *

\n * This is only fired for live events received via /sync - it is not fired for\n * events received over context, search, or pagination APIs.\n *\n * @event module:client~MatrixClient#\"event\"\n * @param {MatrixEvent} event The matrix event which caused this event to fire.\n * @example\n * matrixClient.on(\"event\", function(event){\n * var sender = event.getSender();\n * });\n */\n\n/**\n * Fires whenever the SDK receives a new to-device event.\n * @event module:client~MatrixClient#\"toDeviceEvent\"\n * @param {MatrixEvent} event The matrix event which caused this event to fire.\n * @example\n * matrixClient.on(\"toDeviceEvent\", function(event){\n * var sender = event.getSender();\n * });\n */\n\n/**\n * Fires whenever the SDK's syncing state is updated. The state can be one of:\n *

    \n *\n *
  • PREPARED: The client has synced with the server at least once and is\n * ready for methods to be called on it. This will be immediately followed by\n * a state of SYNCING. This is the equivalent of \"syncComplete\" in the\n * previous API.
  • \n *\n *
  • CATCHUP: The client has detected the connection to the server might be\n * available again and will now try to do a sync again. As this sync might take\n * a long time (depending how long ago was last synced, and general server\n * performance) the client is put in this mode so the UI can reflect trying\n * to catch up with the server after losing connection.
  • \n *\n *
  • SYNCING : The client is currently polling for new events from the server.\n * This will be called after processing latest events from a sync.
  • \n *\n *
  • ERROR : The client has had a problem syncing with the server. If this is\n * called before PREPARED then there was a problem performing the initial\n * sync. If this is called after PREPARED then there was a problem polling\n * the server for updates. This may be called multiple times even if the state is\n * already ERROR. This is the equivalent of \"syncError\" in the previous\n * API.
  • \n *\n *
  • RECONNECTING: The sync connection has dropped, but not (yet) in a way that\n * should be considered erroneous.\n *
  • \n *\n *
  • STOPPED: The client has stopped syncing with server due to stopClient\n * being called.\n *
  • \n *
\n * State transition diagram:\n *
\n *                                          +---->STOPPED\n *                                          |\n *              +----->PREPARED -------> SYNCING <--+\n *              |                        ^  |  ^    |\n *              |      CATCHUP ----------+  |  |    |\n *              |        ^                  V  |    |\n *   null ------+        |  +------- RECONNECTING   |\n *              |        V  V                       |\n *              +------->ERROR ---------------------+\n *\n * NB: 'null' will never be emitted by this event.\n *\n * 
\n * Transitions:\n *
    \n *\n *
  • null -> PREPARED : Occurs when the initial sync is completed\n * first time. This involves setting up filters and obtaining push rules.\n *\n *
  • null -> ERROR : Occurs when the initial sync failed first time.\n *\n *
  • ERROR -> PREPARED : Occurs when the initial sync succeeds\n * after previously failing.\n *\n *
  • PREPARED -> SYNCING : Occurs immediately after transitioning\n * to PREPARED. Starts listening for live updates rather than catching up.\n *\n *
  • SYNCING -> RECONNECTING : Occurs when the live update fails.\n *\n *
  • RECONNECTING -> RECONNECTING : Can occur if the update calls\n * continue to fail, but the keepalive calls (to /versions) succeed.\n *\n *
  • RECONNECTING -> ERROR : Occurs when the keepalive call also fails\n *\n *
  • ERROR -> SYNCING : Occurs when the client has performed a\n * live update after having previously failed.\n *\n *
  • ERROR -> ERROR : Occurs when the client has failed to keepalive\n * for a second time or more.
  • \n *\n *
  • SYNCING -> SYNCING : Occurs when the client has performed a live\n * update. This is called after processing.
  • \n *\n *
  • * -> STOPPED : Occurs once the client has stopped syncing or\n * trying to sync after stopClient has been called.
  • \n *
\n *\n * @event module:client~MatrixClient#\"sync\"\n *\n * @param {string} state An enum representing the syncing state. One of \"PREPARED\",\n * \"SYNCING\", \"ERROR\", \"STOPPED\".\n *\n * @param {?string} prevState An enum representing the previous syncing state.\n * One of \"PREPARED\", \"SYNCING\", \"ERROR\", \"STOPPED\" or null.\n *\n * @param {?Object} data Data about this transition.\n *\n * @param {MatrixError} data.error The matrix error if state=ERROR.\n *\n * @param {String} data.oldSyncToken The 'since' token passed to /sync.\n * null for the first successful sync since this client was\n * started. Only present if state=PREPARED or\n * state=SYNCING.\n *\n * @param {String} data.nextSyncToken The 'next_batch' result from /sync, which\n * will become the 'since' token for the next call to /sync. Only present if\n * state=PREPARED or state=SYNCING.\n *\n * @param {boolean} data.catchingUp True if we are working our way through a\n * backlog of events after connecting. Only present if state=SYNCING.\n *\n * @example\n * matrixClient.on(\"sync\", function(state, prevState, data) {\n * switch (state) {\n * case \"ERROR\":\n * // update UI to say \"Connection Lost\"\n * break;\n * case \"SYNCING\":\n * // update UI to remove any \"Connection Lost\" message\n * break;\n * case \"PREPARED\":\n * // the client instance is ready to be queried.\n * var rooms = matrixClient.getRooms();\n * break;\n * }\n * });\n */\n\n/**\n * Fires whenever the sdk learns about a new group. This event\n * is experimental and may change.\n * @event module:client~MatrixClient#\"Group\"\n * @param {Group} group The newly created, fully populated group.\n * @deprecated groups/communities never made it to the spec and support for them is being discontinued.\n * @example\n * matrixClient.on(\"Group\", function(group){\n * var groupId = group.groupId;\n * });\n */\n\n/**\n * Fires whenever a new Room is added. This will fire when you are invited to a\n * room, as well as when you join a room. This event is experimental and\n * may change.\n * @event module:client~MatrixClient#\"Room\"\n * @param {Room} room The newly created, fully populated room.\n * @example\n * matrixClient.on(\"Room\", function(room){\n * var roomId = room.roomId;\n * });\n */\n\n/**\n * Fires whenever a Room is removed. This will fire when you forget a room.\n * This event is experimental and may change.\n * @event module:client~MatrixClient#\"deleteRoom\"\n * @param {string} roomId The deleted room ID.\n * @example\n * matrixClient.on(\"deleteRoom\", function(roomId){\n * // update UI from getRooms()\n * });\n */\n\n/**\n * Fires whenever an incoming call arrives.\n * @event module:client~MatrixClient#\"Call.incoming\"\n * @param {module:webrtc/call~MatrixCall} call The incoming call.\n * @example\n * matrixClient.on(\"Call.incoming\", function(call){\n * call.answer(); // auto-answer\n * });\n */\n\n/**\n * Fires whenever the login session the JS SDK is using is no\n * longer valid and the user must log in again.\n * NB. This only fires when action is required from the user, not\n * when then login session can be renewed by using a refresh token.\n * @event module:client~MatrixClient#\"Session.logged_out\"\n * @example\n * matrixClient.on(\"Session.logged_out\", function(errorObj){\n * // show the login screen\n * });\n */\n\n/**\n * Fires when the JS SDK receives a M_CONSENT_NOT_GIVEN error in response\n * to a HTTP request.\n * @event module:client~MatrixClient#\"no_consent\"\n * @example\n * matrixClient.on(\"no_consent\", function(message, contentUri) {\n * console.info(message + ' Go to ' + contentUri);\n * });\n */\n\n/**\n * Fires when a device is marked as verified/unverified/blocked/unblocked by\n * {@link module:client~MatrixClient#setDeviceVerified|MatrixClient.setDeviceVerified} or\n * {@link module:client~MatrixClient#setDeviceBlocked|MatrixClient.setDeviceBlocked}.\n *\n * @event module:client~MatrixClient#\"deviceVerificationChanged\"\n * @param {string} userId the owner of the verified device\n * @param {string} deviceId the id of the verified device\n * @param {module:crypto/deviceinfo} deviceInfo updated device information\n */\n\n/**\n * Fires when the trust status of a user changes\n * If userId is the userId of the logged in user, this indicated a change\n * in the trust status of the cross-signing data on the account.\n *\n * The cross-signing API is currently UNSTABLE and may change without notice.\n *\n * @event module:client~MatrixClient#\"userTrustStatusChanged\"\n * @param {string} userId the userId of the user in question\n * @param {UserTrustLevel} trustLevel The new trust level of the user\n */\n\n/**\n * Fires when the user's cross-signing keys have changed or cross-signing\n * has been enabled/disabled. The client can use getStoredCrossSigningForUser\n * with the user ID of the logged in user to check if cross-signing is\n * enabled on the account. If enabled, it can test whether the current key\n * is trusted using with checkUserTrust with the user ID of the logged\n * in user. The checkOwnCrossSigningTrust function may be used to reconcile\n * the trust in the account key.\n *\n * The cross-signing API is currently UNSTABLE and may change without notice.\n *\n * @event module:client~MatrixClient#\"crossSigning.keysChanged\"\n */\n\n/**\n * Fires whenever new user-scoped account_data is added.\n * @event module:client~MatrixClient#\"accountData\"\n * @param {MatrixEvent} event The event describing the account_data just added\n * @param {MatrixEvent} event The previous account data, if known.\n * @example\n * matrixClient.on(\"accountData\", function(event, oldEvent){\n * myAccountData[event.type] = event.content;\n * });\n */\n\n/**\n * Fires whenever the stored devices for a user have changed\n * @event module:client~MatrixClient#\"crypto.devicesUpdated\"\n * @param {String[]} users A list of user IDs that were updated\n * @param {boolean} initialFetch If true, the store was empty (apart\n * from our own device) and has been seeded.\n */\n\n/**\n * Fires whenever the stored devices for a user will be updated\n * @event module:client~MatrixClient#\"crypto.willUpdateDevices\"\n * @param {String[]} users A list of user IDs that will be updated\n * @param {boolean} initialFetch If true, the store is empty (apart\n * from our own device) and is being seeded.\n */\n\n/**\n * Fires whenever the status of e2e key backup changes, as returned by getKeyBackupEnabled()\n * @event module:client~MatrixClient#\"crypto.keyBackupStatus\"\n * @param {boolean} enabled true if key backup has been enabled, otherwise false\n * @example\n * matrixClient.on(\"crypto.keyBackupStatus\", function(enabled){\n * if (enabled) {\n * [...]\n * }\n * });\n */\n\n/**\n * Fires when we want to suggest to the user that they restore their megolm keys\n * from backup or by cross-signing the device.\n *\n * @event module:client~MatrixClient#\"crypto.suggestKeyRestore\"\n */\n\n/**\n * Fires when a key verification is requested.\n * @event module:client~MatrixClient#\"crypto.verification.request\"\n * @param {object} data\n * @param {MatrixEvent} data.event the original verification request message\n * @param {Array} data.methods the verification methods that can be used\n * @param {Number} data.timeout the amount of milliseconds that should be waited\n * before cancelling the request automatically.\n * @param {Function} data.beginKeyVerification a function to call if a key\n * verification should be performed. The function takes one argument: the\n * name of the key verification method (taken from data.methods) to use.\n * @param {Function} data.cancel a function to call if the key verification is\n * rejected.\n */\n\n/**\n * Fires when a key verification is requested with an unknown method.\n * @event module:client~MatrixClient#\"crypto.verification.request.unknown\"\n * @param {string} userId the user ID who requested the key verification\n * @param {Function} cancel a function that will send a cancellation message to\n * reject the key verification.\n */\n\n/**\n * Fires when a secret request has been cancelled. If the client is prompting\n * the user to ask whether they want to share a secret, the prompt can be\n * dismissed.\n *\n * The Secure Secret Storage API is currently UNSTABLE and may change without notice.\n *\n * @event module:client~MatrixClient#\"crypto.secrets.requestCancelled\"\n * @param {object} data\n * @param {string} data.user_id The user ID of the client that had requested the secret.\n * @param {string} data.device_id The device ID of the client that had requested the\n * secret.\n * @param {string} data.request_id The ID of the original request.\n */\n\n/**\n * Fires when the client .well-known info is fetched.\n *\n * @event module:client~MatrixClient#\"WellKnown.client\"\n * @param {object} data The JSON object returned by the server\n */\n", "/*\nCopyright 2018 New Vector Ltd\nCopyright 2018 - 2021 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n/** @module ContentHelpers */\n\nimport { MsgType } from \"./@types/event\";\n\n/**\n * Generates the content for a HTML Message event\n * @param {string} body the plaintext body of the message\n * @param {string} htmlBody the HTML representation of the message\n * @returns {{msgtype: string, format: string, body: string, formatted_body: string}}\n */\nexport function makeHtmlMessage(body: string, htmlBody: string) {\n return {\n msgtype: MsgType.Text,\n format: \"org.matrix.custom.html\",\n body: body,\n formatted_body: htmlBody,\n };\n}\n\n/**\n * Generates the content for a HTML Notice event\n * @param {string} body the plaintext body of the notice\n * @param {string} htmlBody the HTML representation of the notice\n * @returns {{msgtype: string, format: string, body: string, formatted_body: string}}\n */\nexport function makeHtmlNotice(body: string, htmlBody: string) {\n return {\n msgtype: MsgType.Notice,\n format: \"org.matrix.custom.html\",\n body: body,\n formatted_body: htmlBody,\n };\n}\n\n/**\n * Generates the content for a HTML Emote event\n * @param {string} body the plaintext body of the emote\n * @param {string} htmlBody the HTML representation of the emote\n * @returns {{msgtype: string, format: string, body: string, formatted_body: string}}\n */\nexport function makeHtmlEmote(body: string, htmlBody: string) {\n return {\n msgtype: MsgType.Emote,\n format: \"org.matrix.custom.html\",\n body: body,\n formatted_body: htmlBody,\n };\n}\n\n/**\n * Generates the content for a Plaintext Message event\n * @param {string} body the plaintext body of the emote\n * @returns {{msgtype: string, body: string}}\n */\nexport function makeTextMessage(body: string) {\n return {\n msgtype: MsgType.Text,\n body: body,\n };\n}\n\n/**\n * Generates the content for a Plaintext Notice event\n * @param {string} body the plaintext body of the notice\n * @returns {{msgtype: string, body: string}}\n */\nexport function makeNotice(body: string) {\n return {\n msgtype: MsgType.Notice,\n body: body,\n };\n}\n\n/**\n * Generates the content for a Plaintext Emote event\n * @param {string} body the plaintext body of the emote\n * @returns {{msgtype: string, body: string}}\n */\nexport function makeEmoteMessage(body: string) {\n return {\n msgtype: MsgType.Emote,\n body: body,\n };\n}\n", "/*\nCopyright 2015 - 2021 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n/**\n * @module content-repo\n */\n\nimport * as utils from \"./utils\";\n\n/**\n * Get the HTTP URL for an MXC URI.\n * @param {string} baseUrl The base homeserver url which has a content repo.\n * @param {string} mxc The mxc:// URI.\n * @param {Number} width The desired width of the thumbnail.\n * @param {Number} height The desired height of the thumbnail.\n * @param {string} resizeMethod The thumbnail resize method to use, either\n * \"crop\" or \"scale\".\n * @param {Boolean} allowDirectLinks If true, return any non-mxc URLs\n * directly. Fetching such URLs will leak information about the user to\n * anyone they share a room with. If false, will return the emptry string\n * for such URLs.\n * @return {string} The complete URL to the content.\n */\nexport function getHttpUriForMxc(\n baseUrl: string,\n mxc: string,\n width: number,\n height: number,\n resizeMethod: string,\n allowDirectLinks = false,\n): string {\n if (typeof mxc !== \"string\" || !mxc) {\n return '';\n }\n if (mxc.indexOf(\"mxc://\") !== 0) {\n if (allowDirectLinks) {\n return mxc;\n } else {\n return '';\n }\n }\n let serverAndMediaId = mxc.slice(6); // strips mxc://\n let prefix = \"/_matrix/media/r0/download/\";\n const params = {};\n\n if (width) {\n params[\"width\"] = Math.round(width);\n }\n if (height) {\n params[\"height\"] = Math.round(height);\n }\n if (resizeMethod) {\n params[\"method\"] = resizeMethod;\n }\n if (Object.keys(params).length > 0) {\n // these are thumbnailing params so they probably want the\n // thumbnailing API...\n prefix = \"/_matrix/media/r0/thumbnail/\";\n }\n\n const fragmentOffset = serverAndMediaId.indexOf(\"#\");\n let fragment = \"\";\n if (fragmentOffset >= 0) {\n fragment = serverAndMediaId.substr(fragmentOffset);\n serverAndMediaId = serverAndMediaId.substr(0, fragmentOffset);\n }\n\n const urlParams = (Object.keys(params).length === 0 ? \"\" : (\"?\" + utils.encodeParams(params)));\n return baseUrl + prefix + serverAndMediaId + urlParams + fragment;\n}\n", "/*\nCopyright 2019 - 2021 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n/**\n * Cross signing methods\n * @module crypto/CrossSigning\n */\n\nimport { EventEmitter } from 'events';\n\nimport { decodeBase64, encodeBase64, pkSign, pkVerify } from './olmlib';\nimport { logger } from '../logger';\nimport { IndexedDBCryptoStore } from '../crypto/store/indexeddb-crypto-store';\nimport { decryptAES, encryptAES } from './aes';\nimport { PkSigning } from \"@matrix-org/olm\";\nimport { DeviceInfo } from \"./deviceinfo\";\nimport { SecretStorage } from \"./SecretStorage\";\nimport { ICrossSigningKey, ISignedKey, MatrixClient } from \"../client\";\nimport { OlmDevice } from \"./OlmDevice\";\nimport { ICryptoCallbacks } from \"../matrix\";\nimport { ISignatures } from \"../@types/signed\";\nimport { CryptoStore } from \"./store/base\";\n\nconst KEY_REQUEST_TIMEOUT_MS = 1000 * 60;\n\nfunction publicKeyFromKeyInfo(keyInfo: ICrossSigningKey): string {\n // `keys` is an object with { [`ed25519:${pubKey}`]: pubKey }\n // We assume only a single key, and we want the bare form without type\n // prefix, so we select the values.\n return Object.values(keyInfo.keys)[0];\n}\n\nexport interface ICacheCallbacks {\n getCrossSigningKeyCache?(type: string, expectedPublicKey?: string): Promise;\n storeCrossSigningKeyCache?(type: string, key: Uint8Array): Promise;\n}\n\nexport interface ICrossSigningInfo {\n keys: Record;\n firstUse: boolean;\n crossSigningVerifiedBefore: boolean;\n}\n\nexport class CrossSigningInfo extends EventEmitter {\n public keys: Record = {};\n public firstUse = true;\n // This tracks whether we've ever verified this user with any identity.\n // When you verify a user, any devices online at the time that receive\n // the verifying signature via the homeserver will latch this to true\n // and can use it in the future to detect cases where the user has\n // become unverified later for any reason.\n private crossSigningVerifiedBefore = false;\n\n /**\n * Information about a user's cross-signing keys\n *\n * @class\n *\n * @param {string} userId the user that the information is about\n * @param {object} callbacks Callbacks used to interact with the app\n * Requires getCrossSigningKey and saveCrossSigningKeys\n * @param {object} cacheCallbacks Callbacks used to interact with the cache\n */\n constructor(\n public readonly userId: string,\n private callbacks: ICryptoCallbacks = {},\n private cacheCallbacks: ICacheCallbacks = {},\n ) {\n super();\n }\n\n public static fromStorage(obj: ICrossSigningInfo, userId: string): CrossSigningInfo {\n const res = new CrossSigningInfo(userId);\n for (const prop in obj) {\n if (obj.hasOwnProperty(prop)) {\n res[prop] = obj[prop];\n }\n }\n return res;\n }\n\n public toStorage(): ICrossSigningInfo {\n return {\n keys: this.keys,\n firstUse: this.firstUse,\n crossSigningVerifiedBefore: this.crossSigningVerifiedBefore,\n };\n }\n\n /**\n * Calls the app callback to ask for a private key\n *\n * @param {string} type The key type (\"master\", \"self_signing\", or \"user_signing\")\n * @param {string} expectedPubkey The matching public key or undefined to use\n * the stored public key for the given key type.\n * @returns {Array} An array with [ public key, Olm.PkSigning ]\n */\n public async getCrossSigningKey(type: string, expectedPubkey?: string): Promise<[string, PkSigning]> {\n const shouldCache = [\"master\", \"self_signing\", \"user_signing\"].indexOf(type) >= 0;\n\n if (!this.callbacks.getCrossSigningKey) {\n throw new Error(\"No getCrossSigningKey callback supplied\");\n }\n\n if (expectedPubkey === undefined) {\n expectedPubkey = this.getId(type);\n }\n\n function validateKey(key: Uint8Array): [string, PkSigning] {\n if (!key) return;\n const signing = new global.Olm.PkSigning();\n const gotPubkey = signing.init_with_seed(key);\n if (gotPubkey === expectedPubkey) {\n return [gotPubkey, signing];\n }\n signing.free();\n }\n\n let privkey;\n if (this.cacheCallbacks.getCrossSigningKeyCache && shouldCache) {\n privkey = await this.cacheCallbacks.getCrossSigningKeyCache(type, expectedPubkey);\n }\n\n const cacheresult = validateKey(privkey);\n if (cacheresult) {\n return cacheresult;\n }\n\n privkey = await this.callbacks.getCrossSigningKey(type, expectedPubkey);\n const result = validateKey(privkey);\n if (result) {\n if (this.cacheCallbacks.storeCrossSigningKeyCache && shouldCache) {\n await this.cacheCallbacks.storeCrossSigningKeyCache(type, privkey);\n }\n return result;\n }\n\n /* No keysource even returned a key */\n if (!privkey) {\n throw new Error(\n \"getCrossSigningKey callback for \" + type + \" returned falsey\",\n );\n }\n\n /* We got some keys from the keysource, but none of them were valid */\n throw new Error(\n \"Key type \" + type + \" from getCrossSigningKey callback did not match\",\n );\n }\n\n /**\n * Check whether the private keys exist in secret storage.\n * XXX: This could be static, be we often seem to have an instance when we\n * want to know this anyway...\n *\n * @param {SecretStorage} secretStorage The secret store using account data\n * @returns {object} map of key name to key info the secret is encrypted\n * with, or null if it is not present or not encrypted with a trusted\n * key\n */\n public async isStoredInSecretStorage(secretStorage: SecretStorage): Promise> {\n // check what SSSS keys have encrypted the master key (if any)\n const stored = await secretStorage.isStored(\"m.cross_signing.master\", false) || {};\n // then check which of those SSSS keys have also encrypted the SSK and USK\n function intersect(s) {\n for (const k of Object.keys(stored)) {\n if (!s[k]) {\n delete stored[k];\n }\n }\n }\n for (const type of [\"self_signing\", \"user_signing\"]) {\n intersect(await secretStorage.isStored(`m.cross_signing.${type}`, false) || {});\n }\n return Object.keys(stored).length ? stored : null;\n }\n\n /**\n * Store private keys in secret storage for use by other devices. This is\n * typically called in conjunction with the creation of new cross-signing\n * keys.\n *\n * @param {Map} keys The keys to store\n * @param {SecretStorage} secretStorage The secret store using account data\n */\n public static async storeInSecretStorage(\n keys: Map,\n secretStorage: SecretStorage,\n ): Promise {\n for (const [type, privateKey] of keys) {\n const encodedKey = encodeBase64(privateKey);\n await secretStorage.store(`m.cross_signing.${type}`, encodedKey);\n }\n }\n\n /**\n * Get private keys from secret storage created by some other device. This\n * also passes the private keys to the app-specific callback.\n *\n * @param {string} type The type of key to get. One of \"master\",\n * \"self_signing\", or \"user_signing\".\n * @param {SecretStorage} secretStorage The secret store using account data\n * @return {Uint8Array} The private key\n */\n public static async getFromSecretStorage(type: string, secretStorage: SecretStorage): Promise {\n const encodedKey = await secretStorage.get(`m.cross_signing.${type}`);\n if (!encodedKey) {\n return null;\n }\n return decodeBase64(encodedKey);\n }\n\n /**\n * Check whether the private keys exist in the local key cache.\n *\n * @param {string} [type] The type of key to get. One of \"master\",\n * \"self_signing\", or \"user_signing\". Optional, will check all by default.\n * @returns {boolean} True if all keys are stored in the local cache.\n */\n public async isStoredInKeyCache(type?: string): Promise {\n const cacheCallbacks = this.cacheCallbacks;\n if (!cacheCallbacks) return false;\n const types = type ? [type] : [\"master\", \"self_signing\", \"user_signing\"];\n for (const t of types) {\n if (!await cacheCallbacks.getCrossSigningKeyCache(t)) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * Get cross-signing private keys from the local cache.\n *\n * @returns {Map} A map from key type (string) to private key (Uint8Array)\n */\n public async getCrossSigningKeysFromCache(): Promise> {\n const keys = new Map();\n const cacheCallbacks = this.cacheCallbacks;\n if (!cacheCallbacks) return keys;\n for (const type of [\"master\", \"self_signing\", \"user_signing\"]) {\n const privKey = await cacheCallbacks.getCrossSigningKeyCache(type);\n if (!privKey) {\n continue;\n }\n keys.set(type, privKey);\n }\n return keys;\n }\n\n /**\n * Get the ID used to identify the user. This can also be used to test for\n * the existence of a given key type.\n *\n * @param {string} type The type of key to get the ID of. One of \"master\",\n * \"self_signing\", or \"user_signing\". Defaults to \"master\".\n *\n * @return {string} the ID\n */\n public getId(type = \"master\"): string {\n if (!this.keys[type]) return null;\n const keyInfo = this.keys[type];\n return publicKeyFromKeyInfo(keyInfo);\n }\n\n /**\n * Create new cross-signing keys for the given key types. The public keys\n * will be held in this class, while the private keys are passed off to the\n * `saveCrossSigningKeys` application callback.\n *\n * @param {CrossSigningLevel} level The key types to reset\n */\n public async resetKeys(level?: CrossSigningLevel): Promise {\n if (!this.callbacks.saveCrossSigningKeys) {\n throw new Error(\"No saveCrossSigningKeys callback supplied\");\n }\n\n // If we're resetting the master key, we reset all keys\n if (\n level === undefined ||\n level & CrossSigningLevel.MASTER ||\n !this.keys.master\n ) {\n level = (\n CrossSigningLevel.MASTER |\n CrossSigningLevel.USER_SIGNING |\n CrossSigningLevel.SELF_SIGNING\n );\n } else if (level === 0 as CrossSigningLevel) {\n return;\n }\n\n const privateKeys: Record = {};\n const keys: Record = {}; // TODO types\n let masterSigning;\n let masterPub;\n\n try {\n if (level & CrossSigningLevel.MASTER) {\n masterSigning = new global.Olm.PkSigning();\n privateKeys.master = masterSigning.generate_seed();\n masterPub = masterSigning.init_with_seed(privateKeys.master);\n keys.master = {\n user_id: this.userId,\n usage: ['master'],\n keys: {\n ['ed25519:' + masterPub]: masterPub,\n },\n };\n } else {\n [masterPub, masterSigning] = await this.getCrossSigningKey(\"master\");\n }\n\n if (level & CrossSigningLevel.SELF_SIGNING) {\n const sskSigning = new global.Olm.PkSigning();\n try {\n privateKeys.self_signing = sskSigning.generate_seed();\n const sskPub = sskSigning.init_with_seed(privateKeys.self_signing);\n keys.self_signing = {\n user_id: this.userId,\n usage: ['self_signing'],\n keys: {\n ['ed25519:' + sskPub]: sskPub,\n },\n };\n pkSign(keys.self_signing, masterSigning, this.userId, masterPub);\n } finally {\n sskSigning.free();\n }\n }\n\n if (level & CrossSigningLevel.USER_SIGNING) {\n const uskSigning = new global.Olm.PkSigning();\n try {\n privateKeys.user_signing = uskSigning.generate_seed();\n const uskPub = uskSigning.init_with_seed(privateKeys.user_signing);\n keys.user_signing = {\n user_id: this.userId,\n usage: ['user_signing'],\n keys: {\n ['ed25519:' + uskPub]: uskPub,\n },\n };\n pkSign(keys.user_signing, masterSigning, this.userId, masterPub);\n } finally {\n uskSigning.free();\n }\n }\n\n Object.assign(this.keys, keys);\n this.callbacks.saveCrossSigningKeys(privateKeys);\n } finally {\n if (masterSigning) {\n masterSigning.free();\n }\n }\n }\n\n /**\n * unsets the keys, used when another session has reset the keys, to disable cross-signing\n */\n public clearKeys(): void {\n this.keys = {};\n }\n\n public setKeys(keys: Record): void {\n const signingKeys: Record = {};\n if (keys.master) {\n if (keys.master.user_id !== this.userId) {\n const error = \"Mismatched user ID \" + keys.master.user_id +\n \" in master key from \" + this.userId;\n logger.error(error);\n throw new Error(error);\n }\n if (!this.keys.master) {\n // this is the first key we've seen, so first-use is true\n this.firstUse = true;\n } else if (publicKeyFromKeyInfo(keys.master) !== this.getId()) {\n // this is a different key, so first-use is false\n this.firstUse = false;\n } // otherwise, same key, so no change\n signingKeys.master = keys.master;\n } else if (this.keys.master) {\n signingKeys.master = this.keys.master;\n } else {\n throw new Error(\"Tried to set cross-signing keys without a master key\");\n }\n const masterKey = publicKeyFromKeyInfo(signingKeys.master);\n\n // verify signatures\n if (keys.user_signing) {\n if (keys.user_signing.user_id !== this.userId) {\n const error = \"Mismatched user ID \" + keys.master.user_id +\n \" in user_signing key from \" + this.userId;\n logger.error(error);\n throw new Error(error);\n }\n try {\n pkVerify(keys.user_signing, masterKey, this.userId);\n } catch (e) {\n logger.error(\"invalid signature on user-signing key\");\n // FIXME: what do we want to do here?\n throw e;\n }\n }\n if (keys.self_signing) {\n if (keys.self_signing.user_id !== this.userId) {\n const error = \"Mismatched user ID \" + keys.master.user_id +\n \" in self_signing key from \" + this.userId;\n logger.error(error);\n throw new Error(error);\n }\n try {\n pkVerify(keys.self_signing, masterKey, this.userId);\n } catch (e) {\n logger.error(\"invalid signature on self-signing key\");\n // FIXME: what do we want to do here?\n throw e;\n }\n }\n\n // if everything checks out, then save the keys\n if (keys.master) {\n this.keys.master = keys.master;\n // if the master key is set, then the old self-signing and\n // user-signing keys are obsolete\n this.keys.self_signing = null;\n this.keys.user_signing = null;\n }\n if (keys.self_signing) {\n this.keys.self_signing = keys.self_signing;\n }\n if (keys.user_signing) {\n this.keys.user_signing = keys.user_signing;\n }\n }\n\n public updateCrossSigningVerifiedBefore(isCrossSigningVerified: boolean): void {\n // It is critical that this value latches forward from false to true but\n // never back to false to avoid a downgrade attack.\n if (!this.crossSigningVerifiedBefore && isCrossSigningVerified) {\n this.crossSigningVerifiedBefore = true;\n }\n }\n\n public async signObject(data: T, type: string): Promise {\n if (!this.keys[type]) {\n throw new Error(\n \"Attempted to sign with \" + type + \" key but no such key present\",\n );\n }\n const [pubkey, signing] = await this.getCrossSigningKey(type);\n try {\n pkSign(data, signing, this.userId, pubkey);\n return data as T & { signatures: ISignatures };\n } finally {\n signing.free();\n }\n }\n\n public async signUser(key: CrossSigningInfo): Promise {\n if (!this.keys.user_signing) {\n logger.info(\"No user signing key: not signing user\");\n return;\n }\n return this.signObject(key.keys.master, \"user_signing\");\n }\n\n public async signDevice(userId: string, device: DeviceInfo): Promise {\n if (userId !== this.userId) {\n throw new Error(\n `Trying to sign ${userId}'s device; can only sign our own device`,\n );\n }\n if (!this.keys.self_signing) {\n logger.info(\"No self signing key: not signing device\");\n return;\n }\n return this.signObject>(\n {\n algorithms: device.algorithms,\n keys: device.keys,\n device_id: device.deviceId,\n user_id: userId,\n }, \"self_signing\",\n );\n }\n\n /**\n * Check whether a given user is trusted.\n *\n * @param {CrossSigningInfo} userCrossSigning Cross signing info for user\n *\n * @returns {UserTrustLevel}\n */\n public checkUserTrust(userCrossSigning: CrossSigningInfo): UserTrustLevel {\n // if we're checking our own key, then it's trusted if the master key\n // and self-signing key match\n if (this.userId === userCrossSigning.userId\n && this.getId() && this.getId() === userCrossSigning.getId()\n && this.getId(\"self_signing\")\n && this.getId(\"self_signing\") === userCrossSigning.getId(\"self_signing\")\n ) {\n return new UserTrustLevel(true, true, this.firstUse);\n }\n\n if (!this.keys.user_signing) {\n // If there's no user signing key, they can't possibly be verified.\n // They may be TOFU trusted though.\n return new UserTrustLevel(false, false, userCrossSigning.firstUse);\n }\n\n let userTrusted;\n const userMaster = userCrossSigning.keys.master;\n const uskId = this.getId('user_signing');\n try {\n pkVerify(userMaster, uskId, this.userId);\n userTrusted = true;\n } catch (e) {\n userTrusted = false;\n }\n return new UserTrustLevel(\n userTrusted,\n userCrossSigning.crossSigningVerifiedBefore,\n userCrossSigning.firstUse,\n );\n }\n\n /**\n * Check whether a given device is trusted.\n *\n * @param {CrossSigningInfo} userCrossSigning Cross signing info for user\n * @param {module:crypto/deviceinfo} device The device to check\n * @param {boolean} localTrust Whether the device is trusted locally\n * @param {boolean} trustCrossSignedDevices Whether we trust cross signed devices\n *\n * @returns {DeviceTrustLevel}\n */\n public checkDeviceTrust(\n userCrossSigning: CrossSigningInfo,\n device: DeviceInfo,\n localTrust: boolean,\n trustCrossSignedDevices: boolean,\n ): DeviceTrustLevel {\n const userTrust = this.checkUserTrust(userCrossSigning);\n\n const userSSK = userCrossSigning.keys.self_signing;\n if (!userSSK) {\n // if the user has no self-signing key then we cannot make any\n // trust assertions about this device from cross-signing\n return new DeviceTrustLevel(\n false, false, localTrust, trustCrossSignedDevices,\n );\n }\n\n const deviceObj = deviceToObject(device, userCrossSigning.userId);\n try {\n // if we can verify the user's SSK from their master key...\n pkVerify(userSSK, userCrossSigning.getId(), userCrossSigning.userId);\n // ...and this device's key from their SSK...\n pkVerify(deviceObj, publicKeyFromKeyInfo(userSSK), userCrossSigning.userId);\n // ...then we trust this device as much as far as we trust the user\n return DeviceTrustLevel.fromUserTrustLevel(userTrust, localTrust, trustCrossSignedDevices);\n } catch (e) {\n return new DeviceTrustLevel(false, false, localTrust, trustCrossSignedDevices);\n }\n }\n\n /**\n * @returns {object} Cache callbacks\n */\n public getCacheCallbacks(): ICacheCallbacks {\n return this.cacheCallbacks;\n }\n}\n\nfunction deviceToObject(device: DeviceInfo, userId: string) {\n return {\n algorithms: device.algorithms,\n keys: device.keys,\n device_id: device.deviceId,\n user_id: userId,\n signatures: device.signatures,\n };\n}\n\nexport enum CrossSigningLevel {\n MASTER = 4,\n USER_SIGNING = 2,\n SELF_SIGNING = 1,\n}\n\n/**\n * Represents the ways in which we trust a user\n */\nexport class UserTrustLevel {\n constructor(\n private readonly crossSigningVerified: boolean,\n private readonly crossSigningVerifiedBefore: boolean,\n private readonly tofu: boolean,\n ) {}\n\n /**\n * @returns {boolean} true if this user is verified via any means\n */\n public isVerified(): boolean {\n return this.isCrossSigningVerified();\n }\n\n /**\n * @returns {boolean} true if this user is verified via cross signing\n */\n public isCrossSigningVerified(): boolean {\n return this.crossSigningVerified;\n }\n\n /**\n * @returns {boolean} true if we ever verified this user before (at least for\n * the history of verifications observed by this device).\n */\n public wasCrossSigningVerified(): boolean {\n return this.crossSigningVerifiedBefore;\n }\n\n /**\n * @returns {boolean} true if this user's key is trusted on first use\n */\n public isTofu(): boolean {\n return this.tofu;\n }\n}\n\n/**\n * Represents the ways in which we trust a device\n */\nexport class DeviceTrustLevel {\n constructor(\n public readonly crossSigningVerified: boolean,\n public readonly tofu: boolean,\n private readonly localVerified: boolean,\n private readonly trustCrossSignedDevices: boolean,\n ) {}\n\n public static fromUserTrustLevel(\n userTrustLevel: UserTrustLevel,\n localVerified: boolean,\n trustCrossSignedDevices: boolean,\n ): DeviceTrustLevel {\n return new DeviceTrustLevel(\n userTrustLevel.isCrossSigningVerified(),\n userTrustLevel.isTofu(),\n localVerified,\n trustCrossSignedDevices,\n );\n }\n\n /**\n * @returns {boolean} true if this device is verified via any means\n */\n public isVerified(): boolean {\n return Boolean(this.isLocallyVerified() || (\n this.trustCrossSignedDevices && this.isCrossSigningVerified()\n ));\n }\n\n /**\n * @returns {boolean} true if this device is verified via cross signing\n */\n public isCrossSigningVerified(): boolean {\n return this.crossSigningVerified;\n }\n\n /**\n * @returns {boolean} true if this device is verified locally\n */\n public isLocallyVerified(): boolean {\n return this.localVerified;\n }\n\n /**\n * @returns {boolean} true if this device is trusted from a user's key\n * that is trusted on first use\n */\n public isTofu(): boolean {\n return this.tofu;\n }\n}\n\nexport function createCryptoStoreCacheCallbacks(store: CryptoStore, olmDevice: OlmDevice): ICacheCallbacks {\n return {\n getCrossSigningKeyCache: async function(type: string, _expectedPublicKey: string): Promise {\n const key = await new Promise((resolve) => {\n return store.doTxn(\n 'readonly',\n [IndexedDBCryptoStore.STORE_ACCOUNT],\n (txn) => {\n store.getSecretStorePrivateKey(txn, resolve, type);\n },\n );\n });\n\n if (key && key.ciphertext) {\n const pickleKey = Buffer.from(olmDevice._pickleKey);\n const decrypted = await decryptAES(key, pickleKey, type);\n return decodeBase64(decrypted);\n } else {\n return key;\n }\n },\n storeCrossSigningKeyCache: async function(type: string, key: Uint8Array): Promise {\n if (!(key instanceof Uint8Array)) {\n throw new Error(\n `storeCrossSigningKeyCache expects Uint8Array, got ${key}`,\n );\n }\n const pickleKey = Buffer.from(olmDevice._pickleKey);\n const encryptedKey = await encryptAES(encodeBase64(key), pickleKey, type);\n return store.doTxn(\n 'readwrite',\n [IndexedDBCryptoStore.STORE_ACCOUNT],\n (txn) => {\n store.storeSecretStorePrivateKey(txn, type, encryptedKey);\n },\n );\n },\n };\n}\n\n/**\n * Request cross-signing keys from another device during verification.\n *\n * @param {MatrixClient} baseApis base Matrix API interface\n * @param {string} userId The user ID being verified\n * @param {string} deviceId The device ID being verified\n */\nexport async function requestKeysDuringVerification(baseApis: MatrixClient, userId: string, deviceId: string) {\n // If this is a self-verification, ask the other party for keys\n if (baseApis.getUserId() !== userId) {\n return;\n }\n logger.log(\"Cross-signing: Self-verification done; requesting keys\");\n // This happens asynchronously, and we're not concerned about waiting for\n // it. We return here in order to test.\n return new Promise((resolve, reject) => {\n const client = baseApis;\n const original = client.crypto.crossSigningInfo;\n\n // We already have all of the infrastructure we need to validate and\n // cache cross-signing keys, so instead of replicating that, here we set\n // up callbacks that request them from the other device and call\n // CrossSigningInfo.getCrossSigningKey() to validate/cache\n const crossSigning = new CrossSigningInfo(\n original.userId,\n { getCrossSigningKey: async (type) => {\n logger.debug(\"Cross-signing: requesting secret\", type, deviceId);\n const { promise } = client.requestSecret(\n `m.cross_signing.${type}`, [deviceId],\n );\n const result = await promise;\n const decoded = decodeBase64(result);\n return Uint8Array.from(decoded);\n } },\n original.getCacheCallbacks(),\n );\n crossSigning.keys = original.keys;\n\n // XXX: get all keys out if we get one key out\n // https://github.com/vector-im/element-web/issues/12604\n // then change here to reject on the timeout\n // Requests can be ignored, so don't wait around forever\n const timeout = new Promise((resolve, reject) => {\n setTimeout(\n resolve,\n KEY_REQUEST_TIMEOUT_MS,\n new Error(\"Timeout\"),\n );\n });\n\n // also request and cache the key backup key\n const backupKeyPromise = (async () => {\n const cachedKey = await client.crypto.getSessionBackupPrivateKey();\n if (!cachedKey) {\n logger.info(\"No cached backup key found. Requesting...\");\n const secretReq = client.requestSecret(\n 'm.megolm_backup.v1', [deviceId],\n );\n const base64Key = await secretReq.promise;\n logger.info(\"Got key backup key, decoding...\");\n const decodedKey = decodeBase64(base64Key);\n logger.info(\"Decoded backup key, storing...\");\n client.crypto.storeSessionBackupPrivateKey(\n Uint8Array.from(decodedKey),\n );\n logger.info(\"Backup key stored. Starting backup restore...\");\n const backupInfo = await client.getKeyBackupVersion();\n // no need to await for this - just let it go in the bg\n client.restoreKeyBackupWithCache(undefined, undefined, backupInfo).then(() => {\n logger.info(\"Backup restored.\");\n });\n }\n })();\n\n // We call getCrossSigningKey() for its side-effects\n return Promise.race([\n Promise.all([\n crossSigning.getCrossSigningKey(\"master\"),\n crossSigning.getCrossSigningKey(\"self_signing\"),\n crossSigning.getCrossSigningKey(\"user_signing\"),\n backupKeyPromise,\n ]),\n timeout,\n ]).then(resolve, reject);\n }).catch((e) => {\n logger.warn(\"Cross-signing: failure while requesting keys:\", e);\n });\n}\n", "/*\nCopyright 2017 - 2021 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n/**\n * @module crypto/DeviceList\n *\n * Manages the list of other users' devices\n */\n\nimport { EventEmitter } from 'events';\n\nimport { logger } from '../logger';\nimport { DeviceInfo, IDevice } from './deviceinfo';\nimport { CrossSigningInfo, ICrossSigningInfo } from './CrossSigning';\nimport * as olmlib from './olmlib';\nimport { IndexedDBCryptoStore } from './store/indexeddb-crypto-store';\nimport { chunkPromises, defer, IDeferred, sleep } from '../utils';\nimport { MatrixClient } from \"../client\";\nimport { OlmDevice } from \"./OlmDevice\";\nimport { CryptoStore } from \"./store/base\";\n\n/* State transition diagram for DeviceList.deviceTrackingStatus\n *\n * |\n * stopTrackingDeviceList V\n * +---------------------> NOT_TRACKED\n * | |\n * +<--------------------+ | startTrackingDeviceList\n * | | V\n * | +-------------> PENDING_DOWNLOAD <--------------------+-+\n * | | ^ | | |\n * | | restart download | | start download | | invalidateUserDeviceList\n * | | client failed | | | |\n * | | | V | |\n * | +------------ DOWNLOAD_IN_PROGRESS -------------------+ |\n * | | | |\n * +<-------------------+ | download successful |\n * ^ V |\n * +----------------------- UP_TO_DATE ------------------------+\n */\n\n// constants for DeviceList.deviceTrackingStatus\nexport enum TrackingStatus {\n NotTracked,\n PendingDownload,\n DownloadInProgress,\n UpToDate,\n}\n\nexport type DeviceInfoMap = Record>;\n\n/**\n * @alias module:crypto/DeviceList\n */\nexport class DeviceList extends EventEmitter {\n private devices: { [userId: string]: { [deviceId: string]: IDevice } } = {};\n\n public crossSigningInfo: { [userId: string]: ICrossSigningInfo } = {};\n\n // map of identity keys to the user who owns it\n private userByIdentityKey: Record = {};\n\n // which users we are tracking device status for.\n private deviceTrackingStatus: { [userId: string]: TrackingStatus } = {}; // loaded from storage in load()\n\n // The 'next_batch' sync token at the point the data was written,\n // ie. a token representing the point immediately after the\n // moment represented by the snapshot in the db.\n private syncToken: string = null;\n\n private keyDownloadsInProgressByUser: { [userId: string]: Promise } = {};\n\n // Set whenever changes are made other than setting the sync token\n private dirty = false;\n\n // Promise resolved when device data is saved\n private savePromise: Promise = null;\n // Function that resolves the save promise\n private resolveSavePromise: (saved: boolean) => void = null;\n // The time the save is scheduled for\n private savePromiseTime: number = null;\n // The timer used to delay the save\n private saveTimer: number = null;\n // True if we have fetched data from the server or loaded a non-empty\n // set of device data from the store\n private hasFetched: boolean = null;\n\n private readonly serialiser: DeviceListUpdateSerialiser;\n\n constructor(\n baseApis: MatrixClient,\n private readonly cryptoStore: CryptoStore,\n olmDevice: OlmDevice,\n // Maximum number of user IDs per request to prevent server overload (#1619)\n public readonly keyDownloadChunkSize = 250,\n ) {\n super();\n\n this.serialiser = new DeviceListUpdateSerialiser(baseApis, olmDevice, this);\n }\n\n /**\n * Load the device tracking state from storage\n */\n public async load() {\n await this.cryptoStore.doTxn(\n 'readonly', [IndexedDBCryptoStore.STORE_DEVICE_DATA], (txn) => {\n this.cryptoStore.getEndToEndDeviceData(txn, (deviceData) => {\n this.hasFetched = Boolean(deviceData && deviceData.devices);\n this.devices = deviceData ? deviceData.devices : {},\n this.crossSigningInfo = deviceData ?\n deviceData.crossSigningInfo || {} : {};\n this.deviceTrackingStatus = deviceData ?\n deviceData.trackingStatus : {};\n this.syncToken = deviceData ? deviceData.syncToken : null;\n this.userByIdentityKey = {};\n for (const user of Object.keys(this.devices)) {\n const userDevices = this.devices[user];\n for (const device of Object.keys(userDevices)) {\n const idKey = userDevices[device].keys['curve25519:'+device];\n if (idKey !== undefined) {\n this.userByIdentityKey[idKey] = user;\n }\n }\n }\n });\n },\n );\n\n for (const u of Object.keys(this.deviceTrackingStatus)) {\n // if a download was in progress when we got shut down, it isn't any more.\n if (this.deviceTrackingStatus[u] == TrackingStatus.DownloadInProgress) {\n this.deviceTrackingStatus[u] = TrackingStatus.PendingDownload;\n }\n }\n }\n\n public stop() {\n if (this.saveTimer !== null) {\n clearTimeout(this.saveTimer);\n }\n }\n\n /**\n * Save the device tracking state to storage, if any changes are\n * pending other than updating the sync token\n *\n * The actual save will be delayed by a short amount of time to\n * aggregate multiple writes to the database.\n *\n * @param {number} delay Time in ms before which the save actually happens.\n * By default, the save is delayed for a short period in order to batch\n * multiple writes, but this behaviour can be disabled by passing 0.\n *\n * @return {Promise} true if the data was saved, false if\n * it was not (eg. because no changes were pending). The promise\n * will only resolve once the data is saved, so may take some time\n * to resolve.\n */\n public async saveIfDirty(delay = 500): Promise {\n if (!this.dirty) return Promise.resolve(false);\n // Delay saves for a bit so we can aggregate multiple saves that happen\n // in quick succession (eg. when a whole room's devices are marked as known)\n\n const targetTime = Date.now() + delay;\n if (this.savePromiseTime && targetTime < this.savePromiseTime) {\n // There's a save scheduled but for after we would like: cancel\n // it & schedule one for the time we want\n clearTimeout(this.saveTimer);\n this.saveTimer = null;\n this.savePromiseTime = null;\n // (but keep the save promise since whatever called save before\n // will still want to know when the save is done)\n }\n\n let savePromise = this.savePromise;\n if (savePromise === null) {\n savePromise = new Promise((resolve, reject) => {\n this.resolveSavePromise = resolve;\n });\n this.savePromise = savePromise;\n }\n\n if (this.saveTimer === null) {\n const resolveSavePromise = this.resolveSavePromise;\n this.savePromiseTime = targetTime;\n this.saveTimer = setTimeout(() => {\n logger.log('Saving device tracking data', this.syncToken);\n\n // null out savePromise now (after the delay but before the write),\n // otherwise we could return the existing promise when the save has\n // actually already happened.\n this.savePromiseTime = null;\n this.saveTimer = null;\n this.savePromise = null;\n this.resolveSavePromise = null;\n\n this.cryptoStore.doTxn(\n 'readwrite', [IndexedDBCryptoStore.STORE_DEVICE_DATA], (txn) => {\n this.cryptoStore.storeEndToEndDeviceData({\n devices: this.devices,\n crossSigningInfo: this.crossSigningInfo,\n trackingStatus: this.deviceTrackingStatus,\n syncToken: this.syncToken,\n }, txn);\n },\n ).then(() => {\n // The device list is considered dirty until the write completes.\n this.dirty = false;\n resolveSavePromise(true);\n }, err => {\n logger.error('Failed to save device tracking data', this.syncToken);\n logger.error(err);\n });\n }, delay);\n }\n\n return savePromise;\n }\n\n /**\n * Gets the sync token last set with setSyncToken\n *\n * @return {string} The sync token\n */\n public getSyncToken(): string {\n return this.syncToken;\n }\n\n /**\n * Sets the sync token that the app will pass as the 'since' to the /sync\n * endpoint next time it syncs.\n * The sync token must always be set after any changes made as a result of\n * data in that sync since setting the sync token to a newer one will mean\n * those changed will not be synced from the server if a new client starts\n * up with that data.\n *\n * @param {string} st The sync token\n */\n public setSyncToken(st: string): void {\n this.syncToken = st;\n }\n\n /**\n * Ensures up to date keys for a list of users are stored in the session store,\n * downloading and storing them if they're not (or if forceDownload is\n * true).\n * @param {Array} userIds The users to fetch.\n * @param {boolean} forceDownload Always download the keys even if cached.\n *\n * @return {Promise} A promise which resolves to a map userId->deviceId->{@link\n * module:crypto/deviceinfo|DeviceInfo}.\n */\n public downloadKeys(userIds: string[], forceDownload: boolean): Promise {\n const usersToDownload = [];\n const promises = [];\n\n userIds.forEach((u) => {\n const trackingStatus = this.deviceTrackingStatus[u];\n if (this.keyDownloadsInProgressByUser[u]) {\n // already a key download in progress/queued for this user; its results\n // will be good enough for us.\n logger.log(\n `downloadKeys: already have a download in progress for ` +\n `${u}: awaiting its result`,\n );\n promises.push(this.keyDownloadsInProgressByUser[u]);\n } else if (forceDownload || trackingStatus != TrackingStatus.UpToDate) {\n usersToDownload.push(u);\n }\n });\n\n if (usersToDownload.length != 0) {\n logger.log(\"downloadKeys: downloading for\", usersToDownload);\n const downloadPromise = this.doKeyDownload(usersToDownload);\n promises.push(downloadPromise);\n }\n\n if (promises.length === 0) {\n logger.log(\"downloadKeys: already have all necessary keys\");\n }\n\n return Promise.all(promises).then(() => {\n return this.getDevicesFromStore(userIds);\n });\n }\n\n /**\n * Get the stored device keys for a list of user ids\n *\n * @param {string[]} userIds the list of users to list keys for.\n *\n * @return {Object} userId->deviceId->{@link module:crypto/deviceinfo|DeviceInfo}.\n */\n private getDevicesFromStore(userIds: string[]): DeviceInfoMap {\n const stored: DeviceInfoMap = {};\n userIds.map((u) => {\n stored[u] = {};\n const devices = this.getStoredDevicesForUser(u) || [];\n devices.map(function(dev) {\n stored[u][dev.deviceId] = dev;\n });\n });\n return stored;\n }\n\n /**\n * Returns a list of all user IDs the DeviceList knows about\n *\n * @return {array} All known user IDs\n */\n public getKnownUserIds(): string[] {\n return Object.keys(this.devices);\n }\n\n /**\n * Get the stored device keys for a user id\n *\n * @param {string} userId the user to list keys for.\n *\n * @return {module:crypto/deviceinfo[]|null} list of devices, or null if we haven't\n * managed to get a list of devices for this user yet.\n */\n public getStoredDevicesForUser(userId: string): DeviceInfo[] | null {\n const devs = this.devices[userId];\n if (!devs) {\n return null;\n }\n const res = [];\n for (const deviceId in devs) {\n if (devs.hasOwnProperty(deviceId)) {\n res.push(DeviceInfo.fromStorage(devs[deviceId], deviceId));\n }\n }\n return res;\n }\n\n /**\n * Get the stored device data for a user, in raw object form\n *\n * @param {string} userId the user to get data for\n *\n * @return {Object} deviceId->{object} devices, or undefined if\n * there is no data for this user.\n */\n public getRawStoredDevicesForUser(userId: string): Record {\n return this.devices[userId];\n }\n\n public getStoredCrossSigningForUser(userId: string): CrossSigningInfo {\n if (!this.crossSigningInfo[userId]) return null;\n\n return CrossSigningInfo.fromStorage(this.crossSigningInfo[userId], userId);\n }\n\n public storeCrossSigningForUser(userId: string, info: ICrossSigningInfo): void {\n this.crossSigningInfo[userId] = info;\n this.dirty = true;\n }\n\n /**\n * Get the stored keys for a single device\n *\n * @param {string} userId\n * @param {string} deviceId\n *\n * @return {module:crypto/deviceinfo?} device, or undefined\n * if we don't know about this device\n */\n public getStoredDevice(userId: string, deviceId: string): DeviceInfo {\n const devs = this.devices[userId];\n if (!devs || !devs[deviceId]) {\n return undefined;\n }\n return DeviceInfo.fromStorage(devs[deviceId], deviceId);\n }\n\n /**\n * Get a user ID by one of their device's curve25519 identity key\n *\n * @param {string} algorithm encryption algorithm\n * @param {string} senderKey curve25519 key to match\n *\n * @return {string} user ID\n */\n public getUserByIdentityKey(algorithm: string, senderKey: string): string {\n if (\n algorithm !== olmlib.OLM_ALGORITHM &&\n algorithm !== olmlib.MEGOLM_ALGORITHM\n ) {\n // we only deal in olm keys\n return null;\n }\n\n return this.userByIdentityKey[senderKey];\n }\n\n /**\n * Find a device by curve25519 identity key\n *\n * @param {string} algorithm encryption algorithm\n * @param {string} senderKey curve25519 key to match\n *\n * @return {module:crypto/deviceinfo?}\n */\n public getDeviceByIdentityKey(algorithm: string, senderKey: string): DeviceInfo | null {\n const userId = this.getUserByIdentityKey(algorithm, senderKey);\n if (!userId) {\n return null;\n }\n\n const devices = this.devices[userId];\n if (!devices) {\n return null;\n }\n\n for (const deviceId in devices) {\n if (!devices.hasOwnProperty(deviceId)) {\n continue;\n }\n\n const device = devices[deviceId];\n for (const keyId in device.keys) {\n if (!device.keys.hasOwnProperty(keyId)) {\n continue;\n }\n if (keyId.indexOf(\"curve25519:\") !== 0) {\n continue;\n }\n const deviceKey = device.keys[keyId];\n if (deviceKey == senderKey) {\n return DeviceInfo.fromStorage(device, deviceId);\n }\n }\n }\n\n // doesn't match a known device\n return null;\n }\n\n /**\n * Replaces the list of devices for a user with the given device list\n *\n * @param {string} userId The user ID\n * @param {Object} devices New device info for user\n */\n public storeDevicesForUser(userId: string, devices: Record): void {\n this.setRawStoredDevicesForUser(userId, devices);\n this.dirty = true;\n }\n\n /**\n * flag the given user for device-list tracking, if they are not already.\n *\n * This will mean that a subsequent call to refreshOutdatedDeviceLists()\n * will download the device list for the user, and that subsequent calls to\n * invalidateUserDeviceList will trigger more updates.\n *\n * @param {String} userId\n */\n public startTrackingDeviceList(userId: string): void {\n // sanity-check the userId. This is mostly paranoia, but if synapse\n // can't parse the userId we give it as an mxid, it 500s the whole\n // request and we can never update the device lists again (because\n // the broken userId is always 'invalid' and always included in any\n // refresh request).\n // By checking it is at least a string, we can eliminate a class of\n // silly errors.\n if (typeof userId !== 'string') {\n throw new Error('userId must be a string; was '+userId);\n }\n if (!this.deviceTrackingStatus[userId]) {\n logger.log('Now tracking device list for ' + userId);\n this.deviceTrackingStatus[userId] = TrackingStatus.PendingDownload;\n // we don't yet persist the tracking status, since there may be a lot\n // of calls; we save all data together once the sync is done\n this.dirty = true;\n }\n }\n\n /**\n * Mark the given user as no longer being tracked for device-list updates.\n *\n * This won't affect any in-progress downloads, which will still go on to\n * complete; it will just mean that we don't think that we have an up-to-date\n * list for future calls to downloadKeys.\n *\n * @param {String} userId\n */\n public stopTrackingDeviceList(userId: string): void {\n if (this.deviceTrackingStatus[userId]) {\n logger.log('No longer tracking device list for ' + userId);\n this.deviceTrackingStatus[userId] = TrackingStatus.NotTracked;\n\n // we don't yet persist the tracking status, since there may be a lot\n // of calls; we save all data together once the sync is done\n this.dirty = true;\n }\n }\n\n /**\n * Set all users we're currently tracking to untracked\n *\n * This will flag each user whose devices we are tracking as in need of an\n * update.\n */\n public stopTrackingAllDeviceLists(): void {\n for (const userId of Object.keys(this.deviceTrackingStatus)) {\n this.deviceTrackingStatus[userId] = TrackingStatus.NotTracked;\n }\n this.dirty = true;\n }\n\n /**\n * Mark the cached device list for the given user outdated.\n *\n * If we are not tracking this user's devices, we'll do nothing. Otherwise\n * we flag the user as needing an update.\n *\n * This doesn't actually set off an update, so that several users can be\n * batched together. Call refreshOutdatedDeviceLists() for that.\n *\n * @param {String} userId\n */\n public invalidateUserDeviceList(userId: string): void {\n if (this.deviceTrackingStatus[userId]) {\n logger.log(\"Marking device list outdated for\", userId);\n this.deviceTrackingStatus[userId] = TrackingStatus.PendingDownload;\n\n // we don't yet persist the tracking status, since there may be a lot\n // of calls; we save all data together once the sync is done\n this.dirty = true;\n }\n }\n\n /**\n * If we have users who have outdated device lists, start key downloads for them\n *\n * @returns {Promise} which completes when the download completes; normally there\n * is no need to wait for this (it's mostly for the unit tests).\n */\n public refreshOutdatedDeviceLists(): Promise {\n this.saveIfDirty();\n\n const usersToDownload = [];\n for (const userId of Object.keys(this.deviceTrackingStatus)) {\n const stat = this.deviceTrackingStatus[userId];\n if (stat == TrackingStatus.PendingDownload) {\n usersToDownload.push(userId);\n }\n }\n\n return this.doKeyDownload(usersToDownload);\n }\n\n /**\n * Set the stored device data for a user, in raw object form\n * Used only by internal class DeviceListUpdateSerialiser\n *\n * @param {string} userId the user to get data for\n *\n * @param {Object} devices deviceId->{object} the new devices\n */\n public setRawStoredDevicesForUser(userId: string, devices: Record): void {\n // remove old devices from userByIdentityKey\n if (this.devices[userId] !== undefined) {\n for (const [deviceId, dev] of Object.entries(this.devices[userId])) {\n const identityKey = dev.keys['curve25519:'+deviceId];\n\n delete this.userByIdentityKey[identityKey];\n }\n }\n\n this.devices[userId] = devices;\n\n // add new devices into userByIdentityKey\n for (const [deviceId, dev] of Object.entries(devices)) {\n const identityKey = dev.keys['curve25519:'+deviceId];\n\n this.userByIdentityKey[identityKey] = userId;\n }\n }\n\n public setRawStoredCrossSigningForUser(userId: string, info: ICrossSigningInfo): void {\n this.crossSigningInfo[userId] = info;\n }\n\n /**\n * Fire off download update requests for the given users, and update the\n * device list tracking status for them, and the\n * keyDownloadsInProgressByUser map for them.\n *\n * @param {String[]} users list of userIds\n *\n * @return {Promise} resolves when all the users listed have\n * been updated. rejects if there was a problem updating any of the\n * users.\n */\n private doKeyDownload(users: string[]): Promise {\n if (users.length === 0) {\n // nothing to do\n return Promise.resolve();\n }\n\n const prom = this.serialiser.updateDevicesForUsers(users, this.syncToken).then(() => {\n finished(true);\n }, (e) => {\n logger.error(\n 'Error downloading keys for ' + users + \":\", e,\n );\n finished(false);\n throw e;\n });\n\n users.forEach((u) => {\n this.keyDownloadsInProgressByUser[u] = prom;\n const stat = this.deviceTrackingStatus[u];\n if (stat == TrackingStatus.PendingDownload) {\n this.deviceTrackingStatus[u] = TrackingStatus.DownloadInProgress;\n }\n });\n\n const finished = (success) => {\n this.emit(\"crypto.willUpdateDevices\", users, !this.hasFetched);\n users.forEach((u) => {\n this.dirty = true;\n\n // we may have queued up another download request for this user\n // since we started this request. If that happens, we should\n // ignore the completion of the first one.\n if (this.keyDownloadsInProgressByUser[u] !== prom) {\n logger.log('Another update in the queue for', u, '- not marking up-to-date');\n return;\n }\n delete this.keyDownloadsInProgressByUser[u];\n const stat = this.deviceTrackingStatus[u];\n if (stat == TrackingStatus.DownloadInProgress) {\n if (success) {\n // we didn't get any new invalidations since this download started:\n // this user's device list is now up to date.\n this.deviceTrackingStatus[u] = TrackingStatus.UpToDate;\n logger.log(\"Device list for\", u, \"now up to date\");\n } else {\n this.deviceTrackingStatus[u] = TrackingStatus.PendingDownload;\n }\n }\n });\n this.saveIfDirty();\n this.emit(\"crypto.devicesUpdated\", users, !this.hasFetched);\n this.hasFetched = true;\n };\n\n return prom;\n }\n}\n\n/**\n * Serialises updates to device lists\n *\n * Ensures that results from /keys/query are not overwritten if a second call\n * completes *before* an earlier one.\n *\n * It currently does this by ensuring only one call to /keys/query happens at a\n * time (and queuing other requests up).\n */\nclass DeviceListUpdateSerialiser {\n private downloadInProgress = false;\n\n // users which are queued for download\n // userId -> true\n private keyDownloadsQueuedByUser: Record = {};\n\n // deferred which is resolved when the queued users are downloaded.\n // non-null indicates that we have users queued for download.\n private queuedQueryDeferred: IDeferred = null;\n\n private syncToken: string = null; // The sync token we send with the requests\n\n /*\n * @param {object} baseApis Base API object\n * @param {object} olmDevice The Olm Device\n * @param {object} deviceList The device list object, the device list to be updated\n */\n constructor(\n private readonly baseApis: MatrixClient,\n private readonly olmDevice: OlmDevice,\n private readonly deviceList: DeviceList,\n ) {}\n\n /**\n * Make a key query request for the given users\n *\n * @param {String[]} users list of user ids\n *\n * @param {String} syncToken sync token to pass in the query request, to\n * help the HS give the most recent results\n *\n * @return {Promise} resolves when all the users listed have\n * been updated. rejects if there was a problem updating any of the\n * users.\n */\n public updateDevicesForUsers(users: string[], syncToken: string): Promise {\n users.forEach((u) => {\n this.keyDownloadsQueuedByUser[u] = true;\n });\n\n if (!this.queuedQueryDeferred) {\n this.queuedQueryDeferred = defer();\n }\n\n // We always take the new sync token and just use the latest one we've\n // been given, since it just needs to be at least as recent as the\n // sync response the device invalidation message arrived in\n this.syncToken = syncToken;\n\n if (this.downloadInProgress) {\n // just queue up these users\n logger.log('Queued key download for', users);\n return this.queuedQueryDeferred.promise;\n }\n\n // start a new download.\n return this.doQueuedQueries();\n }\n\n private doQueuedQueries(): Promise {\n if (this.downloadInProgress) {\n throw new Error(\n \"DeviceListUpdateSerialiser.doQueuedQueries called with request active\",\n );\n }\n\n const downloadUsers = Object.keys(this.keyDownloadsQueuedByUser);\n this.keyDownloadsQueuedByUser = {};\n const deferred = this.queuedQueryDeferred;\n this.queuedQueryDeferred = null;\n\n logger.log('Starting key download for', downloadUsers);\n this.downloadInProgress = true;\n\n const opts: Parameters[1] = {};\n if (this.syncToken) {\n opts.token = this.syncToken;\n }\n\n const factories = [];\n for (let i = 0; i < downloadUsers.length; i += this.deviceList.keyDownloadChunkSize) {\n const userSlice = downloadUsers.slice(i, i + this.deviceList.keyDownloadChunkSize);\n factories.push(() => this.baseApis.downloadKeysForUsers(userSlice, opts));\n }\n\n chunkPromises(factories, 3).then(async (responses: any[]) => {\n const dk = Object.assign({}, ...(responses.map(res => res.device_keys || {})));\n const masterKeys = Object.assign({}, ...(responses.map(res => res.master_keys || {})));\n const ssks = Object.assign({}, ...(responses.map(res => res.self_signing_keys || {})));\n const usks = Object.assign({}, ...(responses.map(res => res.user_signing_keys || {})));\n\n // yield to other things that want to execute in between users, to\n // avoid wedging the CPU\n // (https://github.com/vector-im/element-web/issues/3158)\n //\n // of course we ought to do this in a web worker or similar, but\n // this serves as an easy solution for now.\n for (const userId of downloadUsers) {\n await sleep(5);\n try {\n await this.processQueryResponseForUser(\n userId, dk[userId], {\n master: masterKeys[userId],\n self_signing: ssks[userId],\n user_signing: usks[userId],\n },\n );\n } catch (e) {\n // log the error but continue, so that one bad key\n // doesn't kill the whole process\n logger.error(`Error processing keys for ${userId}:`, e);\n }\n }\n }).then(() => {\n logger.log('Completed key download for ' + downloadUsers);\n\n this.downloadInProgress = false;\n deferred.resolve();\n\n // if we have queued users, fire off another request.\n if (this.queuedQueryDeferred) {\n this.doQueuedQueries();\n }\n }, (e) => {\n logger.warn('Error downloading keys for ' + downloadUsers + ':', e);\n this.downloadInProgress = false;\n deferred.reject(e);\n });\n\n return deferred.promise;\n }\n\n private async processQueryResponseForUser(\n userId: string,\n dkResponse: object,\n crossSigningResponse: any, // TODO types\n ): Promise {\n logger.log('got device keys for ' + userId + ':', dkResponse);\n logger.log('got cross-signing keys for ' + userId + ':', crossSigningResponse);\n\n {\n // map from deviceid -> deviceinfo for this user\n const userStore: Record = {};\n const devs = this.deviceList.getRawStoredDevicesForUser(userId);\n if (devs) {\n Object.keys(devs).forEach((deviceId) => {\n const d = DeviceInfo.fromStorage(devs[deviceId], deviceId);\n userStore[deviceId] = d;\n });\n }\n\n await updateStoredDeviceKeysForUser(\n this.olmDevice, userId, userStore, dkResponse || {},\n this.baseApis.getUserId(), this.baseApis.deviceId,\n );\n\n // put the updates into the object that will be returned as our results\n const storage: Record = {};\n Object.keys(userStore).forEach((deviceId) => {\n storage[deviceId] = userStore[deviceId].toStorage();\n });\n\n this.deviceList.setRawStoredDevicesForUser(userId, storage);\n }\n\n // now do the same for the cross-signing keys\n {\n // FIXME: should we be ignoring empty cross-signing responses, or\n // should we be dropping the keys?\n if (crossSigningResponse\n && (crossSigningResponse.master || crossSigningResponse.self_signing\n || crossSigningResponse.user_signing)) {\n const crossSigning\n = this.deviceList.getStoredCrossSigningForUser(userId)\n || new CrossSigningInfo(userId);\n\n crossSigning.setKeys(crossSigningResponse);\n\n this.deviceList.setRawStoredCrossSigningForUser(userId, crossSigning.toStorage());\n\n // NB. Unlike most events in the js-sdk, this one is internal to the\n // js-sdk and is not re-emitted\n this.deviceList.emit('userCrossSigningUpdated', userId);\n }\n }\n }\n}\n\nasync function updateStoredDeviceKeysForUser(\n olmDevice: OlmDevice,\n userId: string,\n userStore: Record,\n userResult: object,\n localUserId: string,\n localDeviceId: string,\n): Promise {\n let updated = false;\n\n // remove any devices in the store which aren't in the response\n for (const deviceId in userStore) {\n if (!userStore.hasOwnProperty(deviceId)) {\n continue;\n }\n\n if (!(deviceId in userResult)) {\n if (userId === localUserId && deviceId === localDeviceId) {\n logger.warn(\n `Local device ${deviceId} missing from sync, skipping removal`,\n );\n continue;\n }\n\n logger.log(\"Device \" + userId + \":\" + deviceId +\n \" has been removed\");\n delete userStore[deviceId];\n updated = true;\n }\n }\n\n for (const deviceId in userResult) {\n if (!userResult.hasOwnProperty(deviceId)) {\n continue;\n }\n\n const deviceResult = userResult[deviceId];\n\n // check that the user_id and device_id in the response object are\n // correct\n if (deviceResult.user_id !== userId) {\n logger.warn(\"Mismatched user_id \" + deviceResult.user_id +\n \" in keys from \" + userId + \":\" + deviceId);\n continue;\n }\n if (deviceResult.device_id !== deviceId) {\n logger.warn(\"Mismatched device_id \" + deviceResult.device_id +\n \" in keys from \" + userId + \":\" + deviceId);\n continue;\n }\n\n if (await storeDeviceKeys(olmDevice, userStore, deviceResult)) {\n updated = true;\n }\n }\n\n return updated;\n}\n\n/*\n * Process a device in a /query response, and add it to the userStore\n *\n * returns (a promise for) true if a change was made, else false\n */\nasync function storeDeviceKeys(\n olmDevice: OlmDevice,\n userStore: Record,\n deviceResult: any, // TODO types\n): Promise {\n if (!deviceResult.keys) {\n // no keys?\n return false;\n }\n\n const deviceId = deviceResult.device_id;\n const userId = deviceResult.user_id;\n\n const signKeyId = \"ed25519:\" + deviceId;\n const signKey = deviceResult.keys[signKeyId];\n if (!signKey) {\n logger.warn(\"Device \" + userId + \":\" + deviceId + \" has no ed25519 key\");\n return false;\n }\n\n const unsigned = deviceResult.unsigned || {};\n const signatures = deviceResult.signatures || {};\n\n try {\n await olmlib.verifySignature(olmDevice, deviceResult, userId, deviceId, signKey);\n } catch (e) {\n logger.warn(\"Unable to verify signature on device \" + userId + \":\" + deviceId + \":\" + e);\n return false;\n }\n\n // DeviceInfo\n let deviceStore;\n\n if (deviceId in userStore) {\n // already have this device.\n deviceStore = userStore[deviceId];\n\n if (deviceStore.getFingerprint() != signKey) {\n // this should only happen if the list has been MITMed; we are\n // best off sticking with the original keys.\n //\n // Should we warn the user about it somehow?\n logger.warn(\"Ed25519 key for device \" + userId + \":\" +\n deviceId + \" has changed\");\n return false;\n }\n } else {\n userStore[deviceId] = deviceStore = new DeviceInfo(deviceId);\n }\n\n deviceStore.keys = deviceResult.keys || {};\n deviceStore.algorithms = deviceResult.algorithms || [];\n deviceStore.unsigned = unsigned;\n deviceStore.signatures = signatures;\n return true;\n}\n", - "/*\nCopyright 2021 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\nimport { logger } from \"../logger\";\nimport { MatrixEvent } from \"../models/event\";\nimport { EventEmitter } from \"events\";\nimport { createCryptoStoreCacheCallbacks, ICacheCallbacks } from \"./CrossSigning\";\nimport { IndexedDBCryptoStore } from './store/indexeddb-crypto-store';\nimport { PREFIX_UNSTABLE } from \"../http-api\";\nimport { Crypto, IBootstrapCrossSigningOpts } from \"./index\";\nimport {\n CrossSigningKeys,\n ICrossSigningKey,\n ICryptoCallbacks,\n ISignedKey,\n KeySignatures,\n} from \"../matrix\";\nimport { ISecretStorageKeyInfo } from \"./api\";\nimport { IKeyBackupInfo } from \"./keybackup\";\n\ninterface ICrossSigningKeys {\n authUpload: IBootstrapCrossSigningOpts[\"authUploadDeviceSigningKeys\"];\n keys: Record;\n}\n\n/**\n * Builds an EncryptionSetupOperation by calling any of the add.. methods.\n * Once done, `buildOperation()` can be called which allows to apply to operation.\n *\n * This is used as a helper by Crypto to keep track of all the network requests\n * and other side-effects of bootstrapping, so it can be applied in one go (and retried in the future)\n * Also keeps track of all the private keys created during bootstrapping, so we don't need to prompt for them\n * more than once.\n */\nexport class EncryptionSetupBuilder {\n public readonly accountDataClientAdapter: AccountDataClientAdapter;\n public readonly crossSigningCallbacks: CrossSigningCallbacks;\n public readonly ssssCryptoCallbacks: SSSSCryptoCallbacks;\n\n private crossSigningKeys: ICrossSigningKeys = null;\n private keySignatures: KeySignatures = null;\n private keyBackupInfo: IKeyBackupInfo = null;\n private sessionBackupPrivateKey: Uint8Array;\n\n /**\n * @param {Object.} accountData pre-existing account data, will only be read, not written.\n * @param {CryptoCallbacks} delegateCryptoCallbacks crypto callbacks to delegate to if the key isn't in cache yet\n */\n constructor(accountData: Record, delegateCryptoCallbacks: ICryptoCallbacks) {\n this.accountDataClientAdapter = new AccountDataClientAdapter(accountData);\n this.crossSigningCallbacks = new CrossSigningCallbacks();\n this.ssssCryptoCallbacks = new SSSSCryptoCallbacks(delegateCryptoCallbacks);\n }\n\n /**\n * Adds new cross-signing public keys\n *\n * @param {function} authUpload Function called to await an interactive auth\n * flow when uploading device signing keys.\n * Args:\n * {function} A function that makes the request requiring auth. Receives\n * the auth data as an object. Can be called multiple times, first with\n * an empty authDict, to obtain the flows.\n * @param {Object} keys the new keys\n */\n public addCrossSigningKeys(authUpload: ICrossSigningKeys[\"authUpload\"], keys: ICrossSigningKeys[\"keys\"]): void {\n this.crossSigningKeys = { authUpload, keys };\n }\n\n /**\n * Adds the key backup info to be updated on the server\n *\n * Used either to create a new key backup, or add signatures\n * from the new MSK.\n *\n * @param {Object} keyBackupInfo as received from/sent to the server\n */\n public addSessionBackup(keyBackupInfo: IKeyBackupInfo): void {\n this.keyBackupInfo = keyBackupInfo;\n }\n\n /**\n * Adds the session backup private key to be updated in the local cache\n *\n * Used after fixing the format of the key\n *\n * @param {Uint8Array} privateKey\n */\n public addSessionBackupPrivateKeyToCache(privateKey: Uint8Array): void {\n this.sessionBackupPrivateKey = privateKey;\n }\n\n /**\n * Add signatures from a given user and device/x-sign key\n * Used to sign the new cross-signing key with the device key\n *\n * @param {String} userId\n * @param {String} deviceId\n * @param {Object} signature\n */\n public addKeySignature(userId: string, deviceId: string, signature: ISignedKey): void {\n if (!this.keySignatures) {\n this.keySignatures = {};\n }\n const userSignatures = this.keySignatures[userId] || {};\n this.keySignatures[userId] = userSignatures;\n userSignatures[deviceId] = signature;\n }\n\n /**\n * @param {String} type\n * @param {Object} content\n * @return {Promise}\n */\n public async setAccountData(type: string, content: object): Promise {\n await this.accountDataClientAdapter.setAccountData(type, content);\n }\n\n /**\n * builds the operation containing all the parts that have been added to the builder\n * @return {EncryptionSetupOperation}\n */\n public buildOperation(): EncryptionSetupOperation {\n const accountData = this.accountDataClientAdapter.values;\n return new EncryptionSetupOperation(\n accountData,\n this.crossSigningKeys,\n this.keyBackupInfo,\n this.keySignatures,\n );\n }\n\n /**\n * Stores the created keys locally.\n *\n * This does not yet store the operation in a way that it can be restored,\n * but that is the idea in the future.\n *\n * @param {Crypto} crypto\n * @return {Promise}\n */\n public async persist(crypto: Crypto): Promise {\n // store private keys in cache\n if (this.crossSigningKeys) {\n const cacheCallbacks = createCryptoStoreCacheCallbacks(crypto.cryptoStore, crypto.olmDevice);\n for (const type of [\"master\", \"self_signing\", \"user_signing\"]) {\n logger.log(`Cache ${type} cross-signing private key locally`);\n const privateKey = this.crossSigningCallbacks.privateKeys.get(type);\n await cacheCallbacks.storeCrossSigningKeyCache(type, privateKey);\n }\n // store own cross-sign pubkeys as trusted\n await crypto.cryptoStore.doTxn(\n 'readwrite', [IndexedDBCryptoStore.STORE_ACCOUNT],\n (txn) => {\n crypto.cryptoStore.storeCrossSigningKeys(\n txn, this.crossSigningKeys.keys);\n },\n );\n }\n // store session backup key in cache\n if (this.sessionBackupPrivateKey) {\n await crypto.storeSessionBackupPrivateKey(this.sessionBackupPrivateKey);\n }\n }\n}\n\n/**\n * Can be created from EncryptionSetupBuilder, or\n * (in a follow-up PR, not implemented yet) restored from storage, to retry.\n *\n * It does not have knowledge of any private keys, unlike the builder.\n */\nexport class EncryptionSetupOperation {\n /**\n * @param {Map} accountData\n * @param {Object} crossSigningKeys\n * @param {Object} keyBackupInfo\n * @param {Object} keySignatures\n */\n constructor(\n private readonly accountData: Map,\n private readonly crossSigningKeys: ICrossSigningKeys,\n private readonly keyBackupInfo: IKeyBackupInfo,\n private readonly keySignatures: KeySignatures,\n ) {}\n\n /**\n * Runs the (remaining part of, in the future) operation by sending requests to the server.\n * @param {Crypto} crypto\n */\n public async apply(crypto: Crypto): Promise {\n const baseApis = crypto.baseApis;\n // upload cross-signing keys\n if (this.crossSigningKeys) {\n const keys: Partial = {};\n for (const [name, key] of Object.entries(this.crossSigningKeys.keys)) {\n keys[name + \"_key\"] = key;\n }\n\n // We must only call `uploadDeviceSigningKeys` from inside this auth\n // helper to ensure we properly handle auth errors.\n await this.crossSigningKeys.authUpload(authDict => {\n return baseApis.uploadDeviceSigningKeys(authDict, keys as CrossSigningKeys);\n });\n\n // pass the new keys to the main instance of our own CrossSigningInfo.\n crypto.crossSigningInfo.setKeys(this.crossSigningKeys.keys);\n }\n // set account data\n if (this.accountData) {\n for (const [type, content] of this.accountData) {\n await baseApis.setAccountData(type, content);\n }\n }\n // upload first cross-signing signatures with the new key\n // (e.g. signing our own device)\n if (this.keySignatures) {\n await baseApis.uploadKeySignatures(this.keySignatures);\n }\n // need to create/update key backup info\n if (this.keyBackupInfo) {\n if (this.keyBackupInfo.version) {\n // session backup signature\n // The backup is trusted because the user provided the private key.\n // Sign the backup with the cross signing key so the key backup can\n // be trusted via cross-signing.\n await baseApis.http.authedRequest(\n undefined, \"PUT\", \"/room_keys/version/\" + this.keyBackupInfo.version,\n undefined, {\n algorithm: this.keyBackupInfo.algorithm,\n auth_data: this.keyBackupInfo.auth_data,\n },\n { prefix: PREFIX_UNSTABLE },\n );\n } else {\n // add new key backup\n await baseApis.http.authedRequest(\n undefined, \"POST\", \"/room_keys/version\",\n undefined, this.keyBackupInfo,\n { prefix: PREFIX_UNSTABLE },\n );\n }\n }\n }\n}\n\n/**\n * Catches account data set by SecretStorage during bootstrapping by\n * implementing the methods related to account data in MatrixClient\n */\nclass AccountDataClientAdapter extends EventEmitter {\n public readonly values = new Map();\n\n /**\n * @param {Object.} existingValues existing account data\n */\n constructor(private readonly existingValues: Record) {\n super();\n }\n\n /**\n * @param {String} type\n * @return {Promise} the content of the account data\n */\n public getAccountDataFromServer(type: string): Promise {\n return Promise.resolve(this.getAccountData(type));\n }\n\n /**\n * @param {String} type\n * @return {Object} the content of the account data\n */\n public getAccountData(type: string): MatrixEvent {\n const modifiedValue = this.values.get(type);\n if (modifiedValue) {\n return modifiedValue;\n }\n const existingValue = this.existingValues[type];\n if (existingValue) {\n return existingValue.getContent();\n }\n return null;\n }\n\n /**\n * @param {String} type\n * @param {Object} content\n * @return {Promise}\n */\n public setAccountData(type: string, content: any): Promise<{}> {\n const lastEvent = this.values.get(type);\n this.values.set(type, content);\n // ensure accountData is emitted on the next tick,\n // as SecretStorage listens for it while calling this method\n // and it seems to rely on this.\n return Promise.resolve().then(() => {\n const event = new MatrixEvent({ type, content });\n this.emit(\"accountData\", event, lastEvent);\n return {};\n });\n }\n}\n\n/**\n * Catches the private cross-signing keys set during bootstrapping\n * by both cache callbacks (see createCryptoStoreCacheCallbacks) as non-cache callbacks.\n * See CrossSigningInfo constructor\n */\nclass CrossSigningCallbacks implements ICryptoCallbacks, ICacheCallbacks {\n public readonly privateKeys = new Map();\n\n // cache callbacks\n public getCrossSigningKeyCache(type: string, expectedPublicKey: string): Promise {\n return this.getCrossSigningKey(type, expectedPublicKey);\n }\n\n public storeCrossSigningKeyCache(type: string, key: Uint8Array): Promise {\n this.privateKeys.set(type, key);\n return Promise.resolve();\n }\n\n // non-cache callbacks\n public getCrossSigningKey(type: string, expectedPubkey: string): Promise {\n return Promise.resolve(this.privateKeys.get(type));\n }\n\n public saveCrossSigningKeys(privateKeys: Record) {\n for (const [type, privateKey] of Object.entries(privateKeys)) {\n this.privateKeys.set(type, privateKey);\n }\n }\n}\n\n/**\n * Catches the 4S private key set during bootstrapping by implementing\n * the SecretStorage crypto callbacks\n */\nclass SSSSCryptoCallbacks {\n private readonly privateKeys = new Map();\n\n constructor(private readonly delegateCryptoCallbacks: ICryptoCallbacks) {}\n\n public async getSecretStorageKey(\n { keys }: { keys: Record },\n name: string,\n ): Promise<[string, Uint8Array]> {\n for (const keyId of Object.keys(keys)) {\n const privateKey = this.privateKeys.get(keyId);\n if (privateKey) {\n return [keyId, privateKey];\n }\n }\n // if we don't have the key cached yet, ask\n // for it to the general crypto callbacks and cache it\n if (this.delegateCryptoCallbacks) {\n const result = await this.delegateCryptoCallbacks.\n getSecretStorageKey({ keys }, name);\n if (result) {\n const [keyId, privateKey] = result;\n this.privateKeys.set(keyId, privateKey);\n }\n return result;\n }\n }\n\n public addPrivateKey(keyId: string, keyInfo: ISecretStorageKeyInfo, privKey: Uint8Array): void {\n this.privateKeys.set(keyId, privKey);\n // Also pass along to application to cache if it wishes\n this.delegateCryptoCallbacks?.cacheSecretStorageKey?.(keyId, keyInfo, privKey);\n }\n}\n", + "/*\nCopyright 2021 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\nimport { logger } from \"../logger\";\nimport { MatrixEvent } from \"../models/event\";\nimport { EventEmitter } from \"events\";\nimport { createCryptoStoreCacheCallbacks, ICacheCallbacks } from \"./CrossSigning\";\nimport { IndexedDBCryptoStore } from './store/indexeddb-crypto-store';\nimport { PREFIX_UNSTABLE } from \"../http-api\";\nimport { Crypto, IBootstrapCrossSigningOpts } from \"./index\";\nimport {\n CrossSigningKeys,\n ICrossSigningKey,\n ICryptoCallbacks,\n ISignedKey,\n KeySignatures,\n} from \"../matrix\";\nimport { ISecretStorageKeyInfo } from \"./api\";\nimport { IKeyBackupInfo } from \"./keybackup\";\n\ninterface ICrossSigningKeys {\n authUpload: IBootstrapCrossSigningOpts[\"authUploadDeviceSigningKeys\"];\n keys: Record;\n}\n\n/**\n * Builds an EncryptionSetupOperation by calling any of the add.. methods.\n * Once done, `buildOperation()` can be called which allows to apply to operation.\n *\n * This is used as a helper by Crypto to keep track of all the network requests\n * and other side-effects of bootstrapping, so it can be applied in one go (and retried in the future)\n * Also keeps track of all the private keys created during bootstrapping, so we don't need to prompt for them\n * more than once.\n */\nexport class EncryptionSetupBuilder {\n public readonly accountDataClientAdapter: AccountDataClientAdapter;\n public readonly crossSigningCallbacks: CrossSigningCallbacks;\n public readonly ssssCryptoCallbacks: SSSSCryptoCallbacks;\n\n private crossSigningKeys: ICrossSigningKeys = null;\n private keySignatures: KeySignatures = null;\n private keyBackupInfo: IKeyBackupInfo = null;\n private sessionBackupPrivateKey: Uint8Array;\n\n /**\n * @param {Object.} accountData pre-existing account data, will only be read, not written.\n * @param {CryptoCallbacks} delegateCryptoCallbacks crypto callbacks to delegate to if the key isn't in cache yet\n */\n constructor(accountData: Record, delegateCryptoCallbacks?: ICryptoCallbacks) {\n this.accountDataClientAdapter = new AccountDataClientAdapter(accountData);\n this.crossSigningCallbacks = new CrossSigningCallbacks();\n this.ssssCryptoCallbacks = new SSSSCryptoCallbacks(delegateCryptoCallbacks);\n }\n\n /**\n * Adds new cross-signing public keys\n *\n * @param {function} authUpload Function called to await an interactive auth\n * flow when uploading device signing keys.\n * Args:\n * {function} A function that makes the request requiring auth. Receives\n * the auth data as an object. Can be called multiple times, first with\n * an empty authDict, to obtain the flows.\n * @param {Object} keys the new keys\n */\n public addCrossSigningKeys(authUpload: ICrossSigningKeys[\"authUpload\"], keys: ICrossSigningKeys[\"keys\"]): void {\n this.crossSigningKeys = { authUpload, keys };\n }\n\n /**\n * Adds the key backup info to be updated on the server\n *\n * Used either to create a new key backup, or add signatures\n * from the new MSK.\n *\n * @param {Object} keyBackupInfo as received from/sent to the server\n */\n public addSessionBackup(keyBackupInfo: IKeyBackupInfo): void {\n this.keyBackupInfo = keyBackupInfo;\n }\n\n /**\n * Adds the session backup private key to be updated in the local cache\n *\n * Used after fixing the format of the key\n *\n * @param {Uint8Array} privateKey\n */\n public addSessionBackupPrivateKeyToCache(privateKey: Uint8Array): void {\n this.sessionBackupPrivateKey = privateKey;\n }\n\n /**\n * Add signatures from a given user and device/x-sign key\n * Used to sign the new cross-signing key with the device key\n *\n * @param {String} userId\n * @param {String} deviceId\n * @param {Object} signature\n */\n public addKeySignature(userId: string, deviceId: string, signature: ISignedKey): void {\n if (!this.keySignatures) {\n this.keySignatures = {};\n }\n const userSignatures = this.keySignatures[userId] || {};\n this.keySignatures[userId] = userSignatures;\n userSignatures[deviceId] = signature;\n }\n\n /**\n * @param {String} type\n * @param {Object} content\n * @return {Promise}\n */\n public async setAccountData(type: string, content: object): Promise {\n await this.accountDataClientAdapter.setAccountData(type, content);\n }\n\n /**\n * builds the operation containing all the parts that have been added to the builder\n * @return {EncryptionSetupOperation}\n */\n public buildOperation(): EncryptionSetupOperation {\n const accountData = this.accountDataClientAdapter.values;\n return new EncryptionSetupOperation(\n accountData,\n this.crossSigningKeys,\n this.keyBackupInfo,\n this.keySignatures,\n );\n }\n\n /**\n * Stores the created keys locally.\n *\n * This does not yet store the operation in a way that it can be restored,\n * but that is the idea in the future.\n *\n * @param {Crypto} crypto\n * @return {Promise}\n */\n public async persist(crypto: Crypto): Promise {\n // store private keys in cache\n if (this.crossSigningKeys) {\n const cacheCallbacks = createCryptoStoreCacheCallbacks(crypto.cryptoStore, crypto.olmDevice);\n for (const type of [\"master\", \"self_signing\", \"user_signing\"]) {\n logger.log(`Cache ${type} cross-signing private key locally`);\n const privateKey = this.crossSigningCallbacks.privateKeys.get(type);\n await cacheCallbacks.storeCrossSigningKeyCache(type, privateKey);\n }\n // store own cross-sign pubkeys as trusted\n await crypto.cryptoStore.doTxn(\n 'readwrite', [IndexedDBCryptoStore.STORE_ACCOUNT],\n (txn) => {\n crypto.cryptoStore.storeCrossSigningKeys(\n txn, this.crossSigningKeys.keys);\n },\n );\n }\n // store session backup key in cache\n if (this.sessionBackupPrivateKey) {\n await crypto.storeSessionBackupPrivateKey(this.sessionBackupPrivateKey);\n }\n }\n}\n\n/**\n * Can be created from EncryptionSetupBuilder, or\n * (in a follow-up PR, not implemented yet) restored from storage, to retry.\n *\n * It does not have knowledge of any private keys, unlike the builder.\n */\nexport class EncryptionSetupOperation {\n /**\n * @param {Map} accountData\n * @param {Object} crossSigningKeys\n * @param {Object} keyBackupInfo\n * @param {Object} keySignatures\n */\n constructor(\n private readonly accountData: Map,\n private readonly crossSigningKeys: ICrossSigningKeys,\n private readonly keyBackupInfo: IKeyBackupInfo,\n private readonly keySignatures: KeySignatures,\n ) {}\n\n /**\n * Runs the (remaining part of, in the future) operation by sending requests to the server.\n * @param {Crypto} crypto\n */\n public async apply(crypto: Crypto): Promise {\n const baseApis = crypto.baseApis;\n // upload cross-signing keys\n if (this.crossSigningKeys) {\n const keys: Partial = {};\n for (const [name, key] of Object.entries(this.crossSigningKeys.keys)) {\n keys[name + \"_key\"] = key;\n }\n\n // We must only call `uploadDeviceSigningKeys` from inside this auth\n // helper to ensure we properly handle auth errors.\n await this.crossSigningKeys.authUpload(authDict => {\n return baseApis.uploadDeviceSigningKeys(authDict, keys as CrossSigningKeys);\n });\n\n // pass the new keys to the main instance of our own CrossSigningInfo.\n crypto.crossSigningInfo.setKeys(this.crossSigningKeys.keys);\n }\n // set account data\n if (this.accountData) {\n for (const [type, content] of this.accountData) {\n await baseApis.setAccountData(type, content);\n }\n }\n // upload first cross-signing signatures with the new key\n // (e.g. signing our own device)\n if (this.keySignatures) {\n await baseApis.uploadKeySignatures(this.keySignatures);\n }\n // need to create/update key backup info\n if (this.keyBackupInfo) {\n if (this.keyBackupInfo.version) {\n // session backup signature\n // The backup is trusted because the user provided the private key.\n // Sign the backup with the cross signing key so the key backup can\n // be trusted via cross-signing.\n await baseApis.http.authedRequest(\n undefined, \"PUT\", \"/room_keys/version/\" + this.keyBackupInfo.version,\n undefined, {\n algorithm: this.keyBackupInfo.algorithm,\n auth_data: this.keyBackupInfo.auth_data,\n },\n { prefix: PREFIX_UNSTABLE },\n );\n } else {\n // add new key backup\n await baseApis.http.authedRequest(\n undefined, \"POST\", \"/room_keys/version\",\n undefined, this.keyBackupInfo,\n { prefix: PREFIX_UNSTABLE },\n );\n }\n }\n }\n}\n\n/**\n * Catches account data set by SecretStorage during bootstrapping by\n * implementing the methods related to account data in MatrixClient\n */\nclass AccountDataClientAdapter extends EventEmitter {\n public readonly values = new Map();\n\n /**\n * @param {Object.} existingValues existing account data\n */\n constructor(private readonly existingValues: Record) {\n super();\n }\n\n /**\n * @param {String} type\n * @return {Promise} the content of the account data\n */\n public getAccountDataFromServer(type: string): Promise {\n return Promise.resolve(this.getAccountData(type));\n }\n\n /**\n * @param {String} type\n * @return {Object} the content of the account data\n */\n public getAccountData(type: string): MatrixEvent {\n const modifiedValue = this.values.get(type);\n if (modifiedValue) {\n return modifiedValue;\n }\n const existingValue = this.existingValues[type];\n if (existingValue) {\n return existingValue.getContent();\n }\n return null;\n }\n\n /**\n * @param {String} type\n * @param {Object} content\n * @return {Promise}\n */\n public setAccountData(type: string, content: any): Promise<{}> {\n const lastEvent = this.values.get(type);\n this.values.set(type, content);\n // ensure accountData is emitted on the next tick,\n // as SecretStorage listens for it while calling this method\n // and it seems to rely on this.\n return Promise.resolve().then(() => {\n const event = new MatrixEvent({ type, content });\n this.emit(\"accountData\", event, lastEvent);\n return {};\n });\n }\n}\n\n/**\n * Catches the private cross-signing keys set during bootstrapping\n * by both cache callbacks (see createCryptoStoreCacheCallbacks) as non-cache callbacks.\n * See CrossSigningInfo constructor\n */\nclass CrossSigningCallbacks implements ICryptoCallbacks, ICacheCallbacks {\n public readonly privateKeys = new Map();\n\n // cache callbacks\n public getCrossSigningKeyCache(type: string, expectedPublicKey: string): Promise {\n return this.getCrossSigningKey(type, expectedPublicKey);\n }\n\n public storeCrossSigningKeyCache(type: string, key: Uint8Array): Promise {\n this.privateKeys.set(type, key);\n return Promise.resolve();\n }\n\n // non-cache callbacks\n public getCrossSigningKey(type: string, expectedPubkey: string): Promise {\n return Promise.resolve(this.privateKeys.get(type));\n }\n\n public saveCrossSigningKeys(privateKeys: Record) {\n for (const [type, privateKey] of Object.entries(privateKeys)) {\n this.privateKeys.set(type, privateKey);\n }\n }\n}\n\n/**\n * Catches the 4S private key set during bootstrapping by implementing\n * the SecretStorage crypto callbacks\n */\nclass SSSSCryptoCallbacks {\n private readonly privateKeys = new Map();\n\n constructor(private readonly delegateCryptoCallbacks?: ICryptoCallbacks) {}\n\n public async getSecretStorageKey(\n { keys }: { keys: Record },\n name: string,\n ): Promise<[string, Uint8Array]|null> {\n for (const keyId of Object.keys(keys)) {\n const privateKey = this.privateKeys.get(keyId);\n if (privateKey) {\n return [keyId, privateKey];\n }\n }\n // if we don't have the key cached yet, ask\n // for it to the general crypto callbacks and cache it\n if (this?.delegateCryptoCallbacks?.getSecretStorageKey) {\n const result = await this.delegateCryptoCallbacks.\n getSecretStorageKey({ keys }, name);\n if (result) {\n const [keyId, privateKey] = result;\n this.privateKeys.set(keyId, privateKey);\n }\n return result;\n }\n return null;\n }\n\n public addPrivateKey(keyId: string, keyInfo: ISecretStorageKeyInfo, privKey: Uint8Array): void {\n this.privateKeys.set(keyId, privKey);\n // Also pass along to application to cache if it wishes\n this.delegateCryptoCallbacks?.cacheSecretStorageKey?.(keyId, keyInfo, privKey);\n }\n}\n", "/*\nCopyright 2016 OpenMarket Ltd\nCopyright 2017, 2019 New Vector Ltd\nCopyright 2019, 2020 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\nimport { logger } from '../logger';\nimport { IndexedDBCryptoStore } from './store/indexeddb-crypto-store';\nimport * as algorithms from './algorithms';\n\n// The maximum size of an event is 65K, and we base64 the content, so this is a\n// reasonable approximation to the biggest plaintext we can encrypt.\nconst MAX_PLAINTEXT_LENGTH = 65536 * 3 / 4;\n\nfunction checkPayloadLength(payloadString) {\n if (payloadString === undefined) {\n throw new Error(\"payloadString undefined\");\n }\n\n if (payloadString.length > MAX_PLAINTEXT_LENGTH) {\n // might as well fail early here rather than letting the olm library throw\n // a cryptic memory allocation error.\n //\n // Note that even if we manage to do the encryption, the message send may fail,\n // because by the time we've wrapped the ciphertext in the event object, it may\n // exceed 65K. But at least we won't just fail with \"abort()\" in that case.\n const err = new Error(\"Message too long (\" + payloadString.length + \" bytes). \" +\n \"The maximum for an encrypted message is \" +\n MAX_PLAINTEXT_LENGTH + \" bytes.\");\n // TODO: [TypeScript] We should have our own error types\n err.data = {\n errcode: \"M_TOO_LARGE\",\n error: \"Payload too large for encrypted message\",\n };\n throw err;\n }\n}\n\n/**\n * The type of object we use for importing and exporting megolm session data.\n *\n * @typedef {Object} module:crypto/OlmDevice.MegolmSessionData\n * @property {String} sender_key Sender's Curve25519 device key\n * @property {String[]} forwarding_curve25519_key_chain Devices which forwarded\n * this session to us (normally empty).\n * @property {Object} sender_claimed_keys Other keys the sender claims.\n * @property {String} room_id Room this session is used in\n * @property {String} session_id Unique id for the session\n * @property {String} session_key Base64'ed key data\n */\n\n/**\n * Manages the olm cryptography functions. Each OlmDevice has a single\n * OlmAccount and a number of OlmSessions.\n *\n * Accounts and sessions are kept pickled in the cryptoStore.\n *\n * @constructor\n * @alias module:crypto/OlmDevice\n *\n * @param {Object} cryptoStore A store for crypto data\n *\n * @property {string} deviceCurve25519Key Curve25519 key for the account\n * @property {string} deviceEd25519Key Ed25519 key for the account\n */\nexport function OlmDevice(cryptoStore) {\n this._cryptoStore = cryptoStore;\n this._pickleKey = \"DEFAULT_KEY\";\n\n // don't know these until we load the account from storage in init()\n this.deviceCurve25519Key = null;\n this.deviceEd25519Key = null;\n this._maxOneTimeKeys = null;\n\n // we don't bother stashing outboundgroupsessions in the cryptoStore -\n // instead we keep them here.\n this._outboundGroupSessionStore = {};\n\n // Store a set of decrypted message indexes for each group session.\n // This partially mitigates a replay attack where a MITM resends a group\n // message into the room.\n //\n // When we decrypt a message and the message index matches a previously\n // decrypted message, one possible cause of that is that we are decrypting\n // the same event, and may not indicate an actual replay attack. For\n // example, this could happen if we receive events, forget about them, and\n // then re-fetch them when we backfill. So we store the event ID and\n // timestamp corresponding to each message index when we first decrypt it,\n // and compare these against the event ID and timestamp every time we use\n // that same index. If they match, then we're probably decrypting the same\n // event and we don't consider it a replay attack.\n //\n // Keys are strings of form \"||\"\n // Values are objects of the form \"{id: , timestamp: }\"\n this._inboundGroupSessionMessageIndexes = {};\n\n // Keep track of sessions that we're starting, so that we don't start\n // multiple sessions for the same device at the same time.\n this._sessionsInProgress = {};\n\n // Used by olm to serialise prekey message decryptions\n this._olmPrekeyPromise = Promise.resolve();\n}\n\n/**\n * Initialise the OlmAccount. This must be called before any other operations\n * on the OlmDevice.\n *\n * Data from an exported Olm device can be provided\n * in order to re-create this device.\n *\n * Attempts to load the OlmAccount from the crypto store, or creates one if none is\n * found.\n *\n * Reads the device keys from the OlmAccount object.\n *\n * @param {object} opts\n * @param {object} opts.fromExportedDevice (Optional) data from exported device\n * that must be re-created.\n * If present, opts.pickleKey is ignored\n * (exported data already provides a pickle key)\n * @param {object} opts.pickleKey (Optional) pickle key to set instead of default one\n */\nOlmDevice.prototype.init = async function(opts = {}) {\n let e2eKeys;\n const account = new global.Olm.Account();\n\n const { pickleKey, fromExportedDevice } = opts;\n\n try {\n if (fromExportedDevice) {\n if (pickleKey) {\n logger.warn(\n 'ignoring opts.pickleKey'\n + ' because opts.fromExportedDevice is present.',\n );\n }\n this._pickleKey = fromExportedDevice.pickleKey;\n await _initialiseFromExportedDevice(\n fromExportedDevice,\n this._cryptoStore,\n this._pickleKey,\n account,\n );\n } else {\n if (pickleKey) {\n this._pickleKey = pickleKey;\n }\n await _initialiseAccount(\n this._cryptoStore,\n this._pickleKey,\n account,\n );\n }\n e2eKeys = JSON.parse(account.identity_keys());\n\n this._maxOneTimeKeys = account.max_number_of_one_time_keys();\n } finally {\n account.free();\n }\n\n this.deviceCurve25519Key = e2eKeys.curve25519;\n this.deviceEd25519Key = e2eKeys.ed25519;\n};\n\n/**\n * Populates the crypto store using data that was exported from an existing device.\n * Note that for now only the “account” and “sessions” stores are populated;\n * Other stores will be as with a new device.\n *\n * @param {Object} exportedData Data exported from another device\n * through the “export” method.\n * @param {module:crypto/store/base~CryptoStore} cryptoStore storage for the crypto layer\n * @param {string} pickleKey the key that was used to pickle the exported data\n * @param {Olm.Account} account an olm account to initialize\n */\nasync function _initialiseFromExportedDevice(\n exportedData,\n cryptoStore,\n pickleKey,\n account,\n) {\n await cryptoStore.doTxn(\n 'readwrite',\n [\n IndexedDBCryptoStore.STORE_ACCOUNT,\n IndexedDBCryptoStore.STORE_SESSIONS,\n ],\n (txn) => {\n cryptoStore.storeAccount(txn, exportedData.pickledAccount);\n exportedData.sessions.forEach((session) => {\n const {\n deviceKey,\n sessionId,\n } = session;\n const sessionInfo = {\n session: session.session,\n lastReceivedMessageTs: session.lastReceivedMessageTs,\n };\n cryptoStore.storeEndToEndSession(\n deviceKey,\n sessionId,\n sessionInfo,\n txn,\n );\n });\n });\n account.unpickle(pickleKey, exportedData.pickledAccount);\n}\n\nasync function _initialiseAccount(cryptoStore, pickleKey, account) {\n await cryptoStore.doTxn(\n 'readwrite',\n [IndexedDBCryptoStore.STORE_ACCOUNT],\n (txn) => {\n cryptoStore.getAccount(txn, (pickledAccount) => {\n if (pickledAccount !== null) {\n account.unpickle(pickleKey, pickledAccount);\n } else {\n account.create();\n pickledAccount = account.pickle(pickleKey);\n cryptoStore.storeAccount(txn, pickledAccount);\n }\n });\n },\n );\n}\n\n/**\n * @return {array} The version of Olm.\n */\nOlmDevice.getOlmVersion = function() {\n return global.Olm.get_library_version();\n};\n\n/**\n * extract our OlmAccount from the crypto store and call the given function\n * with the account object\n * The `account` object is useable only within the callback passed to this\n * function and will be freed as soon the callback returns. It is *not*\n * useable for the rest of the lifetime of the transaction.\n * This function requires a live transaction object from cryptoStore.doTxn()\n * and therefore may only be called in a doTxn() callback.\n *\n * @param {*} txn Opaque transaction object from cryptoStore.doTxn()\n * @param {function} func\n * @private\n */\nOlmDevice.prototype._getAccount = function(txn, func) {\n this._cryptoStore.getAccount(txn, (pickledAccount) => {\n const account = new global.Olm.Account();\n try {\n account.unpickle(this._pickleKey, pickledAccount);\n func(account);\n } finally {\n account.free();\n }\n });\n};\n\n/*\n * Saves an account to the crypto store.\n * This function requires a live transaction object from cryptoStore.doTxn()\n * and therefore may only be called in a doTxn() callback.\n *\n * @param {*} txn Opaque transaction object from cryptoStore.doTxn()\n * @param {object} Olm.Account object\n * @private\n */\nOlmDevice.prototype._storeAccount = function(txn, account) {\n this._cryptoStore.storeAccount(txn, account.pickle(this._pickleKey));\n};\n\n/**\n * Export data for re-creating the Olm device later.\n * TODO export data other than just account and (P2P) sessions.\n *\n * @return {Promise} The exported data\n*/\nOlmDevice.prototype.export = async function() {\n const result = {\n pickleKey: this._pickleKey,\n };\n await this._cryptoStore.doTxn(\n 'readonly',\n [\n IndexedDBCryptoStore.STORE_ACCOUNT,\n IndexedDBCryptoStore.STORE_SESSIONS,\n ],\n (txn) => {\n this._cryptoStore.getAccount(txn, (pickledAccount) => {\n result.pickledAccount = pickledAccount;\n });\n result.sessions = [];\n // Note that the pickledSession object we get in the callback\n // is not exactly the same thing you get in method _getSession\n // see documentation of IndexedDBCryptoStore.getAllEndToEndSessions\n this._cryptoStore.getAllEndToEndSessions(txn, (pickledSession) => {\n result.sessions.push(pickledSession);\n });\n },\n );\n return result;\n};\n\n/**\n * extract an OlmSession from the session store and call the given function\n * The session is useable only within the callback passed to this\n * function and will be freed as soon the callback returns. It is *not*\n * useable for the rest of the lifetime of the transaction.\n *\n * @param {string} deviceKey\n * @param {string} sessionId\n * @param {*} txn Opaque transaction object from cryptoStore.doTxn()\n * @param {function} func\n * @private\n */\nOlmDevice.prototype._getSession = function(deviceKey, sessionId, txn, func) {\n this._cryptoStore.getEndToEndSession(\n deviceKey, sessionId, txn, (sessionInfo) => {\n this._unpickleSession(sessionInfo, func);\n },\n );\n};\n\n/**\n * Creates a session object from a session pickle and executes the given\n * function with it. The session object is destroyed once the function\n * returns.\n *\n * @param {object} sessionInfo\n * @param {function} func\n * @private\n */\nOlmDevice.prototype._unpickleSession = function(sessionInfo, func) {\n const session = new global.Olm.Session();\n try {\n session.unpickle(this._pickleKey, sessionInfo.session);\n const unpickledSessInfo = Object.assign({}, sessionInfo, { session });\n\n func(unpickledSessInfo);\n } finally {\n session.free();\n }\n};\n\n/**\n * store our OlmSession in the session store\n *\n * @param {string} deviceKey\n * @param {object} sessionInfo {session: OlmSession, lastReceivedMessageTs: int}\n * @param {*} txn Opaque transaction object from cryptoStore.doTxn()\n * @private\n */\nOlmDevice.prototype._saveSession = function(deviceKey, sessionInfo, txn) {\n const sessionId = sessionInfo.session.session_id();\n const pickledSessionInfo = Object.assign(sessionInfo, {\n session: sessionInfo.session.pickle(this._pickleKey),\n });\n this._cryptoStore.storeEndToEndSession(\n deviceKey, sessionId, pickledSessionInfo, txn,\n );\n};\n\n/**\n * get an OlmUtility and call the given function\n *\n * @param {function} func\n * @return {object} result of func\n * @private\n */\nOlmDevice.prototype._getUtility = function(func) {\n const utility = new global.Olm.Utility();\n try {\n return func(utility);\n } finally {\n utility.free();\n }\n};\n\n/**\n * Signs a message with the ed25519 key for this account.\n *\n * @param {string} message message to be signed\n * @return {Promise} base64-encoded signature\n */\nOlmDevice.prototype.sign = async function(message) {\n let result;\n await this._cryptoStore.doTxn(\n 'readonly', [IndexedDBCryptoStore.STORE_ACCOUNT],\n (txn) => {\n this._getAccount(txn, (account) => {\n result = account.sign(message);\n },\n );\n });\n return result;\n};\n\n/**\n * Get the current (unused, unpublished) one-time keys for this account.\n *\n * @return {object} one time keys; an object with the single property\n * curve25519, which is itself an object mapping key id to Curve25519\n * key.\n */\nOlmDevice.prototype.getOneTimeKeys = async function() {\n let result;\n await this._cryptoStore.doTxn(\n 'readonly', [IndexedDBCryptoStore.STORE_ACCOUNT],\n (txn) => {\n this._getAccount(txn, (account) => {\n result = JSON.parse(account.one_time_keys());\n });\n },\n );\n\n return result;\n};\n\n/**\n * Get the maximum number of one-time keys we can store.\n *\n * @return {number} number of keys\n */\nOlmDevice.prototype.maxNumberOfOneTimeKeys = function() {\n return this._maxOneTimeKeys;\n};\n\n/**\n * Marks all of the one-time keys as published.\n */\nOlmDevice.prototype.markKeysAsPublished = async function() {\n await this._cryptoStore.doTxn(\n 'readwrite', [IndexedDBCryptoStore.STORE_ACCOUNT],\n (txn) => {\n this._getAccount(txn, (account) => {\n account.mark_keys_as_published();\n this._storeAccount(txn, account);\n });\n },\n );\n};\n\n/**\n * Generate some new one-time keys\n *\n * @param {number} numKeys number of keys to generate\n * @return {Promise} Resolved once the account is saved back having generated the keys\n */\nOlmDevice.prototype.generateOneTimeKeys = function(numKeys) {\n return this._cryptoStore.doTxn(\n 'readwrite', [IndexedDBCryptoStore.STORE_ACCOUNT],\n (txn) => {\n this._getAccount(txn, (account) => {\n account.generate_one_time_keys(numKeys);\n this._storeAccount(txn, account);\n });\n },\n );\n};\n\n/**\n * Generate a new fallback keys\n *\n * @return {Promise} Resolved once the account is saved back having generated the key\n */\nOlmDevice.prototype.generateFallbackKey = async function() {\n await this._cryptoStore.doTxn(\n 'readwrite', [IndexedDBCryptoStore.STORE_ACCOUNT],\n (txn) => {\n this._getAccount(txn, (account) => {\n account.generate_fallback_key();\n this._storeAccount(txn, account);\n });\n },\n );\n};\n\nOlmDevice.prototype.getFallbackKey = async function() {\n let result;\n await this._cryptoStore.doTxn(\n 'readonly', [IndexedDBCryptoStore.STORE_ACCOUNT],\n (txn) => {\n this._getAccount(txn, (account) => {\n result = JSON.parse(account.fallback_key());\n });\n },\n );\n return result;\n};\n\n/**\n * Generate a new outbound session\n *\n * The new session will be stored in the cryptoStore.\n *\n * @param {string} theirIdentityKey remote user's Curve25519 identity key\n * @param {string} theirOneTimeKey remote user's one-time Curve25519 key\n * @return {string} sessionId for the outbound session.\n */\nOlmDevice.prototype.createOutboundSession = async function(\n theirIdentityKey, theirOneTimeKey,\n) {\n let newSessionId;\n await this._cryptoStore.doTxn(\n 'readwrite', [\n IndexedDBCryptoStore.STORE_ACCOUNT,\n IndexedDBCryptoStore.STORE_SESSIONS,\n ],\n (txn) => {\n this._getAccount(txn, (account) => {\n const session = new global.Olm.Session();\n try {\n session.create_outbound(account, theirIdentityKey, theirOneTimeKey);\n newSessionId = session.session_id();\n this._storeAccount(txn, account);\n const sessionInfo = {\n session,\n // Pretend we've received a message at this point, otherwise\n // if we try to send a message to the device, it won't use\n // this session\n lastReceivedMessageTs: Date.now(),\n };\n this._saveSession(theirIdentityKey, sessionInfo, txn);\n } finally {\n session.free();\n }\n });\n },\n logger.withPrefix(\"[createOutboundSession]\"),\n );\n return newSessionId;\n};\n\n/**\n * Generate a new inbound session, given an incoming message\n *\n * @param {string} theirDeviceIdentityKey remote user's Curve25519 identity key\n * @param {number} messageType messageType field from the received message (must be 0)\n * @param {string} ciphertext base64-encoded body from the received message\n *\n * @return {{payload: string, session_id: string}} decrypted payload, and\n * session id of new session\n *\n * @raises {Error} if the received message was not valid (for instance, it\n * didn't use a valid one-time key).\n */\nOlmDevice.prototype.createInboundSession = async function(\n theirDeviceIdentityKey, messageType, ciphertext,\n) {\n if (messageType !== 0) {\n throw new Error(\"Need messageType == 0 to create inbound session\");\n }\n\n let result;\n await this._cryptoStore.doTxn(\n 'readwrite', [\n IndexedDBCryptoStore.STORE_ACCOUNT,\n IndexedDBCryptoStore.STORE_SESSIONS,\n ],\n (txn) => {\n this._getAccount(txn, (account) => {\n const session = new global.Olm.Session();\n try {\n session.create_inbound_from(\n account, theirDeviceIdentityKey, ciphertext,\n );\n account.remove_one_time_keys(session);\n this._storeAccount(txn, account);\n\n const payloadString = session.decrypt(messageType, ciphertext);\n\n const sessionInfo = {\n session,\n // this counts as a received message: set last received message time\n // to now\n lastReceivedMessageTs: Date.now(),\n };\n this._saveSession(theirDeviceIdentityKey, sessionInfo, txn);\n\n result = {\n payload: payloadString,\n session_id: session.session_id(),\n };\n } finally {\n session.free();\n }\n });\n },\n logger.withPrefix(\"[createInboundSession]\"),\n );\n\n return result;\n};\n\n/**\n * Get a list of known session IDs for the given device\n *\n * @param {string} theirDeviceIdentityKey Curve25519 identity key for the\n * remote device\n * @return {Promise} a list of known session ids for the device\n */\nOlmDevice.prototype.getSessionIdsForDevice = async function(theirDeviceIdentityKey) {\n const log = logger.withPrefix(\"[getSessionIdsForDevice]\");\n\n if (this._sessionsInProgress[theirDeviceIdentityKey]) {\n log.debug(`Waiting for Olm session for ${theirDeviceIdentityKey} to be created`);\n try {\n await this._sessionsInProgress[theirDeviceIdentityKey];\n } catch (e) {\n // if the session failed to be created, just fall through and\n // return an empty result\n }\n }\n let sessionIds;\n await this._cryptoStore.doTxn(\n 'readonly', [IndexedDBCryptoStore.STORE_SESSIONS],\n (txn) => {\n this._cryptoStore.getEndToEndSessions(\n theirDeviceIdentityKey, txn, (sessions) => {\n sessionIds = Object.keys(sessions);\n },\n );\n },\n log,\n );\n\n return sessionIds;\n};\n\n/**\n * Get the right olm session id for encrypting messages to the given identity key\n *\n * @param {string} theirDeviceIdentityKey Curve25519 identity key for the\n * remote device\n * @param {boolean} nowait Don't wait for an in-progress session to complete.\n * This should only be set to true of the calling function is the function\n * that marked the session as being in-progress.\n * @param {Logger} [log] A possibly customised log\n * @return {Promise} session id, or null if no established session\n */\nOlmDevice.prototype.getSessionIdForDevice = async function(\n theirDeviceIdentityKey, nowait, log,\n) {\n const sessionInfos = await this.getSessionInfoForDevice(\n theirDeviceIdentityKey, nowait, log,\n );\n\n if (sessionInfos.length === 0) {\n return null;\n }\n // Use the session that has most recently received a message\n let idxOfBest = 0;\n for (let i = 1; i < sessionInfos.length; i++) {\n const thisSessInfo = sessionInfos[i];\n const thisLastReceived = thisSessInfo.lastReceivedMessageTs === undefined ?\n 0 : thisSessInfo.lastReceivedMessageTs;\n\n const bestSessInfo = sessionInfos[idxOfBest];\n const bestLastReceived = bestSessInfo.lastReceivedMessageTs === undefined ?\n 0 : bestSessInfo.lastReceivedMessageTs;\n if (\n thisLastReceived > bestLastReceived || (\n thisLastReceived === bestLastReceived &&\n thisSessInfo.sessionId < bestSessInfo.sessionId\n )\n ) {\n idxOfBest = i;\n }\n }\n return sessionInfos[idxOfBest].sessionId;\n};\n\n/**\n * Get information on the active Olm sessions for a device.\n *

\n * Returns an array, with an entry for each active session. The first entry in\n * the result will be the one used for outgoing messages. Each entry contains\n * the keys 'hasReceivedMessage' (true if the session has received an incoming\n * message and is therefore past the pre-key stage), and 'sessionId'.\n *\n * @param {string} deviceIdentityKey Curve25519 identity key for the device\n * @param {boolean} nowait Don't wait for an in-progress session to complete.\n * This should only be set to true of the calling function is the function\n * that marked the session as being in-progress.\n * @param {Logger} [log] A possibly customised log\n * @return {Array.<{sessionId: string, hasReceivedMessage: Boolean}>}\n */\nOlmDevice.prototype.getSessionInfoForDevice = async function(\n deviceIdentityKey, nowait, log = logger,\n) {\n log = log.withPrefix(\"[getSessionInfoForDevice]\");\n\n if (this._sessionsInProgress[deviceIdentityKey] && !nowait) {\n log.debug(`Waiting for Olm session for ${deviceIdentityKey} to be created`);\n try {\n await this._sessionsInProgress[deviceIdentityKey];\n } catch (e) {\n // if the session failed to be created, then just fall through and\n // return an empty result\n }\n }\n const info = [];\n\n await this._cryptoStore.doTxn(\n 'readonly', [IndexedDBCryptoStore.STORE_SESSIONS],\n (txn) => {\n this._cryptoStore.getEndToEndSessions(deviceIdentityKey, txn, (sessions) => {\n const sessionIds = Object.keys(sessions).sort();\n for (const sessionId of sessionIds) {\n this._unpickleSession(sessions[sessionId], (sessInfo) => {\n info.push({\n lastReceivedMessageTs: sessInfo.lastReceivedMessageTs,\n hasReceivedMessage: sessInfo.session.has_received_message(),\n sessionId: sessionId,\n });\n });\n }\n });\n },\n log,\n );\n\n return info;\n};\n\n/**\n * Encrypt an outgoing message using an existing session\n *\n * @param {string} theirDeviceIdentityKey Curve25519 identity key for the\n * remote device\n * @param {string} sessionId the id of the active session\n * @param {string} payloadString payload to be encrypted and sent\n *\n * @return {Promise} ciphertext\n */\nOlmDevice.prototype.encryptMessage = async function(\n theirDeviceIdentityKey, sessionId, payloadString,\n) {\n checkPayloadLength(payloadString);\n\n let res;\n await this._cryptoStore.doTxn(\n 'readwrite', [IndexedDBCryptoStore.STORE_SESSIONS],\n (txn) => {\n this._getSession(theirDeviceIdentityKey, sessionId, txn, (sessionInfo) => {\n const sessionDesc = sessionInfo.session.describe();\n logger.log(\n \"encryptMessage: Olm Session ID \" + sessionId + \" to \" +\n theirDeviceIdentityKey + \": \" + sessionDesc,\n );\n res = sessionInfo.session.encrypt(payloadString);\n this._saveSession(theirDeviceIdentityKey, sessionInfo, txn);\n });\n },\n logger.withPrefix(\"[encryptMessage]\"),\n );\n return res;\n};\n\n/**\n * Decrypt an incoming message using an existing session\n *\n * @param {string} theirDeviceIdentityKey Curve25519 identity key for the\n * remote device\n * @param {string} sessionId the id of the active session\n * @param {number} messageType messageType field from the received message\n * @param {string} ciphertext base64-encoded body from the received message\n *\n * @return {Promise} decrypted payload.\n */\nOlmDevice.prototype.decryptMessage = async function(\n theirDeviceIdentityKey, sessionId, messageType, ciphertext,\n) {\n let payloadString;\n await this._cryptoStore.doTxn(\n 'readwrite', [IndexedDBCryptoStore.STORE_SESSIONS],\n (txn) => {\n this._getSession(theirDeviceIdentityKey, sessionId, txn, (sessionInfo) => {\n const sessionDesc = sessionInfo.session.describe();\n logger.log(\n \"decryptMessage: Olm Session ID \" + sessionId + \" from \" +\n theirDeviceIdentityKey + \": \" + sessionDesc,\n );\n payloadString = sessionInfo.session.decrypt(messageType, ciphertext);\n sessionInfo.lastReceivedMessageTs = Date.now();\n this._saveSession(theirDeviceIdentityKey, sessionInfo, txn);\n });\n },\n logger.withPrefix(\"[decryptMessage]\"),\n );\n return payloadString;\n};\n\n/**\n * Determine if an incoming messages is a prekey message matching an existing session\n *\n * @param {string} theirDeviceIdentityKey Curve25519 identity key for the\n * remote device\n * @param {string} sessionId the id of the active session\n * @param {number} messageType messageType field from the received message\n * @param {string} ciphertext base64-encoded body from the received message\n *\n * @return {Promise} true if the received message is a prekey message which matches\n * the given session.\n */\nOlmDevice.prototype.matchesSession = async function(\n theirDeviceIdentityKey, sessionId, messageType, ciphertext,\n) {\n if (messageType !== 0) {\n return false;\n }\n\n let matches;\n await this._cryptoStore.doTxn(\n 'readonly', [IndexedDBCryptoStore.STORE_SESSIONS],\n (txn) => {\n this._getSession(theirDeviceIdentityKey, sessionId, txn, (sessionInfo) => {\n matches = sessionInfo.session.matches_inbound(ciphertext);\n });\n },\n logger.withPrefix(\"[matchesSession]\"),\n );\n return matches;\n};\n\nOlmDevice.prototype.recordSessionProblem = async function(deviceKey, type, fixed) {\n await this._cryptoStore.storeEndToEndSessionProblem(deviceKey, type, fixed);\n};\n\nOlmDevice.prototype.sessionMayHaveProblems = async function(deviceKey, timestamp) {\n return await this._cryptoStore.getEndToEndSessionProblem(deviceKey, timestamp);\n};\n\nOlmDevice.prototype.filterOutNotifiedErrorDevices = async function(devices) {\n return await this._cryptoStore.filterOutNotifiedErrorDevices(devices);\n};\n\n// Outbound group session\n// ======================\n\n/**\n * store an OutboundGroupSession in _outboundGroupSessionStore\n *\n * @param {Olm.OutboundGroupSession} session\n * @private\n */\nOlmDevice.prototype._saveOutboundGroupSession = function(session) {\n const pickledSession = session.pickle(this._pickleKey);\n this._outboundGroupSessionStore[session.session_id()] = pickledSession;\n};\n\n/**\n * extract an OutboundGroupSession from _outboundGroupSessionStore and call the\n * given function\n *\n * @param {string} sessionId\n * @param {function} func\n * @return {object} result of func\n * @private\n */\nOlmDevice.prototype._getOutboundGroupSession = function(sessionId, func) {\n const pickled = this._outboundGroupSessionStore[sessionId];\n if (pickled === undefined) {\n throw new Error(\"Unknown outbound group session \" + sessionId);\n }\n\n const session = new global.Olm.OutboundGroupSession();\n try {\n session.unpickle(this._pickleKey, pickled);\n return func(session);\n } finally {\n session.free();\n }\n};\n\n/**\n * Generate a new outbound group session\n *\n * @return {string} sessionId for the outbound session.\n */\nOlmDevice.prototype.createOutboundGroupSession = function() {\n const session = new global.Olm.OutboundGroupSession();\n try {\n session.create();\n this._saveOutboundGroupSession(session);\n return session.session_id();\n } finally {\n session.free();\n }\n};\n\n/**\n * Encrypt an outgoing message with an outbound group session\n *\n * @param {string} sessionId the id of the outboundgroupsession\n * @param {string} payloadString payload to be encrypted and sent\n *\n * @return {string} ciphertext\n */\nOlmDevice.prototype.encryptGroupMessage = function(sessionId, payloadString) {\n const self = this;\n\n logger.log(`encrypting msg with megolm session ${sessionId}`);\n\n checkPayloadLength(payloadString);\n\n return this._getOutboundGroupSession(sessionId, function(session) {\n const res = session.encrypt(payloadString);\n self._saveOutboundGroupSession(session);\n return res;\n });\n};\n\n/**\n * Get the session keys for an outbound group session\n *\n * @param {string} sessionId the id of the outbound group session\n *\n * @return {{chain_index: number, key: string}} current chain index, and\n * base64-encoded secret key.\n */\nOlmDevice.prototype.getOutboundGroupSessionKey = function(sessionId) {\n return this._getOutboundGroupSession(sessionId, function(session) {\n return {\n chain_index: session.message_index(),\n key: session.session_key(),\n };\n });\n};\n\n// Inbound group session\n// =====================\n\n/**\n * data stored in the session store about an inbound group session\n *\n * @typedef {Object} InboundGroupSessionData\n * @property {string} room_id\n * @property {string} session pickled Olm.InboundGroupSession\n * @property {Object} keysClaimed\n * @property {Array} forwardingCurve25519KeyChain Devices involved in forwarding\n * this session to us (normally empty).\n */\n\n/**\n * Unpickle a session from a sessionData object and invoke the given function.\n * The session is valid only until func returns.\n *\n * @param {Object} sessionData Object describing the session.\n * @param {function(Olm.InboundGroupSession)} func Invoked with the unpickled session\n * @return {*} result of func\n */\nOlmDevice.prototype._unpickleInboundGroupSession = function(sessionData, func) {\n const session = new global.Olm.InboundGroupSession();\n try {\n session.unpickle(this._pickleKey, sessionData.session);\n return func(session);\n } finally {\n session.free();\n }\n};\n\n/**\n * extract an InboundGroupSession from the crypto store and call the given function\n *\n * @param {string} roomId The room ID to extract the session for, or null to fetch\n * sessions for any room.\n * @param {string} senderKey\n * @param {string} sessionId\n * @param {*} txn Opaque transaction object from cryptoStore.doTxn()\n * @param {function(Olm.InboundGroupSession, InboundGroupSessionData)} func\n * function to call.\n *\n * @private\n */\nOlmDevice.prototype._getInboundGroupSession = function(\n roomId, senderKey, sessionId, txn, func,\n) {\n this._cryptoStore.getEndToEndInboundGroupSession(\n senderKey, sessionId, txn, (sessionData, withheld) => {\n if (sessionData === null) {\n func(null, null, withheld);\n return;\n }\n\n // if we were given a room ID, check that the it matches the original one for the session. This stops\n // the HS pretending a message was targeting a different room.\n if (roomId !== null && roomId !== sessionData.room_id) {\n throw new Error(\n \"Mismatched room_id for inbound group session (expected \" +\n sessionData.room_id + \", was \" + roomId + \")\",\n );\n }\n\n this._unpickleInboundGroupSession(sessionData, (session) => {\n func(session, sessionData, withheld);\n });\n },\n );\n};\n\n/**\n * Add an inbound group session to the session store\n *\n * @param {string} roomId room in which this session will be used\n * @param {string} senderKey base64-encoded curve25519 key of the sender\n * @param {Array} forwardingCurve25519KeyChain Devices involved in forwarding\n * this session to us.\n * @param {string} sessionId session identifier\n * @param {string} sessionKey base64-encoded secret key\n * @param {Object} keysClaimed Other keys the sender claims.\n * @param {boolean} exportFormat true if the megolm keys are in export format\n * (ie, they lack an ed25519 signature)\n * @param {Object} [extraSessionData={}] any other data to be include with the session\n */\nOlmDevice.prototype.addInboundGroupSession = async function(\n roomId, senderKey, forwardingCurve25519KeyChain,\n sessionId, sessionKey, keysClaimed,\n exportFormat, extraSessionData = {},\n) {\n await this._cryptoStore.doTxn(\n 'readwrite', [\n IndexedDBCryptoStore.STORE_INBOUND_GROUP_SESSIONS,\n IndexedDBCryptoStore.STORE_INBOUND_GROUP_SESSIONS_WITHHELD,\n IndexedDBCryptoStore.STORE_SHARED_HISTORY_INBOUND_GROUP_SESSIONS,\n ], (txn) => {\n /* if we already have this session, consider updating it */\n this._getInboundGroupSession(\n roomId, senderKey, sessionId, txn,\n (existingSession, existingSessionData) => {\n // new session.\n const session = new global.Olm.InboundGroupSession();\n try {\n if (exportFormat) {\n session.import_session(sessionKey);\n } else {\n session.create(sessionKey);\n }\n if (sessionId != session.session_id()) {\n throw new Error(\n \"Mismatched group session ID from senderKey: \" +\n senderKey,\n );\n }\n\n if (existingSession) {\n logger.log(\n \"Update for megolm session \"\n + senderKey + \"/\" + sessionId,\n );\n if (existingSession.first_known_index()\n <= session.first_known_index()\n && !(existingSession.first_known_index() == session.first_known_index()\n && !extraSessionData.untrusted\n && existingSessionData.untrusted)) {\n // existing session has lower index (i.e. can\n // decrypt more), or they have the same index and\n // the new sessions trust does not win over the old\n // sessions trust, so keep it\n logger.log(\n `Keeping existing megolm session ${sessionId}`,\n );\n return;\n }\n }\n\n logger.info(\n \"Storing megolm session \" + senderKey + \"/\" + sessionId +\n \" with first index \" + session.first_known_index(),\n );\n\n const sessionData = Object.assign({}, extraSessionData, {\n room_id: roomId,\n session: session.pickle(this._pickleKey),\n keysClaimed: keysClaimed,\n forwardingCurve25519KeyChain: forwardingCurve25519KeyChain,\n });\n\n this._cryptoStore.storeEndToEndInboundGroupSession(\n senderKey, sessionId, sessionData, txn,\n );\n\n if (!existingSession && extraSessionData.sharedHistory) {\n this._cryptoStore.addSharedHistoryInboundGroupSession(\n roomId, senderKey, sessionId, txn,\n );\n }\n } finally {\n session.free();\n }\n },\n );\n },\n logger.withPrefix(\"[addInboundGroupSession]\"),\n );\n};\n\n/**\n * Record in the data store why an inbound group session was withheld.\n *\n * @param {string} roomId room that the session belongs to\n * @param {string} senderKey base64-encoded curve25519 key of the sender\n * @param {string} sessionId session identifier\n * @param {string} code reason code\n * @param {string} reason human-readable version of `code`\n */\nOlmDevice.prototype.addInboundGroupSessionWithheld = async function(\n roomId, senderKey, sessionId, code, reason,\n) {\n await this._cryptoStore.doTxn(\n 'readwrite', [IndexedDBCryptoStore.STORE_INBOUND_GROUP_SESSIONS_WITHHELD],\n (txn) => {\n this._cryptoStore.storeEndToEndInboundGroupSessionWithheld(\n senderKey, sessionId,\n {\n room_id: roomId,\n code: code,\n reason: reason,\n },\n txn,\n );\n },\n );\n};\n\nexport const WITHHELD_MESSAGES = {\n \"m.unverified\": \"The sender has disabled encrypting to unverified devices.\",\n \"m.blacklisted\": \"The sender has blocked you.\",\n \"m.unauthorised\": \"You are not authorised to read the message.\",\n \"m.no_olm\": \"Unable to establish a secure channel.\",\n};\n\n/**\n * Calculate the message to use for the exception when a session key is withheld.\n *\n * @param {object} withheld An object that describes why the key was withheld.\n *\n * @return {string} the message\n *\n * @private\n */\nfunction _calculateWithheldMessage(withheld) {\n if (withheld.code && withheld.code in WITHHELD_MESSAGES) {\n return WITHHELD_MESSAGES[withheld.code];\n } else if (withheld.reason) {\n return withheld.reason;\n } else {\n return \"decryption key withheld\";\n }\n}\n\n/**\n * Decrypt a received message with an inbound group session\n *\n * @param {string} roomId room in which the message was received\n * @param {string} senderKey base64-encoded curve25519 key of the sender\n * @param {string} sessionId session identifier\n * @param {string} body base64-encoded body of the encrypted message\n * @param {string} eventId ID of the event being decrypted\n * @param {Number} timestamp timestamp of the event being decrypted\n *\n * @return {null} the sessionId is unknown\n *\n * @return {Promise<{result: string, senderKey: string,\n * forwardingCurve25519KeyChain: Array,\n * keysClaimed: Object}>}\n */\nOlmDevice.prototype.decryptGroupMessage = async function(\n roomId, senderKey, sessionId, body, eventId, timestamp,\n) {\n let result;\n // when the localstorage crypto store is used as an indexeddb backend,\n // exceptions thrown from within the inner function are not passed through\n // to the top level, so we store exceptions in a variable and raise them at\n // the end\n let error;\n\n await this._cryptoStore.doTxn(\n 'readwrite', [\n IndexedDBCryptoStore.STORE_INBOUND_GROUP_SESSIONS,\n IndexedDBCryptoStore.STORE_INBOUND_GROUP_SESSIONS_WITHHELD,\n ], (txn) => {\n this._getInboundGroupSession(\n roomId, senderKey, sessionId, txn, (session, sessionData, withheld) => {\n if (session === null) {\n if (withheld) {\n error = new algorithms.DecryptionError(\n \"MEGOLM_UNKNOWN_INBOUND_SESSION_ID\",\n _calculateWithheldMessage(withheld),\n {\n session: senderKey + '|' + sessionId,\n },\n );\n }\n result = null;\n return;\n }\n let res;\n try {\n res = session.decrypt(body);\n } catch (e) {\n if (e && e.message === 'OLM.UNKNOWN_MESSAGE_INDEX' && withheld) {\n error = new algorithms.DecryptionError(\n \"MEGOLM_UNKNOWN_INBOUND_SESSION_ID\",\n _calculateWithheldMessage(withheld),\n {\n session: senderKey + '|' + sessionId,\n },\n );\n } else {\n error = e;\n }\n return;\n }\n\n let plaintext = res.plaintext;\n if (plaintext === undefined) {\n // Compatibility for older olm versions.\n plaintext = res;\n } else {\n // Check if we have seen this message index before to detect replay attacks.\n // If the event ID and timestamp are specified, and the match the event ID\n // and timestamp from the last time we used this message index, then we\n // don't consider it a replay attack.\n const messageIndexKey = (\n senderKey + \"|\" + sessionId + \"|\" + res.message_index\n );\n if (messageIndexKey in this._inboundGroupSessionMessageIndexes) {\n const msgInfo = (\n this._inboundGroupSessionMessageIndexes[messageIndexKey]\n );\n if (\n msgInfo.id !== eventId ||\n msgInfo.timestamp !== timestamp\n ) {\n error = new Error(\n \"Duplicate message index, possible replay attack: \" +\n messageIndexKey,\n );\n return;\n }\n }\n this._inboundGroupSessionMessageIndexes[messageIndexKey] = {\n id: eventId,\n timestamp: timestamp,\n };\n }\n\n sessionData.session = session.pickle(this._pickleKey);\n this._cryptoStore.storeEndToEndInboundGroupSession(\n senderKey, sessionId, sessionData, txn,\n );\n result = {\n result: plaintext,\n keysClaimed: sessionData.keysClaimed || {},\n senderKey: senderKey,\n forwardingCurve25519KeyChain: (\n sessionData.forwardingCurve25519KeyChain || []\n ),\n untrusted: sessionData.untrusted,\n };\n },\n );\n },\n logger.withPrefix(\"[decryptGroupMessage]\"),\n );\n\n if (error) {\n throw error;\n }\n return result;\n};\n\n/**\n * Determine if we have the keys for a given megolm session\n *\n * @param {string} roomId room in which the message was received\n * @param {string} senderKey base64-encoded curve25519 key of the sender\n * @param {string} sessionId session identifier\n *\n * @returns {Promise} true if we have the keys to this session\n */\nOlmDevice.prototype.hasInboundSessionKeys = async function(roomId, senderKey, sessionId) {\n let result;\n await this._cryptoStore.doTxn(\n 'readonly', [\n IndexedDBCryptoStore.STORE_INBOUND_GROUP_SESSIONS,\n IndexedDBCryptoStore.STORE_INBOUND_GROUP_SESSIONS_WITHHELD,\n ], (txn) => {\n this._cryptoStore.getEndToEndInboundGroupSession(\n senderKey, sessionId, txn, (sessionData) => {\n if (sessionData === null) {\n result = false;\n return;\n }\n\n if (roomId !== sessionData.room_id) {\n logger.warn(\n `requested keys for inbound group session ${senderKey}|` +\n `${sessionId}, with incorrect room_id ` +\n `(expected ${sessionData.room_id}, ` +\n `was ${roomId})`,\n );\n result = false;\n } else {\n result = true;\n }\n },\n );\n },\n logger.withPrefix(\"[hasInboundSessionKeys]\"),\n );\n\n return result;\n};\n\n/**\n * Extract the keys to a given megolm session, for sharing\n *\n * @param {string} roomId room in which the message was received\n * @param {string} senderKey base64-encoded curve25519 key of the sender\n * @param {string} sessionId session identifier\n * @param {integer} chainIndex The chain index at which to export the session.\n * If omitted, export at the first index we know about.\n *\n * @returns {Promise<{chain_index: number, key: string,\n * forwarding_curve25519_key_chain: Array,\n * sender_claimed_ed25519_key: string\n * }>}\n * details of the session key. The key is a base64-encoded megolm key in\n * export format.\n *\n * @throws Error If the given chain index could not be obtained from the known\n * index (ie. the given chain index is before the first we have).\n */\nOlmDevice.prototype.getInboundGroupSessionKey = async function(\n roomId, senderKey, sessionId, chainIndex,\n) {\n let result;\n await this._cryptoStore.doTxn(\n 'readonly', [\n IndexedDBCryptoStore.STORE_INBOUND_GROUP_SESSIONS,\n IndexedDBCryptoStore.STORE_INBOUND_GROUP_SESSIONS_WITHHELD,\n ], (txn) => {\n this._getInboundGroupSession(\n roomId, senderKey, sessionId, txn, (session, sessionData) => {\n if (session === null) {\n result = null;\n return;\n }\n\n if (chainIndex === undefined) {\n chainIndex = session.first_known_index();\n }\n\n const exportedSession = session.export_session(chainIndex);\n\n const claimedKeys = sessionData.keysClaimed || {};\n const senderEd25519Key = claimedKeys.ed25519 || null;\n\n result = {\n \"chain_index\": chainIndex,\n \"key\": exportedSession,\n \"forwarding_curve25519_key_chain\":\n sessionData.forwardingCurve25519KeyChain || [],\n \"sender_claimed_ed25519_key\": senderEd25519Key,\n \"shared_history\": sessionData.sharedHistory || false,\n };\n },\n );\n },\n logger.withPrefix(\"[getInboundGroupSessionKey]\"),\n );\n\n return result;\n};\n\n/**\n * Export an inbound group session\n *\n * @param {string} senderKey base64-encoded curve25519 key of the sender\n * @param {string} sessionId session identifier\n * @param {string} sessionData The session object from the store\n * @return {module:crypto/OlmDevice.MegolmSessionData} exported session data\n */\nOlmDevice.prototype.exportInboundGroupSession = function(\n senderKey, sessionId, sessionData,\n) {\n return this._unpickleInboundGroupSession(sessionData, (session) => {\n const messageIndex = session.first_known_index();\n\n return {\n \"sender_key\": senderKey,\n \"sender_claimed_keys\": sessionData.keysClaimed,\n \"room_id\": sessionData.room_id,\n \"session_id\": sessionId,\n \"session_key\": session.export_session(messageIndex),\n \"forwarding_curve25519_key_chain\": session.forwardingCurve25519KeyChain || [],\n \"first_known_index\": session.first_known_index(),\n \"org.matrix.msc3061.shared_history\": sessionData.sharedHistory || false,\n };\n });\n};\n\nOlmDevice.prototype.getSharedHistoryInboundGroupSessions = async function(roomId) {\n let result;\n await this._cryptoStore.doTxn(\n 'readonly', [\n IndexedDBCryptoStore.STORE_SHARED_HISTORY_INBOUND_GROUP_SESSIONS,\n ], (txn) => {\n result = this._cryptoStore.getSharedHistoryInboundGroupSessions(roomId, txn);\n },\n logger.withPrefix(\"[getSharedHistoryInboundGroupSessionsForRoom]\"),\n );\n return result;\n};\n\n// Utilities\n// =========\n\n/**\n * Verify an ed25519 signature.\n *\n * @param {string} key ed25519 key\n * @param {string} message message which was signed\n * @param {string} signature base64-encoded signature to be checked\n *\n * @raises {Error} if there is a problem with the verification. If the key was\n * too small then the message will be \"OLM.INVALID_BASE64\". If the signature\n * was invalid then the message will be \"OLM.BAD_MESSAGE_MAC\".\n */\nOlmDevice.prototype.verifySignature = function(\n key, message, signature,\n) {\n this._getUtility(function(util) {\n util.ed25519_verify(key, message, signature);\n });\n};\n", "/*\nCopyright 2017 - 2021 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\nimport { logger } from '../logger';\nimport { MatrixClient } from \"../client\";\nimport { IRoomKeyRequestBody, IRoomKeyRequestRecipient } from \"./index\";\nimport { CryptoStore, OutgoingRoomKeyRequest } from './store/base';\nimport { EventType } from \"../@types/event\";\n\n/**\n * Internal module. Management of outgoing room key requests.\n *\n * See https://docs.google.com/document/d/1m4gQkcnJkxNuBmb5NoFCIadIY-DyqqNAS3lloE73BlQ\n * for draft documentation on what we're supposed to be implementing here.\n *\n * @module\n */\n\n// delay between deciding we want some keys, and sending out the request, to\n// allow for (a) it turning up anyway, (b) grouping requests together\nconst SEND_KEY_REQUESTS_DELAY_MS = 500;\n\n/** possible states for a room key request\n *\n * The state machine looks like:\n *\n * | (cancellation sent)\n * | .-------------------------------------------------.\n * | | |\n * V V (cancellation requested) |\n * UNSENT -----------------------------+ |\n * | | |\n * | | |\n * | (send successful) | CANCELLATION_PENDING_AND_WILL_RESEND\n * V | Λ\n * SENT | |\n * |-------------------------------- | --------------'\n * | | (cancellation requested with intent\n * | | to resend the original request)\n * | |\n * | (cancellation requested) |\n * V |\n * CANCELLATION_PENDING |\n * | |\n * | (cancellation sent) |\n * V |\n * (deleted) <---------------------------+\n *\n * @enum {number}\n */\nexport enum RoomKeyRequestState {\n /** request not yet sent */\n Unsent,\n /** request sent, awaiting reply */\n Sent,\n /** reply received, cancellation not yet sent */\n CancellationPending,\n /**\n * Cancellation not yet sent and will transition to UNSENT instead of\n * being deleted once the cancellation has been sent.\n */\n CancellationPendingAndWillResend,\n}\n\nexport class OutgoingRoomKeyRequestManager {\n // handle for the delayed call to sendOutgoingRoomKeyRequests. Non-null\n // if the callback has been set, or if it is still running.\n private sendOutgoingRoomKeyRequestsTimer: number = null;\n\n // sanity check to ensure that we don't end up with two concurrent runs\n // of sendOutgoingRoomKeyRequests\n private sendOutgoingRoomKeyRequestsRunning = false;\n\n private clientRunning = false;\n\n constructor(\n private readonly baseApis: MatrixClient,\n private readonly deviceId: string,\n private readonly cryptoStore: CryptoStore,\n ) {}\n\n /**\n * Called when the client is started. Sets background processes running.\n */\n public start(): void {\n this.clientRunning = true;\n }\n\n /**\n * Called when the client is stopped. Stops any running background processes.\n */\n public stop(): void {\n logger.log('stopping OutgoingRoomKeyRequestManager');\n // stop the timer on the next run\n this.clientRunning = false;\n }\n\n /**\n * Send any requests that have been queued\n */\n public sendQueuedRequests(): void {\n this.startTimer();\n }\n\n /**\n * Queue up a room key request, if we haven't already queued or sent one.\n *\n * The `requestBody` is compared (with a deep-equality check) against\n * previous queued or sent requests and if it matches, no change is made.\n * Otherwise, a request is added to the pending list, and a job is started\n * in the background to send it.\n *\n * @param {module:crypto~RoomKeyRequestBody} requestBody\n * @param {Array<{userId: string, deviceId: string}>} recipients\n * @param {boolean} resend whether to resend the key request if there is\n * already one\n *\n * @returns {Promise} resolves when the request has been added to the\n * pending list (or we have established that a similar request already\n * exists)\n */\n public async queueRoomKeyRequest(\n requestBody: IRoomKeyRequestBody,\n recipients: IRoomKeyRequestRecipient[],\n resend = false,\n ): Promise {\n const req = await this.cryptoStore.getOutgoingRoomKeyRequest(requestBody);\n if (!req) {\n await this.cryptoStore.getOrAddOutgoingRoomKeyRequest({\n requestBody: requestBody,\n recipients: recipients,\n requestId: this.baseApis.makeTxnId(),\n state: RoomKeyRequestState.Unsent,\n });\n } else {\n switch (req.state) {\n case RoomKeyRequestState.CancellationPendingAndWillResend:\n case RoomKeyRequestState.Unsent:\n // nothing to do here, since we're going to send a request anyways\n return;\n\n case RoomKeyRequestState.CancellationPending: {\n // existing request is about to be cancelled. If we want to\n // resend, then change the state so that it resends after\n // cancelling. Otherwise, just cancel the cancellation.\n const state = resend ?\n RoomKeyRequestState.CancellationPendingAndWillResend :\n RoomKeyRequestState.Sent;\n await this.cryptoStore.updateOutgoingRoomKeyRequest(\n req.requestId, RoomKeyRequestState.CancellationPending, {\n state,\n cancellationTxnId: this.baseApis.makeTxnId(),\n },\n );\n break;\n }\n case RoomKeyRequestState.Sent: {\n // a request has already been sent. If we don't want to\n // resend, then do nothing. If we do want to, then cancel the\n // existing request and send a new one.\n if (resend) {\n const state =\n RoomKeyRequestState.CancellationPendingAndWillResend;\n const updatedReq =\n await this.cryptoStore.updateOutgoingRoomKeyRequest(\n req.requestId, RoomKeyRequestState.Sent, {\n state,\n cancellationTxnId: this.baseApis.makeTxnId(),\n // need to use a new transaction ID so that\n // the request gets sent\n requestTxnId: this.baseApis.makeTxnId(),\n },\n );\n if (!updatedReq) {\n // updateOutgoingRoomKeyRequest couldn't find the request\n // in state ROOM_KEY_REQUEST_STATES.SENT, so we must have\n // raced with another tab to mark the request cancelled.\n // Try again, to make sure the request is resent.\n return await this.queueRoomKeyRequest(\n requestBody, recipients, resend,\n );\n }\n\n // We don't want to wait for the timer, so we send it\n // immediately. (We might actually end up racing with the timer,\n // but that's ok: even if we make the request twice, we'll do it\n // with the same transaction_id, so only one message will get\n // sent).\n //\n // (We also don't want to wait for the response from the server\n // here, as it will slow down processing of received keys if we\n // do.)\n try {\n await this.sendOutgoingRoomKeyRequestCancellation(\n updatedReq,\n true,\n );\n } catch (e) {\n logger.error(\n \"Error sending room key request cancellation;\"\n + \" will retry later.\", e,\n );\n }\n // The request has transitioned from\n // CANCELLATION_PENDING_AND_WILL_RESEND to UNSENT. We\n // still need to resend the request which is now UNSENT, so\n // start the timer if it isn't already started.\n }\n break;\n }\n default:\n throw new Error('unhandled state: ' + req.state);\n }\n }\n }\n\n /**\n * Cancel room key requests, if any match the given requestBody\n *\n * @param {module:crypto~RoomKeyRequestBody} requestBody\n *\n * @returns {Promise} resolves when the request has been updated in our\n * pending list.\n */\n public cancelRoomKeyRequest(requestBody: IRoomKeyRequestBody): Promise {\n return this.cryptoStore.getOutgoingRoomKeyRequest(\n requestBody,\n ).then((req): unknown => {\n if (!req) {\n // no request was made for this key\n return;\n }\n switch (req.state) {\n case RoomKeyRequestState.CancellationPending:\n case RoomKeyRequestState.CancellationPendingAndWillResend:\n // nothing to do here\n return;\n\n case RoomKeyRequestState.Unsent:\n // just delete it\n\n // FIXME: ghahah we may have attempted to send it, and\n // not yet got a successful response. So the server\n // may have seen it, so we still need to send a cancellation\n // in that case :/\n\n logger.log(\n 'deleting unnecessary room key request for ' +\n stringifyRequestBody(requestBody),\n );\n return this.cryptoStore.deleteOutgoingRoomKeyRequest(req.requestId, RoomKeyRequestState.Unsent);\n\n case RoomKeyRequestState.Sent: {\n // send a cancellation.\n return this.cryptoStore.updateOutgoingRoomKeyRequest(\n req.requestId, RoomKeyRequestState.Sent, {\n state: RoomKeyRequestState.CancellationPending,\n cancellationTxnId: this.baseApis.makeTxnId(),\n },\n ).then((updatedReq) => {\n if (!updatedReq) {\n // updateOutgoingRoomKeyRequest couldn't find the\n // request in state ROOM_KEY_REQUEST_STATES.SENT,\n // so we must have raced with another tab to mark\n // the request cancelled. There is no point in\n // sending another cancellation since the other tab\n // will do it.\n logger.log(\n 'Tried to cancel room key request for ' +\n stringifyRequestBody(requestBody) +\n ' but it was already cancelled in another tab',\n );\n return;\n }\n\n // We don't want to wait for the timer, so we send it\n // immediately. (We might actually end up racing with the timer,\n // but that's ok: even if we make the request twice, we'll do it\n // with the same transaction_id, so only one message will get\n // sent).\n //\n // (We also don't want to wait for the response from the server\n // here, as it will slow down processing of received keys if we\n // do.)\n this.sendOutgoingRoomKeyRequestCancellation(\n updatedReq,\n ).catch((e) => {\n logger.error(\n \"Error sending room key request cancellation;\"\n + \" will retry later.\", e,\n );\n this.startTimer();\n });\n });\n }\n default:\n throw new Error('unhandled state: ' + req.state);\n }\n });\n }\n\n /**\n * Look for room key requests by target device and state\n *\n * @param {string} userId Target user ID\n * @param {string} deviceId Target device ID\n *\n * @return {Promise} resolves to a list of all the\n * {@link module:crypto/store/base~OutgoingRoomKeyRequest}\n */\n public getOutgoingSentRoomKeyRequest(userId: string, deviceId: string): Promise {\n return this.cryptoStore.getOutgoingRoomKeyRequestsByTarget(userId, deviceId, [RoomKeyRequestState.Sent]);\n }\n\n /**\n * Find anything in `sent` state, and kick it around the loop again.\n * This is intended for situations where something substantial has changed, and we\n * don't really expect the other end to even care about the cancellation.\n * For example, after initialization or self-verification.\n * @return {Promise} An array of `queueRoomKeyRequest` outputs.\n */\n public async cancelAndResendAllOutgoingRequests(): Promise {\n const outgoings = await this.cryptoStore.getAllOutgoingRoomKeyRequestsByState(RoomKeyRequestState.Sent);\n return Promise.all(outgoings.map(({ requestBody, recipients }) =>\n this.queueRoomKeyRequest(requestBody, recipients, true)));\n }\n\n // start the background timer to send queued requests, if the timer isn't\n // already running\n private startTimer(): void {\n if (this.sendOutgoingRoomKeyRequestsTimer) {\n return;\n }\n\n const startSendingOutgoingRoomKeyRequests = () => {\n if (this.sendOutgoingRoomKeyRequestsRunning) {\n throw new Error(\"RoomKeyRequestSend already in progress!\");\n }\n this.sendOutgoingRoomKeyRequestsRunning = true;\n\n this.sendOutgoingRoomKeyRequests().finally(() => {\n this.sendOutgoingRoomKeyRequestsRunning = false;\n }).catch((e) => {\n // this should only happen if there is an indexeddb error,\n // in which case we're a bit stuffed anyway.\n logger.warn(\n `error in OutgoingRoomKeyRequestManager: ${e}`,\n );\n });\n };\n\n this.sendOutgoingRoomKeyRequestsTimer = setTimeout(\n startSendingOutgoingRoomKeyRequests,\n SEND_KEY_REQUESTS_DELAY_MS,\n );\n }\n\n // look for and send any queued requests. Runs itself recursively until\n // there are no more requests, or there is an error (in which case, the\n // timer will be restarted before the promise resolves).\n private sendOutgoingRoomKeyRequests(): Promise {\n if (!this.clientRunning) {\n this.sendOutgoingRoomKeyRequestsTimer = null;\n return Promise.resolve();\n }\n\n return this.cryptoStore.getOutgoingRoomKeyRequestByState([\n RoomKeyRequestState.CancellationPending,\n RoomKeyRequestState.CancellationPendingAndWillResend,\n RoomKeyRequestState.Unsent,\n ]).then((req: OutgoingRoomKeyRequest) => {\n if (!req) {\n this.sendOutgoingRoomKeyRequestsTimer = null;\n return;\n }\n\n let prom;\n switch (req.state) {\n case RoomKeyRequestState.Unsent:\n prom = this.sendOutgoingRoomKeyRequest(req);\n break;\n case RoomKeyRequestState.CancellationPending:\n prom = this.sendOutgoingRoomKeyRequestCancellation(req);\n break;\n case RoomKeyRequestState.CancellationPendingAndWillResend:\n prom = this.sendOutgoingRoomKeyRequestCancellation(req, true);\n break;\n }\n\n return prom.then(() => {\n // go around the loop again\n return this.sendOutgoingRoomKeyRequests();\n }).catch((e) => {\n logger.error(\"Error sending room key request; will retry later.\", e);\n this.sendOutgoingRoomKeyRequestsTimer = null;\n });\n });\n }\n\n // given a RoomKeyRequest, send it and update the request record\n private sendOutgoingRoomKeyRequest(req: OutgoingRoomKeyRequest): Promise {\n logger.log(\n `Requesting keys for ${stringifyRequestBody(req.requestBody)}` +\n ` from ${stringifyRecipientList(req.recipients)}` +\n `(id ${req.requestId})`,\n );\n\n const requestMessage = {\n action: \"request\",\n requesting_device_id: this.deviceId,\n request_id: req.requestId,\n body: req.requestBody,\n };\n\n return this.sendMessageToDevices(\n requestMessage, req.recipients, req.requestTxnId || req.requestId,\n ).then(() => {\n return this.cryptoStore.updateOutgoingRoomKeyRequest(\n req.requestId, RoomKeyRequestState.Unsent,\n { state: RoomKeyRequestState.Sent },\n );\n });\n }\n\n // Given a RoomKeyRequest, cancel it and delete the request record unless\n // andResend is set, in which case transition to UNSENT.\n private sendOutgoingRoomKeyRequestCancellation(req: OutgoingRoomKeyRequest, andResend = false): Promise {\n logger.log(\n `Sending cancellation for key request for ` +\n `${stringifyRequestBody(req.requestBody)} to ` +\n `${stringifyRecipientList(req.recipients)} ` +\n `(cancellation id ${req.cancellationTxnId})`,\n );\n\n const requestMessage = {\n action: \"request_cancellation\",\n requesting_device_id: this.deviceId,\n request_id: req.requestId,\n };\n\n return this.sendMessageToDevices(\n requestMessage, req.recipients, req.cancellationTxnId,\n ).then(() => {\n if (andResend) {\n // We want to resend, so transition to UNSENT\n return this.cryptoStore.updateOutgoingRoomKeyRequest(\n req.requestId,\n RoomKeyRequestState.CancellationPendingAndWillResend,\n { state: RoomKeyRequestState.Unsent },\n );\n }\n return this.cryptoStore.deleteOutgoingRoomKeyRequest(\n req.requestId, RoomKeyRequestState.CancellationPending,\n );\n });\n }\n\n // send a RoomKeyRequest to a list of recipients\n private sendMessageToDevices(message, recipients, txnId: string): Promise<{}> {\n const contentMap: Record>> = {};\n for (const recip of recipients) {\n if (!contentMap[recip.userId]) {\n contentMap[recip.userId] = {};\n }\n contentMap[recip.userId][recip.deviceId] = message;\n }\n\n return this.baseApis.sendToDevice(EventType.RoomKeyRequest, contentMap, txnId);\n }\n}\n\nfunction stringifyRequestBody(requestBody) {\n // we assume that the request is for megolm keys, which are identified by\n // room id and session id\n return requestBody.room_id + \" / \" + requestBody.session_id;\n}\n\nfunction stringifyRecipientList(recipients) {\n return '['\n + recipients.map((r) => `${r.userId}:${r.deviceId}`).join(\",\")\n + ']';\n}\n\n", "/*\nCopyright 2018 - 2021 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n/**\n * @module crypto/RoomList\n *\n * Manages the list of encrypted rooms\n */\n\nimport { CryptoStore } from './store/base';\nimport { IndexedDBCryptoStore } from './store/indexeddb-crypto-store';\n\n/* eslint-disable camelcase */\nexport interface IRoomEncryption {\n algorithm: string;\n rotation_period_ms?: number;\n rotation_period_msgs?: number;\n}\n/* eslint-enable camelcase */\n\n/**\n * @alias module:crypto/RoomList\n */\nexport class RoomList {\n // Object of roomId -> room e2e info object (body of the m.room.encryption event)\n private roomEncryption: Record = {};\n\n constructor(private readonly cryptoStore: CryptoStore) {}\n\n public async init(): Promise {\n await this.cryptoStore.doTxn(\n 'readwrite', [IndexedDBCryptoStore.STORE_ROOMS], (txn) => {\n this.cryptoStore.getEndToEndRooms(txn, (result) => {\n this.roomEncryption = result;\n });\n },\n );\n }\n\n public getRoomEncryption(roomId: string): IRoomEncryption {\n return this.roomEncryption[roomId] || null;\n }\n\n public isRoomEncrypted(roomId: string): boolean {\n return Boolean(this.getRoomEncryption(roomId));\n }\n\n public async setRoomEncryption(roomId: string, roomInfo: IRoomEncryption): Promise {\n // important that this happens before calling into the store\n // as it prevents the Crypto::setRoomEncryption from calling\n // this twice for consecutive m.room.encryption events\n this.roomEncryption[roomId] = roomInfo;\n await this.cryptoStore.doTxn(\n 'readwrite', [IndexedDBCryptoStore.STORE_ROOMS], (txn) => {\n this.cryptoStore.storeEndToEndRoom(roomId, roomInfo, txn);\n },\n );\n }\n}\n", @@ -270,7 +271,7 @@ "/*\nCopyright 2018 New Vector Ltd\nCopyright 2020 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n/**\n * QR code key verification.\n * @module crypto/verification/QRCode\n */\n\nimport { VerificationBase as Base } from \"./Base\";\nimport {\n newKeyMismatchError,\n newUserCancelledError,\n} from './Error';\nimport { encodeUnpaddedBase64, decodeBase64 } from \"../olmlib\";\nimport { logger } from '../../logger';\n\nexport const SHOW_QR_CODE_METHOD = \"m.qr_code.show.v1\";\nexport const SCAN_QR_CODE_METHOD = \"m.qr_code.scan.v1\";\n\n/**\n * @class crypto/verification/QRCode/ReciprocateQRCode\n * @extends {module:crypto/verification/Base}\n */\nexport class ReciprocateQRCode extends Base {\n static factory(...args) {\n return new ReciprocateQRCode(...args);\n }\n\n static get NAME() {\n return \"m.reciprocate.v1\";\n }\n\n async _doVerification() {\n if (!this.startEvent) {\n // TODO: Support scanning QR codes\n throw new Error(\"It is not currently possible to start verification\" +\n \"with this method yet.\");\n }\n\n const { qrCodeData } = this.request;\n // 1. check the secret\n if (this.startEvent.getContent()['secret'] !== qrCodeData.encodedSharedSecret) {\n throw newKeyMismatchError();\n }\n\n // 2. ask if other user shows shield as well\n await new Promise((resolve, reject) => {\n this.reciprocateQREvent = {\n confirm: resolve,\n cancel: () => reject(newUserCancelledError()),\n };\n this.emit(\"show_reciprocate_qr\", this.reciprocateQREvent);\n });\n\n // 3. determine key to sign / mark as trusted\n const keys = {};\n\n switch (qrCodeData.mode) {\n case MODE_VERIFY_OTHER_USER: {\n // add master key to keys to be signed, only if we're not doing self-verification\n const masterKey = qrCodeData.otherUserMasterKey;\n keys[`ed25519:${masterKey}`] = masterKey;\n break;\n }\n case MODE_VERIFY_SELF_TRUSTED: {\n const deviceId = this.request.targetDevice.deviceId;\n keys[`ed25519:${deviceId}`] = qrCodeData.otherDeviceKey;\n break;\n }\n case MODE_VERIFY_SELF_UNTRUSTED: {\n const masterKey = qrCodeData.myMasterKey;\n keys[`ed25519:${masterKey}`] = masterKey;\n break;\n }\n }\n\n // 4. sign the key (or mark own MSK as verified in case of MODE_VERIFY_SELF_TRUSTED)\n await this._verifyKeys(this.userId, keys, (keyId, device, keyInfo) => {\n // make sure the device has the expected keys\n const targetKey = keys[keyId];\n if (!targetKey) throw newKeyMismatchError();\n\n if (keyInfo !== targetKey) {\n logger.error(\"key ID from key info does not match\");\n throw newKeyMismatchError();\n }\n for (const deviceKeyId in device.keys) {\n if (!deviceKeyId.startsWith(\"ed25519\")) continue;\n const deviceTargetKey = keys[deviceKeyId];\n if (!deviceTargetKey) throw newKeyMismatchError();\n if (device.keys[deviceKeyId] !== deviceTargetKey) {\n logger.error(\"master key does not match\");\n throw newKeyMismatchError();\n }\n }\n });\n }\n}\n\nconst CODE_VERSION = 0x02; // the version of binary QR codes we support\nconst BINARY_PREFIX = \"MATRIX\"; // ASCII, used to prefix the binary format\nconst MODE_VERIFY_OTHER_USER = 0x00; // Verifying someone who isn't us\nconst MODE_VERIFY_SELF_TRUSTED = 0x01; // We trust the master key\nconst MODE_VERIFY_SELF_UNTRUSTED = 0x02; // We do not trust the master key\n\nexport class QRCodeData {\n constructor(\n mode, sharedSecret, otherUserMasterKey,\n otherDeviceKey, myMasterKey, buffer,\n ) {\n this._sharedSecret = sharedSecret;\n this._mode = mode;\n this._otherUserMasterKey = otherUserMasterKey;\n this._otherDeviceKey = otherDeviceKey;\n this._myMasterKey = myMasterKey;\n this._buffer = buffer;\n }\n\n static async create(request, client) {\n const sharedSecret = QRCodeData._generateSharedSecret();\n const mode = QRCodeData._determineMode(request, client);\n let otherUserMasterKey = null;\n let otherDeviceKey = null;\n let myMasterKey = null;\n if (mode === MODE_VERIFY_OTHER_USER) {\n const otherUserCrossSigningInfo =\n client.getStoredCrossSigningForUser(request.otherUserId);\n otherUserMasterKey = otherUserCrossSigningInfo.getId(\"master\");\n } else if (mode === MODE_VERIFY_SELF_TRUSTED) {\n otherDeviceKey = await QRCodeData._getOtherDeviceKey(request, client);\n } else if (mode === MODE_VERIFY_SELF_UNTRUSTED) {\n const myUserId = client.getUserId();\n const myCrossSigningInfo = client.getStoredCrossSigningForUser(myUserId);\n myMasterKey = myCrossSigningInfo.getId(\"master\");\n }\n const qrData = QRCodeData._generateQrData(\n request, client, mode,\n sharedSecret,\n otherUserMasterKey,\n otherDeviceKey,\n myMasterKey,\n );\n const buffer = QRCodeData._generateBuffer(qrData);\n return new QRCodeData(mode, sharedSecret,\n otherUserMasterKey, otherDeviceKey, myMasterKey, buffer);\n }\n\n get buffer() {\n return this._buffer;\n }\n\n get mode() {\n return this._mode;\n }\n\n /**\n * only set when mode is MODE_VERIFY_SELF_TRUSTED\n * @return {string} device key of other party at time of generating QR code\n */\n get otherDeviceKey() {\n return this._otherDeviceKey;\n }\n\n /**\n * only set when mode is MODE_VERIFY_OTHER_USER\n * @return {string} master key of other party at time of generating QR code\n */\n get otherUserMasterKey() {\n return this._otherUserMasterKey;\n }\n\n /**\n * only set when mode is MODE_VERIFY_SELF_UNTRUSTED\n * @return {string} own master key at time of generating QR code\n */\n get myMasterKey() {\n return this._myMasterKey;\n }\n\n /**\n * The unpadded base64 encoded shared secret.\n */\n get encodedSharedSecret() {\n return this._sharedSecret;\n }\n\n static _generateSharedSecret() {\n const secretBytes = new Uint8Array(11);\n global.crypto.getRandomValues(secretBytes);\n return encodeUnpaddedBase64(secretBytes);\n }\n\n static async _getOtherDeviceKey(request, client) {\n const myUserId = client.getUserId();\n const otherDevice = request.targetDevice;\n const otherDeviceId = otherDevice ? otherDevice.deviceId : null;\n const device = client.getStoredDevice(myUserId, otherDeviceId);\n if (!device) {\n throw new Error(\"could not find device \" + otherDeviceId);\n }\n const key = device.getFingerprint();\n return key;\n }\n\n static _determineMode(request, client) {\n const myUserId = client.getUserId();\n const otherUserId = request.otherUserId;\n\n let mode = MODE_VERIFY_OTHER_USER;\n if (myUserId === otherUserId) {\n // Mode changes depending on whether or not we trust the master cross signing key\n const myTrust = client.checkUserTrust(myUserId);\n if (myTrust.isCrossSigningVerified()) {\n mode = MODE_VERIFY_SELF_TRUSTED;\n } else {\n mode = MODE_VERIFY_SELF_UNTRUSTED;\n }\n }\n return mode;\n }\n\n static _generateQrData(request, client, mode,\n encodedSharedSecret, otherUserMasterKey,\n otherDeviceKey, myMasterKey,\n ) {\n const myUserId = client.getUserId();\n const transactionId = request.channel.transactionId;\n const qrData = {\n prefix: BINARY_PREFIX,\n version: CODE_VERSION,\n mode,\n transactionId,\n firstKeyB64: '', // worked out shortly\n secondKeyB64: '', // worked out shortly\n secretB64: encodedSharedSecret,\n };\n\n const myCrossSigningInfo = client.getStoredCrossSigningForUser(myUserId);\n\n if (mode === MODE_VERIFY_OTHER_USER) {\n // First key is our master cross signing key\n qrData.firstKeyB64 = myCrossSigningInfo.getId(\"master\");\n // Second key is the other user's master cross signing key\n qrData.secondKeyB64 = otherUserMasterKey;\n } else if (mode === MODE_VERIFY_SELF_TRUSTED) {\n // First key is our master cross signing key\n qrData.firstKeyB64 = myCrossSigningInfo.getId(\"master\");\n qrData.secondKeyB64 = otherDeviceKey;\n } else if (mode === MODE_VERIFY_SELF_UNTRUSTED) {\n // First key is our device's key\n qrData.firstKeyB64 = client.getDeviceEd25519Key();\n // Second key is what we think our master cross signing key is\n qrData.secondKeyB64 = myMasterKey;\n }\n return qrData;\n }\n\n static _generateBuffer(qrData) {\n let buf = Buffer.alloc(0); // we'll concat our way through life\n\n const appendByte = (b) => {\n const tmpBuf = Buffer.from([b]);\n buf = Buffer.concat([buf, tmpBuf]);\n };\n const appendInt = (i) => {\n const tmpBuf = Buffer.alloc(2);\n tmpBuf.writeInt16BE(i, 0);\n buf = Buffer.concat([buf, tmpBuf]);\n };\n const appendStr = (s, enc, withLengthPrefix = true) => {\n const tmpBuf = Buffer.from(s, enc);\n if (withLengthPrefix) appendInt(tmpBuf.byteLength);\n buf = Buffer.concat([buf, tmpBuf]);\n };\n const appendEncBase64 = (b64) => {\n const b = decodeBase64(b64);\n const tmpBuf = Buffer.from(b);\n buf = Buffer.concat([buf, tmpBuf]);\n };\n\n // Actually build the buffer for the QR code\n appendStr(qrData.prefix, \"ascii\", false);\n appendByte(qrData.version);\n appendByte(qrData.mode);\n appendStr(qrData.transactionId, \"utf-8\");\n appendEncBase64(qrData.firstKeyB64);\n appendEncBase64(qrData.secondKeyB64);\n appendEncBase64(qrData.secretB64);\n\n return buf;\n }\n}\n", "/*\nCopyright 2018 New Vector Ltd\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n/**\n * Short Authentication String (SAS) verification.\n * @module crypto/verification/SAS\n */\n\nimport { VerificationBase as Base, SwitchStartEventError } from \"./Base\";\nimport anotherjson from 'another-json';\nimport {\n errorFactory,\n newInvalidMessageError,\n newKeyMismatchError,\n newUnknownMethodError,\n newUserCancelledError,\n} from './Error';\nimport { logger } from '../../logger';\n\nconst START_TYPE = \"m.key.verification.start\";\n\nconst EVENTS = [\n \"m.key.verification.accept\",\n \"m.key.verification.key\",\n \"m.key.verification.mac\",\n];\n\nlet olmutil;\n\nconst newMismatchedSASError = errorFactory(\n \"m.mismatched_sas\", \"Mismatched short authentication string\",\n);\n\nconst newMismatchedCommitmentError = errorFactory(\n \"m.mismatched_commitment\", \"Mismatched commitment\",\n);\n\nfunction generateDecimalSas(sasBytes) {\n /**\n * +--------+--------+--------+--------+--------+\n * | Byte 0 | Byte 1 | Byte 2 | Byte 3 | Byte 4 |\n * +--------+--------+--------+--------+--------+\n * bits: 87654321 87654321 87654321 87654321 87654321\n * \\____________/\\_____________/\\____________/\n * 1st number 2nd number 3rd number\n */\n return [\n (sasBytes[0] << 5 | sasBytes[1] >> 3) + 1000,\n ((sasBytes[1] & 0x7) << 10 | sasBytes[2] << 2 | sasBytes[3] >> 6) + 1000,\n ((sasBytes[3] & 0x3f) << 7 | sasBytes[4] >> 1) + 1000,\n ];\n}\n\nconst emojiMapping = [\n [\"🐶\", \"dog\"], // 0\n [\"🐱\", \"cat\"], // 1\n [\"🦁\", \"lion\"], // 2\n [\"🐎\", \"horse\"], // 3\n [\"🦄\", \"unicorn\"], // 4\n [\"🐷\", \"pig\"], // 5\n [\"🐘\", \"elephant\"], // 6\n [\"🐰\", \"rabbit\"], // 7\n [\"🐼\", \"panda\"], // 8\n [\"🐓\", \"rooster\"], // 9\n [\"🐧\", \"penguin\"], // 10\n [\"🐢\", \"turtle\"], // 11\n [\"🐟\", \"fish\"], // 12\n [\"🐙\", \"octopus\"], // 13\n [\"🦋\", \"butterfly\"], // 14\n [\"🌷\", \"flower\"], // 15\n [\"🌳\", \"tree\"], // 16\n [\"🌵\", \"cactus\"], // 17\n [\"🍄\", \"mushroom\"], // 18\n [\"🌏\", \"globe\"], // 19\n [\"🌙\", \"moon\"], // 20\n [\"☁️\", \"cloud\"], // 21\n [\"🔥\", \"fire\"], // 22\n [\"🍌\", \"banana\"], // 23\n [\"🍎\", \"apple\"], // 24\n [\"🍓\", \"strawberry\"], // 25\n [\"🌽\", \"corn\"], // 26\n [\"🍕\", \"pizza\"], // 27\n [\"🎂\", \"cake\"], // 28\n [\"❤️\", \"heart\"], // 29\n [\"🙂\", \"smiley\"], // 30\n [\"🤖\", \"robot\"], // 31\n [\"🎩\", \"hat\"], // 32\n [\"👓\", \"glasses\"], // 33\n [\"🔧\", \"spanner\"], // 34\n [\"🎅\", \"santa\"], // 35\n [\"👍\", \"thumbs up\"], // 36\n [\"☂️\", \"umbrella\"], // 37\n [\"⌛\", \"hourglass\"], // 38\n [\"⏰\", \"clock\"], // 39\n [\"🎁\", \"gift\"], // 40\n [\"💡\", \"light bulb\"], // 41\n [\"📕\", \"book\"], // 42\n [\"✏️\", \"pencil\"], // 43\n [\"📎\", \"paperclip\"], // 44\n [\"✂️\", \"scissors\"], // 45\n [\"🔒\", \"lock\"], // 46\n [\"🔑\", \"key\"], // 47\n [\"🔨\", \"hammer\"], // 48\n [\"☎️\", \"telephone\"], // 49\n [\"🏁\", \"flag\"], // 50\n [\"🚂\", \"train\"], // 51\n [\"🚲\", \"bicycle\"], // 52\n [\"✈️\", \"aeroplane\"], // 53\n [\"🚀\", \"rocket\"], // 54\n [\"🏆\", \"trophy\"], // 55\n [\"⚽\", \"ball\"], // 56\n [\"🎸\", \"guitar\"], // 57\n [\"🎺\", \"trumpet\"], // 58\n [\"🔔\", \"bell\"], // 59\n [\"⚓️\", \"anchor\"], // 60\n [\"🎧\", \"headphones\"], // 61\n [\"📁\", \"folder\"], // 62\n [\"📌\", \"pin\"], // 63\n];\n\nfunction generateEmojiSas(sasBytes) {\n const emojis = [\n // just like base64 encoding\n sasBytes[0] >> 2,\n (sasBytes[0] & 0x3) << 4 | sasBytes[1] >> 4,\n (sasBytes[1] & 0xf) << 2 | sasBytes[2] >> 6,\n sasBytes[2] & 0x3f,\n sasBytes[3] >> 2,\n (sasBytes[3] & 0x3) << 4 | sasBytes[4] >> 4,\n (sasBytes[4] & 0xf) << 2 | sasBytes[5] >> 6,\n ];\n\n return emojis.map((num) => emojiMapping[num]);\n}\n\nconst sasGenerators = {\n decimal: generateDecimalSas,\n emoji: generateEmojiSas,\n};\n\nfunction generateSas(sasBytes, methods) {\n const sas = {};\n for (const method of methods) {\n if (method in sasGenerators) {\n sas[method] = sasGenerators[method](sasBytes);\n }\n }\n return sas;\n}\n\nconst macMethods = {\n \"hkdf-hmac-sha256\": \"calculate_mac\",\n \"hmac-sha256\": \"calculate_mac_long_kdf\",\n};\n\nfunction calculateMAC(olmSAS, method) {\n return function(...args) {\n const macFunction = olmSAS[macMethods[method]];\n const mac = macFunction.apply(olmSAS, args);\n logger.log(\"SAS calculateMAC:\", method, args, mac);\n return mac;\n };\n}\n\nconst calculateKeyAgreement = {\n \"curve25519-hkdf-sha256\": function(sas, olmSAS, bytes) {\n const ourInfo = `${sas._baseApis.getUserId()}|${sas._baseApis.deviceId}|`\n + `${sas.ourSASPubKey}|`;\n const theirInfo = `${sas.userId}|${sas.deviceId}|${sas.theirSASPubKey}|`;\n const sasInfo =\n \"MATRIX_KEY_VERIFICATION_SAS|\"\n + (sas.initiatedByMe ? ourInfo + theirInfo : theirInfo + ourInfo)\n + sas._channel.transactionId;\n return olmSAS.generate_bytes(sasInfo, bytes);\n },\n \"curve25519\": function(sas, olmSAS, bytes) {\n const ourInfo = `${sas._baseApis.getUserId()}${sas._baseApis.deviceId}`;\n const theirInfo = `${sas.userId}${sas.deviceId}`;\n const sasInfo =\n \"MATRIX_KEY_VERIFICATION_SAS\"\n + (sas.initiatedByMe ? ourInfo + theirInfo : theirInfo + ourInfo)\n + sas._channel.transactionId;\n return olmSAS.generate_bytes(sasInfo, bytes);\n },\n};\n\n/* lists of algorithms/methods that are supported. The key agreement, hashes,\n * and MAC lists should be sorted in order of preference (most preferred\n * first).\n */\nconst KEY_AGREEMENT_LIST = [\"curve25519-hkdf-sha256\", \"curve25519\"];\nconst HASHES_LIST = [\"sha256\"];\nconst MAC_LIST = [\"hkdf-hmac-sha256\", \"hmac-sha256\"];\nconst SAS_LIST = Object.keys(sasGenerators);\n\nconst KEY_AGREEMENT_SET = new Set(KEY_AGREEMENT_LIST);\nconst HASHES_SET = new Set(HASHES_LIST);\nconst MAC_SET = new Set(MAC_LIST);\nconst SAS_SET = new Set(SAS_LIST);\n\nfunction intersection(anArray, aSet) {\n return anArray instanceof Array ? anArray.filter(x => aSet.has(x)) : [];\n}\n\n/**\n * @alias module:crypto/verification/SAS\n * @extends {module:crypto/verification/Base}\n */\nexport class SAS extends Base {\n static get NAME() {\n return \"m.sas.v1\";\n }\n\n get events() {\n return EVENTS;\n }\n\n async _doVerification() {\n await global.Olm.init();\n olmutil = olmutil || new global.Olm.Utility();\n\n // make sure user's keys are downloaded\n await this._baseApis.downloadKeys([this.userId]);\n\n let retry = false;\n do {\n try {\n if (this.initiatedByMe) {\n return await this._doSendVerification();\n } else {\n return await this._doRespondVerification();\n }\n } catch (err) {\n if (err instanceof SwitchStartEventError) {\n // this changes what initiatedByMe returns\n this.startEvent = err.startEvent;\n retry = true;\n } else {\n throw err;\n }\n }\n } while (retry);\n }\n\n canSwitchStartEvent(event) {\n if (event.getType() !== START_TYPE) {\n return false;\n }\n const content = event.getContent();\n return content && content.method === SAS.NAME &&\n this._waitingForAccept;\n }\n\n async _sendStart() {\n const startContent = this._channel.completeContent(START_TYPE, {\n method: SAS.NAME,\n from_device: this._baseApis.deviceId,\n key_agreement_protocols: KEY_AGREEMENT_LIST,\n hashes: HASHES_LIST,\n message_authentication_codes: MAC_LIST,\n // FIXME: allow app to specify what SAS methods can be used\n short_authentication_string: SAS_LIST,\n });\n await this._channel.sendCompleted(START_TYPE, startContent);\n return startContent;\n }\n\n async _doSendVerification() {\n this._waitingForAccept = true;\n let startContent;\n if (this.startEvent) {\n startContent = this._channel.completedContentFromEvent(this.startEvent);\n } else {\n startContent = await this._sendStart();\n }\n\n // we might have switched to a different start event,\n // but was we didn't call _waitForEvent there was no\n // call that could throw yet. So check manually that\n // we're still on the initiator side\n if (!this.initiatedByMe) {\n throw new SwitchStartEventError(this.startEvent);\n }\n\n let e;\n try {\n e = await this._waitForEvent(\"m.key.verification.accept\");\n } finally {\n this._waitingForAccept = false;\n }\n let content = e.getContent();\n const sasMethods\n = intersection(content.short_authentication_string, SAS_SET);\n if (!(KEY_AGREEMENT_SET.has(content.key_agreement_protocol)\n && HASHES_SET.has(content.hash)\n && MAC_SET.has(content.message_authentication_code)\n && sasMethods.length)) {\n throw newUnknownMethodError();\n }\n if (typeof content.commitment !== \"string\") {\n throw newInvalidMessageError();\n }\n const keyAgreement = content.key_agreement_protocol;\n const macMethod = content.message_authentication_code;\n const hashCommitment = content.commitment;\n const olmSAS = new global.Olm.SAS();\n try {\n this.ourSASPubKey = olmSAS.get_pubkey();\n await this._send(\"m.key.verification.key\", {\n key: this.ourSASPubKey,\n });\n\n e = await this._waitForEvent(\"m.key.verification.key\");\n // FIXME: make sure event is properly formed\n content = e.getContent();\n const commitmentStr = content.key + anotherjson.stringify(startContent);\n // TODO: use selected hash function (when we support multiple)\n if (olmutil.sha256(commitmentStr) !== hashCommitment) {\n throw newMismatchedCommitmentError();\n }\n this.theirSASPubKey = content.key;\n olmSAS.set_their_key(content.key);\n\n const sasBytes = calculateKeyAgreement[keyAgreement](this, olmSAS, 6);\n const verifySAS = new Promise((resolve, reject) => {\n this.sasEvent = {\n sas: generateSas(sasBytes, sasMethods),\n confirm: async () => {\n try {\n await this._sendMAC(olmSAS, macMethod);\n resolve();\n } catch (err) {\n reject(err);\n }\n },\n cancel: () => reject(newUserCancelledError()),\n mismatch: () => reject(newMismatchedSASError()),\n };\n this.emit(\"show_sas\", this.sasEvent);\n });\n\n [e] = await Promise.all([\n this._waitForEvent(\"m.key.verification.mac\")\n .then((e) => {\n // we don't expect any more messages from the other\n // party, and they may send a m.key.verification.done\n // when they're done on their end\n this._expectedEvent = \"m.key.verification.done\";\n return e;\n }),\n verifySAS,\n ]);\n content = e.getContent();\n await this._checkMAC(olmSAS, content, macMethod);\n } finally {\n olmSAS.free();\n }\n }\n\n async _doRespondVerification() {\n // as m.related_to is not included in the encrypted content in e2e rooms,\n // we need to make sure it is added\n let content = this._channel.completedContentFromEvent(this.startEvent);\n\n // Note: we intersect using our pre-made lists, rather than the sets,\n // so that the result will be in our order of preference. Then\n // fetching the first element from the array will give our preferred\n // method out of the ones offered by the other party.\n const keyAgreement\n = intersection(\n KEY_AGREEMENT_LIST, new Set(content.key_agreement_protocols),\n )[0];\n const hashMethod\n = intersection(HASHES_LIST, new Set(content.hashes))[0];\n const macMethod\n = intersection(MAC_LIST, new Set(content.message_authentication_codes))[0];\n // FIXME: allow app to specify what SAS methods can be used\n const sasMethods\n = intersection(content.short_authentication_string, SAS_SET);\n if (!(keyAgreement !== undefined\n && hashMethod !== undefined\n && macMethod !== undefined\n && sasMethods.length)) {\n throw newUnknownMethodError();\n }\n\n const olmSAS = new global.Olm.SAS();\n try {\n const commitmentStr = olmSAS.get_pubkey() + anotherjson.stringify(content);\n await this._send(\"m.key.verification.accept\", {\n key_agreement_protocol: keyAgreement,\n hash: hashMethod,\n message_authentication_code: macMethod,\n short_authentication_string: sasMethods,\n // TODO: use selected hash function (when we support multiple)\n commitment: olmutil.sha256(commitmentStr),\n });\n\n let e = await this._waitForEvent(\"m.key.verification.key\");\n // FIXME: make sure event is properly formed\n content = e.getContent();\n this.theirSASPubKey = content.key;\n olmSAS.set_their_key(content.key);\n this.ourSASPubKey = olmSAS.get_pubkey();\n await this._send(\"m.key.verification.key\", {\n key: this.ourSASPubKey,\n });\n\n const sasBytes = calculateKeyAgreement[keyAgreement](this, olmSAS, 6);\n const verifySAS = new Promise((resolve, reject) => {\n this.sasEvent = {\n sas: generateSas(sasBytes, sasMethods),\n confirm: async () => {\n try {\n await this._sendMAC(olmSAS, macMethod);\n resolve();\n } catch (err) {\n reject(err);\n }\n },\n cancel: () => reject(newUserCancelledError()),\n mismatch: () => reject(newMismatchedSASError()),\n };\n this.emit(\"show_sas\", this.sasEvent);\n });\n\n [e] = await Promise.all([\n this._waitForEvent(\"m.key.verification.mac\")\n .then((e) => {\n // we don't expect any more messages from the other\n // party, and they may send a m.key.verification.done\n // when they're done on their end\n this._expectedEvent = \"m.key.verification.done\";\n return e;\n }),\n verifySAS,\n ]);\n content = e.getContent();\n await this._checkMAC(olmSAS, content, macMethod);\n } finally {\n olmSAS.free();\n }\n }\n\n _sendMAC(olmSAS, method) {\n const mac = {};\n const keyList = [];\n const baseInfo = \"MATRIX_KEY_VERIFICATION_MAC\"\n + this._baseApis.getUserId() + this._baseApis.deviceId\n + this.userId + this.deviceId\n + this._channel.transactionId;\n\n const deviceKeyId = `ed25519:${this._baseApis.deviceId}`;\n mac[deviceKeyId] = calculateMAC(olmSAS, method)(\n this._baseApis.getDeviceEd25519Key(),\n baseInfo + deviceKeyId,\n );\n keyList.push(deviceKeyId);\n\n const crossSigningId = this._baseApis.getCrossSigningId();\n if (crossSigningId) {\n const crossSigningKeyId = `ed25519:${crossSigningId}`;\n mac[crossSigningKeyId] = calculateMAC(olmSAS, method)(\n crossSigningId,\n baseInfo + crossSigningKeyId,\n );\n keyList.push(crossSigningKeyId);\n }\n\n const keys = calculateMAC(olmSAS, method)(\n keyList.sort().join(\",\"),\n baseInfo + \"KEY_IDS\",\n );\n return this._send(\"m.key.verification.mac\", { mac, keys });\n }\n\n async _checkMAC(olmSAS, content, method) {\n const baseInfo = \"MATRIX_KEY_VERIFICATION_MAC\"\n + this.userId + this.deviceId\n + this._baseApis.getUserId() + this._baseApis.deviceId\n + this._channel.transactionId;\n\n if (content.keys !== calculateMAC(olmSAS, method)(\n Object.keys(content.mac).sort().join(\",\"),\n baseInfo + \"KEY_IDS\",\n )) {\n throw newKeyMismatchError();\n }\n\n await this._verifyKeys(this.userId, content.mac, (keyId, device, keyInfo) => {\n if (keyInfo !== calculateMAC(olmSAS, method)(\n device.keys[keyId],\n baseInfo + keyId,\n )) {\n throw newKeyMismatchError();\n }\n });\n }\n}\n", "/*\nCopyright 2018 New Vector Ltd\nCopyright 2019 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\nimport {\n VerificationRequest,\n REQUEST_TYPE,\n READY_TYPE,\n START_TYPE,\n} from \"./VerificationRequest\";\nimport { logger } from '../../../logger';\n\nconst MESSAGE_TYPE = \"m.room.message\";\nconst M_REFERENCE = \"m.reference\";\nconst M_RELATES_TO = \"m.relates_to\";\n\n/**\n * A key verification channel that sends verification events in the timeline of a room.\n * Uses the event id of the initial m.key.verification.request event as a transaction id.\n */\nexport class InRoomChannel {\n /**\n * @param {MatrixClient} client the matrix client, to send messages with and get current user & device from.\n * @param {string} roomId id of the room where verification events should be posted in, should be a DM with the given user.\n * @param {string} userId id of user that the verification request is directed at, should be present in the room.\n */\n constructor(client, roomId, userId = null) {\n this._client = client;\n this._roomId = roomId;\n this.userId = userId;\n this._requestEventId = null;\n }\n\n get receiveStartFromOtherDevices() {\n return true;\n }\n\n get roomId() {\n return this._roomId;\n }\n\n /** The transaction id generated/used by this verification channel */\n get transactionId() {\n return this._requestEventId;\n }\n\n static getOtherPartyUserId(event, client) {\n const type = InRoomChannel.getEventType(event);\n if (type !== REQUEST_TYPE) {\n return;\n }\n const ownUserId = client.getUserId();\n const sender = event.getSender();\n const content = event.getContent();\n const receiver = content.to;\n\n if (sender === ownUserId) {\n return receiver;\n } else if (receiver === ownUserId) {\n return sender;\n }\n }\n\n /**\n * @param {MatrixEvent} event the event to get the timestamp of\n * @return {number} the timestamp when the event was sent\n */\n getTimestamp(event) {\n return event.getTs();\n }\n\n /**\n * Checks whether the given event type should be allowed to initiate a new VerificationRequest over this channel\n * @param {string} type the event type to check\n * @returns {bool} boolean flag\n */\n static canCreateRequest(type) {\n return type === REQUEST_TYPE;\n }\n\n /**\n * Extract the transaction id used by a given key verification event, if any\n * @param {MatrixEvent} event the event\n * @returns {string} the transaction id\n */\n static getTransactionId(event) {\n if (InRoomChannel.getEventType(event) === REQUEST_TYPE) {\n return event.getId();\n } else {\n const relation = event.getRelation();\n if (relation && relation.rel_type === M_REFERENCE) {\n return relation.event_id;\n }\n }\n }\n\n /**\n * Checks whether this event is a well-formed key verification event.\n * This only does checks that don't rely on the current state of a potentially already channel\n * so we can prevent channels being created by invalid events.\n * `handleEvent` can do more checks and choose to ignore invalid events.\n * @param {MatrixEvent} event the event to validate\n * @param {MatrixClient} client the client to get the current user and device id from\n * @returns {bool} whether the event is valid and should be passed to handleEvent\n */\n static validateEvent(event, client) {\n const txnId = InRoomChannel.getTransactionId(event);\n if (typeof txnId !== \"string\" || txnId.length === 0) {\n return false;\n }\n const type = InRoomChannel.getEventType(event);\n const content = event.getContent();\n\n // from here on we're fairly sure that this is supposed to be\n // part of a verification request, so be noisy when rejecting something\n if (type === REQUEST_TYPE) {\n if (!content || typeof content.to !== \"string\" || !content.to.length) {\n logger.log(\"InRoomChannel: validateEvent: \" +\n \"no valid to \" + (content && content.to));\n return false;\n }\n\n // ignore requests that are not direct to or sent by the syncing user\n if (!InRoomChannel.getOtherPartyUserId(event, client)) {\n logger.log(\"InRoomChannel: validateEvent: \" +\n `not directed to or sent by me: ${event.getSender()}` +\n `, ${content && content.to}`);\n return false;\n }\n }\n\n return VerificationRequest.validateEvent(type, event, client);\n }\n\n /**\n * As m.key.verification.request events are as m.room.message events with the InRoomChannel\n * to have a fallback message in non-supporting clients, we map the real event type\n * to the symbolic one to keep things in unison with ToDeviceChannel\n * @param {MatrixEvent} event the event to get the type of\n * @returns {string} the \"symbolic\" event type\n */\n static getEventType(event) {\n const type = event.getType();\n if (type === MESSAGE_TYPE) {\n const content = event.getContent();\n if (content) {\n const { msgtype } = content;\n if (msgtype === REQUEST_TYPE) {\n return REQUEST_TYPE;\n }\n }\n }\n if (type && type !== REQUEST_TYPE) {\n return type;\n } else {\n return \"\";\n }\n }\n\n /**\n * Changes the state of the channel, request, and verifier in response to a key verification event.\n * @param {MatrixEvent} event to handle\n * @param {VerificationRequest} request the request to forward handling to\n * @param {bool} isLiveEvent whether this is an even received through sync or not\n * @returns {Promise} a promise that resolves when any requests as an anwser to the passed-in event are sent.\n */\n async handleEvent(event, request, isLiveEvent) {\n // prevent processing the same event multiple times, as under\n // some circumstances Room.timeline can get emitted twice for the same event\n if (request.hasEventId(event.getId())) {\n return;\n }\n const type = InRoomChannel.getEventType(event);\n // do validations that need state (roomId, userId),\n // ignore if invalid\n\n if (event.getRoomId() !== this._roomId) {\n return;\n }\n // set userId if not set already\n if (this.userId === null) {\n const userId = InRoomChannel.getOtherPartyUserId(event, this._client);\n if (userId) {\n this.userId = userId;\n }\n }\n // ignore events not sent by us or the other party\n const ownUserId = this._client.getUserId();\n const sender = event.getSender();\n if (this.userId !== null) {\n if (sender !== ownUserId && sender !== this.userId) {\n logger.log(`InRoomChannel: ignoring verification event from ` +\n `non-participating sender ${sender}`);\n return;\n }\n }\n if (this._requestEventId === null) {\n this._requestEventId = InRoomChannel.getTransactionId(event);\n }\n\n const isRemoteEcho = !!event.getUnsigned().transaction_id;\n const isSentByUs = event.getSender() === this._client.getUserId();\n\n return await request.handleEvent(\n type, event, isLiveEvent, isRemoteEcho, isSentByUs);\n }\n\n /**\n * Adds the transaction id (relation) back to a received event\n * so it has the same format as returned by `completeContent` before sending.\n * The relation can not appear on the event content because of encryption,\n * relations are excluded from encryption.\n * @param {MatrixEvent} event the received event\n * @returns {Object} the content object with the relation added again\n */\n completedContentFromEvent(event) {\n // ensure m.related_to is included in e2ee rooms\n // as the field is excluded from encryption\n const content = Object.assign({}, event.getContent());\n content[M_RELATES_TO] = event.getRelation();\n return content;\n }\n /**\n * Add all the fields to content needed for sending it over this channel.\n * This is public so verification methods (SAS uses this) can get the exact\n * content that will be sent independent of the used channel,\n * as they need to calculate the hash of it.\n * @param {string} type the event type\n * @param {object} content the (incomplete) content\n * @returns {object} the complete content, as it will be sent.\n */\n completeContent(type, content) {\n content = Object.assign({}, content);\n if (type === REQUEST_TYPE || type === READY_TYPE || type === START_TYPE) {\n content.from_device = this._client.getDeviceId();\n }\n if (type === REQUEST_TYPE) {\n // type is mapped to m.room.message in the send method\n content = {\n body: this._client.getUserId() + \" is requesting to verify \" +\n \"your key, but your client does not support in-chat key \" +\n \"verification. You will need to use legacy key \" +\n \"verification to verify keys.\",\n msgtype: REQUEST_TYPE,\n to: this.userId,\n from_device: content.from_device,\n methods: content.methods,\n };\n } else {\n content[M_RELATES_TO] = {\n rel_type: M_REFERENCE,\n event_id: this.transactionId,\n };\n }\n return content;\n }\n\n /**\n * Send an event over the channel with the content not having gone through `completeContent`.\n * @param {string} type the event type\n * @param {object} uncompletedContent the (incomplete) content\n * @returns {Promise} the promise of the request\n */\n send(type, uncompletedContent) {\n const content = this.completeContent(type, uncompletedContent);\n return this.sendCompleted(type, content);\n }\n\n /**\n * Send an event over the channel with the content having gone through `completeContent` already.\n * @param {string} type the event type\n * @param {object} content\n * @returns {Promise} the promise of the request\n */\n async sendCompleted(type, content) {\n let sendType = type;\n if (type === REQUEST_TYPE) {\n sendType = MESSAGE_TYPE;\n }\n const response = await this._client.sendEvent(this._roomId, sendType, content);\n if (type === REQUEST_TYPE) {\n this._requestEventId = response.event_id;\n }\n }\n}\n\nexport class InRoomRequests {\n constructor() {\n this._requestsByRoomId = new Map();\n }\n\n getRequest(event) {\n const roomId = event.getRoomId();\n const txnId = InRoomChannel.getTransactionId(event);\n return this._getRequestByTxnId(roomId, txnId);\n }\n\n getRequestByChannel(channel) {\n return this._getRequestByTxnId(channel.roomId, channel.transactionId);\n }\n\n _getRequestByTxnId(roomId, txnId) {\n const requestsByTxnId = this._requestsByRoomId.get(roomId);\n if (requestsByTxnId) {\n return requestsByTxnId.get(txnId);\n }\n }\n\n setRequest(event, request) {\n this._setRequest(\n event.getRoomId(),\n InRoomChannel.getTransactionId(event),\n request,\n );\n }\n\n setRequestByChannel(channel, request) {\n this._setRequest(channel.roomId, channel.transactionId, request);\n }\n\n _setRequest(roomId, txnId, request) {\n let requestsByTxnId = this._requestsByRoomId.get(roomId);\n if (!requestsByTxnId) {\n requestsByTxnId = new Map();\n this._requestsByRoomId.set(roomId, requestsByTxnId);\n }\n requestsByTxnId.set(txnId, request);\n }\n\n removeRequest(event) {\n const roomId = event.getRoomId();\n const requestsByTxnId = this._requestsByRoomId.get(roomId);\n if (requestsByTxnId) {\n requestsByTxnId.delete(InRoomChannel.getTransactionId(event));\n if (requestsByTxnId.size === 0) {\n this._requestsByRoomId.delete(roomId);\n }\n }\n }\n\n findRequestInProgress(roomId) {\n const requestsByTxnId = this._requestsByRoomId.get(roomId);\n if (requestsByTxnId) {\n for (const request of requestsByTxnId.values()) {\n if (request.pending) {\n return request;\n }\n }\n }\n }\n}\n", - "/*\nCopyright 2018 New Vector Ltd\nCopyright 2019 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\nimport { randomString } from '../../../randomstring';\nimport { logger } from '../../../logger';\nimport {\n CANCEL_TYPE,\n PHASE_STARTED,\n PHASE_READY,\n REQUEST_TYPE,\n READY_TYPE,\n START_TYPE,\n VerificationRequest,\n} from \"./VerificationRequest\";\nimport { errorFromEvent, newUnexpectedMessageError } from \"../Error\";\nimport { MatrixEvent } from \"../../../models/event\";\n\n/**\n * A key verification channel that sends verification events over to_device messages.\n * Generates its own transaction ids.\n */\nexport class ToDeviceChannel {\n // userId and devices of user we're about to verify\n constructor(client, userId, devices, transactionId = null, deviceId = null) {\n this._client = client;\n this.userId = userId;\n this._devices = devices;\n this.transactionId = transactionId;\n this._deviceId = deviceId;\n }\n\n isToDevices(devices) {\n if (devices.length === this._devices.length) {\n for (const device of devices) {\n const d = this._devices.find(d => d.deviceId === device.deviceId);\n if (!d) {\n return false;\n }\n }\n return true;\n } else {\n return false;\n }\n }\n\n get deviceId() {\n return this._deviceId;\n }\n\n static getEventType(event) {\n return event.getType();\n }\n\n /**\n * Extract the transaction id used by a given key verification event, if any\n * @param {MatrixEvent} event the event\n * @returns {string} the transaction id\n */\n static getTransactionId(event) {\n const content = event.getContent();\n return content && content.transaction_id;\n }\n\n /**\n * Checks whether the given event type should be allowed to initiate a new VerificationRequest over this channel\n * @param {string} type the event type to check\n * @returns {bool} boolean flag\n */\n static canCreateRequest(type) {\n return type === REQUEST_TYPE || type === START_TYPE;\n }\n\n /**\n * Checks whether this event is a well-formed key verification event.\n * This only does checks that don't rely on the current state of a potentially already channel\n * so we can prevent channels being created by invalid events.\n * `handleEvent` can do more checks and choose to ignore invalid events.\n * @param {MatrixEvent} event the event to validate\n * @param {MatrixClient} client the client to get the current user and device id from\n * @returns {bool} whether the event is valid and should be passed to handleEvent\n */\n static validateEvent(event, client) {\n if (event.isCancelled()) {\n logger.warn(\"Ignoring flagged verification request from \"\n + event.getSender());\n return false;\n }\n const content = event.getContent();\n if (!content) {\n logger.warn(\"ToDeviceChannel.validateEvent: invalid: no content\");\n return false;\n }\n\n if (!content.transaction_id) {\n logger.warn(\"ToDeviceChannel.validateEvent: invalid: no transaction_id\");\n return false;\n }\n\n const type = event.getType();\n\n if (type === REQUEST_TYPE) {\n if (!Number.isFinite(content.timestamp)) {\n logger.warn(\"ToDeviceChannel.validateEvent: invalid: no timestamp\");\n return false;\n }\n if (event.getSender() === client.getUserId() &&\n content.from_device == client.getDeviceId()\n ) {\n // ignore requests from ourselves, because it doesn't make sense for a\n // device to verify itself\n logger.warn(\"ToDeviceChannel.validateEvent: invalid: from own device\");\n return false;\n }\n }\n\n return VerificationRequest.validateEvent(type, event, client);\n }\n\n /**\n * @param {MatrixEvent} event the event to get the timestamp of\n * @return {number} the timestamp when the event was sent\n */\n getTimestamp(event) {\n const content = event.getContent();\n return content && content.timestamp;\n }\n\n /**\n * Changes the state of the channel, request, and verifier in response to a key verification event.\n * @param {MatrixEvent} event to handle\n * @param {VerificationRequest} request the request to forward handling to\n * @param {bool} isLiveEvent whether this is an even received through sync or not\n * @returns {Promise} a promise that resolves when any requests as an anwser to the passed-in event are sent.\n */\n async handleEvent(event, request, isLiveEvent) {\n const type = event.getType();\n const content = event.getContent();\n if (type === REQUEST_TYPE || type === READY_TYPE || type === START_TYPE) {\n if (!this.transactionId) {\n this.transactionId = content.transaction_id;\n }\n const deviceId = content.from_device;\n // adopt deviceId if not set before and valid\n if (!this._deviceId && this._devices.includes(deviceId)) {\n this._deviceId = deviceId;\n }\n // if no device id or different from addopted one, cancel with sender\n if (!this._deviceId || this._deviceId !== deviceId) {\n // also check that message came from the device we sent the request to earlier on\n // and do send a cancel message to that device\n // (but don't cancel the request for the device we should be talking to)\n const cancelContent =\n this.completeContent(errorFromEvent(newUnexpectedMessageError()));\n return this._sendToDevices(CANCEL_TYPE, cancelContent, [deviceId]);\n }\n }\n const wasStarted = request.phase === PHASE_STARTED ||\n request.phase === PHASE_READY;\n\n await request.handleEvent(event.getType(), event, isLiveEvent, false, false);\n\n const isStarted = request.phase === PHASE_STARTED ||\n request.phase === PHASE_READY;\n\n const isAcceptingEvent = type === START_TYPE || type === READY_TYPE;\n // the request has picked a ready or start event, tell the other devices about it\n if (isAcceptingEvent && !wasStarted && isStarted && this._deviceId) {\n const nonChosenDevices = this._devices.filter(\n d => d !== this._deviceId && d !== this._client.getDeviceId(),\n );\n if (nonChosenDevices.length) {\n const message = this.completeContent({\n code: \"m.accepted\",\n reason: \"Verification request accepted by another device\",\n });\n await this._sendToDevices(CANCEL_TYPE, message, nonChosenDevices);\n }\n }\n }\n\n /**\n * See {InRoomChannel.completedContentFromEvent} why this is needed.\n * @param {MatrixEvent} event the received event\n * @returns {Object} the content object\n */\n completedContentFromEvent(event) {\n return event.getContent();\n }\n\n /**\n * Add all the fields to content needed for sending it over this channel.\n * This is public so verification methods (SAS uses this) can get the exact\n * content that will be sent independent of the used channel,\n * as they need to calculate the hash of it.\n * @param {string} type the event type\n * @param {object} content the (incomplete) content\n * @returns {object} the complete content, as it will be sent.\n */\n completeContent(type, content) {\n // make a copy\n content = Object.assign({}, content);\n if (this.transactionId) {\n content.transaction_id = this.transactionId;\n }\n if (type === REQUEST_TYPE || type === READY_TYPE || type === START_TYPE) {\n content.from_device = this._client.getDeviceId();\n }\n if (type === REQUEST_TYPE) {\n content.timestamp = Date.now();\n }\n return content;\n }\n\n /**\n * Send an event over the channel with the content not having gone through `completeContent`.\n * @param {string} type the event type\n * @param {object} uncompletedContent the (incomplete) content\n * @returns {Promise} the promise of the request\n */\n send(type, uncompletedContent = {}) {\n // create transaction id when sending request\n if ((type === REQUEST_TYPE || type === START_TYPE) && !this.transactionId) {\n this.transactionId = ToDeviceChannel.makeTransactionId();\n }\n const content = this.completeContent(type, uncompletedContent);\n return this.sendCompleted(type, content);\n }\n\n /**\n * Send an event over the channel with the content having gone through `completeContent` already.\n * @param {string} type the event type\n * @param {object} content\n * @returns {Promise} the promise of the request\n */\n async sendCompleted(type, content) {\n let result;\n if (type === REQUEST_TYPE) {\n result = await this._sendToDevices(type, content, this._devices);\n } else {\n result = await this._sendToDevices(type, content, [this._deviceId]);\n }\n // the VerificationRequest state machine requires remote echos of the event\n // the client sends itself, so we fake this for to_device messages\n const remoteEchoEvent = new MatrixEvent({\n sender: this._client.getUserId(),\n content,\n type,\n });\n await this._request.handleEvent(\n type,\n remoteEchoEvent,\n /*isLiveEvent=*/true,\n /*isRemoteEcho=*/true,\n /*isSentByUs=*/true,\n );\n return result;\n }\n\n _sendToDevices(type, content, devices) {\n if (devices.length) {\n const msgMap = {};\n for (const deviceId of devices) {\n msgMap[deviceId] = content;\n }\n\n return this._client.sendToDevice(type, { [this.userId]: msgMap });\n } else {\n return Promise.resolve();\n }\n }\n\n /**\n * Allow Crypto module to create and know the transaction id before the .start event gets sent.\n * @returns {string} the transaction id\n */\n static makeTransactionId() {\n return randomString(32);\n }\n}\n\nexport class ToDeviceRequests {\n constructor() {\n this._requestsByUserId = new Map();\n }\n\n getRequest(event) {\n return this.getRequestBySenderAndTxnId(\n event.getSender(),\n ToDeviceChannel.getTransactionId(event),\n );\n }\n\n getRequestByChannel(channel) {\n return this.getRequestBySenderAndTxnId(channel.userId, channel.transactionId);\n }\n\n getRequestBySenderAndTxnId(sender, txnId) {\n const requestsByTxnId = this._requestsByUserId.get(sender);\n if (requestsByTxnId) {\n return requestsByTxnId.get(txnId);\n }\n }\n\n setRequest(event, request) {\n this.setRequestBySenderAndTxnId(\n event.getSender(),\n ToDeviceChannel.getTransactionId(event),\n request,\n );\n }\n\n setRequestByChannel(channel, request) {\n this.setRequestBySenderAndTxnId(channel.userId, channel.transactionId, request);\n }\n\n setRequestBySenderAndTxnId(sender, txnId, request) {\n let requestsByTxnId = this._requestsByUserId.get(sender);\n if (!requestsByTxnId) {\n requestsByTxnId = new Map();\n this._requestsByUserId.set(sender, requestsByTxnId);\n }\n requestsByTxnId.set(txnId, request);\n }\n\n removeRequest(event) {\n const userId = event.getSender();\n const requestsByTxnId = this._requestsByUserId.get(userId);\n if (requestsByTxnId) {\n requestsByTxnId.delete(ToDeviceChannel.getTransactionId(event));\n if (requestsByTxnId.size === 0) {\n this._requestsByUserId.delete(userId);\n }\n }\n }\n\n findRequestInProgress(userId, devices) {\n const requestsByTxnId = this._requestsByUserId.get(userId);\n if (requestsByTxnId) {\n for (const request of requestsByTxnId.values()) {\n if (request.pending && request.channel.isToDevices(devices)) {\n return request;\n }\n }\n }\n }\n\n getRequestsInProgress(userId) {\n const requestsByTxnId = this._requestsByUserId.get(userId);\n if (requestsByTxnId) {\n return Array.from(requestsByTxnId.values()).filter(r => r.pending);\n }\n return [];\n }\n}\n", + "/*\nCopyright 2018 New Vector Ltd\nCopyright 2019 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\nimport { randomString } from '../../../randomstring';\nimport { logger } from '../../../logger';\nimport {\n CANCEL_TYPE,\n PHASE_STARTED,\n PHASE_READY,\n REQUEST_TYPE,\n READY_TYPE,\n START_TYPE,\n VerificationRequest,\n} from \"./VerificationRequest\";\nimport { errorFromEvent, newUnexpectedMessageError } from \"../Error\";\nimport { MatrixEvent } from \"../../../models/event\";\n\n/**\n * A key verification channel that sends verification events over to_device messages.\n * Generates its own transaction ids.\n */\nexport class ToDeviceChannel {\n // userId and devices of user we're about to verify\n constructor(client, userId, devices, transactionId = null, deviceId = null) {\n this._client = client;\n this.userId = userId;\n this._devices = devices;\n this.transactionId = transactionId;\n this._deviceId = deviceId;\n }\n\n isToDevices(devices) {\n if (devices.length === this._devices.length) {\n for (const device of devices) {\n const d = this._devices.find(d => d.deviceId === device.deviceId);\n if (!d) {\n return false;\n }\n }\n return true;\n } else {\n return false;\n }\n }\n\n get deviceId() {\n return this._deviceId;\n }\n\n static getEventType(event) {\n return event.getType();\n }\n\n /**\n * Extract the transaction id used by a given key verification event, if any\n * @param {MatrixEvent} event the event\n * @returns {string} the transaction id\n */\n static getTransactionId(event) {\n const content = event.getContent();\n return content && content.transaction_id;\n }\n\n /**\n * Checks whether the given event type should be allowed to initiate a new VerificationRequest over this channel\n * @param {string} type the event type to check\n * @returns {bool} boolean flag\n */\n static canCreateRequest(type) {\n return type === REQUEST_TYPE || type === START_TYPE;\n }\n\n /**\n * Checks whether this event is a well-formed key verification event.\n * This only does checks that don't rely on the current state of a potentially already channel\n * so we can prevent channels being created by invalid events.\n * `handleEvent` can do more checks and choose to ignore invalid events.\n * @param {MatrixEvent} event the event to validate\n * @param {MatrixClient} client the client to get the current user and device id from\n * @returns {bool} whether the event is valid and should be passed to handleEvent\n */\n static validateEvent(event, client) {\n if (event.isCancelled()) {\n logger.warn(\"Ignoring flagged verification request from \"\n + event.getSender());\n return false;\n }\n const content = event.getContent();\n if (!content) {\n logger.warn(\"ToDeviceChannel.validateEvent: invalid: no content\");\n return false;\n }\n\n if (!content.transaction_id) {\n logger.warn(\"ToDeviceChannel.validateEvent: invalid: no transaction_id\");\n return false;\n }\n\n const type = event.getType();\n\n if (type === REQUEST_TYPE) {\n if (!Number.isFinite(content.timestamp)) {\n logger.warn(\"ToDeviceChannel.validateEvent: invalid: no timestamp\");\n return false;\n }\n if (event.getSender() === client.getUserId() &&\n content.from_device == client.getDeviceId()\n ) {\n // ignore requests from ourselves, because it doesn't make sense for a\n // device to verify itself\n logger.warn(\"ToDeviceChannel.validateEvent: invalid: from own device\");\n return false;\n }\n }\n\n return VerificationRequest.validateEvent(type, event, client);\n }\n\n /**\n * @param {MatrixEvent} event the event to get the timestamp of\n * @return {number} the timestamp when the event was sent\n */\n getTimestamp(event) {\n const content = event.getContent();\n return content && content.timestamp;\n }\n\n /**\n * Changes the state of the channel, request, and verifier in response to a key verification event.\n * @param {MatrixEvent} event to handle\n * @param {VerificationRequest} request the request to forward handling to\n * @param {bool} isLiveEvent whether this is an even received through sync or not\n * @returns {Promise} a promise that resolves when any requests as an anwser to the passed-in event are sent.\n */\n async handleEvent(event, request, isLiveEvent) {\n const type = event.getType();\n const content = event.getContent();\n if (type === REQUEST_TYPE || type === READY_TYPE || type === START_TYPE) {\n if (!this.transactionId) {\n this.transactionId = content.transaction_id;\n }\n const deviceId = content.from_device;\n // adopt deviceId if not set before and valid\n if (!this._deviceId && this._devices.includes(deviceId)) {\n this._deviceId = deviceId;\n }\n // if no device id or different from addopted one, cancel with sender\n if (!this._deviceId || this._deviceId !== deviceId) {\n // also check that message came from the device we sent the request to earlier on\n // and do send a cancel message to that device\n // (but don't cancel the request for the device we should be talking to)\n const cancelContent =\n this.completeContent(errorFromEvent(newUnexpectedMessageError()));\n return this._sendToDevices(CANCEL_TYPE, cancelContent, [deviceId]);\n }\n }\n const wasStarted = request.phase === PHASE_STARTED ||\n request.phase === PHASE_READY;\n\n await request.handleEvent(event.getType(), event, isLiveEvent, false, false);\n\n const isStarted = request.phase === PHASE_STARTED ||\n request.phase === PHASE_READY;\n\n const isAcceptingEvent = type === START_TYPE || type === READY_TYPE;\n // the request has picked a ready or start event, tell the other devices about it\n if (isAcceptingEvent && !wasStarted && isStarted && this._deviceId) {\n const nonChosenDevices = this._devices.filter(\n d => d !== this._deviceId && d !== this._client.getDeviceId(),\n );\n if (nonChosenDevices.length) {\n const message = this.completeContent({\n code: \"m.accepted\",\n reason: \"Verification request accepted by another device\",\n });\n await this._sendToDevices(CANCEL_TYPE, message, nonChosenDevices);\n }\n }\n }\n\n /**\n * See {InRoomChannel.completedContentFromEvent} why this is needed.\n * @param {MatrixEvent} event the received event\n * @returns {Object} the content object\n */\n completedContentFromEvent(event) {\n return event.getContent();\n }\n\n /**\n * Add all the fields to content needed for sending it over this channel.\n * This is public so verification methods (SAS uses this) can get the exact\n * content that will be sent independent of the used channel,\n * as they need to calculate the hash of it.\n * @param {string} type the event type\n * @param {object} content the (incomplete) content\n * @returns {object} the complete content, as it will be sent.\n */\n completeContent(type, content) {\n // make a copy\n content = Object.assign({}, content);\n if (this.transactionId) {\n content.transaction_id = this.transactionId;\n }\n if (type === REQUEST_TYPE || type === READY_TYPE || type === START_TYPE) {\n content.from_device = this._client.getDeviceId();\n }\n if (type === REQUEST_TYPE) {\n content.timestamp = Date.now();\n }\n return content;\n }\n\n /**\n * Send an event over the channel with the content not having gone through `completeContent`.\n * @param {string} type the event type\n * @param {object} uncompletedContent the (incomplete) content\n * @returns {Promise} the promise of the request\n */\n send(type, uncompletedContent = {}) {\n // create transaction id when sending request\n if ((type === REQUEST_TYPE || type === START_TYPE) && !this.transactionId) {\n this.transactionId = ToDeviceChannel.makeTransactionId();\n }\n const content = this.completeContent(type, uncompletedContent);\n return this.sendCompleted(type, content);\n }\n\n /**\n * Send an event over the channel with the content having gone through `completeContent` already.\n * @param {string} type the event type\n * @param {object} content\n * @returns {Promise} the promise of the request\n */\n async sendCompleted(type, content) {\n let result;\n if (type === REQUEST_TYPE || (type === CANCEL_TYPE && !this.__deviceId)) {\n result = await this._sendToDevices(type, content, this._devices);\n } else {\n result = await this._sendToDevices(type, content, [this._deviceId]);\n }\n // the VerificationRequest state machine requires remote echos of the event\n // the client sends itself, so we fake this for to_device messages\n const remoteEchoEvent = new MatrixEvent({\n sender: this._client.getUserId(),\n content,\n type,\n });\n await this._request.handleEvent(\n type,\n remoteEchoEvent,\n /*isLiveEvent=*/true,\n /*isRemoteEcho=*/true,\n /*isSentByUs=*/true,\n );\n return result;\n }\n\n _sendToDevices(type, content, devices) {\n if (devices.length) {\n const msgMap = {};\n for (const deviceId of devices) {\n msgMap[deviceId] = content;\n }\n\n return this._client.sendToDevice(type, { [this.userId]: msgMap });\n } else {\n return Promise.resolve();\n }\n }\n\n /**\n * Allow Crypto module to create and know the transaction id before the .start event gets sent.\n * @returns {string} the transaction id\n */\n static makeTransactionId() {\n return randomString(32);\n }\n}\n\nexport class ToDeviceRequests {\n constructor() {\n this._requestsByUserId = new Map();\n }\n\n getRequest(event) {\n return this.getRequestBySenderAndTxnId(\n event.getSender(),\n ToDeviceChannel.getTransactionId(event),\n );\n }\n\n getRequestByChannel(channel) {\n return this.getRequestBySenderAndTxnId(channel.userId, channel.transactionId);\n }\n\n getRequestBySenderAndTxnId(sender, txnId) {\n const requestsByTxnId = this._requestsByUserId.get(sender);\n if (requestsByTxnId) {\n return requestsByTxnId.get(txnId);\n }\n }\n\n setRequest(event, request) {\n this.setRequestBySenderAndTxnId(\n event.getSender(),\n ToDeviceChannel.getTransactionId(event),\n request,\n );\n }\n\n setRequestByChannel(channel, request) {\n this.setRequestBySenderAndTxnId(channel.userId, channel.transactionId, request);\n }\n\n setRequestBySenderAndTxnId(sender, txnId, request) {\n let requestsByTxnId = this._requestsByUserId.get(sender);\n if (!requestsByTxnId) {\n requestsByTxnId = new Map();\n this._requestsByUserId.set(sender, requestsByTxnId);\n }\n requestsByTxnId.set(txnId, request);\n }\n\n removeRequest(event) {\n const userId = event.getSender();\n const requestsByTxnId = this._requestsByUserId.get(userId);\n if (requestsByTxnId) {\n requestsByTxnId.delete(ToDeviceChannel.getTransactionId(event));\n if (requestsByTxnId.size === 0) {\n this._requestsByUserId.delete(userId);\n }\n }\n }\n\n findRequestInProgress(userId, devices) {\n const requestsByTxnId = this._requestsByUserId.get(userId);\n if (requestsByTxnId) {\n for (const request of requestsByTxnId.values()) {\n if (request.pending && request.channel.isToDevices(devices)) {\n return request;\n }\n }\n }\n }\n\n getRequestsInProgress(userId) {\n const requestsByTxnId = this._requestsByUserId.get(userId);\n if (requestsByTxnId) {\n return Array.from(requestsByTxnId.values()).filter(r => r.pending);\n }\n return [];\n }\n}\n", "/*\nCopyright 2018 New Vector Ltd\nCopyright 2019 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\nimport { logger } from '../../../logger';\nimport { EventEmitter } from 'events';\nimport {\n errorFactory,\n errorFromEvent,\n newUnexpectedMessageError,\n newUnknownMethodError,\n} from \"../Error\";\nimport { QRCodeData, SCAN_QR_CODE_METHOD } from \"../QRCode\";\n\n// How long after the event's timestamp that the request times out\nconst TIMEOUT_FROM_EVENT_TS = 10 * 60 * 1000; // 10 minutes\n\n// How long after we receive the event that the request times out\nconst TIMEOUT_FROM_EVENT_RECEIPT = 2 * 60 * 1000; // 2 minutes\n\n// to avoid almost expired verification notifications\n// from showing a notification and almost immediately\n// disappearing, also ignore verification requests that\n// are this amount of time away from expiring.\nconst VERIFICATION_REQUEST_MARGIN = 3 * 1000; // 3 seconds\n\nexport const EVENT_PREFIX = \"m.key.verification.\";\nexport const REQUEST_TYPE = EVENT_PREFIX + \"request\";\nexport const START_TYPE = EVENT_PREFIX + \"start\";\nexport const CANCEL_TYPE = EVENT_PREFIX + \"cancel\";\nexport const DONE_TYPE = EVENT_PREFIX + \"done\";\nexport const READY_TYPE = EVENT_PREFIX + \"ready\";\n\nexport const PHASE_UNSENT = 1;\nexport const PHASE_REQUESTED = 2;\nexport const PHASE_READY = 3;\nexport const PHASE_STARTED = 4;\nexport const PHASE_CANCELLED = 5;\nexport const PHASE_DONE = 6;\n\n/**\n * State machine for verification requests.\n * Things that differ based on what channel is used to\n * send and receive verification events are put in `InRoomChannel` or `ToDeviceChannel`.\n * @event \"change\" whenever the state of the request object has changed.\n */\nexport class VerificationRequest extends EventEmitter {\n constructor(channel, verificationMethods, client) {\n super();\n this.channel = channel;\n this.channel._request = this;\n this._verificationMethods = verificationMethods;\n this._client = client;\n this._commonMethods = [];\n this._setPhase(PHASE_UNSENT, false);\n this._eventsByUs = new Map();\n this._eventsByThem = new Map();\n this._observeOnly = false;\n this._timeoutTimer = null;\n this._accepting = false;\n this._declining = false;\n this._verifierHasFinished = false;\n this._cancelled = false;\n this._chosenMethod = null;\n // we keep a copy of the QR Code data (including other user master key) around\n // for QR reciprocate verification, to protect against\n // cross-signing identity reset between the .ready and .start event\n // and signing the wrong key after .start\n this._qrCodeData = null;\n\n // The timestamp when we received the request event from the other side\n this._requestReceivedAt = null;\n }\n\n /**\n * Stateless validation logic not specific to the channel.\n * Invoked by the same static method in either channel.\n * @param {string} type the \"symbolic\" event type, as returned by the `getEventType` function on the channel.\n * @param {MatrixEvent} event the event to validate. Don't call getType() on it but use the `type` parameter instead.\n * @param {MatrixClient} client the client to get the current user and device id from\n * @returns {bool} whether the event is valid and should be passed to handleEvent\n */\n static validateEvent(type, event, client) {\n const content = event.getContent();\n\n if (!type || !type.startsWith(EVENT_PREFIX)) {\n return false;\n }\n\n // from here on we're fairly sure that this is supposed to be\n // part of a verification request, so be noisy when rejecting something\n if (!content) {\n logger.log(\"VerificationRequest: validateEvent: no content\");\n return false;\n }\n\n if (type === REQUEST_TYPE || type === READY_TYPE) {\n if (!Array.isArray(content.methods)) {\n logger.log(\"VerificationRequest: validateEvent: \" +\n \"fail because methods\");\n return false;\n }\n }\n\n if (type === REQUEST_TYPE || type === READY_TYPE || type === START_TYPE) {\n if (typeof content.from_device !== \"string\" ||\n content.from_device.length === 0\n ) {\n logger.log(\"VerificationRequest: validateEvent: \"+\n \"fail because from_device\");\n return false;\n }\n }\n\n return true;\n }\n\n get invalid() {\n return this.phase === PHASE_UNSENT;\n }\n\n /** returns whether the phase is PHASE_REQUESTED */\n get requested() {\n return this.phase === PHASE_REQUESTED;\n }\n\n /** returns whether the phase is PHASE_CANCELLED */\n get cancelled() {\n return this.phase === PHASE_CANCELLED;\n }\n\n /** returns whether the phase is PHASE_READY */\n get ready() {\n return this.phase === PHASE_READY;\n }\n\n /** returns whether the phase is PHASE_STARTED */\n get started() {\n return this.phase === PHASE_STARTED;\n }\n\n /** returns whether the phase is PHASE_DONE */\n get done() {\n return this.phase === PHASE_DONE;\n }\n\n /** once the phase is PHASE_STARTED (and !initiatedByMe) or PHASE_READY: common methods supported by both sides */\n get methods() {\n return this._commonMethods;\n }\n\n /** the method picked in the .start event */\n get chosenMethod() {\n return this._chosenMethod;\n }\n\n calculateEventTimeout(event) {\n let effectiveExpiresAt = this.channel.getTimestamp(event)\n + TIMEOUT_FROM_EVENT_TS;\n\n if (this._requestReceivedAt && !this.initiatedByMe &&\n this.phase <= PHASE_REQUESTED\n ) {\n const expiresAtByReceipt = this._requestReceivedAt\n + TIMEOUT_FROM_EVENT_RECEIPT;\n effectiveExpiresAt = Math.min(effectiveExpiresAt, expiresAtByReceipt);\n }\n\n return Math.max(0, effectiveExpiresAt - Date.now());\n }\n\n /** The current remaining amount of ms before the request should be automatically cancelled */\n get timeout() {\n const requestEvent = this._getEventByEither(REQUEST_TYPE);\n if (requestEvent) {\n return this.calculateEventTimeout(requestEvent);\n }\n return 0;\n }\n\n /**\n * The key verification request event.\n * @returns {MatrixEvent} The request event, or falsey if not found.\n */\n get requestEvent() {\n return this._getEventByEither(REQUEST_TYPE);\n }\n\n /** current phase of the request. Some properties might only be defined in a current phase. */\n get phase() {\n return this._phase;\n }\n\n /** The verifier to do the actual verification, once the method has been established. Only defined when the `phase` is PHASE_STARTED. */\n get verifier() {\n return this._verifier;\n }\n\n get canAccept() {\n return this.phase < PHASE_READY && !this._accepting && !this._declining;\n }\n\n get accepting() {\n return this._accepting;\n }\n\n get declining() {\n return this._declining;\n }\n\n /** whether this request has sent it's initial event and needs more events to complete */\n get pending() {\n return !this.observeOnly &&\n this._phase !== PHASE_DONE &&\n this._phase !== PHASE_CANCELLED;\n }\n\n /** Only set after a .ready if the other party can scan a QR code */\n get qrCodeData() {\n return this._qrCodeData;\n }\n\n /** Checks whether the other party supports a given verification method.\n * This is useful when setting up the QR code UI, as it is somewhat asymmetrical:\n * if the other party supports SCAN_QR, we should show a QR code in the UI, and vice versa.\n * For methods that need to be supported by both ends, use the `methods` property.\n * @param {string} method the method to check\n * @param {boolean} force to check even if the phase is not ready or started yet, internal usage\n * @return {bool} whether or not the other party said the supported the method */\n otherPartySupportsMethod(method, force = false) {\n if (!force && !this.ready && !this.started) {\n return false;\n }\n const theirMethodEvent = this._eventsByThem.get(REQUEST_TYPE) ||\n this._eventsByThem.get(READY_TYPE);\n if (!theirMethodEvent) {\n // if we started straight away with .start event,\n // we are assuming that the other side will support the\n // chosen method, so return true for that.\n if (this.started && this.initiatedByMe) {\n const myStartEvent = this._eventsByUs.get(START_TYPE);\n const content = myStartEvent && myStartEvent.getContent();\n const myStartMethod = content && content.method;\n return method == myStartMethod;\n }\n return false;\n }\n const content = theirMethodEvent.getContent();\n if (!content) {\n return false;\n }\n const { methods } = content;\n if (!Array.isArray(methods)) {\n return false;\n }\n\n return methods.includes(method);\n }\n\n /** Whether this request was initiated by the syncing user.\n * For InRoomChannel, this is who sent the .request event.\n * For ToDeviceChannel, this is who sent the .start event\n */\n get initiatedByMe() {\n // event created by us but no remote echo has been received yet\n const noEventsYet = (this._eventsByUs.size + this._eventsByThem.size) === 0;\n if (this._phase === PHASE_UNSENT && noEventsYet) {\n return true;\n }\n const hasMyRequest = this._eventsByUs.has(REQUEST_TYPE);\n const hasTheirRequest = this._eventsByThem.has(REQUEST_TYPE);\n if (hasMyRequest && !hasTheirRequest) {\n return true;\n }\n if (!hasMyRequest && hasTheirRequest) {\n return false;\n }\n const hasMyStart = this._eventsByUs.has(START_TYPE);\n const hasTheirStart = this._eventsByThem.has(START_TYPE);\n if (hasMyStart && !hasTheirStart) {\n return true;\n }\n return false;\n }\n\n /** The id of the user that initiated the request */\n get requestingUserId() {\n if (this.initiatedByMe) {\n return this._client.getUserId();\n } else {\n return this.otherUserId;\n }\n }\n\n /** The id of the user that (will) receive(d) the request */\n get receivingUserId() {\n if (this.initiatedByMe) {\n return this.otherUserId;\n } else {\n return this._client.getUserId();\n }\n }\n\n /** The user id of the other party in this request */\n get otherUserId() {\n return this.channel.userId;\n }\n\n get isSelfVerification() {\n return this._client.getUserId() === this.otherUserId;\n }\n\n /**\n * The id of the user that cancelled the request,\n * only defined when phase is PHASE_CANCELLED\n */\n get cancellingUserId() {\n const myCancel = this._eventsByUs.get(CANCEL_TYPE);\n const theirCancel = this._eventsByThem.get(CANCEL_TYPE);\n\n if (myCancel && (!theirCancel || myCancel.getId() < theirCancel.getId())) {\n return myCancel.getSender();\n }\n if (theirCancel) {\n return theirCancel.getSender();\n }\n return undefined;\n }\n\n /**\n * The cancellation code e.g m.user which is responsible for cancelling this verification\n */\n get cancellationCode() {\n const ev = this._getEventByEither(CANCEL_TYPE);\n return ev ? ev.getContent().code : null;\n }\n\n get observeOnly() {\n return this._observeOnly;\n }\n\n /**\n * Gets which device the verification should be started with\n * given the events sent so far in the verification. This is the\n * same algorithm used to determine which device to send the\n * verification to when no specific device is specified.\n * @returns {{userId: *, deviceId: *}} The device information\n */\n get targetDevice() {\n const theirFirstEvent =\n this._eventsByThem.get(REQUEST_TYPE) ||\n this._eventsByThem.get(READY_TYPE) ||\n this._eventsByThem.get(START_TYPE);\n const theirFirstContent = theirFirstEvent.getContent();\n const fromDevice = theirFirstContent.from_device;\n return {\n userId: this.otherUserId,\n deviceId: fromDevice,\n };\n }\n\n /* Start the key verification, creating a verifier and sending a .start event.\n * If no previous events have been sent, pass in `targetDevice` to set who to direct this request to.\n * @param {string} method the name of the verification method to use.\n * @param {string?} targetDevice.userId the id of the user to direct this request to\n * @param {string?} targetDevice.deviceId the id of the device to direct this request to\n * @returns {VerifierBase} the verifier of the given method\n */\n beginKeyVerification(method, targetDevice = null) {\n // need to allow also when unsent in case of to_device\n if (!this.observeOnly && !this._verifier) {\n const validStartPhase =\n this.phase === PHASE_REQUESTED ||\n this.phase === PHASE_READY ||\n (this.phase === PHASE_UNSENT &&\n this.channel.constructor.canCreateRequest(START_TYPE));\n if (validStartPhase) {\n // when called on a request that was initiated with .request event\n // check the method is supported by both sides\n if (this._commonMethods.length && !this._commonMethods.includes(method)) {\n throw newUnknownMethodError();\n }\n this._verifier = this._createVerifier(method, null, targetDevice);\n if (!this._verifier) {\n throw newUnknownMethodError();\n }\n this._chosenMethod = method;\n }\n }\n return this._verifier;\n }\n\n /**\n * sends the initial .request event.\n * @returns {Promise} resolves when the event has been sent.\n */\n async sendRequest() {\n if (!this.observeOnly && this._phase === PHASE_UNSENT) {\n const methods = [...this._verificationMethods.keys()];\n await this.channel.send(REQUEST_TYPE, { methods });\n }\n }\n\n /**\n * Cancels the request, sending a cancellation to the other party\n * @param {string?} error.reason the error reason to send the cancellation with\n * @param {string?} error.code the error code to send the cancellation with\n * @returns {Promise} resolves when the event has been sent.\n */\n async cancel({ reason = \"User declined\", code = \"m.user\" } = {}) {\n if (!this.observeOnly && this._phase !== PHASE_CANCELLED) {\n this._declining = true;\n this.emit(\"change\");\n if (this._verifier) {\n return this._verifier.cancel(errorFactory(code, reason)());\n } else {\n this._cancellingUserId = this._client.getUserId();\n await this.channel.send(CANCEL_TYPE, { code, reason });\n }\n }\n }\n\n /**\n * Accepts the request, sending a .ready event to the other party\n * @returns {Promise} resolves when the event has been sent.\n */\n async accept() {\n if (!this.observeOnly && this.phase === PHASE_REQUESTED && !this.initiatedByMe) {\n const methods = [...this._verificationMethods.keys()];\n this._accepting = true;\n this.emit(\"change\");\n await this.channel.send(READY_TYPE, { methods });\n }\n }\n\n /**\n * Can be used to listen for state changes until the callback returns true.\n * @param {Function} fn callback to evaluate whether the request is in the desired state.\n * Takes the request as an argument.\n * @returns {Promise} that resolves once the callback returns true\n * @throws {Error} when the request is cancelled\n */\n waitFor(fn) {\n return new Promise((resolve, reject) => {\n const check = () => {\n let handled = false;\n if (fn(this)) {\n resolve(this);\n handled = true;\n } else if (this.cancelled) {\n reject(new Error(\"cancelled\"));\n handled = true;\n }\n if (handled) {\n this.off(\"change\", check);\n }\n return handled;\n };\n if (!check()) {\n this.on(\"change\", check);\n }\n });\n }\n\n _setPhase(phase, notify = true) {\n this._phase = phase;\n if (notify) {\n this.emit(\"change\");\n }\n }\n\n _getEventByEither(type) {\n return this._eventsByThem.get(type) || this._eventsByUs.get(type);\n }\n\n _getEventBy(type, byThem) {\n if (byThem) {\n return this._eventsByThem.get(type);\n } else {\n return this._eventsByUs.get(type);\n }\n }\n\n _calculatePhaseTransitions() {\n const transitions = [{ phase: PHASE_UNSENT }];\n const phase = () => transitions[transitions.length - 1].phase;\n\n // always pass by .request first to be sure channel.userId has been set\n const hasRequestByThem = this._eventsByThem.has(REQUEST_TYPE);\n const requestEvent = this._getEventBy(REQUEST_TYPE, hasRequestByThem);\n if (requestEvent) {\n transitions.push({ phase: PHASE_REQUESTED, event: requestEvent });\n }\n\n const readyEvent =\n requestEvent && this._getEventBy(READY_TYPE, !hasRequestByThem);\n if (readyEvent && phase() === PHASE_REQUESTED) {\n transitions.push({ phase: PHASE_READY, event: readyEvent });\n }\n\n let startEvent;\n if (readyEvent || !requestEvent) {\n const theirStartEvent = this._eventsByThem.get(START_TYPE);\n const ourStartEvent = this._eventsByUs.get(START_TYPE);\n // any party can send .start after a .ready or unsent\n if (theirStartEvent && ourStartEvent) {\n startEvent = theirStartEvent.getSender() < ourStartEvent.getSender() ?\n theirStartEvent : ourStartEvent;\n } else {\n startEvent = theirStartEvent ? theirStartEvent : ourStartEvent;\n }\n } else {\n startEvent = this._getEventBy(START_TYPE, !hasRequestByThem);\n }\n if (startEvent) {\n const fromRequestPhase = phase() === PHASE_REQUESTED &&\n requestEvent.getSender() !== startEvent.getSender();\n const fromUnsentPhase = phase() === PHASE_UNSENT &&\n this.channel.constructor.canCreateRequest(START_TYPE);\n if (fromRequestPhase || phase() === PHASE_READY || fromUnsentPhase) {\n transitions.push({ phase: PHASE_STARTED, event: startEvent });\n }\n }\n\n const ourDoneEvent = this._eventsByUs.get(DONE_TYPE);\n if (this._verifierHasFinished || (ourDoneEvent && phase() === PHASE_STARTED)) {\n transitions.push({ phase: PHASE_DONE });\n }\n\n const cancelEvent = this._getEventByEither(CANCEL_TYPE);\n if ((this._cancelled || cancelEvent) && phase() !== PHASE_DONE) {\n transitions.push({ phase: PHASE_CANCELLED, event: cancelEvent });\n return transitions;\n }\n\n return transitions;\n }\n\n _transitionToPhase(transition) {\n const { phase, event } = transition;\n // get common methods\n if (phase === PHASE_REQUESTED || phase === PHASE_READY) {\n if (!this._wasSentByOwnDevice(event)) {\n const content = event.getContent();\n this._commonMethods =\n content.methods.filter(m => this._verificationMethods.has(m));\n }\n }\n // detect if we're not a party in the request, and we should just observe\n if (!this.observeOnly) {\n // if requested or accepted by one of my other devices\n if (phase === PHASE_REQUESTED ||\n phase === PHASE_STARTED ||\n phase === PHASE_READY\n ) {\n if (\n this.channel.receiveStartFromOtherDevices &&\n this._wasSentByOwnUser(event) &&\n !this._wasSentByOwnDevice(event)\n ) {\n this._observeOnly = true;\n }\n }\n }\n // create verifier\n if (phase === PHASE_STARTED) {\n const { method } = event.getContent();\n if (!this._verifier && !this.observeOnly) {\n this._verifier = this._createVerifier(method, event);\n if (!this._verifier) {\n this.cancel({\n code: \"m.unknown_method\",\n reason: `Unknown method: ${method}`,\n });\n } else {\n this._chosenMethod = method;\n }\n }\n }\n }\n\n _applyPhaseTransitions() {\n const transitions = this._calculatePhaseTransitions();\n const existingIdx = transitions.findIndex(t => t.phase === this.phase);\n // trim off phases we already went through, if any\n const newTransitions = transitions.slice(existingIdx + 1);\n // transition to all new phases\n for (const transition of newTransitions) {\n this._transitionToPhase(transition);\n }\n return newTransitions;\n }\n\n _isWinningStartRace(newEvent) {\n if (newEvent.getType() !== START_TYPE) {\n return false;\n }\n const oldEvent = this._verifier.startEvent;\n\n let oldRaceIdentifier;\n if (this.isSelfVerification) {\n // if the verifier does not have a startEvent,\n // it is because it's still sending and we are on the initator side\n // we know we are sending a .start event because we already\n // have a verifier (checked in calling method)\n if (oldEvent) {\n const oldContent = oldEvent.getContent();\n oldRaceIdentifier = oldContent && oldContent.from_device;\n } else {\n oldRaceIdentifier = this._client.getDeviceId();\n }\n } else {\n if (oldEvent) {\n oldRaceIdentifier = oldEvent.getSender();\n } else {\n oldRaceIdentifier = this._client.getUserId();\n }\n }\n\n let newRaceIdentifier;\n if (this.isSelfVerification) {\n const newContent = newEvent.getContent();\n newRaceIdentifier = newContent && newContent.from_device;\n } else {\n newRaceIdentifier = newEvent.getSender();\n }\n return newRaceIdentifier < oldRaceIdentifier;\n }\n\n hasEventId(eventId) {\n for (const event of this._eventsByUs.values()) {\n if (event.getId() === eventId) {\n return true;\n }\n }\n for (const event of this._eventsByThem.values()) {\n if (event.getId() === eventId) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * Changes the state of the request and verifier in response to a key verification event.\n * @param {string} type the \"symbolic\" event type, as returned by the `getEventType` function on the channel.\n * @param {MatrixEvent} event the event to handle. Don't call getType() on it but use the `type` parameter instead.\n * @param {bool} isLiveEvent whether this is an even received through sync or not\n * @param {bool} isRemoteEcho whether this is the remote echo of an event sent by the same device\n * @param {bool} isSentByUs whether this event is sent by a party that can accept and/or observe the request like one of our peers.\n * For InRoomChannel this means any device for the syncing user. For ToDeviceChannel, just the syncing device.\n * @returns {Promise} a promise that resolves when any requests as an anwser to the passed-in event are sent.\n */\n async handleEvent(type, event, isLiveEvent, isRemoteEcho, isSentByUs) {\n // if reached phase cancelled or done, ignore anything else that comes\n if (this.done || this.cancelled) {\n return;\n }\n const wasObserveOnly = this._observeOnly;\n\n this._adjustObserveOnly(event, isLiveEvent);\n\n if (!this.observeOnly && !isRemoteEcho) {\n if (await this._cancelOnError(type, event)) {\n return;\n }\n }\n\n // This assumes verification won't need to send an event with\n // the same type for the same party twice.\n // This is true for QR and SAS verification, and was\n // added here to prevent verification getting cancelled\n // when the server duplicates an event (https://github.com/matrix-org/synapse/issues/3365)\n const isDuplicateEvent = isSentByUs ?\n this._eventsByUs.has(type) :\n this._eventsByThem.has(type);\n if (isDuplicateEvent) {\n return;\n }\n\n const oldPhase = this.phase;\n this._addEvent(type, event, isSentByUs);\n\n // this will create if needed the verifier so needs to happen before calling it\n const newTransitions = this._applyPhaseTransitions();\n try {\n // only pass events from the other side to the verifier,\n // no remote echos of our own events\n if (this._verifier && !this.observeOnly) {\n const newEventWinsRace = this._isWinningStartRace(event);\n if (this._verifier.canSwitchStartEvent(event) && newEventWinsRace) {\n this._verifier.switchStartEvent(event);\n } else if (!isRemoteEcho) {\n if (type === CANCEL_TYPE || (this._verifier.events\n && this._verifier.events.includes(type))) {\n this._verifier.handleEvent(event);\n }\n }\n }\n\n if (newTransitions.length) {\n // create QRCodeData if the other side can scan\n // important this happens before emitting a phase change,\n // so listeners can rely on it being there already\n // We only do this for live events because it is important that\n // we sign the keys that were in the QR code, and not the keys\n // we happen to have at some later point in time.\n if (isLiveEvent && newTransitions.some(t => t.phase === PHASE_READY)) {\n const shouldGenerateQrCode =\n this.otherPartySupportsMethod(SCAN_QR_CODE_METHOD, true);\n if (shouldGenerateQrCode) {\n this._qrCodeData = await QRCodeData.create(this, this._client);\n }\n }\n\n const lastTransition = newTransitions[newTransitions.length - 1];\n const { phase } = lastTransition;\n\n this._setupTimeout(phase);\n // set phase as last thing as this emits the \"change\" event\n this._setPhase(phase);\n } else if (this._observeOnly !== wasObserveOnly) {\n this.emit(\"change\");\n }\n } finally {\n // log events we processed so we can see from rageshakes what events were added to a request\n logger.log(`Verification request ${this.channel.transactionId}: ` +\n `${type} event with id:${event.getId()}, ` +\n `content:${JSON.stringify(event.getContent())} ` +\n `deviceId:${this.channel.deviceId}, ` +\n `sender:${event.getSender()}, isSentByUs:${isSentByUs}, ` +\n `isLiveEvent:${isLiveEvent}, isRemoteEcho:${isRemoteEcho}, ` +\n `phase:${oldPhase}=>${this.phase}, ` +\n `observeOnly:${wasObserveOnly}=>${this._observeOnly}`);\n }\n }\n\n _setupTimeout(phase) {\n const shouldTimeout = !this._timeoutTimer && !this.observeOnly &&\n phase === PHASE_REQUESTED;\n\n if (shouldTimeout) {\n this._timeoutTimer = setTimeout(this._cancelOnTimeout, this.timeout);\n }\n if (this._timeoutTimer) {\n const shouldClear = phase === PHASE_STARTED ||\n phase === PHASE_READY ||\n phase === PHASE_DONE ||\n phase === PHASE_CANCELLED;\n if (shouldClear) {\n clearTimeout(this._timeoutTimer);\n this._timeoutTimer = null;\n }\n }\n }\n\n _cancelOnTimeout = () => {\n try {\n if (this.initiatedByMe) {\n this.cancel({\n reason: \"Other party didn't accept in time\",\n code: \"m.timeout\",\n });\n } else {\n this.cancel({\n reason: \"User didn't accept in time\",\n code: \"m.timeout\",\n });\n }\n } catch (err) {\n logger.error(\"Error while cancelling verification request\", err);\n }\n };\n\n async _cancelOnError(type, event) {\n if (type === START_TYPE) {\n const method = event.getContent().method;\n if (!this._verificationMethods.has(method)) {\n await this.cancel(errorFromEvent(newUnknownMethodError()));\n return true;\n }\n }\n\n const isUnexpectedRequest = type === REQUEST_TYPE && this.phase !== PHASE_UNSENT;\n const isUnexpectedReady = type === READY_TYPE && this.phase !== PHASE_REQUESTED;\n // only if phase has passed from PHASE_UNSENT should we cancel, because events\n // are allowed to come in in any order (at least with InRoomChannel). So we only know\n // we're dealing with a valid request we should participate in once we've moved to PHASE_REQUESTED\n // before that, we could be looking at somebody elses verification request and we just\n // happen to be in the room\n if (this.phase !== PHASE_UNSENT && (isUnexpectedRequest || isUnexpectedReady)) {\n logger.warn(`Cancelling, unexpected ${type} verification ` +\n `event from ${event.getSender()}`);\n const reason = `Unexpected ${type} event in phase ${this.phase}`;\n await this.cancel(errorFromEvent(newUnexpectedMessageError({ reason })));\n return true;\n }\n return false;\n }\n\n _adjustObserveOnly(event, isLiveEvent) {\n // don't send out events for historical requests\n if (!isLiveEvent) {\n this._observeOnly = true;\n }\n if (this.calculateEventTimeout(event) < VERIFICATION_REQUEST_MARGIN) {\n this._observeOnly = true;\n }\n }\n\n _addEvent(type, event, isSentByUs) {\n if (isSentByUs) {\n this._eventsByUs.set(type, event);\n } else {\n this._eventsByThem.set(type, event);\n }\n\n // once we know the userId of the other party (from the .request event)\n // see if any event by anyone else crept into this._eventsByThem\n if (type === REQUEST_TYPE) {\n for (const [type, event] of this._eventsByThem.entries()) {\n if (event.getSender() !== this.otherUserId) {\n this._eventsByThem.delete(type);\n }\n }\n // also remember when we received the request event\n this._requestReceivedAt = Date.now();\n }\n }\n\n _createVerifier(method, startEvent = null, targetDevice = null) {\n if (!targetDevice) {\n targetDevice = this.targetDevice;\n }\n const { userId, deviceId } = targetDevice;\n\n const VerifierCtor = this._verificationMethods.get(method);\n if (!VerifierCtor) {\n logger.warn(\"could not find verifier constructor for method\", method);\n return;\n }\n return new VerifierCtor(\n this.channel,\n this._client,\n userId,\n deviceId,\n startEvent,\n this,\n );\n }\n\n _wasSentByOwnUser(event) {\n return event.getSender() === this._client.getUserId();\n }\n\n // only for .request, .ready or .start\n _wasSentByOwnDevice(event) {\n if (!this._wasSentByOwnUser(event)) {\n return false;\n }\n const content = event.getContent();\n if (!content || content.from_device !== this._client.getDeviceId()) {\n return false;\n }\n return true;\n }\n\n onVerifierCancelled() {\n this._cancelled = true;\n // move to cancelled phase\n const newTransitions = this._applyPhaseTransitions();\n if (newTransitions.length) {\n this._setPhase(newTransitions[newTransitions.length - 1].phase);\n }\n }\n\n onVerifierFinished() {\n this.channel.send(\"m.key.verification.done\", {});\n this._verifierHasFinished = true;\n // move to .done phase\n const newTransitions = this._applyPhaseTransitions();\n if (newTransitions.length) {\n this._setPhase(newTransitions[newTransitions.length - 1].phase);\n }\n }\n\n getEventFromOtherParty(type) {\n return this._eventsByThem.get(type);\n }\n}\n", "// can't just do InvalidStoreError extends Error\n// because of http://babeljs.io/docs/usage/caveats/#classes\nexport function InvalidStoreError(reason, value) {\n const message = `Store is invalid because ${reason}, ` +\n `please stop the client, delete all data and start the client again`;\n const instance = Reflect.construct(Error, [message]);\n Reflect.setPrototypeOf(instance, Reflect.getPrototypeOf(this));\n instance.reason = reason;\n instance.value = value;\n return instance;\n}\n\nInvalidStoreError.TOGGLED_LAZY_LOADING = \"TOGGLED_LAZY_LOADING\";\n\nInvalidStoreError.prototype = Object.create(Error.prototype, {\n constructor: {\n value: Error,\n enumerable: false,\n writable: true,\n configurable: true,\n },\n});\nReflect.setPrototypeOf(InvalidStoreError, Error);\n\nexport function InvalidCryptoStoreError(reason) {\n const message = `Crypto store is invalid because ${reason}, ` +\n `please stop the client, delete all data and start the client again`;\n const instance = Reflect.construct(Error, [message]);\n Reflect.setPrototypeOf(instance, Reflect.getPrototypeOf(this));\n instance.reason = reason;\n instance.name = 'InvalidCryptoStoreError';\n return instance;\n}\n\nInvalidCryptoStoreError.TOO_NEW = \"TOO_NEW\";\n\nInvalidCryptoStoreError.prototype = Object.create(Error.prototype, {\n constructor: {\n value: Error,\n enumerable: false,\n writable: true,\n configurable: true,\n },\n});\nReflect.setPrototypeOf(InvalidCryptoStoreError, Error);\n\nexport class KeySignatureUploadError extends Error {\n constructor(message, value) {\n super(message);\n this.value = value;\n }\n}\n", "/*\nCopyright 2021 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\nimport { MatrixClient } from \"./client\";\nimport { IEvent, MatrixEvent } from \"./models/event\";\n\nexport type EventMapper = (obj: Partial) => MatrixEvent;\n\nexport interface MapperOpts {\n preventReEmit?: boolean;\n decrypt?: boolean;\n}\n\nexport function eventMapperFor(client: MatrixClient, options: MapperOpts): EventMapper {\n const preventReEmit = Boolean(options.preventReEmit);\n const decrypt = options.decrypt !== false;\n\n function mapper(plainOldJsObject: Partial) {\n const event = new MatrixEvent(plainOldJsObject);\n if (event.isEncrypted()) {\n if (!preventReEmit) {\n client.reEmitter.reEmit(event, [\n \"Event.decrypted\",\n ]);\n }\n if (decrypt) {\n client.decryptEventIfNeeded(event);\n }\n }\n if (!preventReEmit) {\n client.reEmitter.reEmit(event, [\"Event.replaced\"]);\n }\n return event;\n }\n\n return mapper;\n}\n", @@ -278,42 +279,43 @@ "/*\nCopyright 2015 - 2021 Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n/**\n * @module filter\n */\n\nimport { FilterComponent, IFilterComponent } from \"./filter-component\";\nimport { MatrixEvent } from \"./models/event\";\n\n/**\n * @param {Object} obj\n * @param {string} keyNesting\n * @param {*} val\n */\nfunction setProp(obj: object, keyNesting: string, val: any) {\n const nestedKeys = keyNesting.split(\".\");\n let currentObj = obj;\n for (let i = 0; i < (nestedKeys.length - 1); i++) {\n if (!currentObj[nestedKeys[i]]) {\n currentObj[nestedKeys[i]] = {};\n }\n currentObj = currentObj[nestedKeys[i]];\n }\n currentObj[nestedKeys[nestedKeys.length - 1]] = val;\n}\n\n/* eslint-disable camelcase */\nexport interface IFilterDefinition {\n event_fields?: string[];\n event_format?: \"client\" | \"federation\";\n presence?: IFilterComponent;\n account_data?: IFilterComponent;\n room?: IRoomFilter;\n}\n\nexport interface IRoomEventFilter extends IFilterComponent {\n lazy_load_members?: boolean;\n include_redundant_members?: boolean;\n}\n\ninterface IStateFilter extends IRoomEventFilter {}\n\ninterface IRoomFilter {\n not_rooms?: string[];\n rooms?: string[];\n ephemeral?: IRoomEventFilter;\n include_leave?: boolean;\n state?: IStateFilter;\n timeline?: IRoomEventFilter;\n account_data?: IRoomEventFilter;\n}\n/* eslint-enable camelcase */\n\n/**\n * Construct a new Filter.\n * @constructor\n * @param {string} userId The user ID for this filter.\n * @param {string=} filterId The filter ID if known.\n * @prop {string} userId The user ID of the filter\n * @prop {?string} filterId The filter ID\n */\nexport class Filter {\n static LAZY_LOADING_MESSAGES_FILTER = {\n lazy_load_members: true,\n };\n\n /**\n * Create a filter from existing data.\n * @static\n * @param {string} userId\n * @param {string} filterId\n * @param {Object} jsonObj\n * @return {Filter}\n */\n public static fromJson(userId: string, filterId: string, jsonObj: IFilterDefinition): Filter {\n const filter = new Filter(userId, filterId);\n filter.setDefinition(jsonObj);\n return filter;\n }\n\n private definition: IFilterDefinition = {};\n private roomFilter: FilterComponent;\n private roomTimelineFilter: FilterComponent;\n\n constructor(public readonly userId: string, public filterId?: string) {}\n\n /**\n * Get the ID of this filter on your homeserver (if known)\n * @return {?string} The filter ID\n */\n getFilterId(): string | null {\n return this.filterId;\n }\n\n /**\n * Get the JSON body of the filter.\n * @return {Object} The filter definition\n */\n getDefinition(): IFilterDefinition {\n return this.definition;\n }\n\n /**\n * Set the JSON body of the filter\n * @param {Object} definition The filter definition\n */\n setDefinition(definition: IFilterDefinition) {\n this.definition = definition;\n\n // This is all ported from synapse's FilterCollection()\n\n // definitions look something like:\n // {\n // \"room\": {\n // \"rooms\": [\"!abcde:example.com\"],\n // \"not_rooms\": [\"!123456:example.com\"],\n // \"state\": {\n // \"types\": [\"m.room.*\"],\n // \"not_rooms\": [\"!726s6s6q:example.com\"],\n // \"lazy_load_members\": true,\n // },\n // \"timeline\": {\n // \"limit\": 10,\n // \"types\": [\"m.room.message\"],\n // \"not_rooms\": [\"!726s6s6q:example.com\"],\n // \"not_senders\": [\"@spam:example.com\"]\n // \"contains_url\": true\n // },\n // \"ephemeral\": {\n // \"types\": [\"m.receipt\", \"m.typing\"],\n // \"not_rooms\": [\"!726s6s6q:example.com\"],\n // \"not_senders\": [\"@spam:example.com\"]\n // }\n // },\n // \"presence\": {\n // \"types\": [\"m.presence\"],\n // \"not_senders\": [\"@alice:example.com\"]\n // },\n // \"event_format\": \"client\",\n // \"event_fields\": [\"type\", \"content\", \"sender\"]\n // }\n\n const roomFilterJson = definition.room;\n\n // consider the top level rooms/not_rooms filter\n const roomFilterFields: IRoomFilter = {};\n if (roomFilterJson) {\n if (roomFilterJson.rooms) {\n roomFilterFields.rooms = roomFilterJson.rooms;\n }\n if (roomFilterJson.rooms) {\n roomFilterFields.not_rooms = roomFilterJson.not_rooms;\n }\n }\n\n this.roomFilter = new FilterComponent(roomFilterFields);\n this.roomTimelineFilter = new FilterComponent(roomFilterJson?.timeline || {});\n\n // don't bother porting this from synapse yet:\n // this._room_state_filter =\n // new FilterComponent(roomFilterJson.state || {});\n // this._room_ephemeral_filter =\n // new FilterComponent(roomFilterJson.ephemeral || {});\n // this._room_account_data_filter =\n // new FilterComponent(roomFilterJson.account_data || {});\n // this._presence_filter =\n // new FilterComponent(definition.presence || {});\n // this._account_data_filter =\n // new FilterComponent(definition.account_data || {});\n }\n\n /**\n * Get the room.timeline filter component of the filter\n * @return {FilterComponent} room timeline filter component\n */\n getRoomTimelineFilterComponent(): FilterComponent {\n return this.roomTimelineFilter;\n }\n\n /**\n * Filter the list of events based on whether they are allowed in a timeline\n * based on this filter\n * @param {MatrixEvent[]} events the list of events being filtered\n * @return {MatrixEvent[]} the list of events which match the filter\n */\n filterRoomTimeline(events: MatrixEvent[]): MatrixEvent[] {\n return this.roomTimelineFilter.filter(this.roomFilter.filter(events));\n }\n\n /**\n * Set the max number of events to return for each room's timeline.\n * @param {Number} limit The max number of events to return for each room.\n */\n setTimelineLimit(limit: number) {\n setProp(this.definition, \"room.timeline.limit\", limit);\n }\n\n setLazyLoadMembers(enabled: boolean) {\n setProp(this.definition, \"room.state.lazy_load_members\", !!enabled);\n }\n\n /**\n * Control whether left rooms should be included in responses.\n * @param {boolean} includeLeave True to make rooms the user has left appear\n * in responses.\n */\n setIncludeLeaveRooms(includeLeave: boolean) {\n setProp(this.definition, \"room.include_leave\", includeLeave);\n }\n}\n", "/*\nCopyright 2015, 2016 OpenMarket Ltd\nCopyright 2019 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n/**\n * This is an internal module. See {@link MatrixHttpApi} for the public class.\n * @module http-api\n */\n\nimport { parse as parseContentType } from \"content-type\";\nimport * as utils from \"./utils\";\nimport { logger } from './logger';\n\n// we use our own implementation of setTimeout, so that if we get suspended in\n// the middle of a /sync, we cancel the sync as soon as we awake, rather than\n// waiting for the delay to elapse.\nimport * as callbacks from \"./realtime-callbacks\";\n\n/*\nTODO:\n- CS: complete register function (doing stages)\n- Identity server: linkEmail, authEmail, bindEmail, lookup3pid\n*/\n\n/**\n * A constant representing the URI path for release 0 of the Client-Server HTTP API.\n */\nexport const PREFIX_R0 = \"/_matrix/client/r0\";\n\n/**\n * A constant representing the URI path for as-yet unspecified Client-Server HTTP APIs.\n */\nexport const PREFIX_UNSTABLE = \"/_matrix/client/unstable\";\n\n/**\n * URI path for v1 of the the identity API\n * @deprecated Use v2.\n */\nexport const PREFIX_IDENTITY_V1 = \"/_matrix/identity/api/v1\";\n\n/**\n * URI path for the v2 identity API\n */\nexport const PREFIX_IDENTITY_V2 = \"/_matrix/identity/v2\";\n\n/**\n * URI path for the media repo API\n */\nexport const PREFIX_MEDIA_R0 = \"/_matrix/media/r0\";\n\n/**\n * Construct a MatrixHttpApi.\n * @constructor\n * @param {EventEmitter} event_emitter The event emitter to use for emitting events\n * @param {Object} opts The options to use for this HTTP API.\n * @param {string} opts.baseUrl Required. The base client-server URL e.g.\n * 'http://localhost:8008'.\n * @param {Function} opts.request Required. The function to call for HTTP\n * requests. This function must look like function(opts, callback){ ... }.\n * @param {string} opts.prefix Required. The matrix client prefix to use, e.g.\n * '/_matrix/client/r0'. See PREFIX_R0 and PREFIX_UNSTABLE for constants.\n *\n * @param {boolean} opts.onlyData True to return only the 'data' component of the\n * response (e.g. the parsed HTTP body). If false, requests will return an\n * object with the properties code, headers and data.\n *\n * @param {string} opts.accessToken The access_token to send with requests. Can be\n * null to not send an access token.\n * @param {Object=} opts.extraParams Optional. Extra query parameters to send on\n * requests.\n * @param {Number=} opts.localTimeoutMs The default maximum amount of time to wait\n * before timing out the request. If not specified, there is no timeout.\n * @param {boolean} [opts.useAuthorizationHeader = false] Set to true to use\n * Authorization header instead of query param to send the access token to the server.\n */\nexport function MatrixHttpApi(event_emitter, opts) {\n utils.checkObjectHasKeys(opts, [\"baseUrl\", \"request\", \"prefix\"]);\n opts.onlyData = opts.onlyData || false;\n this.event_emitter = event_emitter;\n this.opts = opts;\n this.useAuthorizationHeader = Boolean(opts.useAuthorizationHeader);\n this.uploads = [];\n}\n\nMatrixHttpApi.prototype = {\n /**\n * Sets the baase URL for the identity server\n * @param {string} url The new base url\n */\n setIdBaseUrl: function(url) {\n this.opts.idBaseUrl = url;\n },\n\n /**\n * Get the content repository url with query parameters.\n * @return {Object} An object with a 'base', 'path' and 'params' for base URL,\n * path and query parameters respectively.\n */\n getContentUri: function() {\n const params = {\n access_token: this.opts.accessToken,\n };\n return {\n base: this.opts.baseUrl,\n path: \"/_matrix/media/r0/upload\",\n params: params,\n };\n },\n\n /**\n * Upload content to the homeserver\n *\n * @param {object} file The object to upload. On a browser, something that\n * can be sent to XMLHttpRequest.send (typically a File). Under node.js,\n * a Buffer, String or ReadStream.\n *\n * @param {object} opts options object\n *\n * @param {string=} opts.name Name to give the file on the server. Defaults\n * to file.name.\n *\n * @param {boolean=} opts.includeFilename if false will not send the filename,\n * e.g for encrypted file uploads where filename leaks are undesirable.\n * Defaults to true.\n *\n * @param {string=} opts.type Content-type for the upload. Defaults to\n * file.type, or applicaton/octet-stream.\n *\n * @param {boolean=} opts.rawResponse Return the raw body, rather than\n * parsing the JSON. Defaults to false (except on node.js, where it\n * defaults to true for backwards compatibility).\n *\n * @param {boolean=} opts.onlyContentUri Just return the content URI,\n * rather than the whole body. Defaults to false (except on browsers,\n * where it defaults to true for backwards compatibility). Ignored if\n * opts.rawResponse is true.\n *\n * @param {Function=} opts.callback Deprecated. Optional. The callback to\n * invoke on success/failure. See the promise return values for more\n * information.\n *\n * @param {Function=} opts.progressHandler Optional. Called when a chunk of\n * data has been uploaded, with an object containing the fields `loaded`\n * (number of bytes transferred) and `total` (total size, if known).\n *\n * @return {Promise} Resolves to response object, as\n * determined by this.opts.onlyData, opts.rawResponse, and\n * opts.onlyContentUri. Rejects with an error (usually a MatrixError).\n */\n uploadContent: function(file, opts) {\n if (utils.isFunction(opts)) {\n // opts used to be callback\n opts = {\n callback: opts,\n };\n } else if (opts === undefined) {\n opts = {};\n }\n\n // default opts.includeFilename to true (ignoring falsey values)\n const includeFilename = opts.includeFilename !== false;\n\n // if the file doesn't have a mime type, use a default since\n // the HS errors if we don't supply one.\n const contentType = opts.type || file.type || 'application/octet-stream';\n const fileName = opts.name || file.name;\n\n // We used to recommend setting file.stream to the thing to upload on\n // Node.js. As of 2019-06-11, this is still in widespread use in various\n // clients, so we should preserve this for simple objects used in\n // Node.js. File API objects (via either the File or Blob interfaces) in\n // the browser now define a `stream` method, which leads to trouble\n // here, so we also check the type of `stream`.\n let body = file;\n if (body.stream && typeof body.stream !== \"function\") {\n logger.warn(\n \"Using `file.stream` as the content to upload. Future \" +\n \"versions of the js-sdk will change this to expect `file` to \" +\n \"be the content directly.\",\n );\n body = body.stream;\n }\n\n // backwards-compatibility hacks where we used to do different things\n // between browser and node.\n let rawResponse = opts.rawResponse;\n if (rawResponse === undefined) {\n if (global.XMLHttpRequest) {\n rawResponse = false;\n } else {\n logger.warn(\n \"Returning the raw JSON from uploadContent(). Future \" +\n \"versions of the js-sdk will change this default, to \" +\n \"return the parsed object. Set opts.rawResponse=false \" +\n \"to change this behaviour now.\",\n );\n rawResponse = true;\n }\n }\n\n let onlyContentUri = opts.onlyContentUri;\n if (!rawResponse && onlyContentUri === undefined) {\n if (global.XMLHttpRequest) {\n logger.warn(\n \"Returning only the content-uri from uploadContent(). \" +\n \"Future versions of the js-sdk will change this \" +\n \"default, to return the whole response object. Set \" +\n \"opts.onlyContentUri=false to change this behaviour now.\",\n );\n onlyContentUri = true;\n } else {\n onlyContentUri = false;\n }\n }\n\n // browser-request doesn't support File objects because it deep-copies\n // the options using JSON.parse(JSON.stringify(options)). Instead of\n // loading the whole file into memory as a string and letting\n // browser-request base64 encode and then decode it again, we just\n // use XMLHttpRequest directly.\n // (browser-request doesn't support progress either, which is also kind\n // of important here)\n\n const upload = { loaded: 0, total: 0 };\n let promise;\n\n // XMLHttpRequest doesn't parse JSON for us. request normally does, but\n // we're setting opts.json=false so that it doesn't JSON-encode the\n // request, which also means it doesn't JSON-decode the response. Either\n // way, we have to JSON-parse the response ourselves.\n let bodyParser = null;\n if (!rawResponse) {\n bodyParser = function(rawBody) {\n let body = JSON.parse(rawBody);\n if (onlyContentUri) {\n body = body.content_uri;\n if (body === undefined) {\n throw Error('Bad response');\n }\n }\n return body;\n };\n }\n\n if (global.XMLHttpRequest) {\n const defer = utils.defer();\n const xhr = new global.XMLHttpRequest();\n upload.xhr = xhr;\n const cb = requestCallback(defer, opts.callback, this.opts.onlyData);\n\n const timeout_fn = function() {\n xhr.abort();\n cb(new Error('Timeout'));\n };\n\n // set an initial timeout of 30s; we'll advance it each time we get\n // a progress notification\n xhr.timeout_timer = callbacks.setTimeout(timeout_fn, 30000);\n\n xhr.onreadystatechange = function() {\n let resp;\n switch (xhr.readyState) {\n case global.XMLHttpRequest.DONE:\n callbacks.clearTimeout(xhr.timeout_timer);\n try {\n if (xhr.status === 0) {\n throw new AbortError();\n }\n if (!xhr.responseText) {\n throw new Error('No response body.');\n }\n resp = xhr.responseText;\n if (bodyParser) {\n resp = bodyParser(resp);\n }\n } catch (err) {\n err.http_status = xhr.status;\n cb(err);\n return;\n }\n cb(undefined, xhr, resp);\n break;\n }\n };\n xhr.upload.addEventListener(\"progress\", function(ev) {\n callbacks.clearTimeout(xhr.timeout_timer);\n upload.loaded = ev.loaded;\n upload.total = ev.total;\n xhr.timeout_timer = callbacks.setTimeout(timeout_fn, 30000);\n if (opts.progressHandler) {\n opts.progressHandler({\n loaded: ev.loaded,\n total: ev.total,\n });\n }\n });\n let url = this.opts.baseUrl + \"/_matrix/media/r0/upload\";\n\n const queryArgs = [];\n\n if (includeFilename && fileName) {\n queryArgs.push(\"filename=\" + encodeURIComponent(fileName));\n }\n\n if (!this.useAuthorizationHeader) {\n queryArgs.push(\"access_token=\"\n + encodeURIComponent(this.opts.accessToken));\n }\n\n if (queryArgs.length > 0) {\n url += \"?\" + queryArgs.join(\"&\");\n }\n\n xhr.open(\"POST\", url);\n if (this.useAuthorizationHeader) {\n xhr.setRequestHeader(\"Authorization\", \"Bearer \" + this.opts.accessToken);\n }\n xhr.setRequestHeader(\"Content-Type\", contentType);\n xhr.send(body);\n promise = defer.promise;\n\n // dirty hack (as per _request) to allow the upload to be cancelled.\n promise.abort = xhr.abort.bind(xhr);\n } else {\n const queryParams = {};\n\n if (includeFilename && fileName) {\n queryParams.filename = fileName;\n }\n\n promise = this.authedRequest(\n opts.callback, \"POST\", \"/upload\", queryParams, body, {\n prefix: \"/_matrix/media/r0\",\n headers: { \"Content-Type\": contentType },\n json: false,\n bodyParser: bodyParser,\n },\n );\n }\n\n const self = this;\n\n // remove the upload from the list on completion\n const promise0 = promise.finally(function() {\n for (let i = 0; i < self.uploads.length; ++i) {\n if (self.uploads[i] === upload) {\n self.uploads.splice(i, 1);\n return;\n }\n }\n });\n\n // copy our dirty abort() method to the new promise\n promise0.abort = promise.abort;\n\n upload.promise = promise0;\n this.uploads.push(upload);\n\n return promise0;\n },\n\n cancelUpload: function(promise) {\n if (promise.abort) {\n promise.abort();\n return true;\n }\n return false;\n },\n\n getCurrentUploads: function() {\n return this.uploads;\n },\n\n idServerRequest: function(\n callback,\n method,\n path,\n params,\n prefix,\n accessToken,\n ) {\n if (!this.opts.idBaseUrl) {\n throw new Error(\"No identity server base URL set\");\n }\n\n const fullUri = this.opts.idBaseUrl + prefix + path;\n\n if (callback !== undefined && !utils.isFunction(callback)) {\n throw Error(\n \"Expected callback to be a function but got \" + typeof callback,\n );\n }\n\n const opts = {\n uri: fullUri,\n method: method,\n withCredentials: false,\n json: true, // we want a JSON response if we can\n _matrix_opts: this.opts,\n headers: {},\n };\n if (method === 'GET') {\n opts.qs = params;\n } else if (typeof params === \"object\") {\n opts.json = params;\n }\n if (accessToken) {\n opts.headers['Authorization'] = `Bearer ${accessToken}`;\n }\n\n const defer = utils.defer();\n this.opts.request(\n opts,\n requestCallback(defer, callback, this.opts.onlyData),\n );\n return defer.promise;\n },\n\n /**\n * Perform an authorised request to the homeserver.\n * @param {Function} callback Optional. The callback to invoke on\n * success/failure. See the promise return values for more information.\n * @param {string} method The HTTP method e.g. \"GET\".\n * @param {string} path The HTTP path after the supplied prefix e.g.\n * \"/createRoom\".\n *\n * @param {Object=} queryParams A dict of query params (these will NOT be\n * urlencoded). If unspecified, there will be no query params.\n *\n * @param {Object} [data] The HTTP JSON body.\n *\n * @param {Object|Number=} opts additional options. If a number is specified,\n * this is treated as `opts.localTimeoutMs`.\n *\n * @param {Number=} opts.localTimeoutMs The maximum amount of time to wait before\n * timing out the request. If not specified, there is no timeout.\n *\n * @param {sting=} opts.prefix The full prefix to use e.g.\n * \"/_matrix/client/v2_alpha\". If not specified, uses this.opts.prefix.\n *\n * @param {Object=} opts.headers map of additional request headers\n *\n * @return {Promise} Resolves to {data: {Object},\n * headers: {Object}, code: {Number}}.\n * If onlyData is set, this will resolve to the data\n * object only.\n * @return {module:http-api.MatrixError} Rejects with an error if a problem\n * occurred. This includes network problems and Matrix-specific error JSON.\n */\n authedRequest: function(callback, method, path, queryParams, data, opts) {\n if (!queryParams) {\n queryParams = {};\n }\n if (this.useAuthorizationHeader) {\n if (isFinite(opts)) {\n // opts used to be localTimeoutMs\n opts = {\n localTimeoutMs: opts,\n };\n }\n if (!opts) {\n opts = {};\n }\n if (!opts.headers) {\n opts.headers = {};\n }\n if (!opts.headers.Authorization) {\n opts.headers.Authorization = \"Bearer \" + this.opts.accessToken;\n }\n if (queryParams.access_token) {\n delete queryParams.access_token;\n }\n } else {\n if (!queryParams.access_token) {\n queryParams.access_token = this.opts.accessToken;\n }\n }\n\n const requestPromise = this.request(\n callback, method, path, queryParams, data, opts,\n );\n\n const self = this;\n requestPromise.catch(function(err) {\n if (err.errcode == 'M_UNKNOWN_TOKEN') {\n self.event_emitter.emit(\"Session.logged_out\", err);\n } else if (err.errcode == 'M_CONSENT_NOT_GIVEN') {\n self.event_emitter.emit(\n \"no_consent\",\n err.message,\n err.data.consent_uri,\n );\n }\n });\n\n // return the original promise, otherwise tests break due to it having to\n // go around the event loop one more time to process the result of the request\n return requestPromise;\n },\n\n /**\n * Perform a request to the homeserver without any credentials.\n * @param {Function} callback Optional. The callback to invoke on\n * success/failure. See the promise return values for more information.\n * @param {string} method The HTTP method e.g. \"GET\".\n * @param {string} path The HTTP path after the supplied prefix e.g.\n * \"/createRoom\".\n *\n * @param {Object=} queryParams A dict of query params (these will NOT be\n * urlencoded). If unspecified, there will be no query params.\n *\n * @param {Object} [data] The HTTP JSON body.\n *\n * @param {Object=} opts additional options\n *\n * @param {Number=} opts.localTimeoutMs The maximum amount of time to wait before\n * timing out the request. If not specified, there is no timeout.\n *\n * @param {sting=} opts.prefix The full prefix to use e.g.\n * \"/_matrix/client/v2_alpha\". If not specified, uses this.opts.prefix.\n *\n * @param {Object=} opts.headers map of additional request headers\n *\n * @return {Promise} Resolves to {data: {Object},\n * headers: {Object}, code: {Number}}.\n * If onlyData is set, this will resolve to the data\n * object only.\n * @return {module:http-api.MatrixError} Rejects with an error if a problem\n * occurred. This includes network problems and Matrix-specific error JSON.\n */\n request: function(callback, method, path, queryParams, data, opts) {\n opts = opts || {};\n const prefix = opts.prefix !== undefined ? opts.prefix : this.opts.prefix;\n const fullUri = this.opts.baseUrl + prefix + path;\n\n return this.requestOtherUrl(\n callback, method, fullUri, queryParams, data, opts,\n );\n },\n\n /**\n * Perform a request to an arbitrary URL.\n * @param {Function} callback Optional. The callback to invoke on\n * success/failure. See the promise return values for more information.\n * @param {string} method The HTTP method e.g. \"GET\".\n * @param {string} uri The HTTP URI\n *\n * @param {Object=} queryParams A dict of query params (these will NOT be\n * urlencoded). If unspecified, there will be no query params.\n *\n * @param {Object} [data] The HTTP JSON body.\n *\n * @param {Object=} opts additional options\n *\n * @param {Number=} opts.localTimeoutMs The maximum amount of time to wait before\n * timing out the request. If not specified, there is no timeout.\n *\n * @param {sting=} opts.prefix The full prefix to use e.g.\n * \"/_matrix/client/v2_alpha\". If not specified, uses this.opts.prefix.\n *\n * @param {Object=} opts.headers map of additional request headers\n *\n * @return {Promise} Resolves to {data: {Object},\n * headers: {Object}, code: {Number}}.\n * If onlyData is set, this will resolve to the data\n * object only.\n * @return {module:http-api.MatrixError} Rejects with an error if a problem\n * occurred. This includes network problems and Matrix-specific error JSON.\n */\n requestOtherUrl: function(callback, method, uri, queryParams, data,\n opts) {\n if (opts === undefined || opts === null) {\n opts = {};\n } else if (isFinite(opts)) {\n // opts used to be localTimeoutMs\n opts = {\n localTimeoutMs: opts,\n };\n }\n\n return this._request(\n callback, method, uri, queryParams, data, opts,\n );\n },\n\n /**\n * Form and return a homeserver request URL based on the given path\n * params and prefix.\n * @param {string} path The HTTP path after the supplied prefix e.g.\n * \"/createRoom\".\n * @param {Object} queryParams A dict of query params (these will NOT be\n * urlencoded).\n * @param {string} prefix The full prefix to use e.g.\n * \"/_matrix/client/v2_alpha\".\n * @return {string} URL\n */\n getUrl: function(path, queryParams, prefix) {\n let queryString = \"\";\n if (queryParams) {\n queryString = \"?\" + utils.encodeParams(queryParams);\n }\n return this.opts.baseUrl + prefix + path + queryString;\n },\n\n /**\n * @private\n *\n * @param {function} callback\n * @param {string} method\n * @param {string} uri\n * @param {object} queryParams\n * @param {object|string} data\n * @param {object=} opts\n *\n * @param {boolean} [opts.json =true] Json-encode data before sending, and\n * decode response on receipt. (We will still json-decode error\n * responses, even if this is false.)\n *\n * @param {object=} opts.headers extra request headers\n *\n * @param {number=} opts.localTimeoutMs client-side timeout for the\n * request. Default timeout if falsy.\n *\n * @param {function=} opts.bodyParser function to parse the body of the\n * response before passing it to the promise and callback.\n *\n * @return {Promise} a promise which resolves to either the\n * response object (if this.opts.onlyData is truthy), or the parsed\n * body. Rejects\n */\n _request: function(callback, method, uri, queryParams, data, opts) {\n if (callback !== undefined && !utils.isFunction(callback)) {\n throw Error(\n \"Expected callback to be a function but got \" + typeof callback,\n );\n }\n opts = opts || {};\n\n const self = this;\n if (this.opts.extraParams) {\n queryParams = {\n ...queryParams,\n ...this.opts.extraParams,\n };\n }\n\n const headers = utils.extend({}, opts.headers || {});\n const json = opts.json === undefined ? true : opts.json;\n let bodyParser = opts.bodyParser;\n\n // we handle the json encoding/decoding here, because request and\n // browser-request make a mess of it. Specifically, they attempt to\n // json-decode plain-text error responses, which in turn means that the\n // actual error gets swallowed by a SyntaxError.\n\n if (json) {\n if (data) {\n data = JSON.stringify(data);\n headers['content-type'] = 'application/json';\n }\n\n if (!headers['accept']) {\n headers['accept'] = 'application/json';\n }\n\n if (bodyParser === undefined) {\n bodyParser = function(rawBody) {\n return JSON.parse(rawBody);\n };\n }\n }\n\n const defer = utils.defer();\n\n let timeoutId;\n let timedOut = false;\n let req;\n const localTimeoutMs = opts.localTimeoutMs || this.opts.localTimeoutMs;\n\n const resetTimeout = () => {\n if (localTimeoutMs) {\n if (timeoutId) {\n callbacks.clearTimeout(timeoutId);\n }\n timeoutId = callbacks.setTimeout(function() {\n timedOut = true;\n if (req && req.abort) {\n req.abort();\n }\n defer.reject(new MatrixError({\n error: \"Locally timed out waiting for a response\",\n errcode: \"ORG.MATRIX.JSSDK_TIMEOUT\",\n timeout: localTimeoutMs,\n }));\n }, localTimeoutMs);\n }\n };\n resetTimeout();\n\n const reqPromise = defer.promise;\n\n try {\n req = this.opts.request(\n {\n uri: uri,\n method: method,\n withCredentials: false,\n qs: queryParams,\n qsStringifyOptions: opts.qsStringifyOptions,\n useQuerystring: true,\n body: data,\n json: false,\n timeout: localTimeoutMs,\n headers: headers || {},\n _matrix_opts: this.opts,\n },\n function(err, response, body) {\n if (localTimeoutMs) {\n callbacks.clearTimeout(timeoutId);\n if (timedOut) {\n return; // already rejected promise\n }\n }\n\n const handlerFn = requestCallback(\n defer, callback, self.opts.onlyData,\n bodyParser,\n );\n handlerFn(err, response, body);\n },\n );\n if (req) {\n // This will only work in a browser, where opts.request is the\n // `browser-request` import. Currently `request` does not support progress\n // updates - see https://github.com/request/request/pull/2346.\n // `browser-request` returns an XHRHttpRequest which exposes `onprogress`\n if ('onprogress' in req) {\n req.onprogress = (e) => {\n // Prevent the timeout from rejecting the deferred promise if progress is\n // seen with the request\n resetTimeout();\n };\n }\n\n // FIXME: This is EVIL, but I can't think of a better way to expose\n // abort() operations on underlying HTTP requests :(\n if (req.abort) reqPromise.abort = req.abort.bind(req);\n }\n } catch (ex) {\n defer.reject(ex);\n if (callback) {\n callback(ex);\n }\n }\n return reqPromise;\n },\n};\n\n/*\n * Returns a callback that can be invoked by an HTTP request on completion,\n * that will either resolve or reject the given defer as well as invoke the\n * given userDefinedCallback (if any).\n *\n * HTTP errors are transformed into javascript errors and the deferred is rejected.\n *\n * If bodyParser is given, it is used to transform the body of the successful\n * responses before passing to the defer/callback.\n *\n * If onlyData is true, the defer/callback is invoked with the body of the\n * response, otherwise the result object (with `code` and `data` fields)\n *\n */\nconst requestCallback = function(\n defer, userDefinedCallback, onlyData,\n bodyParser,\n) {\n userDefinedCallback = userDefinedCallback || function() {};\n\n return function(err, response, body) {\n if (err) {\n // the unit tests use matrix-mock-request, which throw the string \"aborted\" when aborting a request.\n // See https://github.com/matrix-org/matrix-mock-request/blob/3276d0263a561b5b8326b47bae720578a2c7473a/src/index.js#L48\n const aborted = err.name === \"AbortError\" || err === \"aborted\";\n if (!aborted && !(err instanceof MatrixError)) {\n // browser-request just throws normal Error objects,\n // not `TypeError`s like fetch does. So just assume any\n // error is due to the connection.\n err = new ConnectionError(\"request failed\", err);\n }\n }\n if (!err) {\n try {\n const httpStatus = response.status || response.statusCode; // XMLHttpRequest vs http.IncomingMessage\n if (httpStatus >= 400) {\n err = parseErrorResponse(response, body);\n } else if (bodyParser) {\n body = bodyParser(body);\n }\n } catch (e) {\n err = new Error(`Error parsing server response: ${e}`);\n }\n }\n\n if (err) {\n defer.reject(err);\n userDefinedCallback(err);\n } else {\n const res = {\n code: response.status || response.statusCode, // XMLHttpRequest vs http.IncomingMessage\n\n // XXX: why do we bother with this? it doesn't work for\n // XMLHttpRequest, so clearly we don't use it.\n headers: response.headers,\n data: body,\n };\n defer.resolve(onlyData ? body : res);\n userDefinedCallback(null, onlyData ? body : res);\n }\n };\n};\n\n/**\n * Attempt to turn an HTTP error response into a Javascript Error.\n *\n * If it is a JSON response, we will parse it into a MatrixError. Otherwise\n * we return a generic Error.\n *\n * @param {XMLHttpRequest|http.IncomingMessage} response response object\n * @param {String} body raw body of the response\n * @returns {Error}\n */\nfunction parseErrorResponse(response, body) {\n const httpStatus = response.status || response.statusCode; // XMLHttpRequest vs http.IncomingMessage\n const contentType = getResponseContentType(response);\n\n let err;\n if (contentType) {\n if (contentType.type === 'application/json') {\n const jsonBody = typeof(body) === 'object' ? body : JSON.parse(body);\n err = new MatrixError(jsonBody);\n } else if (contentType.type === 'text/plain') {\n err = new Error(`Server returned ${httpStatus} error: ${body}`);\n }\n }\n\n if (!err) {\n err = new Error(`Server returned ${httpStatus} error`);\n }\n err.httpStatus = httpStatus;\n return err;\n}\n\n/**\n * extract the Content-Type header from the response object, and\n * parse it to a `{type, parameters}` object.\n *\n * returns null if no content-type header could be found.\n *\n * @param {XMLHttpRequest|http.IncomingMessage} response response object\n * @returns {{type: String, parameters: Object}?} parsed content-type header, or null if not found\n */\nfunction getResponseContentType(response) {\n let contentType;\n if (response.getResponseHeader) {\n // XMLHttpRequest provides getResponseHeader\n contentType = response.getResponseHeader(\"Content-Type\");\n } else if (response.headers) {\n // request provides http.IncomingMessage which has a message.headers map\n contentType = response.headers['content-type'] || null;\n }\n\n if (!contentType) {\n return null;\n }\n\n try {\n return parseContentType(contentType);\n } catch (e) {\n throw new Error(`Error parsing Content-Type '${contentType}': ${e}`);\n }\n}\n\n/**\n * Construct a Matrix error. This is a JavaScript Error with additional\n * information specific to the standard Matrix error response.\n * @constructor\n * @param {Object} errorJson The Matrix error JSON returned from the homeserver.\n * @prop {string} errcode The Matrix 'errcode' value, e.g. \"M_FORBIDDEN\".\n * @prop {string} name Same as MatrixError.errcode but with a default unknown string.\n * @prop {string} message The Matrix 'error' value, e.g. \"Missing token.\"\n * @prop {Object} data The raw Matrix error JSON used to construct this object.\n * @prop {integer} httpStatus The numeric HTTP status code given\n */\nexport class MatrixError extends Error {\n constructor(errorJson) {\n errorJson = errorJson || {};\n super(`MatrixError: ${errorJson.errcode}`);\n this.errcode = errorJson.errcode;\n this.name = errorJson.errcode || \"Unknown error code\";\n this.message = errorJson.error || \"Unknown message\";\n this.data = errorJson;\n }\n}\n\n/**\n * Construct a ConnectionError. This is a JavaScript Error indicating\n * that a request failed because of some error with the connection, either\n * CORS was not correctly configured on the server, the server didn't response,\n * the request timed out, or the internet connection on the client side went down.\n * @constructor\n */\nexport class ConnectionError extends Error {\n constructor(message, cause = undefined) {\n super(message + (cause ? `: ${cause.message}` : \"\"));\n this._cause = cause;\n }\n\n get name() {\n return \"ConnectionError\";\n }\n\n get cause() {\n return this._cause;\n }\n}\n\nexport class AbortError extends Error {\n constructor() {\n super(\"Operation aborted\");\n }\n\n get name() {\n return \"AbortError\";\n }\n}\n\n/**\n * Retries a network operation run in a callback.\n * @param {number} maxAttempts maximum attempts to try\n * @param {Function} callback callback that returns a promise of the network operation. If rejected with ConnectionError, it will be retried by calling the callback again.\n * @return {any} the result of the network operation\n * @throws {ConnectionError} If after maxAttempts the callback still throws ConnectionError\n */\nexport async function retryNetworkOperation(maxAttempts, callback) {\n let attempts = 0;\n let lastConnectionError = null;\n while (attempts < maxAttempts) {\n try {\n if (attempts > 0) {\n const timeout = 1000 * Math.pow(2, attempts);\n logger.log(`network operation failed ${attempts} times,` +\n ` retrying in ${timeout}ms...`);\n await new Promise(r => setTimeout(r, timeout));\n }\n return await callback();\n } catch (err) {\n if (err instanceof ConnectionError) {\n attempts += 1;\n lastConnectionError = err;\n } else {\n throw err;\n }\n }\n }\n throw lastConnectionError;\n}\n", "/*\nCopyright 2019 New Vector Ltd\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n/**\n * Check if an IndexedDB database exists. The only way to do so is to try opening it, so\n * we do that and then delete it did not exist before.\n *\n * @param {Object} indexedDB The `indexedDB` interface\n * @param {string} dbName The database name to test for\n * @returns {boolean} Whether the database exists\n */\nexport function exists(indexedDB: IDBFactory, dbName: string): Promise {\n return new Promise((resolve, reject) => {\n let exists = true;\n const req = indexedDB.open(dbName);\n req.onupgradeneeded = () => {\n // Since we did not provide an explicit version when opening, this event\n // should only fire if the DB did not exist before at any version.\n exists = false;\n };\n req.onblocked = () => reject(req.error);\n req.onsuccess = () => {\n const db = req.result;\n db.close();\n if (!exists) {\n // The DB did not exist before, but has been created as part of this\n // existence check. Delete it now to restore previous state. Delete can\n // actually take a while to complete in some browsers, so don't wait for\n // it. This won't block future open calls that a store might issue next to\n // properly set up the DB.\n indexedDB.deleteDatabase(dbName);\n }\n resolve(exists);\n };\n req.onerror = ev => reject(req.error);\n });\n}\n", - "/*\nCopyright 2016 OpenMarket Ltd\nCopyright 2017 Vector Creations Ltd\nCopyright 2019 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n/** @module interactive-auth */\n\nimport * as utils from \"./utils\";\nimport { logger } from './logger';\n\nconst EMAIL_STAGE_TYPE = \"m.login.email.identity\";\nconst MSISDN_STAGE_TYPE = \"m.login.msisdn\";\n\n/**\n * Abstracts the logic used to drive the interactive auth process.\n *\n *

Components implementing an interactive auth flow should instantiate one of\n * these, passing in the necessary callbacks to the constructor. They should\n * then call attemptAuth, which will return a promise which will resolve or\n * reject when the interactive-auth process completes.\n *\n *

Meanwhile, calls will be made to the startAuthStage and doRequest\n * callbacks, and information gathered from the user can be submitted with\n * submitAuthDict.\n *\n * @constructor\n * @alias module:interactive-auth\n *\n * @param {object} opts options object\n *\n * @param {object} opts.matrixClient A matrix client to use for the auth process\n *\n * @param {object?} opts.authData error response from the last request. If\n * null, a request will be made with no auth before starting.\n *\n * @param {function(object?): Promise} opts.doRequest\n * called with the new auth dict to submit the request. Also passes a\n * second deprecated arg which is a flag set to true if this request\n * is a background request. The busyChanged callback should be used\n * instead of the backfround flag. Should return a promise which resolves\n * to the successful response or rejects with a MatrixError.\n *\n * @param {function(bool): Promise} opts.busyChanged\n * called whenever the interactive auth logic becomes busy submitting\n * information provided by the user or finsihes. After this has been\n * called with true the UI should indicate that a request is in progress\n * until it is called again with false.\n *\n * @param {function(string, object?)} opts.stateUpdated\n * called when the status of the UI auth changes, ie. when the state of\n * an auth stage changes of when the auth flow moves to a new stage.\n * The arguments are: the login type (eg m.login.password); and an object\n * which is either an error or an informational object specific to the\n * login type. If the 'errcode' key is defined, the object is an error,\n * and has keys:\n * errcode: string, the textual error code, eg. M_UNKNOWN\n * error: string, human readable string describing the error\n *\n * The login type specific objects are as follows:\n * m.login.email.identity:\n * * emailSid: string, the sid of the active email auth session\n *\n * @param {object?} opts.inputs Inputs provided by the user and used by different\n * stages of the auto process. The inputs provided will affect what flow is chosen.\n *\n * @param {string?} opts.inputs.emailAddress An email address. If supplied, a flow\n * using email verification will be chosen.\n *\n * @param {string?} opts.inputs.phoneCountry An ISO two letter country code. Gives\n * the country that opts.phoneNumber should be resolved relative to.\n *\n * @param {string?} opts.inputs.phoneNumber A phone number. If supplied, a flow\n * using phone number validation will be chosen.\n *\n * @param {string?} opts.sessionId If resuming an existing interactive auth session,\n * the sessionId of that session.\n *\n * @param {string?} opts.clientSecret If resuming an existing interactive auth session,\n * the client secret for that session\n *\n * @param {string?} opts.emailSid If returning from having completed m.login.email.identity\n * auth, the sid for the email verification session.\n *\n * @param {function?} opts.requestEmailToken A function that takes the email address (string),\n * clientSecret (string), attempt number (int) and sessionId (string) and calls the\n * relevant requestToken function and returns the promise returned by that function.\n * If the resulting promise rejects, the rejection will propagate through to the\n * attemptAuth promise.\n *\n */\nexport function InteractiveAuth(opts) {\n this._matrixClient = opts.matrixClient;\n this._data = opts.authData || {};\n this._requestCallback = opts.doRequest;\n this._busyChangedCallback = opts.busyChanged;\n // startAuthStage included for backwards compat\n this._stateUpdatedCallback = opts.stateUpdated || opts.startAuthStage;\n this._resolveFunc = null;\n this._rejectFunc = null;\n this._inputs = opts.inputs || {};\n this._requestEmailTokenCallback = opts.requestEmailToken;\n\n if (opts.sessionId) this._data.session = opts.sessionId;\n this._clientSecret = opts.clientSecret || this._matrixClient.generateClientSecret();\n this._emailSid = opts.emailSid;\n if (this._emailSid === undefined) this._emailSid = null;\n this._requestingEmailToken = false;\n\n this._chosenFlow = null;\n this._currentStage = null;\n\n // if we are currently trying to submit an auth dict (which includes polling)\n // the promise the will resolve/reject when it completes\n this._submitPromise = null;\n}\n\nInteractiveAuth.prototype = {\n /**\n * begin the authentication process.\n *\n * @return {Promise} which resolves to the response on success,\n * or rejects with the error on failure. Rejects with NoAuthFlowFoundError if\n * no suitable authentication flow can be found\n */\n attemptAuth: function() {\n // This promise will be quite long-lived and will resolve when the\n // request is authenticated and completes successfully.\n return new Promise((resolve, reject) => {\n this._resolveFunc = resolve;\n this._rejectFunc = reject;\n\n const hasFlows = this._data && this._data.flows;\n\n // if we have no flows, try a request to acquire the flows\n if (!hasFlows) {\n if (this._busyChangedCallback) this._busyChangedCallback(true);\n // use the existing sessionid, if one is present.\n let auth = null;\n if (this._data.session) {\n auth = {\n session: this._data.session,\n };\n }\n this._doRequest(auth).finally(() => {\n if (this._busyChangedCallback) this._busyChangedCallback(false);\n });\n } else {\n this._startNextAuthStage();\n }\n });\n },\n\n /**\n * Poll to check if the auth session or current stage has been\n * completed out-of-band. If so, the attemptAuth promise will\n * be resolved.\n */\n poll: async function() {\n if (!this._data.session) return;\n // likewise don't poll if there is no auth session in progress\n if (!this._resolveFunc) return;\n // if we currently have a request in flight, there's no point making\n // another just to check what the status is\n if (this._submitPromise) return;\n\n let authDict = {};\n if (this._currentStage == EMAIL_STAGE_TYPE) {\n // The email can be validated out-of-band, but we need to provide the\n // creds so the HS can go & check it.\n if (this._emailSid) {\n const creds = {\n sid: this._emailSid,\n client_secret: this._clientSecret,\n };\n if (await this._matrixClient.doesServerRequireIdServerParam()) {\n const idServerParsedUrl = new URL(this._matrixClient.getIdentityServerUrl());\n creds.id_server = idServerParsedUrl.host;\n }\n authDict = {\n type: EMAIL_STAGE_TYPE,\n // TODO: Remove `threepid_creds` once servers support proper UIA\n // See https://github.com/matrix-org/synapse/issues/5665\n // See https://github.com/matrix-org/matrix-doc/issues/2220\n threepid_creds: creds,\n threepidCreds: creds,\n };\n }\n }\n\n this.submitAuthDict(authDict, true);\n },\n\n /**\n * get the auth session ID\n *\n * @return {string} session id\n */\n getSessionId: function() {\n return this._data ? this._data.session : undefined;\n },\n\n /**\n * get the client secret used for validation sessions\n * with the identity server.\n *\n * @return {string} client secret\n */\n getClientSecret: function() {\n return this._clientSecret;\n },\n\n /**\n * get the server params for a given stage\n *\n * @param {string} loginType login type for the stage\n * @return {object?} any parameters from the server for this stage\n */\n getStageParams: function(loginType) {\n let params = {};\n if (this._data && this._data.params) {\n params = this._data.params;\n }\n return params[loginType];\n },\n\n getChosenFlow() {\n return this._chosenFlow;\n },\n\n /**\n * submit a new auth dict and fire off the request. This will either\n * make attemptAuth resolve/reject, or cause the startAuthStage callback\n * to be called for a new stage.\n *\n * @param {object} authData new auth dict to send to the server. Should\n * include a `type` propterty denoting the login type, as well as any\n * other params for that stage.\n * @param {bool} background If true, this request failing will not result\n * in the attemptAuth promise being rejected. This can be set to true\n * for requests that just poll to see if auth has been completed elsewhere.\n */\n submitAuthDict: async function(authData, background) {\n if (!this._resolveFunc) {\n throw new Error(\"submitAuthDict() called before attemptAuth()\");\n }\n\n if (!background && this._busyChangedCallback) {\n this._busyChangedCallback(true);\n }\n\n // if we're currently trying a request, wait for it to finish\n // as otherwise we can get multiple 200 responses which can mean\n // things like multiple logins for register requests.\n // (but discard any expections as we only care when its done,\n // not whether it worked or not)\n while (this._submitPromise) {\n try {\n await this._submitPromise;\n } catch (e) {\n }\n }\n\n // use the sessionid from the last request, if one is present.\n let auth;\n if (this._data.session) {\n auth = {\n session: this._data.session,\n };\n utils.extend(auth, authData);\n } else {\n auth = authData;\n }\n\n try {\n // NB. the 'background' flag is deprecated by the busyChanged\n // callback and is here for backwards compat\n this._submitPromise = this._doRequest(auth, background);\n await this._submitPromise;\n } finally {\n this._submitPromise = null;\n if (!background && this._busyChangedCallback) {\n this._busyChangedCallback(false);\n }\n }\n },\n\n /**\n * Gets the sid for the email validation session\n * Specific to m.login.email.identity\n *\n * @returns {string} The sid of the email auth session\n */\n getEmailSid: function() {\n return this._emailSid;\n },\n\n /**\n * Sets the sid for the email validation session\n * This must be set in order to successfully poll for completion\n * of the email validation.\n * Specific to m.login.email.identity\n *\n * @param {string} sid The sid for the email validation session\n */\n setEmailSid: function(sid) {\n this._emailSid = sid;\n },\n\n /**\n * Fire off a request, and either resolve the promise, or call\n * startAuthStage.\n *\n * @private\n * @param {object?} auth new auth dict, including session id\n * @param {bool?} background If true, this request is a background poll, so it\n * failing will not result in the attemptAuth promise being rejected.\n * This can be set to true for requests that just poll to see if auth has\n * been completed elsewhere.\n */\n _doRequest: async function(auth, background) {\n try {\n const result = await this._requestCallback(auth, background);\n this._resolveFunc(result);\n this._resolveFunc = null;\n this._rejectFunc = null;\n } catch (error) {\n // sometimes UI auth errors don't come with flows\n const errorFlows = error.data ? error.data.flows : null;\n const haveFlows = this._data.flows || Boolean(errorFlows);\n if (error.httpStatus !== 401 || !error.data || !haveFlows) {\n // doesn't look like an interactive-auth failure.\n if (!background) {\n this._rejectFunc(error);\n } else {\n // We ignore all failures here (even non-UI auth related ones)\n // since we don't want to suddenly fail if the internet connection\n // had a blip whilst we were polling\n logger.log(\n \"Background poll request failed doing UI auth: ignoring\",\n error,\n );\n }\n }\n // if the error didn't come with flows, completed flows or session ID,\n // copy over the ones we have. Synapse sometimes sends responses without\n // any UI auth data (eg. when polling for email validation, if the email\n // has not yet been validated). This appears to be a Synapse bug, which\n // we workaround here.\n if (!error.data.flows && !error.data.completed && !error.data.session) {\n error.data.flows = this._data.flows;\n error.data.completed = this._data.completed;\n error.data.session = this._data.session;\n }\n this._data = error.data;\n try {\n this._startNextAuthStage();\n } catch (e) {\n this._rejectFunc(e);\n this._resolveFunc = null;\n this._rejectFunc = null;\n }\n\n if (\n !this._emailSid &&\n !this._requestingEmailToken &&\n this._chosenFlow.stages.includes('m.login.email.identity')\n ) {\n // If we've picked a flow with email auth, we send the email\n // now because we want the request to fail as soon as possible\n // if the email address is not valid (ie. already taken or not\n // registered, depending on what the operation is).\n this._requestingEmailToken = true;\n try {\n const requestTokenResult = await this._requestEmailTokenCallback(\n this._inputs.emailAddress,\n this._clientSecret,\n 1, // TODO: Multiple send attempts?\n this._data.session,\n );\n this._emailSid = requestTokenResult.sid;\n // NB. promise is not resolved here - at some point, doRequest\n // will be called again and if the user has jumped through all\n // the hoops correctly, auth will be complete and the request\n // will succeed.\n // Also, we should expose the fact that this request has compledted\n // so clients can know that the email has actually been sent.\n } catch (e) {\n // we failed to request an email token, so fail the request.\n // This could be due to the email already beeing registered\n // (or not being registered, depending on what we're trying\n // to do) or it could be a network failure. Either way, pass\n // the failure up as the user can't complete auth if we can't\n // send the email, for whatever reason.\n this._rejectFunc(e);\n this._resolveFunc = null;\n this._rejectFunc = null;\n } finally {\n this._requestingEmailToken = false;\n }\n }\n }\n },\n\n /**\n * Pick the next stage and call the callback\n *\n * @private\n * @throws {NoAuthFlowFoundError} If no suitable authentication flow can be found\n */\n _startNextAuthStage: function() {\n const nextStage = this._chooseStage();\n if (!nextStage) {\n throw new Error(\"No incomplete flows from the server\");\n }\n this._currentStage = nextStage;\n\n if (nextStage === 'm.login.dummy') {\n this.submitAuthDict({\n type: 'm.login.dummy',\n });\n return;\n }\n\n if (this._data && this._data.errcode || this._data.error) {\n this._stateUpdatedCallback(nextStage, {\n errcode: this._data.errcode || \"\",\n error: this._data.error || \"\",\n });\n return;\n }\n\n const stageStatus = {};\n if (nextStage == EMAIL_STAGE_TYPE) {\n stageStatus.emailSid = this._emailSid;\n }\n this._stateUpdatedCallback(nextStage, stageStatus);\n },\n\n /**\n * Pick the next auth stage\n *\n * @private\n * @return {string?} login type\n * @throws {NoAuthFlowFoundError} If no suitable authentication flow can be found\n */\n _chooseStage: function() {\n if (this._chosenFlow === null) {\n this._chosenFlow = this._chooseFlow();\n }\n logger.log(\"Active flow => %s\", JSON.stringify(this._chosenFlow));\n const nextStage = this._firstUncompletedStage(this._chosenFlow);\n logger.log(\"Next stage: %s\", nextStage);\n return nextStage;\n },\n\n /**\n * Pick one of the flows from the returned list\n * If a flow using all of the inputs is found, it will\n * be returned, otherwise, null will be returned.\n *\n * Only flows using all given inputs are chosen because it\n * is likley to be surprising if the user provides a\n * credential and it is not used. For example, for registration,\n * this could result in the email not being used which would leave\n * the account with no means to reset a password.\n *\n * @private\n * @return {object} flow\n * @throws {NoAuthFlowFoundError} If no suitable authentication flow can be found\n */\n _chooseFlow: function() {\n const flows = this._data.flows || [];\n\n // we've been given an email or we've already done an email part\n const haveEmail = Boolean(this._inputs.emailAddress) || Boolean(this._emailSid);\n const haveMsisdn = (\n Boolean(this._inputs.phoneCountry) &&\n Boolean(this._inputs.phoneNumber)\n );\n\n for (const flow of flows) {\n let flowHasEmail = false;\n let flowHasMsisdn = false;\n for (const stage of flow.stages) {\n if (stage === EMAIL_STAGE_TYPE) {\n flowHasEmail = true;\n } else if (stage == MSISDN_STAGE_TYPE) {\n flowHasMsisdn = true;\n }\n }\n\n if (flowHasEmail == haveEmail && flowHasMsisdn == haveMsisdn) {\n return flow;\n }\n }\n // Throw an error with a fairly generic description, but with more\n // information such that the app can give a better one if so desired.\n const err = new Error(\"No appropriate authentication flow found\");\n err.name = 'NoAuthFlowFoundError';\n err.required_stages = [];\n if (haveEmail) err.required_stages.push(EMAIL_STAGE_TYPE);\n if (haveMsisdn) err.required_stages.push(MSISDN_STAGE_TYPE);\n err.available_flows = flows;\n throw err;\n },\n\n /**\n * Get the first uncompleted stage in the given flow\n *\n * @private\n * @param {object} flow\n * @return {string} login type\n */\n _firstUncompletedStage: function(flow) {\n const completed = (this._data || {}).completed || [];\n for (let i = 0; i < flow.stages.length; ++i) {\n const stageType = flow.stages[i];\n if (completed.indexOf(stageType) === -1) {\n return stageType;\n }\n }\n },\n};\n\n", + "/*\nCopyright 2016 OpenMarket Ltd\nCopyright 2017 Vector Creations Ltd\nCopyright 2019 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n/** @module interactive-auth */\n\nimport * as utils from \"./utils\";\nimport { logger } from './logger';\nimport { MatrixClient } from \"./client\";\nimport { defer, IDeferred } from \"./utils\";\nimport { MatrixError } from \"./http-api\";\n\nconst EMAIL_STAGE_TYPE = \"m.login.email.identity\";\nconst MSISDN_STAGE_TYPE = \"m.login.msisdn\";\n\ninterface IFlow {\n stages: AuthType[];\n}\n\nexport interface IInputs {\n emailAddress?: string;\n phoneCountry?: string;\n phoneNumber?: string;\n}\n\nexport interface IStageStatus {\n emailSid?: string;\n errcode?: string;\n error?: string;\n}\n\nexport interface IAuthData {\n session?: string;\n completed?: string[];\n flows?: IFlow[];\n params?: Record>;\n errcode?: string;\n error?: MatrixError;\n}\n\nexport enum AuthType {\n Password = \"m.login.password\",\n Recaptcha = \"m.login.recaptcha\",\n Terms = \"m.login.terms\",\n Email = \"m.login.email.identity\",\n Msisdn = \"m.login.msisdn\",\n Sso = \"m.login.sso\",\n SsoUnstable = \"org.matrix.login.sso\",\n Dummy = \"m.login.dummy\",\n}\n\nexport interface IAuthDict {\n // [key: string]: any;\n type?: string;\n // session?: string; // TODO\n // TODO: Remove `user` once servers support proper UIA\n // See https://github.com/vector-im/element-web/issues/10312\n user?: string;\n identifier?: any;\n password?: string;\n response?: string;\n // TODO: Remove `threepid_creds` once servers support proper UIA\n // See https://github.com/vector-im/element-web/issues/10312\n // See https://github.com/matrix-org/matrix-doc/issues/2220\n // eslint-disable-next-line camelcase\n threepid_creds?: any;\n threepidCreds?: any;\n}\n\nclass NoAuthFlowFoundError extends Error {\n public name = \"NoAuthFlowFoundError\";\n\n // eslint-disable-next-line @typescript-eslint/naming-convention, camelcase\n constructor(m: string, public readonly required_stages: string[], public readonly flows: IFlow[]) {\n super(m);\n }\n}\n\ninterface IOpts {\n matrixClient: MatrixClient;\n authData?: IAuthData;\n inputs?: IInputs;\n sessionId?: string;\n clientSecret?: string;\n emailSid?: string;\n doRequest(auth: IAuthData, background: boolean): Promise;\n stateUpdated(nextStage: AuthType, status: IStageStatus): void;\n requestEmailToken(email: string, secret: string, attempt: number, session: string): Promise<{ sid: string }>;\n busyChanged?(busy: boolean): void;\n startAuthStage?(nextStage: string): Promise; // LEGACY\n}\n\n/**\n * Abstracts the logic used to drive the interactive auth process.\n *\n *

Components implementing an interactive auth flow should instantiate one of\n * these, passing in the necessary callbacks to the constructor. They should\n * then call attemptAuth, which will return a promise which will resolve or\n * reject when the interactive-auth process completes.\n *\n *

Meanwhile, calls will be made to the startAuthStage and doRequest\n * callbacks, and information gathered from the user can be submitted with\n * submitAuthDict.\n *\n * @constructor\n * @alias module:interactive-auth\n *\n * @param {object} opts options object\n *\n * @param {object} opts.matrixClient A matrix client to use for the auth process\n *\n * @param {object?} opts.authData error response from the last request. If\n * null, a request will be made with no auth before starting.\n *\n * @param {function(object?): Promise} opts.doRequest\n * called with the new auth dict to submit the request. Also passes a\n * second deprecated arg which is a flag set to true if this request\n * is a background request. The busyChanged callback should be used\n * instead of the background flag. Should return a promise which resolves\n * to the successful response or rejects with a MatrixError.\n *\n * @param {function(boolean): Promise} opts.busyChanged\n * called whenever the interactive auth logic becomes busy submitting\n * information provided by the user or finishes. After this has been\n * called with true the UI should indicate that a request is in progress\n * until it is called again with false.\n *\n * @param {function(string, object?)} opts.stateUpdated\n * called when the status of the UI auth changes, ie. when the state of\n * an auth stage changes of when the auth flow moves to a new stage.\n * The arguments are: the login type (eg m.login.password); and an object\n * which is either an error or an informational object specific to the\n * login type. If the 'errcode' key is defined, the object is an error,\n * and has keys:\n * errcode: string, the textual error code, eg. M_UNKNOWN\n * error: string, human readable string describing the error\n *\n * The login type specific objects are as follows:\n * m.login.email.identity:\n * * emailSid: string, the sid of the active email auth session\n *\n * @param {object?} opts.inputs Inputs provided by the user and used by different\n * stages of the auto process. The inputs provided will affect what flow is chosen.\n *\n * @param {string?} opts.inputs.emailAddress An email address. If supplied, a flow\n * using email verification will be chosen.\n *\n * @param {string?} opts.inputs.phoneCountry An ISO two letter country code. Gives\n * the country that opts.phoneNumber should be resolved relative to.\n *\n * @param {string?} opts.inputs.phoneNumber A phone number. If supplied, a flow\n * using phone number validation will be chosen.\n *\n * @param {string?} opts.sessionId If resuming an existing interactive auth session,\n * the sessionId of that session.\n *\n * @param {string?} opts.clientSecret If resuming an existing interactive auth session,\n * the client secret for that session\n *\n * @param {string?} opts.emailSid If returning from having completed m.login.email.identity\n * auth, the sid for the email verification session.\n *\n * @param {function?} opts.requestEmailToken A function that takes the email address (string),\n * clientSecret (string), attempt number (int) and sessionId (string) and calls the\n * relevant requestToken function and returns the promise returned by that function.\n * If the resulting promise rejects, the rejection will propagate through to the\n * attemptAuth promise.\n *\n */\nexport class InteractiveAuth {\n private readonly matrixClient: MatrixClient;\n private readonly inputs: IInputs;\n private readonly clientSecret: string;\n private readonly requestCallback: IOpts[\"doRequest\"];\n private readonly busyChangedCallback?: IOpts[\"busyChanged\"];\n private readonly stateUpdatedCallback: IOpts[\"stateUpdated\"];\n private readonly requestEmailTokenCallback: IOpts[\"requestEmailToken\"];\n\n private data: IAuthData;\n private emailSid?: string;\n private requestingEmailToken = false;\n private attemptAuthDeferred: IDeferred = null;\n private chosenFlow: IFlow = null;\n private currentStage: string = null;\n\n // if we are currently trying to submit an auth dict (which includes polling)\n // the promise the will resolve/reject when it completes\n private submitPromise: Promise = null;\n\n constructor(opts: IOpts) {\n this.matrixClient = opts.matrixClient;\n this.data = opts.authData || {};\n this.requestCallback = opts.doRequest;\n this.busyChangedCallback = opts.busyChanged;\n // startAuthStage included for backwards compat\n this.stateUpdatedCallback = opts.stateUpdated || opts.startAuthStage;\n this.requestEmailTokenCallback = opts.requestEmailToken;\n this.inputs = opts.inputs || {};\n\n if (opts.sessionId) this.data.session = opts.sessionId;\n this.clientSecret = opts.clientSecret || this.matrixClient.generateClientSecret();\n this.emailSid = opts.emailSid ?? null;\n }\n\n /**\n * begin the authentication process.\n *\n * @return {Promise} which resolves to the response on success,\n * or rejects with the error on failure. Rejects with NoAuthFlowFoundError if\n * no suitable authentication flow can be found\n */\n public attemptAuth(): Promise {\n // This promise will be quite long-lived and will resolve when the\n // request is authenticated and completes successfully.\n this.attemptAuthDeferred = defer();\n // pluck the promise out now, as doRequest may clear before we return\n const promise = this.attemptAuthDeferred.promise;\n\n // if we have no flows, try a request to acquire the flows\n if (!this.data?.flows) {\n this.busyChangedCallback?.(true);\n // use the existing sessionId, if one is present.\n let auth = null;\n if (this.data.session) {\n auth = {\n session: this.data.session,\n };\n }\n this.doRequest(auth).finally(() => {\n this.busyChangedCallback?.(false);\n });\n } else {\n this.startNextAuthStage();\n }\n\n return promise;\n }\n\n /**\n * Poll to check if the auth session or current stage has been\n * completed out-of-band. If so, the attemptAuth promise will\n * be resolved.\n */\n public async poll(): Promise {\n if (!this.data.session) return;\n // likewise don't poll if there is no auth session in progress\n if (!this.attemptAuthDeferred) return;\n // if we currently have a request in flight, there's no point making\n // another just to check what the status is\n if (this.submitPromise) return;\n\n let authDict: IAuthDict = {};\n if (this.currentStage == EMAIL_STAGE_TYPE) {\n // The email can be validated out-of-band, but we need to provide the\n // creds so the HS can go & check it.\n if (this.emailSid) {\n const creds: Record = {\n sid: this.emailSid,\n client_secret: this.clientSecret,\n };\n if (await this.matrixClient.doesServerRequireIdServerParam()) {\n const idServerParsedUrl = new URL(this.matrixClient.getIdentityServerUrl());\n creds.id_server = idServerParsedUrl.host;\n }\n authDict = {\n type: EMAIL_STAGE_TYPE,\n // TODO: Remove `threepid_creds` once servers support proper UIA\n // See https://github.com/matrix-org/synapse/issues/5665\n // See https://github.com/matrix-org/matrix-doc/issues/2220\n threepid_creds: creds,\n threepidCreds: creds,\n };\n }\n }\n\n this.submitAuthDict(authDict, true);\n }\n\n /**\n * get the auth session ID\n *\n * @return {string} session id\n */\n public getSessionId(): string {\n return this.data ? this.data.session : undefined;\n }\n\n /**\n * get the client secret used for validation sessions\n * with the identity server.\n *\n * @return {string} client secret\n */\n public getClientSecret(): string {\n return this.clientSecret;\n }\n\n /**\n * get the server params for a given stage\n *\n * @param {string} loginType login type for the stage\n * @return {object?} any parameters from the server for this stage\n */\n public getStageParams(loginType: string): Record {\n return this.data.params?.[loginType];\n }\n\n public getChosenFlow(): IFlow {\n return this.chosenFlow;\n }\n\n /**\n * submit a new auth dict and fire off the request. This will either\n * make attemptAuth resolve/reject, or cause the startAuthStage callback\n * to be called for a new stage.\n *\n * @param {object} authData new auth dict to send to the server. Should\n * include a `type` property denoting the login type, as well as any\n * other params for that stage.\n * @param {boolean} background If true, this request failing will not result\n * in the attemptAuth promise being rejected. This can be set to true\n * for requests that just poll to see if auth has been completed elsewhere.\n */\n public async submitAuthDict(authData: IAuthDict, background = false): Promise {\n if (!this.attemptAuthDeferred) {\n throw new Error(\"submitAuthDict() called before attemptAuth()\");\n }\n\n if (!background) {\n this.busyChangedCallback?.(true);\n }\n\n // if we're currently trying a request, wait for it to finish\n // as otherwise we can get multiple 200 responses which can mean\n // things like multiple logins for register requests.\n // (but discard any exceptions as we only care when its done,\n // not whether it worked or not)\n while (this.submitPromise) {\n try {\n await this.submitPromise;\n } catch (e) {\n }\n }\n\n // use the sessionid from the last request, if one is present.\n let auth;\n if (this.data.session) {\n auth = {\n session: this.data.session,\n };\n utils.extend(auth, authData);\n } else {\n auth = authData;\n }\n\n try {\n // NB. the 'background' flag is deprecated by the busyChanged\n // callback and is here for backwards compat\n this.submitPromise = this.doRequest(auth, background);\n await this.submitPromise;\n } finally {\n this.submitPromise = null;\n if (!background) {\n this.busyChangedCallback?.(false);\n }\n }\n }\n\n /**\n * Gets the sid for the email validation session\n * Specific to m.login.email.identity\n *\n * @returns {string} The sid of the email auth session\n */\n public getEmailSid(): string {\n return this.emailSid;\n }\n\n /**\n * Sets the sid for the email validation session\n * This must be set in order to successfully poll for completion\n * of the email validation.\n * Specific to m.login.email.identity\n *\n * @param {string} sid The sid for the email validation session\n */\n public setEmailSid(sid: string): void {\n this.emailSid = sid;\n }\n\n /**\n * Fire off a request, and either resolve the promise, or call\n * startAuthStage.\n *\n * @private\n * @param {object?} auth new auth dict, including session id\n * @param {boolean?} background If true, this request is a background poll, so it\n * failing will not result in the attemptAuth promise being rejected.\n * This can be set to true for requests that just poll to see if auth has\n * been completed elsewhere.\n */\n private async doRequest(auth: IAuthData, background = false): Promise {\n try {\n const result = await this.requestCallback(auth, background);\n this.attemptAuthDeferred.resolve(result);\n this.attemptAuthDeferred = null;\n } catch (error) {\n // sometimes UI auth errors don't come with flows\n const errorFlows = error.data?.flows ?? null;\n const haveFlows = this.data.flows || Boolean(errorFlows);\n if (error.httpStatus !== 401 || !error.data || !haveFlows) {\n // doesn't look like an interactive-auth failure.\n if (!background) {\n this.attemptAuthDeferred?.reject(error);\n } else {\n // We ignore all failures here (even non-UI auth related ones)\n // since we don't want to suddenly fail if the internet connection\n // had a blip whilst we were polling\n logger.log(\"Background poll request failed doing UI auth: ignoring\", error);\n }\n }\n // if the error didn't come with flows, completed flows or session ID,\n // copy over the ones we have. Synapse sometimes sends responses without\n // any UI auth data (eg. when polling for email validation, if the email\n // has not yet been validated). This appears to be a Synapse bug, which\n // we workaround here.\n if (!error.data.flows && !error.data.completed && !error.data.session) {\n error.data.flows = this.data.flows;\n error.data.completed = this.data.completed;\n error.data.session = this.data.session;\n }\n this.data = error.data;\n try {\n this.startNextAuthStage();\n } catch (e) {\n this.attemptAuthDeferred.reject(e);\n this.attemptAuthDeferred = null;\n }\n\n if (\n !this.emailSid &&\n !this.requestingEmailToken &&\n this.chosenFlow.stages.includes(AuthType.Email)\n ) {\n // If we've picked a flow with email auth, we send the email\n // now because we want the request to fail as soon as possible\n // if the email address is not valid (ie. already taken or not\n // registered, depending on what the operation is).\n this.requestingEmailToken = true;\n try {\n const requestTokenResult = await this.requestEmailTokenCallback(\n this.inputs.emailAddress,\n this.clientSecret,\n 1, // TODO: Multiple send attempts?\n this.data.session,\n );\n this.emailSid = requestTokenResult.sid;\n // NB. promise is not resolved here - at some point, doRequest\n // will be called again and if the user has jumped through all\n // the hoops correctly, auth will be complete and the request\n // will succeed.\n // Also, we should expose the fact that this request has compledted\n // so clients can know that the email has actually been sent.\n } catch (e) {\n // we failed to request an email token, so fail the request.\n // This could be due to the email already beeing registered\n // (or not being registered, depending on what we're trying\n // to do) or it could be a network failure. Either way, pass\n // the failure up as the user can't complete auth if we can't\n // send the email, for whatever reason.\n this.attemptAuthDeferred.reject(e);\n this.attemptAuthDeferred = null;\n } finally {\n this.requestingEmailToken = false;\n }\n }\n }\n }\n\n /**\n * Pick the next stage and call the callback\n *\n * @private\n * @throws {NoAuthFlowFoundError} If no suitable authentication flow can be found\n */\n private startNextAuthStage(): void {\n const nextStage = this.chooseStage();\n if (!nextStage) {\n throw new Error(\"No incomplete flows from the server\");\n }\n this.currentStage = nextStage;\n\n if (nextStage === AuthType.Dummy) {\n this.submitAuthDict({\n type: 'm.login.dummy',\n });\n return;\n }\n\n if (this.data && this.data.errcode || this.data.error) {\n this.stateUpdatedCallback(nextStage, {\n errcode: this.data.errcode || \"\",\n error: this.data.error || \"\",\n });\n return;\n }\n\n const stageStatus: IStageStatus = {};\n if (nextStage == EMAIL_STAGE_TYPE) {\n stageStatus.emailSid = this.emailSid;\n }\n this.stateUpdatedCallback(nextStage, stageStatus);\n }\n\n /**\n * Pick the next auth stage\n *\n * @private\n * @return {string?} login type\n * @throws {NoAuthFlowFoundError} If no suitable authentication flow can be found\n */\n private chooseStage(): AuthType {\n if (this.chosenFlow === null) {\n this.chosenFlow = this.chooseFlow();\n }\n logger.log(\"Active flow => %s\", JSON.stringify(this.chosenFlow));\n const nextStage = this.firstUncompletedStage(this.chosenFlow);\n logger.log(\"Next stage: %s\", nextStage);\n return nextStage;\n }\n\n /**\n * Pick one of the flows from the returned list\n * If a flow using all of the inputs is found, it will\n * be returned, otherwise, null will be returned.\n *\n * Only flows using all given inputs are chosen because it\n * is likely to be surprising if the user provides a\n * credential and it is not used. For example, for registration,\n * this could result in the email not being used which would leave\n * the account with no means to reset a password.\n *\n * @private\n * @return {object} flow\n * @throws {NoAuthFlowFoundError} If no suitable authentication flow can be found\n */\n private chooseFlow(): IFlow {\n const flows = this.data.flows || [];\n\n // we've been given an email or we've already done an email part\n const haveEmail = Boolean(this.inputs.emailAddress) || Boolean(this.emailSid);\n const haveMsisdn = (\n Boolean(this.inputs.phoneCountry) &&\n Boolean(this.inputs.phoneNumber)\n );\n\n for (const flow of flows) {\n let flowHasEmail = false;\n let flowHasMsisdn = false;\n for (const stage of flow.stages) {\n if (stage === EMAIL_STAGE_TYPE) {\n flowHasEmail = true;\n } else if (stage == MSISDN_STAGE_TYPE) {\n flowHasMsisdn = true;\n }\n }\n\n if (flowHasEmail == haveEmail && flowHasMsisdn == haveMsisdn) {\n return flow;\n }\n }\n\n const requiredStages: string[] = [];\n if (haveEmail) requiredStages.push(EMAIL_STAGE_TYPE);\n if (haveMsisdn) requiredStages.push(MSISDN_STAGE_TYPE);\n // Throw an error with a fairly generic description, but with more\n // information such that the app can give a better one if so desired.\n throw new NoAuthFlowFoundError(\"No appropriate authentication flow found\", requiredStages, flows);\n }\n\n /**\n * Get the first uncompleted stage in the given flow\n *\n * @private\n * @param {object} flow\n * @return {string} login type\n */\n private firstUncompletedStage(flow: IFlow): AuthType {\n const completed = this.data.completed || [];\n for (let i = 0; i < flow.stages.length; ++i) {\n const stageType = flow.stages[i];\n if (completed.indexOf(stageType) === -1) {\n return stageType;\n }\n }\n }\n}\n", "/*\nCopyright 2018 André Jaenisch\nCopyright 2019, 2021 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n/**\n * @module logger\n */\n\nimport log, { Logger } from \"loglevel\";\n\n// This is to demonstrate, that you can use any namespace you want.\n// Namespaces allow you to turn on/off the logging for specific parts of the\n// application.\n// An idea would be to control this via an environment variable (on Node.js).\n// See https://www.npmjs.com/package/debug to see how this could be implemented\n// Part of #332 is introducing a logging library in the first place.\nconst DEFAULT_NAMESPACE = \"matrix\";\n\n// because rageshakes in react-sdk hijack the console log, also at module load time,\n// initializing the logger here races with the initialization of rageshakes.\n// to avoid the issue, we override the methodFactory of loglevel that binds to the\n// console methods at initialization time by a factory that looks up the console methods\n// when logging so we always get the current value of console methods.\nlog.methodFactory = function(methodName, logLevel, loggerName) {\n return function(...args) {\n /* eslint-disable @typescript-eslint/no-invalid-this */\n if (this.prefix) {\n args.unshift(this.prefix);\n }\n /* eslint-enable @typescript-eslint/no-invalid-this */\n const supportedByConsole = methodName === \"error\" ||\n methodName === \"warn\" ||\n methodName === \"trace\" ||\n methodName === \"info\";\n /* eslint-disable no-console */\n if (supportedByConsole) {\n return console[methodName](...args);\n } else {\n return console.log(...args);\n }\n /* eslint-enable no-console */\n };\n};\n\n/**\n * Drop-in replacement for console using {@link https://www.npmjs.com/package/loglevel|loglevel}.\n * Can be tailored down to specific use cases if needed.\n */\nexport const logger: PrefixedLogger = log.getLogger(DEFAULT_NAMESPACE);\nlogger.setLevel(log.levels.DEBUG);\n\nexport interface PrefixedLogger extends Logger {\n withPrefix?: (prefix: string) => PrefixedLogger;\n prefix?: string;\n}\n\nfunction extendLogger(logger: PrefixedLogger) {\n logger.withPrefix = function(prefix: string): PrefixedLogger {\n const existingPrefix = this.prefix || \"\";\n return getPrefixedLogger(existingPrefix + prefix);\n };\n}\n\nextendLogger(logger);\n\nfunction getPrefixedLogger(prefix): PrefixedLogger {\n const prefixLogger: PrefixedLogger = log.getLogger(`${DEFAULT_NAMESPACE}-${prefix}`);\n if (prefixLogger.prefix !== prefix) {\n // Only do this setup work the first time through, as loggers are saved by name.\n extendLogger(prefixLogger);\n prefixLogger.prefix = prefix;\n prefixLogger.setLevel(log.levels.DEBUG);\n }\n return prefixLogger;\n}\n", "/*\nCopyright 2015-2021 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\nimport { MemoryCryptoStore } from \"./crypto/store/memory-crypto-store\";\nimport { MemoryStore } from \"./store/memory\";\nimport { MatrixScheduler } from \"./scheduler\";\nimport { MatrixClient } from \"./client\";\nimport { ICreateClientOpts } from \"./client\";\nimport { DeviceTrustLevel } from \"./crypto/CrossSigning\";\nimport { ISecretStorageKeyInfo } from \"./crypto/api\";\n\nexport * from \"./client\";\nexport * from \"./http-api\";\nexport * from \"./autodiscovery\";\nexport * from \"./sync-accumulator\";\nexport * from \"./errors\";\nexport * from \"./models/event\";\nexport * from \"./models/room\";\nexport * from \"./models/group\";\nexport * from \"./models/event-timeline\";\nexport * from \"./models/event-timeline-set\";\nexport * from \"./models/room-member\";\nexport * from \"./models/room-state\";\nexport * from \"./models/user\";\nexport * from \"./scheduler\";\nexport * from \"./filter\";\nexport * from \"./timeline-window\";\nexport * from \"./interactive-auth\";\nexport * from \"./service-types\";\nexport * from \"./store/memory\";\nexport * from \"./store/indexeddb\";\nexport * from \"./store/session/webstorage\";\nexport * from \"./crypto/store/memory-crypto-store\";\nexport * from \"./crypto/store/indexeddb-crypto-store\";\nexport * from \"./content-repo\";\nexport * as ContentHelpers from \"./content-helpers\";\nexport {\n createNewMatrixCall,\n setAudioInput as setMatrixCallAudioInput,\n setVideoInput as setMatrixCallVideoInput,\n} from \"./webrtc/call\";\n\n// expose the underlying request object so different environments can use\n// different request libs (e.g. request or browser-request)\nlet requestInstance;\n\n/**\n * The function used to perform HTTP requests. Only use this if you want to\n * use a different HTTP library, e.g. Angular's $http. This should\n * be set prior to calling {@link createClient}.\n * @param {requestFunction} r The request function to use.\n */\nexport function request(r) {\n requestInstance = r;\n}\n\n/**\n * Return the currently-set request function.\n * @return {requestFunction} The current request function.\n */\nexport function getRequest() {\n return requestInstance;\n}\n\n/**\n * Apply wrapping code around the request function. The wrapper function is\n * installed as the new request handler, and when invoked it is passed the\n * previous value, along with the options and callback arguments.\n * @param {requestWrapperFunction} wrapper The wrapping function.\n */\nexport function wrapRequest(wrapper) {\n const origRequest = requestInstance;\n requestInstance = function(options, callback) {\n return wrapper(origRequest, options, callback);\n };\n}\n\nlet cryptoStoreFactory = () => new MemoryCryptoStore;\n\n/**\n * Configure a different factory to be used for creating crypto stores\n *\n * @param {Function} fac a function which will return a new\n * {@link module:crypto.store.base~CryptoStore}.\n */\nexport function setCryptoStoreFactory(fac) {\n cryptoStoreFactory = fac;\n}\n\nexport interface ICryptoCallbacks {\n getCrossSigningKey?: (keyType: string, pubKey: string) => Promise;\n saveCrossSigningKeys?: (keys: Record) => void;\n shouldUpgradeDeviceVerifications?: (\n users: Record\n ) => Promise;\n getSecretStorageKey?: (\n keys: {keys: Record}, name: string\n ) => Promise<[string, Uint8Array] | null>;\n cacheSecretStorageKey?: (\n keyId: string, keyInfo: ISecretStorageKeyInfo, key: Uint8Array\n ) => void;\n onSecretRequested?: (\n userId: string, deviceId: string,\n requestId: string, secretName: string, deviceTrust: DeviceTrustLevel\n ) => Promise;\n getDehydrationKey?: (\n keyInfo: ISecretStorageKeyInfo,\n checkFunc: (Uint8Array) => void,\n ) => Promise;\n getBackupKey?: () => Promise;\n}\n\n/**\n * Construct a Matrix Client. Similar to {@link module:client.MatrixClient}\n * except that the 'request', 'store' and 'scheduler' dependencies are satisfied.\n * @param {(Object|string)} opts The configuration options for this client. If\n * this is a string, it is assumed to be the base URL. These configuration\n * options will be passed directly to {@link module:client.MatrixClient}.\n * @param {Object} opts.store If not set, defaults to\n * {@link module:store/memory.MemoryStore}.\n * @param {Object} opts.scheduler If not set, defaults to\n * {@link module:scheduler~MatrixScheduler}.\n * @param {requestFunction} opts.request If not set, defaults to the function\n * supplied to {@link request} which defaults to the request module from NPM.\n *\n * @param {module:crypto.store.base~CryptoStore=} opts.cryptoStore\n * crypto store implementation. Calls the factory supplied to\n * {@link setCryptoStoreFactory} if unspecified; or if no factory has been\n * specified, uses a default implementation (indexeddb in the browser,\n * in-memory otherwise).\n *\n * @return {MatrixClient} A new matrix client.\n * @see {@link module:client.MatrixClient} for the full list of options for\n * opts.\n */\nexport function createClient(opts: ICreateClientOpts | string) {\n if (typeof opts === \"string\") {\n opts = {\n \"baseUrl\": opts as string,\n };\n }\n opts.request = opts.request || requestInstance;\n opts.store = opts.store || new MemoryStore({\n localStorage: global.localStorage,\n });\n opts.scheduler = opts.scheduler || new MatrixScheduler();\n opts.cryptoStore = opts.cryptoStore || cryptoStoreFactory();\n return new MatrixClient(opts);\n}\n\n/**\n * The request function interface for performing HTTP requests. This matches the\n * API for the {@link https://github.com/request/request#requestoptions-callback|\n * request NPM module}. The SDK will attempt to call this function in order to\n * perform an HTTP request.\n * @callback requestFunction\n * @param {Object} opts The options for this HTTP request.\n * @param {string} opts.uri The complete URI.\n * @param {string} opts.method The HTTP method.\n * @param {Object} opts.qs The query parameters to append to the URI.\n * @param {Object} opts.body The JSON-serializable object.\n * @param {boolean} opts.json True if this is a JSON request.\n * @param {Object} opts._matrix_opts The underlying options set for\n * {@link MatrixHttpApi}.\n * @param {requestCallback} callback The request callback.\n */\n\n/**\n * A wrapper for the request function interface.\n * @callback requestWrapperFunction\n * @param {requestFunction} origRequest The underlying request function being\n * wrapped\n * @param {Object} opts The options for this HTTP request, given in the same\n * form as {@link requestFunction}.\n * @param {requestCallback} callback The request callback.\n */\n\n/**\n * The request callback interface for performing HTTP requests. This matches the\n * API for the {@link https://github.com/request/request#requestoptions-callback|\n * request NPM module}. The SDK will implement a callback which meets this\n * interface in order to handle the HTTP response.\n * @callback requestCallback\n * @param {Error} err The error if one occurred, else falsey.\n * @param {Object} response The HTTP response which consists of\n * {statusCode: {Number}, headers: {Object}}\n * @param {Object} body The parsed HTTP response body.\n */\n", "/*\nCopyright 2021 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\nimport { MatrixClient } from \"../client\";\nimport { IEncryptedFile, UNSTABLE_MSC3089_BRANCH } from \"../@types/event\";\nimport { MatrixEvent } from \"./event\";\n\n/**\n * Represents a [MSC3089](https://github.com/matrix-org/matrix-doc/pull/3089) branch - a reference\n * to a file (leaf) in the tree. Note that this is UNSTABLE and subject to breaking changes\n * without notice.\n */\nexport class MSC3089Branch {\n public constructor(private client: MatrixClient, public readonly indexEvent: MatrixEvent) {\n // Nothing to do\n }\n\n /**\n * The file ID.\n */\n public get id(): string {\n return this.indexEvent.getStateKey();\n }\n\n /**\n * Whether this branch is active/valid.\n */\n public get isActive(): boolean {\n return this.indexEvent.getContent()[\"active\"] === true;\n }\n\n private get roomId(): string {\n return this.indexEvent.getRoomId();\n }\n\n /**\n * Deletes the file from the tree.\n * @returns {Promise} Resolves when complete.\n */\n public async delete(): Promise {\n await this.client.sendStateEvent(this.roomId, UNSTABLE_MSC3089_BRANCH.name, {}, this.id);\n await this.client.redactEvent(this.roomId, this.id);\n\n // TODO: Delete edit history as well\n }\n\n /**\n * Gets the name for this file.\n * @returns {string} The name, or \"Unnamed File\" if unknown.\n */\n public getName(): string {\n return this.indexEvent.getContent()['name'] || \"Unnamed File\";\n }\n\n /**\n * Sets the name for this file.\n * @param {string} name The new name for this file.\n * @returns {Promise} Resolves when complete.\n */\n public async setName(name: string): Promise {\n await this.client.sendStateEvent(this.roomId, UNSTABLE_MSC3089_BRANCH.name, {\n ...this.indexEvent.getContent(),\n name: name,\n }, this.id);\n }\n\n /**\n * Gets information about the file needed to download it.\n * @returns {Promise<{info: IEncryptedFile, httpUrl: string}>} Information about the file.\n */\n public async getFileInfo(): Promise<{ info: IEncryptedFile, httpUrl: string }> {\n const event = await this.getFileEvent();\n\n const file = event.getContent()['file'];\n const httpUrl = this.client.mxcUrlToHttp(file['url']);\n\n return { info: file, httpUrl: httpUrl };\n }\n\n /**\n * Gets the event the file points to.\n * @returns {Promise} Resolves to the file's event.\n */\n public async getFileEvent(): Promise {\n const room = this.client.getRoom(this.roomId);\n if (!room) throw new Error(\"Unknown room\");\n\n const timeline = await this.client.getEventTimeline(room.getUnfilteredTimelineSet(), this.id);\n if (!timeline) throw new Error(\"Failed to get timeline for room event\");\n\n const event = timeline.getEvents().find(e => e.getId() === this.id);\n if (!event) throw new Error(\"Failed to find event\");\n\n // Sometimes the event context doesn't decrypt for us, so do that.\n await this.client.decryptEventIfNeeded(event, { emit: false, isRetry: false });\n\n return event;\n }\n}\n", - "/*\nCopyright 2021 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\nimport { MatrixClient } from \"../client\";\nimport { EventType, IEncryptedFile, MsgType, UNSTABLE_MSC3089_BRANCH, UNSTABLE_MSC3089_LEAF } from \"../@types/event\";\nimport { Room } from \"./room\";\nimport { logger } from \"../logger\";\nimport { MatrixEvent } from \"./event\";\nimport {\n averageBetweenStrings,\n DEFAULT_ALPHABET,\n lexicographicCompare,\n nextString,\n prevString,\n simpleRetryOperation,\n} from \"../utils\";\nimport { MSC3089Branch } from \"./MSC3089Branch\";\nimport promiseRetry from \"p-retry\";\nimport { isRoomSharedHistory } from \"../crypto/algorithms/megolm\";\n\n/**\n * The recommended defaults for a tree space's power levels. Note that this\n * is UNSTABLE and subject to breaking changes without notice.\n */\nexport const DEFAULT_TREE_POWER_LEVELS_TEMPLATE = {\n // Owner\n invite: 100,\n kick: 100,\n ban: 100,\n\n // Editor\n redact: 50,\n state_default: 50,\n events_default: 50,\n\n // Viewer\n users_default: 0,\n\n // Mixed\n events: {\n [EventType.RoomPowerLevels]: 100,\n [EventType.RoomHistoryVisibility]: 100,\n [EventType.RoomTombstone]: 100,\n [EventType.RoomEncryption]: 100,\n [EventType.RoomName]: 50,\n [EventType.RoomMessage]: 50,\n [EventType.RoomMessageEncrypted]: 50,\n [EventType.Sticker]: 50,\n },\n\n users: {}, // defined by calling code\n};\n\n/**\n * Ease-of-use representation for power levels represented as simple roles.\n * Note that this is UNSTABLE and subject to breaking changes without notice.\n */\nexport enum TreePermissions {\n Viewer = \"viewer\", // Default\n Editor = \"editor\", // \"Moderator\" or ~PL50\n Owner = \"owner\", // \"Admin\" or PL100\n}\n\n/**\n * Represents a [MSC3089](https://github.com/matrix-org/matrix-doc/pull/3089)\n * file tree Space. Note that this is UNSTABLE and subject to breaking changes\n * without notice.\n */\nexport class MSC3089TreeSpace {\n public readonly room: Room;\n\n public constructor(private client: MatrixClient, public readonly roomId: string) {\n this.room = this.client.getRoom(this.roomId);\n\n if (!this.room) throw new Error(\"Unknown room\");\n }\n\n /**\n * Syntactic sugar for room ID of the Space.\n */\n public get id(): string {\n return this.roomId;\n }\n\n /**\n * Whether or not this is a top level space.\n */\n public get isTopLevel(): boolean {\n // XXX: This is absolutely not how you find out if the space is top level\n // but is safe for a managed usecase like we offer in the SDK.\n const parentEvents = this.room.currentState.getStateEvents(EventType.SpaceParent);\n if (!parentEvents?.length) return true;\n return parentEvents.every(e => !e.getContent()?.['via']);\n }\n\n /**\n * Sets the name of the tree space.\n * @param {string} name The new name for the space.\n * @returns {Promise} Resolves when complete.\n */\n public async setName(name: string): Promise {\n await this.client.sendStateEvent(this.roomId, EventType.RoomName, { name }, \"\");\n }\n\n /**\n * Invites a user to the tree space. They will be given the default Viewer\n * permission level unless specified elsewhere.\n * @param {string} userId The user ID to invite.\n * @param {boolean} andSubspaces True (default) to invite the user to all\n * directories/subspaces too, recursively.\n * @param {boolean} shareHistoryKeys True (default) to share encryption keys\n * with the invited user. This will allow them to decrypt the events (files)\n * in the tree. Keys will not be shared if the room is lacking appropriate\n * history visibility (by default, history visibility is \"shared\" in trees,\n * which is an appropriate visibility for these purposes).\n * @returns {Promise} Resolves when complete.\n */\n public async invite(userId: string, andSubspaces = true, shareHistoryKeys = true): Promise {\n const promises: Promise[] = [this.retryInvite(userId)];\n if (andSubspaces) {\n promises.push(...this.getDirectories().map(d => d.invite(userId, andSubspaces, shareHistoryKeys)));\n }\n return Promise.all(promises).then(() => {\n // Note: key sharing is default on because for file trees it is relatively important that the invite\n // target can actually decrypt the files. The implied use case is that by inviting a user to the tree\n // it means the sender would like the receiver to view/download the files contained within, much like\n // sharing a folder in other circles.\n if (shareHistoryKeys && isRoomSharedHistory(this.room)) {\n // noinspection JSIgnoredPromiseFromCall - we aren't concerned as much if this fails.\n this.client.sendSharedHistoryKeys(this.roomId, [userId]);\n }\n });\n }\n\n private retryInvite(userId: string): Promise {\n return simpleRetryOperation(async () => {\n await this.client.invite(this.roomId, userId).catch(e => {\n // We don't want to retry permission errors forever...\n if (e?.errcode === \"M_FORBIDDEN\") {\n throw new promiseRetry.AbortError(e);\n }\n throw e;\n });\n });\n }\n\n /**\n * Sets the permissions of a user to the given role. Note that if setting a user\n * to Owner then they will NOT be able to be demoted. If the user does not have\n * permission to change the power level of the target, an error will be thrown.\n * @param {string} userId The user ID to change the role of.\n * @param {TreePermissions} role The role to assign.\n * @returns {Promise} Resolves when complete.\n */\n public async setPermissions(userId: string, role: TreePermissions): Promise {\n const currentPls = this.room.currentState.getStateEvents(EventType.RoomPowerLevels, \"\");\n if (Array.isArray(currentPls)) throw new Error(\"Unexpected return type for power levels\");\n\n const pls = currentPls.getContent() || {};\n const viewLevel = pls['users_default'] || 0;\n const editLevel = pls['events_default'] || 50;\n const adminLevel = pls['events']?.[EventType.RoomPowerLevels] || 100;\n\n const users = pls['users'] || {};\n switch (role) {\n case TreePermissions.Viewer:\n users[userId] = viewLevel;\n break;\n case TreePermissions.Editor:\n users[userId] = editLevel;\n break;\n case TreePermissions.Owner:\n users[userId] = adminLevel;\n break;\n default:\n throw new Error(\"Invalid role: \" + role);\n }\n pls['users'] = users;\n\n await this.client.sendStateEvent(this.roomId, EventType.RoomPowerLevels, pls, \"\");\n }\n\n /**\n * Gets the current permissions of a user. Note that any users missing explicit permissions (or not\n * in the space) will be considered Viewers. Appropriate membership checks need to be performed\n * elsewhere.\n * @param {string} userId The user ID to check permissions of.\n * @returns {TreePermissions} The permissions for the user, defaulting to Viewer.\n */\n public getPermissions(userId: string): TreePermissions {\n const currentPls = this.room.currentState.getStateEvents(EventType.RoomPowerLevels, \"\");\n if (Array.isArray(currentPls)) throw new Error(\"Unexpected return type for power levels\");\n\n const pls = currentPls.getContent() || {};\n const viewLevel = pls['users_default'] || 0;\n const editLevel = pls['events_default'] || 50;\n const adminLevel = pls['events']?.[EventType.RoomPowerLevels] || 100;\n\n const userLevel = pls['users']?.[userId] || viewLevel;\n if (userLevel >= adminLevel) return TreePermissions.Owner;\n if (userLevel >= editLevel) return TreePermissions.Editor;\n return TreePermissions.Viewer;\n }\n\n /**\n * Creates a directory under this tree space, represented as another tree space.\n * @param {string} name The name for the directory.\n * @returns {Promise} Resolves to the created directory.\n */\n public async createDirectory(name: string): Promise {\n const directory = await this.client.unstableCreateFileTree(name);\n\n await this.client.sendStateEvent(this.roomId, EventType.SpaceChild, {\n via: [this.client.getDomain()],\n }, directory.roomId);\n\n await this.client.sendStateEvent(directory.roomId, EventType.SpaceParent, {\n via: [this.client.getDomain()],\n }, this.roomId);\n\n return directory;\n }\n\n /**\n * Gets a list of all known immediate subdirectories to this tree space.\n * @returns {MSC3089TreeSpace[]} The tree spaces (directories). May be empty, but not null.\n */\n public getDirectories(): MSC3089TreeSpace[] {\n const trees: MSC3089TreeSpace[] = [];\n const children = this.room.currentState.getStateEvents(EventType.SpaceChild);\n for (const child of children) {\n try {\n const tree = this.client.unstableGetFileTreeSpace(child.getStateKey());\n if (tree) trees.push(tree);\n } catch (e) {\n logger.warn(\"Unable to create tree space instance for listing. Are we joined?\", e);\n }\n }\n return trees;\n }\n\n /**\n * Gets a subdirectory of a given ID under this tree space. Note that this will not recurse\n * into children and instead only look one level deep.\n * @param {string} roomId The room ID (directory ID) to find.\n * @returns {MSC3089TreeSpace} The directory, or falsy if not found.\n */\n public getDirectory(roomId: string): MSC3089TreeSpace {\n return this.getDirectories().find(r => r.roomId === roomId);\n }\n\n /**\n * Deletes the tree, kicking all members and deleting **all subdirectories**.\n * @returns {Promise} Resolves when complete.\n */\n public async delete(): Promise {\n const subdirectories = this.getDirectories();\n for (const dir of subdirectories) {\n await dir.delete();\n }\n\n const kickMemberships = [\"invite\", \"knock\", \"join\"];\n const members = this.room.currentState.getStateEvents(EventType.RoomMember);\n for (const member of members) {\n const isNotUs = member.getStateKey() !== this.client.getUserId();\n if (isNotUs && kickMemberships.includes(member.getContent()['membership'])) {\n await this.client.kick(this.roomId, member.getStateKey(), \"Room deleted\");\n }\n }\n\n await this.client.leave(this.roomId);\n }\n\n private getOrderedChildren(children: MatrixEvent[]): { roomId: string, order: string }[] {\n const ordered: { roomId: string, order: string }[] = children\n .map(c => ({ roomId: c.getStateKey(), order: c.getContent()['order'] }));\n ordered.sort((a, b) => {\n if (a.order && !b.order) {\n return -1;\n } else if (!a.order && b.order) {\n return 1;\n } else if (!a.order && !b.order) {\n const roomA = this.client.getRoom(a.roomId);\n const roomB = this.client.getRoom(b.roomId);\n if (!roomA || !roomB) { // just don't bother trying to do more partial sorting\n return lexicographicCompare(a.roomId, b.roomId);\n }\n\n const createTsA = roomA.currentState.getStateEvents(EventType.RoomCreate, \"\")?.getTs() ?? 0;\n const createTsB = roomB.currentState.getStateEvents(EventType.RoomCreate, \"\")?.getTs() ?? 0;\n if (createTsA === createTsB) {\n return lexicographicCompare(a.roomId, b.roomId);\n }\n return createTsA - createTsB;\n } else { // both not-null orders\n return lexicographicCompare(a.order, b.order);\n }\n });\n return ordered;\n }\n\n private getParentRoom(): Room {\n const parents = this.room.currentState.getStateEvents(EventType.SpaceParent);\n const parent = parents[0]; // XXX: Wild assumption\n if (!parent) throw new Error(\"Expected to have a parent in a non-top level space\");\n\n // XXX: We are assuming the parent is a valid tree space.\n // We probably don't need to validate the parent room state for this usecase though.\n const parentRoom = this.client.getRoom(parent.getStateKey());\n if (!parentRoom) throw new Error(\"Unable to locate room for parent\");\n\n return parentRoom;\n }\n\n /**\n * Gets the current order index for this directory. Note that if this is the top level space\n * then -1 will be returned.\n * @returns {number} The order index of this space.\n */\n public getOrder(): number {\n if (this.isTopLevel) return -1;\n\n const parentRoom = this.getParentRoom();\n const children = parentRoom.currentState.getStateEvents(EventType.SpaceChild);\n const ordered = this.getOrderedChildren(children);\n\n return ordered.findIndex(c => c.roomId === this.roomId);\n }\n\n /**\n * Sets the order index for this directory within its parent. Note that if this is a top level\n * space then an error will be thrown. -1 can be used to move the child to the start, and numbers\n * larger than the number of children can be used to move the child to the end.\n * @param {number} index The new order index for this space.\n * @returns {Promise} Resolves when complete.\n * @throws Throws if this is a top level space.\n */\n public async setOrder(index: number): Promise {\n if (this.isTopLevel) throw new Error(\"Cannot set order of top level spaces currently\");\n\n const parentRoom = this.getParentRoom();\n const children = parentRoom.currentState.getStateEvents(EventType.SpaceChild);\n const ordered = this.getOrderedChildren(children);\n index = Math.max(Math.min(index, ordered.length - 1), 0);\n\n const currentIndex = this.getOrder();\n const movingUp = currentIndex < index;\n if (movingUp && index === (ordered.length - 1)) {\n index--;\n } else if (!movingUp && index === 0) {\n index++;\n }\n\n const prev = ordered[movingUp ? index : (index - 1)];\n const next = ordered[movingUp ? (index + 1) : index];\n\n let newOrder = DEFAULT_ALPHABET[0];\n let ensureBeforeIsSane = false;\n if (!prev) {\n // Move to front\n if (next?.order) {\n newOrder = prevString(next.order);\n }\n } else if (index === (ordered.length - 1)) {\n // Move to back\n if (next?.order) {\n newOrder = nextString(next.order);\n }\n } else {\n // Move somewhere in the middle\n const startOrder = prev?.order;\n const endOrder = next?.order;\n if (startOrder && endOrder) {\n if (startOrder === endOrder) {\n // Error case: just move +1 to break out of awful math\n newOrder = nextString(startOrder);\n } else {\n newOrder = averageBetweenStrings(startOrder, endOrder);\n }\n } else {\n if (startOrder) {\n // We're at the end (endOrder is null, so no explicit order)\n newOrder = nextString(startOrder);\n } else if (endOrder) {\n // We're at the start (startOrder is null, so nothing before us)\n newOrder = prevString(endOrder);\n } else {\n // Both points are unknown. We're likely in a range where all the children\n // don't have particular order values, so we may need to update them too.\n // The other possibility is there's only us as a child, but we should have\n // shown up in the other states.\n ensureBeforeIsSane = true;\n }\n }\n }\n\n if (ensureBeforeIsSane) {\n // We were asked by the order algorithm to prepare the moving space for a landing\n // in the undefined order part of the order array, which means we need to update the\n // spaces that come before it with a stable order value.\n let lastOrder: string;\n for (let i = 0; i <= index; i++) {\n const target = ordered[i];\n if (i === 0) {\n lastOrder = target.order;\n }\n if (!target.order) {\n // XXX: We should be creating gaps to avoid conflicts\n lastOrder = lastOrder ? nextString(lastOrder) : DEFAULT_ALPHABET[0];\n const currentChild = parentRoom.currentState.getStateEvents(EventType.SpaceChild, target.roomId);\n const content = currentChild?.getContent() ?? { via: [this.client.getDomain()] };\n await this.client.sendStateEvent(parentRoom.roomId, EventType.SpaceChild, {\n ...content,\n order: lastOrder,\n }, target.roomId);\n } else {\n lastOrder = target.order;\n }\n }\n newOrder = nextString(lastOrder);\n }\n\n // TODO: Deal with order conflicts by reordering\n\n // Now we can finally update our own order state\n const currentChild = parentRoom.currentState.getStateEvents(EventType.SpaceChild, this.roomId);\n const content = currentChild?.getContent() ?? { via: [this.client.getDomain()] };\n await this.client.sendStateEvent(parentRoom.roomId, EventType.SpaceChild, {\n ...content,\n\n // TODO: Safely constrain to 50 character limit required by spaces.\n order: newOrder,\n }, this.roomId);\n }\n\n /**\n * Creates (uploads) a new file to this tree. The file must have already been encrypted for the room.\n * @param {string} name The name of the file.\n * @param {ArrayBuffer} encryptedContents The encrypted contents.\n * @param {Partial} info The encrypted file information.\n * @returns {Promise} Resolves when uploaded.\n */\n public async createFile(\n name: string,\n encryptedContents: ArrayBuffer, info: Partial,\n ): Promise {\n const mxc = await this.client.uploadContent(new Blob([encryptedContents]), {\n includeFilename: false,\n onlyContentUri: true,\n });\n info.url = mxc;\n\n const res = await this.client.sendMessage(this.roomId, {\n msgtype: MsgType.File,\n body: name,\n url: mxc,\n file: info,\n [UNSTABLE_MSC3089_LEAF.name]: {},\n });\n\n await this.client.sendStateEvent(this.roomId, UNSTABLE_MSC3089_BRANCH.name, {\n active: true,\n name: name,\n }, res['event_id']);\n }\n\n /**\n * Retrieves a file from the tree.\n * @param {string} fileEventId The event ID of the file.\n * @returns {MSC3089Branch} The file, or falsy if not found.\n */\n public getFile(fileEventId: string): MSC3089Branch {\n const branch = this.room.currentState.getStateEvents(UNSTABLE_MSC3089_BRANCH.name, fileEventId);\n return branch ? new MSC3089Branch(this.client, branch) : null;\n }\n\n /**\n * Gets an array of all known files for the tree.\n * @returns {MSC3089Branch[]} The known files. May be empty, but not null.\n */\n public listFiles(): MSC3089Branch[] {\n const branches = this.room.currentState.getStateEvents(UNSTABLE_MSC3089_BRANCH.name) ?? [];\n return branches.map(e => new MSC3089Branch(this.client, e)).filter(b => b.isActive);\n }\n}\n", + "/*\nCopyright 2021 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\nimport { MatrixClient } from \"../client\";\nimport { EventType, IEncryptedFile, MsgType, UNSTABLE_MSC3089_BRANCH, UNSTABLE_MSC3089_LEAF } from \"../@types/event\";\nimport { Room } from \"./room\";\nimport { logger } from \"../logger\";\nimport { IContent, MatrixEvent } from \"./event\";\nimport {\n averageBetweenStrings,\n DEFAULT_ALPHABET,\n lexicographicCompare,\n nextString,\n prevString,\n simpleRetryOperation,\n} from \"../utils\";\nimport { MSC3089Branch } from \"./MSC3089Branch\";\nimport promiseRetry from \"p-retry\";\nimport { isRoomSharedHistory } from \"../crypto/algorithms/megolm\";\n\n/**\n * The recommended defaults for a tree space's power levels. Note that this\n * is UNSTABLE and subject to breaking changes without notice.\n */\nexport const DEFAULT_TREE_POWER_LEVELS_TEMPLATE = {\n // Owner\n invite: 100,\n kick: 100,\n ban: 100,\n\n // Editor\n redact: 50,\n state_default: 50,\n events_default: 50,\n\n // Viewer\n users_default: 0,\n\n // Mixed\n events: {\n [EventType.RoomPowerLevels]: 100,\n [EventType.RoomHistoryVisibility]: 100,\n [EventType.RoomTombstone]: 100,\n [EventType.RoomEncryption]: 100,\n [EventType.RoomName]: 50,\n [EventType.RoomMessage]: 50,\n [EventType.RoomMessageEncrypted]: 50,\n [EventType.Sticker]: 50,\n },\n\n users: {}, // defined by calling code\n};\n\n/**\n * Ease-of-use representation for power levels represented as simple roles.\n * Note that this is UNSTABLE and subject to breaking changes without notice.\n */\nexport enum TreePermissions {\n Viewer = \"viewer\", // Default\n Editor = \"editor\", // \"Moderator\" or ~PL50\n Owner = \"owner\", // \"Admin\" or PL100\n}\n\n/**\n * Represents a [MSC3089](https://github.com/matrix-org/matrix-doc/pull/3089)\n * file tree Space. Note that this is UNSTABLE and subject to breaking changes\n * without notice.\n */\nexport class MSC3089TreeSpace {\n public readonly room: Room;\n\n public constructor(private client: MatrixClient, public readonly roomId: string) {\n this.room = this.client.getRoom(this.roomId);\n\n if (!this.room) throw new Error(\"Unknown room\");\n }\n\n /**\n * Syntactic sugar for room ID of the Space.\n */\n public get id(): string {\n return this.roomId;\n }\n\n /**\n * Whether or not this is a top level space.\n */\n public get isTopLevel(): boolean {\n // XXX: This is absolutely not how you find out if the space is top level\n // but is safe for a managed usecase like we offer in the SDK.\n const parentEvents = this.room.currentState.getStateEvents(EventType.SpaceParent);\n if (!parentEvents?.length) return true;\n return parentEvents.every(e => !e.getContent()?.['via']);\n }\n\n /**\n * Sets the name of the tree space.\n * @param {string} name The new name for the space.\n * @returns {Promise} Resolves when complete.\n */\n public async setName(name: string): Promise {\n await this.client.sendStateEvent(this.roomId, EventType.RoomName, { name }, \"\");\n }\n\n /**\n * Invites a user to the tree space. They will be given the default Viewer\n * permission level unless specified elsewhere.\n * @param {string} userId The user ID to invite.\n * @param {boolean} andSubspaces True (default) to invite the user to all\n * directories/subspaces too, recursively.\n * @param {boolean} shareHistoryKeys True (default) to share encryption keys\n * with the invited user. This will allow them to decrypt the events (files)\n * in the tree. Keys will not be shared if the room is lacking appropriate\n * history visibility (by default, history visibility is \"shared\" in trees,\n * which is an appropriate visibility for these purposes).\n * @returns {Promise} Resolves when complete.\n */\n public async invite(userId: string, andSubspaces = true, shareHistoryKeys = true): Promise {\n const promises: Promise[] = [this.retryInvite(userId)];\n if (andSubspaces) {\n promises.push(...this.getDirectories().map(d => d.invite(userId, andSubspaces, shareHistoryKeys)));\n }\n return Promise.all(promises).then(() => {\n // Note: key sharing is default on because for file trees it is relatively important that the invite\n // target can actually decrypt the files. The implied use case is that by inviting a user to the tree\n // it means the sender would like the receiver to view/download the files contained within, much like\n // sharing a folder in other circles.\n if (shareHistoryKeys && isRoomSharedHistory(this.room)) {\n // noinspection JSIgnoredPromiseFromCall - we aren't concerned as much if this fails.\n this.client.sendSharedHistoryKeys(this.roomId, [userId]);\n }\n });\n }\n\n private retryInvite(userId: string): Promise {\n return simpleRetryOperation(async () => {\n await this.client.invite(this.roomId, userId).catch(e => {\n // We don't want to retry permission errors forever...\n if (e?.errcode === \"M_FORBIDDEN\") {\n throw new promiseRetry.AbortError(e);\n }\n throw e;\n });\n });\n }\n\n /**\n * Sets the permissions of a user to the given role. Note that if setting a user\n * to Owner then they will NOT be able to be demoted. If the user does not have\n * permission to change the power level of the target, an error will be thrown.\n * @param {string} userId The user ID to change the role of.\n * @param {TreePermissions} role The role to assign.\n * @returns {Promise} Resolves when complete.\n */\n public async setPermissions(userId: string, role: TreePermissions): Promise {\n const currentPls = this.room.currentState.getStateEvents(EventType.RoomPowerLevels, \"\");\n if (Array.isArray(currentPls)) throw new Error(\"Unexpected return type for power levels\");\n\n const pls = currentPls.getContent() || {};\n const viewLevel = pls['users_default'] || 0;\n const editLevel = pls['events_default'] || 50;\n const adminLevel = pls['events']?.[EventType.RoomPowerLevels] || 100;\n\n const users = pls['users'] || {};\n switch (role) {\n case TreePermissions.Viewer:\n users[userId] = viewLevel;\n break;\n case TreePermissions.Editor:\n users[userId] = editLevel;\n break;\n case TreePermissions.Owner:\n users[userId] = adminLevel;\n break;\n default:\n throw new Error(\"Invalid role: \" + role);\n }\n pls['users'] = users;\n\n await this.client.sendStateEvent(this.roomId, EventType.RoomPowerLevels, pls, \"\");\n }\n\n /**\n * Gets the current permissions of a user. Note that any users missing explicit permissions (or not\n * in the space) will be considered Viewers. Appropriate membership checks need to be performed\n * elsewhere.\n * @param {string} userId The user ID to check permissions of.\n * @returns {TreePermissions} The permissions for the user, defaulting to Viewer.\n */\n public getPermissions(userId: string): TreePermissions {\n const currentPls = this.room.currentState.getStateEvents(EventType.RoomPowerLevels, \"\");\n if (Array.isArray(currentPls)) throw new Error(\"Unexpected return type for power levels\");\n\n const pls = currentPls.getContent() || {};\n const viewLevel = pls['users_default'] || 0;\n const editLevel = pls['events_default'] || 50;\n const adminLevel = pls['events']?.[EventType.RoomPowerLevels] || 100;\n\n const userLevel = pls['users']?.[userId] || viewLevel;\n if (userLevel >= adminLevel) return TreePermissions.Owner;\n if (userLevel >= editLevel) return TreePermissions.Editor;\n return TreePermissions.Viewer;\n }\n\n /**\n * Creates a directory under this tree space, represented as another tree space.\n * @param {string} name The name for the directory.\n * @returns {Promise} Resolves to the created directory.\n */\n public async createDirectory(name: string): Promise {\n const directory = await this.client.unstableCreateFileTree(name);\n\n await this.client.sendStateEvent(this.roomId, EventType.SpaceChild, {\n via: [this.client.getDomain()],\n }, directory.roomId);\n\n await this.client.sendStateEvent(directory.roomId, EventType.SpaceParent, {\n via: [this.client.getDomain()],\n }, this.roomId);\n\n return directory;\n }\n\n /**\n * Gets a list of all known immediate subdirectories to this tree space.\n * @returns {MSC3089TreeSpace[]} The tree spaces (directories). May be empty, but not null.\n */\n public getDirectories(): MSC3089TreeSpace[] {\n const trees: MSC3089TreeSpace[] = [];\n const children = this.room.currentState.getStateEvents(EventType.SpaceChild);\n for (const child of children) {\n try {\n const tree = this.client.unstableGetFileTreeSpace(child.getStateKey());\n if (tree) trees.push(tree);\n } catch (e) {\n logger.warn(\"Unable to create tree space instance for listing. Are we joined?\", e);\n }\n }\n return trees;\n }\n\n /**\n * Gets a subdirectory of a given ID under this tree space. Note that this will not recurse\n * into children and instead only look one level deep.\n * @param {string} roomId The room ID (directory ID) to find.\n * @returns {MSC3089TreeSpace} The directory, or falsy if not found.\n */\n public getDirectory(roomId: string): MSC3089TreeSpace {\n return this.getDirectories().find(r => r.roomId === roomId);\n }\n\n /**\n * Deletes the tree, kicking all members and deleting **all subdirectories**.\n * @returns {Promise} Resolves when complete.\n */\n public async delete(): Promise {\n const subdirectories = this.getDirectories();\n for (const dir of subdirectories) {\n await dir.delete();\n }\n\n const kickMemberships = [\"invite\", \"knock\", \"join\"];\n const members = this.room.currentState.getStateEvents(EventType.RoomMember);\n for (const member of members) {\n const isNotUs = member.getStateKey() !== this.client.getUserId();\n if (isNotUs && kickMemberships.includes(member.getContent()['membership'])) {\n await this.client.kick(this.roomId, member.getStateKey(), \"Room deleted\");\n }\n }\n\n await this.client.leave(this.roomId);\n }\n\n private getOrderedChildren(children: MatrixEvent[]): { roomId: string, order: string }[] {\n const ordered: { roomId: string, order: string }[] = children\n .map(c => ({ roomId: c.getStateKey(), order: c.getContent()['order'] }));\n ordered.sort((a, b) => {\n if (a.order && !b.order) {\n return -1;\n } else if (!a.order && b.order) {\n return 1;\n } else if (!a.order && !b.order) {\n const roomA = this.client.getRoom(a.roomId);\n const roomB = this.client.getRoom(b.roomId);\n if (!roomA || !roomB) { // just don't bother trying to do more partial sorting\n return lexicographicCompare(a.roomId, b.roomId);\n }\n\n const createTsA = roomA.currentState.getStateEvents(EventType.RoomCreate, \"\")?.getTs() ?? 0;\n const createTsB = roomB.currentState.getStateEvents(EventType.RoomCreate, \"\")?.getTs() ?? 0;\n if (createTsA === createTsB) {\n return lexicographicCompare(a.roomId, b.roomId);\n }\n return createTsA - createTsB;\n } else { // both not-null orders\n return lexicographicCompare(a.order, b.order);\n }\n });\n return ordered;\n }\n\n private getParentRoom(): Room {\n const parents = this.room.currentState.getStateEvents(EventType.SpaceParent);\n const parent = parents[0]; // XXX: Wild assumption\n if (!parent) throw new Error(\"Expected to have a parent in a non-top level space\");\n\n // XXX: We are assuming the parent is a valid tree space.\n // We probably don't need to validate the parent room state for this usecase though.\n const parentRoom = this.client.getRoom(parent.getStateKey());\n if (!parentRoom) throw new Error(\"Unable to locate room for parent\");\n\n return parentRoom;\n }\n\n /**\n * Gets the current order index for this directory. Note that if this is the top level space\n * then -1 will be returned.\n * @returns {number} The order index of this space.\n */\n public getOrder(): number {\n if (this.isTopLevel) return -1;\n\n const parentRoom = this.getParentRoom();\n const children = parentRoom.currentState.getStateEvents(EventType.SpaceChild);\n const ordered = this.getOrderedChildren(children);\n\n return ordered.findIndex(c => c.roomId === this.roomId);\n }\n\n /**\n * Sets the order index for this directory within its parent. Note that if this is a top level\n * space then an error will be thrown. -1 can be used to move the child to the start, and numbers\n * larger than the number of children can be used to move the child to the end.\n * @param {number} index The new order index for this space.\n * @returns {Promise} Resolves when complete.\n * @throws Throws if this is a top level space.\n */\n public async setOrder(index: number): Promise {\n if (this.isTopLevel) throw new Error(\"Cannot set order of top level spaces currently\");\n\n const parentRoom = this.getParentRoom();\n const children = parentRoom.currentState.getStateEvents(EventType.SpaceChild);\n const ordered = this.getOrderedChildren(children);\n index = Math.max(Math.min(index, ordered.length - 1), 0);\n\n const currentIndex = this.getOrder();\n const movingUp = currentIndex < index;\n if (movingUp && index === (ordered.length - 1)) {\n index--;\n } else if (!movingUp && index === 0) {\n index++;\n }\n\n const prev = ordered[movingUp ? index : (index - 1)];\n const next = ordered[movingUp ? (index + 1) : index];\n\n let newOrder = DEFAULT_ALPHABET[0];\n let ensureBeforeIsSane = false;\n if (!prev) {\n // Move to front\n if (next?.order) {\n newOrder = prevString(next.order);\n }\n } else if (index === (ordered.length - 1)) {\n // Move to back\n if (next?.order) {\n newOrder = nextString(next.order);\n }\n } else {\n // Move somewhere in the middle\n const startOrder = prev?.order;\n const endOrder = next?.order;\n if (startOrder && endOrder) {\n if (startOrder === endOrder) {\n // Error case: just move +1 to break out of awful math\n newOrder = nextString(startOrder);\n } else {\n newOrder = averageBetweenStrings(startOrder, endOrder);\n }\n } else {\n if (startOrder) {\n // We're at the end (endOrder is null, so no explicit order)\n newOrder = nextString(startOrder);\n } else if (endOrder) {\n // We're at the start (startOrder is null, so nothing before us)\n newOrder = prevString(endOrder);\n } else {\n // Both points are unknown. We're likely in a range where all the children\n // don't have particular order values, so we may need to update them too.\n // The other possibility is there's only us as a child, but we should have\n // shown up in the other states.\n ensureBeforeIsSane = true;\n }\n }\n }\n\n if (ensureBeforeIsSane) {\n // We were asked by the order algorithm to prepare the moving space for a landing\n // in the undefined order part of the order array, which means we need to update the\n // spaces that come before it with a stable order value.\n let lastOrder: string;\n for (let i = 0; i <= index; i++) {\n const target = ordered[i];\n if (i === 0) {\n lastOrder = target.order;\n }\n if (!target.order) {\n // XXX: We should be creating gaps to avoid conflicts\n lastOrder = lastOrder ? nextString(lastOrder) : DEFAULT_ALPHABET[0];\n const currentChild = parentRoom.currentState.getStateEvents(EventType.SpaceChild, target.roomId);\n const content = currentChild?.getContent() ?? { via: [this.client.getDomain()] };\n await this.client.sendStateEvent(parentRoom.roomId, EventType.SpaceChild, {\n ...content,\n order: lastOrder,\n }, target.roomId);\n } else {\n lastOrder = target.order;\n }\n }\n newOrder = nextString(lastOrder);\n }\n\n // TODO: Deal with order conflicts by reordering\n\n // Now we can finally update our own order state\n const currentChild = parentRoom.currentState.getStateEvents(EventType.SpaceChild, this.roomId);\n const content = currentChild?.getContent() ?? { via: [this.client.getDomain()] };\n await this.client.sendStateEvent(parentRoom.roomId, EventType.SpaceChild, {\n ...content,\n\n // TODO: Safely constrain to 50 character limit required by spaces.\n order: newOrder,\n }, this.roomId);\n }\n\n /**\n * Creates (uploads) a new file to this tree. The file must have already been encrypted for the room.\n * @param {string} name The name of the file.\n * @param {ArrayBuffer} encryptedContents The encrypted contents.\n * @param {Partial} info The encrypted file information.\n * @param {IContent} additionalContent Optional event content fields to include in the message.\n * @returns {Promise} Resolves when uploaded.\n */\n public async createFile(\n name: string,\n encryptedContents: ArrayBuffer,\n info: Partial,\n additionalContent?: IContent,\n ): Promise {\n const mxc = await this.client.uploadContent(new Blob([encryptedContents]), {\n includeFilename: false,\n onlyContentUri: true,\n });\n info.url = mxc;\n\n const res = await this.client.sendMessage(this.roomId, {\n ...(additionalContent ?? {}),\n msgtype: MsgType.File,\n body: name,\n url: mxc,\n file: info,\n [UNSTABLE_MSC3089_LEAF.name]: {},\n });\n\n await this.client.sendStateEvent(this.roomId, UNSTABLE_MSC3089_BRANCH.name, {\n active: true,\n name: name,\n }, res['event_id']);\n }\n\n /**\n * Retrieves a file from the tree.\n * @param {string} fileEventId The event ID of the file.\n * @returns {MSC3089Branch} The file, or falsy if not found.\n */\n public getFile(fileEventId: string): MSC3089Branch {\n const branch = this.room.currentState.getStateEvents(UNSTABLE_MSC3089_BRANCH.name, fileEventId);\n return branch ? new MSC3089Branch(this.client, branch) : null;\n }\n\n /**\n * Gets an array of all known files for the tree.\n * @returns {MSC3089Branch[]} The known files. May be empty, but not null.\n */\n public listFiles(): MSC3089Branch[] {\n const branches = this.room.currentState.getStateEvents(UNSTABLE_MSC3089_BRANCH.name) ?? [];\n return branches.map(e => new MSC3089Branch(this.client, e)).filter(b => b.isActive);\n }\n}\n", "/*\nCopyright 2015 - 2021 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\nimport { MatrixEvent } from \"./event\";\nimport { Direction } from \"./event-timeline\";\n\n/**\n * @module models/event-context\n */\nexport class EventContext {\n private timeline: MatrixEvent[];\n private ourEventIndex = 0;\n private paginateTokens: Record = {\n [Direction.Backward]: null,\n [Direction.Forward]: null,\n };\n\n /**\n * Construct a new EventContext\n *\n * An eventcontext is used for circumstances such as search results, when we\n * have a particular event of interest, and a bunch of events before and after\n * it.\n *\n * It also stores pagination tokens for going backwards and forwards in the\n * timeline.\n *\n * @param {MatrixEvent} ourEvent the event at the centre of this context\n *\n * @constructor\n */\n constructor(ourEvent: MatrixEvent) {\n this.timeline = [ourEvent];\n }\n\n /**\n * Get the main event of interest\n *\n * This is a convenience function for getTimeline()[getOurEventIndex()].\n *\n * @return {MatrixEvent} The event at the centre of this context.\n */\n public getEvent(): MatrixEvent {\n return this.timeline[this.ourEventIndex];\n }\n\n /**\n * Get the list of events in this context\n *\n * @return {Array} An array of MatrixEvents\n */\n public getTimeline(): MatrixEvent[] {\n return this.timeline;\n }\n\n /**\n * Get the index in the timeline of our event\n *\n * @return {Number}\n */\n public getOurEventIndex(): number {\n return this.ourEventIndex;\n }\n\n /**\n * Get a pagination token.\n *\n * @param {boolean} backwards true to get the pagination token for going\n * backwards in time\n * @return {string}\n */\n public getPaginateToken(backwards = false): string {\n return this.paginateTokens[backwards ? Direction.Backward : Direction.Forward];\n }\n\n /**\n * Set a pagination token.\n *\n * Generally this will be used only by the matrix js sdk.\n *\n * @param {string} token pagination token\n * @param {boolean} backwards true to set the pagination token for going\n * backwards in time\n */\n public setPaginateToken(token: string, backwards = false): void {\n this.paginateTokens[backwards ? Direction.Backward : Direction.Forward] = token;\n }\n\n /**\n * Add more events to the timeline\n *\n * @param {Array} events new events, in timeline order\n * @param {boolean} atStart true to insert new events at the start\n */\n public addEvents(events: MatrixEvent[], atStart = false): void {\n // TODO: should we share logic with Room.addEventsToTimeline?\n // Should Room even use EventContext?\n\n if (atStart) {\n this.timeline = events.concat(this.timeline);\n this.ourEventIndex += events.length;\n } else {\n this.timeline = this.timeline.concat(events);\n }\n }\n}\n", "/*\nCopyright 2016 - 2021 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n/**\n * @module models/event-timeline-set\n */\n\nimport { EventEmitter } from \"events\";\n\nimport { EventTimeline } from \"./event-timeline\";\nimport { EventStatus, MatrixEvent } from \"./event\";\nimport { logger } from '../logger';\nimport { Relations } from './relations';\nimport { Room } from \"./room\";\nimport { Filter } from \"../filter\";\nimport { EventType, RelationType } from \"../@types/event\";\n\n// var DEBUG = false;\nconst DEBUG = true;\n\nlet debuglog;\nif (DEBUG) {\n // using bind means that we get to keep useful line numbers in the console\n debuglog = logger.log.bind(logger);\n} else {\n debuglog = function() {};\n}\n\ninterface IOpts {\n timelineSupport?: boolean;\n filter?: Filter;\n unstableClientRelationAggregation?: boolean;\n}\n\nexport class EventTimelineSet extends EventEmitter {\n private readonly timelineSupport: boolean;\n private unstableClientRelationAggregation: boolean;\n private liveTimeline: EventTimeline;\n private timelines: EventTimeline[];\n private _eventIdToTimeline: Record;\n private filter?: Filter;\n private relations: Record>>;\n\n /**\n * Construct a set of EventTimeline objects, typically on behalf of a given\n * room. A room may have multiple EventTimelineSets for different levels\n * of filtering. The global notification list is also an EventTimelineSet, but\n * lacks a room.\n *\n *

This is an ordered sequence of timelines, which may or may not\n * be continuous. Each timeline lists a series of events, as well as tracking\n * the room state at the start and the end of the timeline (if appropriate).\n * It also tracks forward and backward pagination tokens, as well as containing\n * links to the next timeline in the sequence.\n *\n *

There is one special timeline - the 'live' timeline, which represents the\n * timeline to which events are being added in real-time as they are received\n * from the /sync API. Note that you should not retain references to this\n * timeline - even if it is the current timeline right now, it may not remain\n * so if the server gives us a timeline gap in /sync.\n *\n *

In order that we can find events from their ids later, we also maintain a\n * map from event_id to timeline and index.\n *\n * @constructor\n * @param {?Room} room\n * Room for this timelineSet. May be null for non-room cases, such as the\n * notification timeline.\n * @param {Object} opts Options inherited from Room.\n *\n * @param {boolean} [opts.timelineSupport = false]\n * Set to true to enable improved timeline support.\n * @param {Object} [opts.filter = null]\n * The filter object, if any, for this timelineSet.\n * @param {boolean} [opts.unstableClientRelationAggregation = false]\n * Optional. Set to true to enable client-side aggregation of event relations\n * via `getRelationsForEvent`.\n * This feature is currently unstable and the API may change without notice.\n */\n constructor(public readonly room: Room, opts: IOpts) {\n super();\n\n this.timelineSupport = Boolean(opts.timelineSupport);\n this.liveTimeline = new EventTimeline(this);\n this.unstableClientRelationAggregation = !!opts.unstableClientRelationAggregation;\n\n // just a list - *not* ordered.\n this.timelines = [this.liveTimeline];\n this._eventIdToTimeline = {};\n\n this.filter = opts.filter;\n\n if (this.unstableClientRelationAggregation) {\n // A tree of objects to access a set of relations for an event, as in:\n // this.relations[relatesToEventId][relationType][relationEventType]\n this.relations = {};\n }\n }\n\n /**\n * Get all the timelines in this set\n * @return {module:models/event-timeline~EventTimeline[]} the timelines in this set\n */\n public getTimelines(): EventTimeline[] {\n return this.timelines;\n }\n\n /**\n * Get the filter object this timeline set is filtered on, if any\n * @return {?Filter} the optional filter for this timelineSet\n */\n public getFilter(): Filter | undefined {\n return this.filter;\n }\n\n /**\n * Set the filter object this timeline set is filtered on\n * (passed to the server when paginating via /messages).\n * @param {Filter} filter the filter for this timelineSet\n */\n public setFilter(filter?: Filter): void {\n this.filter = filter;\n }\n\n /**\n * Get the list of pending sent events for this timelineSet's room, filtered\n * by the timelineSet's filter if appropriate.\n *\n * @return {module:models/event.MatrixEvent[]} A list of the sent events\n * waiting for remote echo.\n *\n * @throws If opts.pendingEventOrdering was not 'detached'\n */\n public getPendingEvents(): MatrixEvent[] {\n if (!this.room) {\n return [];\n }\n\n if (this.filter) {\n return this.filter.filterRoomTimeline(this.room.getPendingEvents());\n } else {\n return this.room.getPendingEvents();\n }\n }\n\n /**\n * Get the live timeline for this room.\n *\n * @return {module:models/event-timeline~EventTimeline} live timeline\n */\n public getLiveTimeline(): EventTimeline {\n return this.liveTimeline;\n }\n\n /**\n * Return the timeline (if any) this event is in.\n * @param {String} eventId the eventId being sought\n * @return {module:models/event-timeline~EventTimeline} timeline\n */\n public eventIdToTimeline(eventId: string): EventTimeline {\n return this._eventIdToTimeline[eventId];\n }\n\n /**\n * Track a new event as if it were in the same timeline as an old event,\n * replacing it.\n * @param {String} oldEventId event ID of the original event\n * @param {String} newEventId event ID of the replacement event\n */\n public replaceEventId(oldEventId: string, newEventId: string): void {\n const existingTimeline = this._eventIdToTimeline[oldEventId];\n if (existingTimeline) {\n delete this._eventIdToTimeline[oldEventId];\n this._eventIdToTimeline[newEventId] = existingTimeline;\n }\n }\n\n /**\n * Reset the live timeline, and start a new one.\n *\n *

This is used when /sync returns a 'limited' timeline.\n *\n * @param {string=} backPaginationToken token for back-paginating the new timeline\n * @param {string=} forwardPaginationToken token for forward-paginating the old live timeline,\n * if absent or null, all timelines are reset.\n *\n * @fires module:client~MatrixClient#event:\"Room.timelineReset\"\n */\n public resetLiveTimeline(backPaginationToken: string, forwardPaginationToken?: string): void {\n // Each EventTimeline has RoomState objects tracking the state at the start\n // and end of that timeline. The copies at the end of the live timeline are\n // special because they will have listeners attached to monitor changes to\n // the current room state, so we move this RoomState from the end of the\n // current live timeline to the end of the new one and, if necessary,\n // replace it with a newly created one. We also make a copy for the start\n // of the new timeline.\n\n // if timeline support is disabled, forget about the old timelines\n const resetAllTimelines = !this.timelineSupport || !forwardPaginationToken;\n\n const oldTimeline = this.liveTimeline;\n const newTimeline = resetAllTimelines ?\n oldTimeline.forkLive(EventTimeline.FORWARDS) :\n oldTimeline.fork(EventTimeline.FORWARDS);\n\n if (resetAllTimelines) {\n this.timelines = [newTimeline];\n this._eventIdToTimeline = {};\n } else {\n this.timelines.push(newTimeline);\n }\n\n if (forwardPaginationToken) {\n // Now set the forward pagination token on the old live timeline\n // so it can be forward-paginated.\n oldTimeline.setPaginationToken(\n forwardPaginationToken, EventTimeline.FORWARDS,\n );\n }\n\n // make sure we set the pagination token before firing timelineReset,\n // otherwise clients which start back-paginating will fail, and then get\n // stuck without realising that they *can* back-paginate.\n newTimeline.setPaginationToken(backPaginationToken, EventTimeline.BACKWARDS);\n\n // Now we can swap the live timeline to the new one.\n this.liveTimeline = newTimeline;\n this.emit(\"Room.timelineReset\", this.room, this, resetAllTimelines);\n }\n\n /**\n * Get the timeline which contains the given event, if any\n *\n * @param {string} eventId event ID to look for\n * @return {?module:models/event-timeline~EventTimeline} timeline containing\n * the given event, or null if unknown\n */\n public getTimelineForEvent(eventId: string): EventTimeline | null {\n const res = this._eventIdToTimeline[eventId];\n return (res === undefined) ? null : res;\n }\n\n /**\n * Get an event which is stored in our timelines\n *\n * @param {string} eventId event ID to look for\n * @return {?module:models/event~MatrixEvent} the given event, or undefined if unknown\n */\n public findEventById(eventId: string): MatrixEvent | undefined {\n const tl = this.getTimelineForEvent(eventId);\n if (!tl) {\n return undefined;\n }\n return tl.getEvents().find(function(ev) {\n return ev.getId() == eventId;\n });\n }\n\n /**\n * Add a new timeline to this timeline list\n *\n * @return {module:models/event-timeline~EventTimeline} newly-created timeline\n */\n public addTimeline(): EventTimeline {\n if (!this.timelineSupport) {\n throw new Error(\"timeline support is disabled. Set the 'timelineSupport'\" +\n \" parameter to true when creating MatrixClient to enable\" +\n \" it.\");\n }\n\n const timeline = new EventTimeline(this);\n this.timelines.push(timeline);\n return timeline;\n }\n\n /**\n * Add events to a timeline\n *\n *

Will fire \"Room.timeline\" for each event added.\n *\n * @param {MatrixEvent[]} events A list of events to add.\n *\n * @param {boolean} toStartOfTimeline True to add these events to the start\n * (oldest) instead of the end (newest) of the timeline. If true, the oldest\n * event will be the last element of 'events'.\n *\n * @param {module:models/event-timeline~EventTimeline} timeline timeline to\n * add events to.\n *\n * @param {string=} paginationToken token for the next batch of events\n *\n * @fires module:client~MatrixClient#event:\"Room.timeline\"\n *\n */\n public addEventsToTimeline(\n events: MatrixEvent[],\n toStartOfTimeline: boolean,\n timeline: EventTimeline,\n paginationToken: string,\n ): void {\n if (!timeline) {\n throw new Error(\n \"'timeline' not specified for EventTimelineSet.addEventsToTimeline\",\n );\n }\n\n if (!toStartOfTimeline && timeline == this.liveTimeline) {\n throw new Error(\n \"EventTimelineSet.addEventsToTimeline cannot be used for adding events to \" +\n \"the live timeline - use Room.addLiveEvents instead\",\n );\n }\n\n if (this.filter) {\n events = this.filter.filterRoomTimeline(events);\n if (!events.length) {\n return;\n }\n }\n\n const direction = toStartOfTimeline ? EventTimeline.BACKWARDS :\n EventTimeline.FORWARDS;\n const inverseDirection = toStartOfTimeline ? EventTimeline.FORWARDS :\n EventTimeline.BACKWARDS;\n\n // Adding events to timelines can be quite complicated. The following\n // illustrates some of the corner-cases.\n //\n // Let's say we start by knowing about four timelines. timeline3 and\n // timeline4 are neighbours:\n //\n // timeline1 timeline2 timeline3 timeline4\n // [M] [P] [S] <------> [T]\n //\n // Now we paginate timeline1, and get the following events from the server:\n // [M, N, P, R, S, T, U].\n //\n // 1. First, we ignore event M, since we already know about it.\n //\n // 2. Next, we append N to timeline 1.\n //\n // 3. Next, we don't add event P, since we already know about it,\n // but we do link together the timelines. We now have:\n //\n // timeline1 timeline2 timeline3 timeline4\n // [M, N] <---> [P] [S] <------> [T]\n //\n // 4. Now we add event R to timeline2:\n //\n // timeline1 timeline2 timeline3 timeline4\n // [M, N] <---> [P, R] [S] <------> [T]\n //\n // Note that we have switched the timeline we are working on from\n // timeline1 to timeline2.\n //\n // 5. We ignore event S, but again join the timelines:\n //\n // timeline1 timeline2 timeline3 timeline4\n // [M, N] <---> [P, R] <---> [S] <------> [T]\n //\n // 6. We ignore event T, and the timelines are already joined, so there\n // is nothing to do.\n //\n // 7. Finally, we add event U to timeline4:\n //\n // timeline1 timeline2 timeline3 timeline4\n // [M, N] <---> [P, R] <---> [S] <------> [T, U]\n //\n // The important thing to note in the above is what happened when we\n // already knew about a given event:\n //\n // - if it was appropriate, we joined up the timelines (steps 3, 5).\n // - in any case, we started adding further events to the timeline which\n // contained the event we knew about (steps 3, 5, 6).\n //\n //\n // So much for adding events to the timeline. But what do we want to do\n // with the pagination token?\n //\n // In the case above, we will be given a pagination token which tells us how to\n // get events beyond 'U' - in this case, it makes sense to store this\n // against timeline4. But what if timeline4 already had 'U' and beyond? in\n // that case, our best bet is to throw away the pagination token we were\n // given and stick with whatever token timeline4 had previously. In short,\n // we want to only store the pagination token if the last event we receive\n // is one we didn't previously know about.\n //\n // We make an exception for this if it turns out that we already knew about\n // *all* of the events, and we weren't able to join up any timelines. When\n // that happens, it means our existing pagination token is faulty, since it\n // is only telling us what we already know. Rather than repeatedly\n // paginating with the same token, we might as well use the new pagination\n // token in the hope that we eventually work our way out of the mess.\n\n let didUpdate = false;\n let lastEventWasNew = false;\n for (let i = 0; i < events.length; i++) {\n const event = events[i];\n const eventId = event.getId();\n\n const existingTimeline = this._eventIdToTimeline[eventId];\n\n if (!existingTimeline) {\n // we don't know about this event yet. Just add it to the timeline.\n this.addEventToTimeline(event, timeline, toStartOfTimeline);\n lastEventWasNew = true;\n didUpdate = true;\n continue;\n }\n\n lastEventWasNew = false;\n\n if (existingTimeline == timeline) {\n debuglog(\"Event \" + eventId + \" already in timeline \" + timeline);\n continue;\n }\n\n const neighbour = timeline.getNeighbouringTimeline(direction);\n if (neighbour) {\n // this timeline already has a neighbour in the relevant direction;\n // let's assume the timelines are already correctly linked up, and\n // skip over to it.\n //\n // there's probably some edge-case here where we end up with an\n // event which is in a timeline a way down the chain, and there is\n // a break in the chain somewhere. But I can't really imagine how\n // that would happen, so I'm going to ignore it for now.\n //\n if (existingTimeline == neighbour) {\n debuglog(\"Event \" + eventId + \" in neighbouring timeline - \" +\n \"switching to \" + existingTimeline);\n } else {\n debuglog(\"Event \" + eventId + \" already in a different \" +\n \"timeline \" + existingTimeline);\n }\n timeline = existingTimeline;\n continue;\n }\n\n // time to join the timelines.\n logger.info(\"Already have timeline for \" + eventId +\n \" - joining timeline \" + timeline + \" to \" +\n existingTimeline);\n\n // Variables to keep the line length limited below.\n const existingIsLive = existingTimeline === this.liveTimeline;\n const timelineIsLive = timeline === this.liveTimeline;\n\n const backwardsIsLive = direction === EventTimeline.BACKWARDS && existingIsLive;\n const forwardsIsLive = direction === EventTimeline.FORWARDS && timelineIsLive;\n\n if (backwardsIsLive || forwardsIsLive) {\n // The live timeline should never be spliced into a non-live position.\n // We use independent logging to better discover the problem at a glance.\n if (backwardsIsLive) {\n logger.warn(\n \"Refusing to set a preceding existingTimeLine on our \" +\n \"timeline as the existingTimeLine is live (\" + existingTimeline + \")\",\n );\n }\n if (forwardsIsLive) {\n logger.warn(\n \"Refusing to set our preceding timeline on a existingTimeLine \" +\n \"as our timeline is live (\" + timeline + \")\",\n );\n }\n continue; // abort splicing - try next event\n }\n\n timeline.setNeighbouringTimeline(existingTimeline, direction);\n existingTimeline.setNeighbouringTimeline(timeline, inverseDirection);\n\n timeline = existingTimeline;\n didUpdate = true;\n }\n\n // see above - if the last event was new to us, or if we didn't find any\n // new information, we update the pagination token for whatever\n // timeline we ended up on.\n if (lastEventWasNew || !didUpdate) {\n if (direction === EventTimeline.FORWARDS && timeline === this.liveTimeline) {\n logger.warn({ lastEventWasNew, didUpdate }); // for debugging\n logger.warn(\n `Refusing to set forwards pagination token of live timeline ` +\n `${timeline} to ${paginationToken}`,\n );\n return;\n }\n timeline.setPaginationToken(paginationToken, direction);\n }\n }\n\n /**\n * Add an event to the end of this live timeline.\n *\n * @param {MatrixEvent} event Event to be added\n * @param {string?} duplicateStrategy 'ignore' or 'replace'\n * @param {boolean} fromCache whether the sync response came from cache\n */\n public addLiveEvent(event: MatrixEvent, duplicateStrategy?: \"ignore\" | \"replace\", fromCache = false): void {\n if (this.filter) {\n const events = this.filter.filterRoomTimeline([event]);\n if (!events.length) {\n return;\n }\n }\n\n const timeline = this._eventIdToTimeline[event.getId()];\n if (timeline) {\n if (duplicateStrategy === \"replace\") {\n debuglog(\"EventTimelineSet.addLiveEvent: replacing duplicate event \" +\n event.getId());\n const tlEvents = timeline.getEvents();\n for (let j = 0; j < tlEvents.length; j++) {\n if (tlEvents[j].getId() === event.getId()) {\n // still need to set the right metadata on this event\n EventTimeline.setEventMetadata(\n event,\n timeline.getState(EventTimeline.FORWARDS),\n false,\n );\n tlEvents[j] = event;\n\n // XXX: we need to fire an event when this happens.\n break;\n }\n }\n } else {\n debuglog(\"EventTimelineSet.addLiveEvent: ignoring duplicate event \" +\n event.getId());\n }\n return;\n }\n\n this.addEventToTimeline(event, this.liveTimeline, false, fromCache);\n }\n\n /**\n * Add event to the given timeline, and emit Room.timeline. Assumes\n * we have already checked we don't know about this event.\n *\n * Will fire \"Room.timeline\" for each event added.\n *\n * @param {MatrixEvent} event\n * @param {EventTimeline} timeline\n * @param {boolean} toStartOfTimeline\n * @param {boolean} fromCache whether the sync response came from cache\n *\n * @fires module:client~MatrixClient#event:\"Room.timeline\"\n */\n public addEventToTimeline(\n event: MatrixEvent,\n timeline: EventTimeline,\n toStartOfTimeline: boolean,\n fromCache = false,\n ) {\n const eventId = event.getId();\n timeline.addEvent(event, toStartOfTimeline);\n this._eventIdToTimeline[eventId] = timeline;\n\n this.setRelationsTarget(event);\n this.aggregateRelations(event);\n\n const data = {\n timeline: timeline,\n liveEvent: !toStartOfTimeline && timeline == this.liveTimeline && !fromCache,\n };\n this.emit(\"Room.timeline\", event, this.room,\n Boolean(toStartOfTimeline), false, data);\n }\n\n /**\n * Replaces event with ID oldEventId with one with newEventId, if oldEventId is\n * recognised. Otherwise, add to the live timeline. Used to handle remote echos.\n *\n * @param {MatrixEvent} localEvent the new event to be added to the timeline\n * @param {String} oldEventId the ID of the original event\n * @param {boolean} newEventId the ID of the replacement event\n *\n * @fires module:client~MatrixClient#event:\"Room.timeline\"\n */\n public handleRemoteEcho(\n localEvent: MatrixEvent,\n oldEventId: string,\n newEventId: string,\n ): void {\n // XXX: why don't we infer newEventId from localEvent?\n const existingTimeline = this._eventIdToTimeline[oldEventId];\n if (existingTimeline) {\n delete this._eventIdToTimeline[oldEventId];\n this._eventIdToTimeline[newEventId] = existingTimeline;\n } else {\n if (this.filter) {\n if (this.filter.filterRoomTimeline([localEvent]).length) {\n this.addEventToTimeline(localEvent, this.liveTimeline, false);\n }\n } else {\n this.addEventToTimeline(localEvent, this.liveTimeline, false);\n }\n }\n }\n\n /**\n * Removes a single event from this room.\n *\n * @param {String} eventId The id of the event to remove\n *\n * @return {?MatrixEvent} the removed event, or null if the event was not found\n * in this room.\n */\n public removeEvent(eventId: string): MatrixEvent | null {\n const timeline = this._eventIdToTimeline[eventId];\n if (!timeline) {\n return null;\n }\n\n const removed = timeline.removeEvent(eventId);\n if (removed) {\n delete this._eventIdToTimeline[eventId];\n const data = {\n timeline: timeline,\n };\n this.emit(\"Room.timeline\", removed, this.room, undefined, true, data);\n }\n return removed;\n }\n\n /**\n * Determine where two events appear in the timeline relative to one another\n *\n * @param {string} eventId1 The id of the first event\n * @param {string} eventId2 The id of the second event\n\n * @return {?number} a number less than zero if eventId1 precedes eventId2, and\n * greater than zero if eventId1 succeeds eventId2. zero if they are the\n * same event; null if we can't tell (either because we don't know about one\n * of the events, or because they are in separate timelines which don't join\n * up).\n */\n public compareEventOrdering(eventId1: string, eventId2: string): number | null {\n if (eventId1 == eventId2) {\n // optimise this case\n return 0;\n }\n\n const timeline1 = this._eventIdToTimeline[eventId1];\n const timeline2 = this._eventIdToTimeline[eventId2];\n\n if (timeline1 === undefined) {\n return null;\n }\n if (timeline2 === undefined) {\n return null;\n }\n\n if (timeline1 === timeline2) {\n // both events are in the same timeline - figure out their\n // relative indices\n let idx1;\n let idx2;\n const events = timeline1.getEvents();\n for (let idx = 0; idx < events.length &&\n (idx1 === undefined || idx2 === undefined); idx++) {\n const evId = events[idx].getId();\n if (evId == eventId1) {\n idx1 = idx;\n }\n if (evId == eventId2) {\n idx2 = idx;\n }\n }\n return idx1 - idx2;\n }\n\n // the events are in different timelines. Iterate through the\n // linkedlist to see which comes first.\n\n // first work forwards from timeline1\n let tl = timeline1;\n while (tl) {\n if (tl === timeline2) {\n // timeline1 is before timeline2\n return -1;\n }\n tl = tl.getNeighbouringTimeline(EventTimeline.FORWARDS);\n }\n\n // now try backwards from timeline1\n tl = timeline1;\n while (tl) {\n if (tl === timeline2) {\n // timeline2 is before timeline1\n return 1;\n }\n tl = tl.getNeighbouringTimeline(EventTimeline.BACKWARDS);\n }\n\n // the timelines are not contiguous.\n return null;\n }\n\n /**\n * Get a collection of relations to a given event in this timeline set.\n *\n * @param {String} eventId\n * The ID of the event that you'd like to access relation events for.\n * For example, with annotations, this would be the ID of the event being annotated.\n * @param {String} relationType\n * The type of relation involved, such as \"m.annotation\", \"m.reference\", \"m.replace\", etc.\n * @param {String} eventType\n * The relation event's type, such as \"m.reaction\", etc.\n * @throws If eventId, relationType or eventType\n * are not valid.\n *\n * @returns {?Relations}\n * A container for relation events or undefined if there are no relation events for\n * the relationType.\n */\n public getRelationsForEvent(\n eventId: string,\n relationType: RelationType,\n eventType: EventType | string,\n ): Relations | undefined {\n if (!this.unstableClientRelationAggregation) {\n throw new Error(\"Client-side relation aggregation is disabled\");\n }\n\n if (!eventId || !relationType || !eventType) {\n throw new Error(\"Invalid arguments for `getRelationsForEvent`\");\n }\n\n // debuglog(\"Getting relations for: \", eventId, relationType, eventType);\n\n const relationsForEvent = this.relations[eventId] || {};\n const relationsWithRelType = relationsForEvent[relationType] || {};\n return relationsWithRelType[eventType];\n }\n\n /**\n * Set an event as the target event if any Relations exist for it already\n *\n * @param {MatrixEvent} event\n * The event to check as relation target.\n */\n public setRelationsTarget(event: MatrixEvent): void {\n if (!this.unstableClientRelationAggregation) {\n return;\n }\n\n const relationsForEvent = this.relations[event.getId()];\n if (!relationsForEvent) {\n return;\n }\n\n for (const relationsWithRelType of Object.values(relationsForEvent)) {\n for (const relationsWithEventType of Object.values(relationsWithRelType)) {\n relationsWithEventType.setTargetEvent(event);\n }\n }\n }\n\n /**\n * Add relation events to the relevant relation collection.\n *\n * @param {MatrixEvent} event\n * The new relation event to be aggregated.\n */\n public aggregateRelations(event: MatrixEvent): void {\n if (!this.unstableClientRelationAggregation) {\n return;\n }\n\n if (event.isRedacted() || event.status === EventStatus.CANCELLED) {\n return;\n }\n\n // If the event is currently encrypted, wait until it has been decrypted.\n if (event.isBeingDecrypted() || event.shouldAttemptDecryption()) {\n event.once(\"Event.decrypted\", () => {\n this.aggregateRelations(event);\n });\n return;\n }\n\n const relation = event.getRelation();\n if (!relation) {\n return;\n }\n\n const relatesToEventId = relation.event_id;\n const relationType = relation.rel_type;\n const eventType = event.getType();\n\n // debuglog(\"Aggregating relation: \", event.getId(), eventType, relation);\n\n let relationsForEvent: Record>> = this.relations[relatesToEventId];\n if (!relationsForEvent) {\n relationsForEvent = this.relations[relatesToEventId] = {};\n }\n let relationsWithRelType = relationsForEvent[relationType];\n if (!relationsWithRelType) {\n relationsWithRelType = relationsForEvent[relationType] = {};\n }\n let relationsWithEventType = relationsWithRelType[eventType];\n\n let relatesToEvent;\n if (!relationsWithEventType) {\n relationsWithEventType = relationsWithRelType[eventType] = new Relations(\n relationType,\n eventType,\n this.room,\n );\n relatesToEvent = this.findEventById(relatesToEventId) || this.room.getPendingEvent(relatesToEventId);\n if (relatesToEvent) {\n relationsWithEventType.setTargetEvent(relatesToEvent);\n }\n }\n\n relationsWithEventType.addEvent(event);\n }\n}\n\n/**\n * Fires whenever the timeline in a room is updated.\n * @event module:client~MatrixClient#\"Room.timeline\"\n * @param {MatrixEvent} event The matrix event which caused this event to fire.\n * @param {?Room} room The room, if any, whose timeline was updated.\n * @param {boolean} toStartOfTimeline True if this event was added to the start\n * @param {boolean} removed True if this event has just been removed from the timeline\n * (beginning; oldest) of the timeline e.g. due to pagination.\n *\n * @param {object} data more data about the event\n *\n * @param {module:models/event-timeline.EventTimeline} data.timeline the timeline the\n * event was added to/removed from\n *\n * @param {boolean} data.liveEvent true if the event was a real-time event\n * added to the end of the live timeline\n *\n * @example\n * matrixClient.on(\"Room.timeline\",\n * function(event, room, toStartOfTimeline, removed, data) {\n * if (!toStartOfTimeline && data.liveEvent) {\n * var messageToAppend = room.timeline.[room.timeline.length - 1];\n * }\n * });\n */\n\n/**\n * Fires whenever the live timeline in a room is reset.\n *\n * When we get a 'limited' sync (for example, after a network outage), we reset\n * the live timeline to be empty before adding the recent events to the new\n * timeline. This event is fired after the timeline is reset, and before the\n * new events are added.\n *\n * @event module:client~MatrixClient#\"Room.timelineReset\"\n * @param {Room} room The room whose live timeline was reset, if any\n * @param {EventTimelineSet} timelineSet timelineSet room whose live timeline was reset\n * @param {boolean} resetAllTimelines True if all timelines were reset.\n */\n", "/*\nCopyright 2016 - 2021 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n/**\n * @module models/event-timeline\n */\n\nimport { RoomState } from \"./room-state\";\nimport { EventTimelineSet } from \"./event-timeline-set\";\nimport { MatrixEvent } from \"./event\";\nimport { Filter } from \"../filter\";\nimport { EventType } from \"../@types/event\";\n\nexport enum Direction {\n Backward = \"b\",\n Forward = \"f\",\n}\n\nexport class EventTimeline {\n /**\n * Symbolic constant for methods which take a 'direction' argument:\n * refers to the start of the timeline, or backwards in time.\n */\n static BACKWARDS = Direction.Backward;\n\n /**\n * Symbolic constant for methods which take a 'direction' argument:\n * refers to the end of the timeline, or forwards in time.\n */\n static FORWARDS = Direction.Forward;\n\n /**\n * Static helper method to set sender and target properties\n *\n * @param {MatrixEvent} event the event whose metadata is to be set\n * @param {RoomState} stateContext the room state to be queried\n * @param {boolean} toStartOfTimeline if true the event's forwardLooking flag is set false\n */\n static setEventMetadata(event: MatrixEvent, stateContext: RoomState, toStartOfTimeline: boolean): void {\n // When we try to generate a sentinel member before we have that member\n // in the members object, we still generate a sentinel but it doesn't\n // have a membership event, so test to see if events.member is set. We\n // check this to avoid overriding non-sentinel members by sentinel ones\n // when adding the event to a filtered timeline\n if (!event.sender?.events?.member) {\n event.sender = stateContext.getSentinelMember(event.getSender());\n }\n if (!event.target?.events?.member && event.getType() === EventType.RoomMember) {\n event.target = stateContext.getSentinelMember(event.getStateKey());\n }\n\n if (event.isState()) {\n // room state has no concept of 'old' or 'current', but we want the\n // room state to regress back to previous values if toStartOfTimeline\n // is set, which means inspecting prev_content if it exists. This\n // is done by toggling the forwardLooking flag.\n if (toStartOfTimeline) {\n event.forwardLooking = false;\n }\n }\n }\n\n private readonly roomId: string | null;\n private readonly name: string;\n private events: MatrixEvent[] = [];\n private baseIndex = 0;\n private startState: RoomState;\n private endState: RoomState;\n private prevTimeline?: EventTimeline;\n private nextTimeline?: EventTimeline;\n public paginationRequests: Record> = {\n [Direction.Backward]: null,\n [Direction.Forward]: null,\n };\n\n /**\n * Construct a new EventTimeline\n *\n *

An EventTimeline represents a contiguous sequence of events in a room.\n *\n *

As well as keeping track of the events themselves, it stores the state of\n * the room at the beginning and end of the timeline, and pagination tokens for\n * going backwards and forwards in the timeline.\n *\n *

In order that clients can meaningfully maintain an index into a timeline,\n * the EventTimeline object tracks a 'baseIndex'. This starts at zero, but is\n * incremented when events are prepended to the timeline. The index of an event\n * relative to baseIndex therefore remains constant.\n *\n *

Once a timeline joins up with its neighbour, they are linked together into a\n * doubly-linked list.\n *\n * @param {EventTimelineSet} eventTimelineSet the set of timelines this is part of\n * @constructor\n */\n constructor(private readonly eventTimelineSet: EventTimelineSet) {\n this.roomId = eventTimelineSet.room?.roomId ?? null;\n this.startState = new RoomState(this.roomId);\n this.startState.paginationToken = null;\n this.endState = new RoomState(this.roomId);\n this.endState.paginationToken = null;\n\n this.prevTimeline = null;\n this.nextTimeline = null;\n\n // this is used by client.js\n this.paginationRequests = { 'b': null, 'f': null };\n\n this.name = this.roomId + \":\" + new Date().toISOString();\n }\n\n /**\n * Initialise the start and end state with the given events\n *\n *

This can only be called before any events are added.\n *\n * @param {MatrixEvent[]} stateEvents list of state events to initialise the\n * state with.\n * @throws {Error} if an attempt is made to call this after addEvent is called.\n */\n public initialiseState(stateEvents: MatrixEvent[]): void {\n if (this.events.length > 0) {\n throw new Error(\"Cannot initialise state after events are added\");\n }\n\n // We previously deep copied events here and used different copies in\n // the oldState and state events: this decision seems to date back\n // quite a way and was apparently made to fix a bug where modifications\n // made to the start state leaked through to the end state.\n // This really shouldn't be possible though: the events themselves should\n // not change. Duplicating the events uses a lot of extra memory,\n // so we now no longer do it. To assert that they really do never change,\n // freeze them! Note that we can't do this for events in general:\n // although it looks like the only things preventing us are the\n // 'status' flag, forwardLooking (which is only set once when adding to the\n // timeline) and possibly the sender (which seems like it should never be\n // reset but in practice causes a lot of the tests to break).\n for (const e of stateEvents) {\n Object.freeze(e);\n }\n\n this.startState.setStateEvents(stateEvents);\n this.endState.setStateEvents(stateEvents);\n }\n\n /**\n * Forks the (live) timeline, taking ownership of the existing directional state of this timeline.\n * All attached listeners will keep receiving state updates from the new live timeline state.\n * The end state of this timeline gets replaced with an independent copy of the current RoomState,\n * and will need a new pagination token if it ever needs to paginate forwards.\n\n * @param {string} direction EventTimeline.BACKWARDS to get the state at the\n * start of the timeline; EventTimeline.FORWARDS to get the state at the end\n * of the timeline.\n *\n * @return {EventTimeline} the new timeline\n */\n public forkLive(direction: Direction): EventTimeline {\n const forkState = this.getState(direction);\n const timeline = new EventTimeline(this.eventTimelineSet);\n timeline.startState = forkState.clone();\n // Now clobber the end state of the new live timeline with that from the\n // previous live timeline. It will be identical except that we'll keep\n // using the same RoomMember objects for the 'live' set of members with any\n // listeners still attached\n timeline.endState = forkState;\n // Firstly, we just stole the current timeline's end state, so it needs a new one.\n // Make an immutable copy of the state so back pagination will get the correct sentinels.\n this.endState = forkState.clone();\n return timeline;\n }\n\n /**\n * Creates an independent timeline, inheriting the directional state from this timeline.\n *\n * @param {string} direction EventTimeline.BACKWARDS to get the state at the\n * start of the timeline; EventTimeline.FORWARDS to get the state at the end\n * of the timeline.\n *\n * @return {EventTimeline} the new timeline\n */\n public fork(direction: Direction): EventTimeline {\n const forkState = this.getState(direction);\n const timeline = new EventTimeline(this.eventTimelineSet);\n timeline.startState = forkState.clone();\n timeline.endState = forkState.clone();\n return timeline;\n }\n\n /**\n * Get the ID of the room for this timeline\n * @return {string} room ID\n */\n public getRoomId(): string {\n return this.roomId;\n }\n\n /**\n * Get the filter for this timeline's timelineSet (if any)\n * @return {Filter} filter\n */\n public getFilter(): Filter {\n return this.eventTimelineSet.getFilter();\n }\n\n /**\n * Get the timelineSet for this timeline\n * @return {EventTimelineSet} timelineSet\n */\n public getTimelineSet(): EventTimelineSet {\n return this.eventTimelineSet;\n }\n\n /**\n * Get the base index.\n *\n *

This is an index which is incremented when events are prepended to the\n * timeline. An individual event therefore stays at the same index in the array\n * relative to the base index (although note that a given event's index may\n * well be less than the base index, thus giving that event a negative relative\n * index).\n *\n * @return {number}\n */\n public getBaseIndex(): number {\n return this.baseIndex;\n }\n\n /**\n * Get the list of events in this context\n *\n * @return {MatrixEvent[]} An array of MatrixEvents\n */\n public getEvents(): MatrixEvent[] {\n return this.events;\n }\n\n /**\n * Get the room state at the start/end of the timeline\n *\n * @param {string} direction EventTimeline.BACKWARDS to get the state at the\n * start of the timeline; EventTimeline.FORWARDS to get the state at the end\n * of the timeline.\n *\n * @return {RoomState} state at the start/end of the timeline\n */\n public getState(direction: Direction): RoomState {\n if (direction == EventTimeline.BACKWARDS) {\n return this.startState;\n } else if (direction == EventTimeline.FORWARDS) {\n return this.endState;\n } else {\n throw new Error(\"Invalid direction '\" + direction + \"'\");\n }\n }\n\n /**\n * Get a pagination token\n *\n * @param {string} direction EventTimeline.BACKWARDS to get the pagination\n * token for going backwards in time; EventTimeline.FORWARDS to get the\n * pagination token for going forwards in time.\n *\n * @return {?string} pagination token\n */\n public getPaginationToken(direction: Direction): string | null {\n return this.getState(direction).paginationToken;\n }\n\n /**\n * Set a pagination token\n *\n * @param {?string} token pagination token\n *\n * @param {string} direction EventTimeline.BACKWARDS to set the pagination\n * token for going backwards in time; EventTimeline.FORWARDS to set the\n * pagination token for going forwards in time.\n */\n public setPaginationToken(token: string, direction: Direction): void {\n this.getState(direction).paginationToken = token;\n }\n\n /**\n * Get the next timeline in the series\n *\n * @param {string} direction EventTimeline.BACKWARDS to get the previous\n * timeline; EventTimeline.FORWARDS to get the next timeline.\n *\n * @return {?EventTimeline} previous or following timeline, if they have been\n * joined up.\n */\n public getNeighbouringTimeline(direction: Direction): EventTimeline {\n if (direction == EventTimeline.BACKWARDS) {\n return this.prevTimeline;\n } else if (direction == EventTimeline.FORWARDS) {\n return this.nextTimeline;\n } else {\n throw new Error(\"Invalid direction '\" + direction + \"'\");\n }\n }\n\n /**\n * Set the next timeline in the series\n *\n * @param {EventTimeline} neighbour previous/following timeline\n *\n * @param {string} direction EventTimeline.BACKWARDS to set the previous\n * timeline; EventTimeline.FORWARDS to set the next timeline.\n *\n * @throws {Error} if an attempt is made to set the neighbouring timeline when\n * it is already set.\n */\n public setNeighbouringTimeline(neighbour: EventTimeline, direction: Direction): void {\n if (this.getNeighbouringTimeline(direction)) {\n throw new Error(\"timeline already has a neighbouring timeline - \" +\n \"cannot reset neighbour (direction: \" + direction + \")\");\n }\n\n if (direction == EventTimeline.BACKWARDS) {\n this.prevTimeline = neighbour;\n } else if (direction == EventTimeline.FORWARDS) {\n this.nextTimeline = neighbour;\n } else {\n throw new Error(\"Invalid direction '\" + direction + \"'\");\n }\n\n // make sure we don't try to paginate this timeline\n this.setPaginationToken(null, direction);\n }\n\n /**\n * Add a new event to the timeline, and update the state\n *\n * @param {MatrixEvent} event new event\n * @param {boolean} atStart true to insert new event at the start\n */\n public addEvent(event: MatrixEvent, atStart: boolean): void {\n const stateContext = atStart ? this.startState : this.endState;\n const timelineSet = this.getTimelineSet();\n\n if (timelineSet.room) {\n EventTimeline.setEventMetadata(event, stateContext, atStart);\n\n // modify state but only on unfiltered timelineSets\n if (\n event.isState() &&\n timelineSet.room.getUnfilteredTimelineSet() === timelineSet\n ) {\n stateContext.setStateEvents([event]);\n // it is possible that the act of setting the state event means we\n // can set more metadata (specifically sender/target props), so try\n // it again if the prop wasn't previously set. It may also mean that\n // the sender/target is updated (if the event set was a room member event)\n // so we want to use the *updated* member (new avatar/name) instead.\n //\n // However, we do NOT want to do this on member events if we're going\n // back in time, else we'll set the .sender value for BEFORE the given\n // member event, whereas we want to set the .sender value for the ACTUAL\n // member event itself.\n if (!event.sender || (event.getType() === \"m.room.member\" && !atStart)) {\n EventTimeline.setEventMetadata(event, stateContext, atStart);\n }\n }\n }\n\n let insertIndex;\n\n if (atStart) {\n insertIndex = 0;\n } else {\n insertIndex = this.events.length;\n }\n\n this.events.splice(insertIndex, 0, event); // insert element\n if (atStart) {\n this.baseIndex++;\n }\n }\n\n /**\n * Remove an event from the timeline\n *\n * @param {string} eventId ID of event to be removed\n * @return {?MatrixEvent} removed event, or null if not found\n */\n public removeEvent(eventId: string): MatrixEvent | null {\n for (let i = this.events.length - 1; i >= 0; i--) {\n const ev = this.events[i];\n if (ev.getId() == eventId) {\n this.events.splice(i, 1);\n if (i < this.baseIndex) {\n this.baseIndex--;\n }\n return ev;\n }\n }\n return null;\n }\n\n /**\n * Return a string to identify this timeline, for debugging\n *\n * @return {string} name for this timeline\n */\n public toString(): string {\n return this.name;\n }\n}\n", - "/*\nCopyright 2015 - 2021 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n/**\n * This is an internal module. See {@link MatrixEvent} and {@link RoomEvent} for\n * the public classes.\n * @module models/event\n */\n\nimport { EventEmitter } from 'events';\n\nimport { logger } from '../logger';\nimport { VerificationRequest } from \"../crypto/verification/request/VerificationRequest\";\nimport { EventType, MsgType, RelationType } from \"../@types/event\";\nimport { Crypto } from \"../crypto\";\nimport { deepSortedObjectEntries } from \"../utils\";\nimport { RoomMember } from \"./room-member\";\n\n/**\n * Enum for event statuses.\n * @readonly\n * @enum {string}\n */\nexport enum EventStatus {\n /** The event was not sent and will no longer be retried. */\n NOT_SENT = \"not_sent\",\n\n /** The message is being encrypted */\n ENCRYPTING = \"encrypting\",\n\n /** The event is in the process of being sent. */\n SENDING = \"sending\",\n\n /** The event is in a queue waiting to be sent. */\n QUEUED = \"queued\",\n\n /** The event has been sent to the server, but we have not yet received the echo. */\n SENT = \"sent\",\n\n /** The event was cancelled before it was successfully sent. */\n CANCELLED = \"cancelled\",\n}\n\nconst interns: Record = {};\nfunction intern(str: string): string {\n if (!interns[str]) {\n interns[str] = str;\n }\n return interns[str];\n}\n\n/* eslint-disable camelcase */\nexport interface IContent {\n [key: string]: any;\n msgtype?: MsgType | string;\n membership?: string;\n avatar_url?: string;\n displayname?: string;\n \"m.relates_to\"?: IEventRelation;\n}\n\ntype StrippedState = Required>;\n\nexport interface IUnsigned {\n age?: number;\n prev_sender?: string;\n prev_content?: IContent;\n redacted_because?: IEvent;\n transaction_id?: string;\n invite_room_state?: StrippedState[];\n}\n\nexport interface IEvent {\n event_id: string;\n type: string;\n content: IContent;\n sender: string;\n room_id: string;\n origin_server_ts: number;\n txn_id?: string;\n state_key?: string;\n membership?: string;\n unsigned: IUnsigned;\n redacts?: string;\n\n // v1 legacy fields\n user_id?: string;\n prev_content?: IContent;\n age?: number;\n}\n\ninterface IAggregatedRelation {\n origin_server_ts: number;\n event_id?: string;\n sender?: string;\n type?: string;\n count?: number;\n key?: string;\n}\n\ninterface IEventRelation {\n rel_type: RelationType | string;\n event_id: string;\n key?: string;\n}\n\ninterface IDecryptionResult {\n clearEvent: {\n room_id?: string;\n type: string;\n content: IContent;\n unsigned?: IUnsigned;\n };\n forwardingCurve25519KeyChain?: string[];\n senderCurve25519Key?: string;\n claimedEd25519Key?: string;\n untrusted?: boolean;\n}\n/* eslint-enable camelcase */\n\nexport interface IClearEvent {\n type: string;\n content: Omit;\n unsigned?: IUnsigned;\n}\n\ninterface IKeyRequestRecipient {\n userId: string;\n deviceId: \"*\" | string;\n}\n\nexport interface IDecryptOptions {\n emit?: boolean;\n isRetry?: boolean;\n}\n\nexport class MatrixEvent extends EventEmitter {\n private pushActions: object = null;\n private _replacingEvent: MatrixEvent = null;\n private _localRedactionEvent: MatrixEvent = null;\n private _isCancelled = false;\n private clearEvent?: IClearEvent;\n\n /* curve25519 key which we believe belongs to the sender of the event. See\n * getSenderKey()\n */\n private senderCurve25519Key: string = null;\n\n /* ed25519 key which the sender of this event (for olm) or the creator of\n * the megolm session (for megolm) claims to own. See getClaimedEd25519Key()\n */\n private claimedEd25519Key: string = null;\n\n /* curve25519 keys of devices involved in telling us about the\n * senderCurve25519Key and claimedEd25519Key.\n * See getForwardingCurve25519KeyChain().\n */\n private forwardingCurve25519KeyChain: string[] = [];\n\n /* where the decryption key is untrusted\n */\n private untrusted: boolean = null;\n\n /* if we have a process decrypting this event, a Promise which resolves\n * when it is finished. Normally null.\n */\n private _decryptionPromise: Promise = null;\n\n /* flag to indicate if we should retry decrypting this event after the\n * first attempt (eg, we have received new data which means that a second\n * attempt may succeed)\n */\n private retryDecryption = false;\n\n /* The txnId with which this event was sent if it was during this session,\n * allows for a unique ID which does not change when the event comes back down sync.\n */\n private txnId: string = null;\n\n /* Set an approximate timestamp for the event relative the local clock.\n * This will inherently be approximate because it doesn't take into account\n * the time between the server putting the 'age' field on the event as it sent\n * it to us and the time we're now constructing this event, but that's better\n * than assuming the local clock is in sync with the origin HS's clock.\n */\n private readonly localTimestamp: number;\n\n // XXX: these should be read-only\n public sender: RoomMember = null;\n public target: RoomMember = null;\n public status: EventStatus = null;\n public error = null;\n public forwardLooking = true;\n\n /* If the event is a `m.key.verification.request` (or to_device `m.key.verification.start`) event,\n * `Crypto` will set this the `VerificationRequest` for the event\n * so it can be easily accessed from the timeline.\n */\n public verificationRequest = null;\n\n /**\n * Construct a Matrix Event object\n * @constructor\n *\n * @param {Object} event The raw event to be wrapped in this DAO\n *\n * @prop {Object} event The raw (possibly encrypted) event. Do not access\n * this property directly unless you absolutely have to. Prefer the getter\n * methods defined on this class. Using the getter methods shields your app\n * from changes to event JSON between Matrix versions.\n *\n * @prop {RoomMember} sender The room member who sent this event, or null e.g.\n * this is a presence event. This is only guaranteed to be set for events that\n * appear in a timeline, ie. do not guarantee that it will be set on state\n * events.\n * @prop {RoomMember} target The room member who is the target of this event, e.g.\n * the invitee, the person being banned, etc.\n * @prop {EventStatus} status The sending status of the event.\n * @prop {Error} error most recent error associated with sending the event, if any\n * @prop {boolean} forwardLooking True if this event is 'forward looking', meaning\n * that getDirectionalContent() will return event.content and not event.prev_content.\n * Default: true. This property is experimental and may change.\n */\n constructor(public event: Partial = {}) {\n super();\n\n // intern the values of matrix events to force share strings and reduce the\n // amount of needless string duplication. This can save moderate amounts of\n // memory (~10% on a 350MB heap).\n // 'membership' at the event level (rather than the content level) is a legacy\n // field that Element never otherwise looks at, but it will still take up a lot\n // of space if we don't intern it.\n [\"state_key\", \"type\", \"sender\", \"room_id\", \"membership\"].forEach((prop) => {\n if (typeof event[prop] !== \"string\") return;\n event[prop] = intern(event[prop]);\n });\n\n [\"membership\", \"avatar_url\", \"displayname\"].forEach((prop) => {\n if (typeof event.content?.[prop] !== \"string\") return;\n event.content[prop] = intern(event.content[prop]);\n });\n\n [\"rel_type\"].forEach((prop) => {\n if (typeof event.content?.[\"m.relates_to\"]?.[prop] !== \"string\") return;\n event.content[\"m.relates_to\"][prop] = intern(event.content[\"m.relates_to\"][prop]);\n });\n\n this.txnId = event.txn_id || null;\n this.localTimestamp = Date.now() - this.getAge();\n }\n\n /**\n * Gets the event as though it would appear unencrypted. If the event is already not\n * encrypted, it is simply returned as-is.\n * @returns {IEvent} The event in wire format.\n */\n public getEffectiveEvent(): IEvent {\n // clearEvent doesn't have all the fields, so we'll copy what we can from this.event\n return Object.assign({}, this.event, this.clearEvent) as IEvent;\n }\n\n /**\n * Get the event_id for this event.\n * @return {string} The event ID, e.g. $143350589368169JsLZx:localhost\n * \n */\n public getId(): string {\n return this.event.event_id;\n }\n\n /**\n * Get the user_id for this event.\n * @return {string} The user ID, e.g. @alice:matrix.org\n */\n public getSender(): string {\n return this.event.sender || this.event.user_id; // v2 / v1\n }\n\n /**\n * Get the (decrypted, if necessary) type of event.\n *\n * @return {string} The event type, e.g. m.room.message\n */\n public getType(): EventType | string {\n if (this.clearEvent) {\n return this.clearEvent.type;\n }\n return this.event.type;\n }\n\n /**\n * Get the (possibly encrypted) type of the event that will be sent to the\n * homeserver.\n *\n * @return {string} The event type.\n */\n public getWireType(): EventType | string {\n return this.event.type;\n }\n\n /**\n * Get the room_id for this event. This will return undefined\n * for m.presence events.\n * @return {string} The room ID, e.g. !cURbafjkfsMDVwdRDQ:matrix.org\n * \n */\n public getRoomId(): string {\n return this.event.room_id;\n }\n\n /**\n * Get the timestamp of this event.\n * @return {Number} The event timestamp, e.g. 1433502692297\n */\n public getTs(): number {\n return this.event.origin_server_ts;\n }\n\n /**\n * Get the timestamp of this event, as a Date object.\n * @return {Date} The event date, e.g. new Date(1433502692297)\n */\n public getDate(): Date | null {\n return this.event.origin_server_ts ? new Date(this.event.origin_server_ts) : null;\n }\n\n /**\n * Get the (decrypted, if necessary) event content JSON, even if the event\n * was replaced by another event.\n *\n * @return {Object} The event content JSON, or an empty object.\n */\n public getOriginalContent(): T {\n if (this._localRedactionEvent) {\n return {} as T;\n }\n if (this.clearEvent) {\n return (this.clearEvent.content || {}) as T;\n }\n return (this.event.content || {}) as T;\n }\n\n /**\n * Get the (decrypted, if necessary) event content JSON,\n * or the content from the replacing event, if any.\n * See `makeReplaced`.\n *\n * @return {Object} The event content JSON, or an empty object.\n */\n public getContent(): T {\n if (this._localRedactionEvent) {\n return {} as T;\n } else if (this._replacingEvent) {\n return this._replacingEvent.getContent()[\"m.new_content\"] || {};\n } else {\n return this.getOriginalContent();\n }\n }\n\n /**\n * Get the (possibly encrypted) event content JSON that will be sent to the\n * homeserver.\n *\n * @return {Object} The event content JSON, or an empty object.\n */\n public getWireContent(): IContent {\n return this.event.content || {};\n }\n\n /**\n * Get the previous event content JSON. This will only return something for\n * state events which exist in the timeline.\n * @return {Object} The previous event content JSON, or an empty object.\n */\n public getPrevContent(): IContent {\n // v2 then v1 then default\n return this.getUnsigned().prev_content || this.event.prev_content || {};\n }\n\n /**\n * Get either 'content' or 'prev_content' depending on if this event is\n * 'forward-looking' or not. This can be modified via event.forwardLooking.\n * In practice, this means we get the chronologically earlier content value\n * for this event (this method should surely be called getEarlierContent)\n * This method is experimental and may change.\n * @return {Object} event.content if this event is forward-looking, else\n * event.prev_content.\n */\n public getDirectionalContent(): IContent {\n return this.forwardLooking ? this.getContent() : this.getPrevContent();\n }\n\n /**\n * Get the age of this event. This represents the age of the event when the\n * event arrived at the device, and not the age of the event when this\n * function was called.\n * @return {Number} The age of this event in milliseconds.\n */\n public getAge(): number {\n return this.getUnsigned().age || this.event.age; // v2 / v1\n }\n\n /**\n * Get the age of the event when this function was called.\n * This is the 'age' field adjusted according to how long this client has\n * had the event.\n * @return {Number} The age of this event in milliseconds.\n */\n public getLocalAge(): number {\n return Date.now() - this.localTimestamp;\n }\n\n /**\n * Get the event state_key if it has one. This will return undefined\n * for message events.\n * @return {string} The event's state_key.\n */\n public getStateKey(): string | undefined {\n return this.event.state_key;\n }\n\n /**\n * Check if this event is a state event.\n * @return {boolean} True if this is a state event.\n */\n public isState(): boolean {\n return this.event.state_key !== undefined;\n }\n\n /**\n * Replace the content of this event with encrypted versions.\n * (This is used when sending an event; it should not be used by applications).\n *\n * @internal\n *\n * @param {string} cryptoType type of the encrypted event - typically\n * \"m.room.encrypted\"\n *\n * @param {object} cryptoContent raw 'content' for the encrypted event.\n *\n * @param {string} senderCurve25519Key curve25519 key to record for the\n * sender of this event.\n * See {@link module:models/event.MatrixEvent#getSenderKey}.\n *\n * @param {string} claimedEd25519Key claimed ed25519 key to record for the\n * sender if this event.\n * See {@link module:models/event.MatrixEvent#getClaimedEd25519Key}\n */\n public makeEncrypted(\n cryptoType: string,\n cryptoContent: object,\n senderCurve25519Key: string,\n claimedEd25519Key: string,\n ): void {\n // keep the plain-text data for 'view source'\n this.clearEvent = {\n type: this.event.type,\n content: this.event.content,\n };\n this.event.type = cryptoType;\n this.event.content = cryptoContent;\n this.senderCurve25519Key = senderCurve25519Key;\n this.claimedEd25519Key = claimedEd25519Key;\n }\n\n /**\n * Check if this event is currently being decrypted.\n *\n * @return {boolean} True if this event is currently being decrypted, else false.\n */\n public isBeingDecrypted(): boolean {\n return this._decryptionPromise != null;\n }\n\n public getDecryptionPromise(): Promise {\n return this._decryptionPromise;\n }\n\n /**\n * Check if this event is an encrypted event which we failed to decrypt\n *\n * (This implies that we might retry decryption at some point in the future)\n *\n * @return {boolean} True if this event is an encrypted event which we\n * couldn't decrypt.\n */\n public isDecryptionFailure(): boolean {\n return this.clearEvent?.content?.msgtype === \"m.bad.encrypted\";\n }\n\n public shouldAttemptDecryption() {\n return this.isEncrypted() && !this.isBeingDecrypted() && !this.clearEvent;\n }\n\n /**\n * Start the process of trying to decrypt this event.\n *\n * (This is used within the SDK: it isn't intended for use by applications)\n *\n * @internal\n *\n * @param {module:crypto} crypto crypto module\n * @param {object} options\n * @param {boolean} options.isRetry True if this is a retry (enables more logging)\n * @param {boolean} options.emit Emits \"event.decrypted\" if set to true\n *\n * @returns {Promise} promise which resolves (to undefined) when the decryption\n * attempt is completed.\n */\n public async attemptDecryption(crypto: Crypto, options: IDecryptOptions = {}): Promise {\n // For backwards compatibility purposes\n // The function signature used to be attemptDecryption(crypto, isRetry)\n if (typeof options === \"boolean\") {\n options = {\n isRetry: options,\n };\n }\n\n // start with a couple of sanity checks.\n if (!this.isEncrypted()) {\n throw new Error(\"Attempt to decrypt event which isn't encrypted\");\n }\n\n if (this.clearEvent && !this.isDecryptionFailure()) {\n // we may want to just ignore this? let's start with rejecting it.\n throw new Error(\n \"Attempt to decrypt event which has already been decrypted\",\n );\n }\n\n // if we already have a decryption attempt in progress, then it may\n // fail because it was using outdated info. We now have reason to\n // succeed where it failed before, but we don't want to have multiple\n // attempts going at the same time, so just set a flag that says we have\n // new info.\n //\n if (this._decryptionPromise) {\n logger.log(\n `Event ${this.getId()} already being decrypted; queueing a retry`,\n );\n this.retryDecryption = true;\n return this._decryptionPromise;\n }\n\n this._decryptionPromise = this.decryptionLoop(crypto, options);\n return this._decryptionPromise;\n }\n\n /**\n * Cancel any room key request for this event and resend another.\n *\n * @param {module:crypto} crypto crypto module\n * @param {string} userId the user who received this event\n *\n * @returns {Promise} a promise that resolves when the request is queued\n */\n public cancelAndResendKeyRequest(crypto: Crypto, userId: string): Promise {\n const wireContent = this.getWireContent();\n return crypto.requestRoomKey({\n algorithm: wireContent.algorithm,\n room_id: this.getRoomId(),\n session_id: wireContent.session_id,\n sender_key: wireContent.sender_key,\n }, this.getKeyRequestRecipients(userId), true);\n }\n\n /**\n * Calculate the recipients for keyshare requests.\n *\n * @param {string} userId the user who received this event.\n *\n * @returns {Array} array of recipients\n */\n public getKeyRequestRecipients(userId: string): IKeyRequestRecipient[] {\n // send the request to all of our own devices, and the\n // original sending device if it wasn't us.\n const wireContent = this.getWireContent();\n const recipients = [{\n userId, deviceId: '*',\n }];\n const sender = this.getSender();\n if (sender !== userId) {\n recipients.push({\n userId: sender, deviceId: wireContent.device_id,\n });\n }\n return recipients;\n }\n\n private async decryptionLoop(crypto: Crypto, options: IDecryptOptions = {}): Promise {\n // make sure that this method never runs completely synchronously.\n // (doing so would mean that we would clear _decryptionPromise *before*\n // it is set in attemptDecryption - and hence end up with a stuck\n // `_decryptionPromise`).\n await Promise.resolve();\n\n // eslint-disable-next-line no-constant-condition\n while (true) {\n this.retryDecryption = false;\n\n let res;\n let err;\n try {\n if (!crypto) {\n res = this.badEncryptedMessage(\"Encryption not enabled\");\n } else {\n res = await crypto.decryptEvent(this);\n if (options.isRetry === true) {\n logger.info(`Decrypted event on retry (id=${this.getId()})`);\n }\n }\n } catch (e) {\n if (e.name !== \"DecryptionError\") {\n // not a decryption error: log the whole exception as an error\n // (and don't bother with a retry)\n const re = options.isRetry ? 're' : '';\n logger.error(\n `Error ${re}decrypting event ` +\n `(id=${this.getId()}): ${e.stack || e}`,\n );\n this._decryptionPromise = null;\n this.retryDecryption = false;\n return;\n }\n\n err = e;\n\n // see if we have a retry queued.\n //\n // NB: make sure to keep this check in the same tick of the\n // event loop as `_decryptionPromise = null` below - otherwise we\n // risk a race:\n //\n // * A: we check retryDecryption here and see that it is\n // false\n // * B: we get a second call to attemptDecryption, which sees\n // that _decryptionPromise is set so sets\n // retryDecryption\n // * A: we continue below, clear _decryptionPromise, and\n // never do the retry.\n //\n if (this.retryDecryption) {\n // decryption error, but we have a retry queued.\n logger.log(\n `Got error decrypting event (id=${this.getId()}: ` +\n `${e}), but retrying`,\n );\n continue;\n }\n\n // decryption error, no retries queued. Warn about the error and\n // set it to m.bad.encrypted.\n logger.warn(\n `Error decrypting event (id=${this.getId()}): ${e.detailedString}`,\n );\n\n res = this.badEncryptedMessage(e.message);\n }\n\n // at this point, we've either successfully decrypted the event, or have given up\n // (and set res to a 'badEncryptedMessage'). Either way, we can now set the\n // cleartext of the event and raise Event.decrypted.\n //\n // make sure we clear '_decryptionPromise' before sending the 'Event.decrypted' event,\n // otherwise the app will be confused to see `isBeingDecrypted` still set when\n // there isn't an `Event.decrypted` on the way.\n //\n // see also notes on retryDecryption above.\n //\n this._decryptionPromise = null;\n this.retryDecryption = false;\n this.setClearData(res);\n\n // Before we emit the event, clear the push actions so that they can be recalculated\n // by relevant code. We do this because the clear event has now changed, making it\n // so that existing rules can be re-run over the applicable properties. Stuff like\n // highlighting when the user's name is mentioned rely on this happening. We also want\n // to set the push actions before emitting so that any notification listeners don't\n // pick up the wrong contents.\n this.setPushActions(null);\n\n if (options.emit !== false) {\n this.emit(\"Event.decrypted\", this, err);\n }\n\n return;\n }\n }\n\n private badEncryptedMessage(reason: string): IDecryptionResult {\n return {\n clearEvent: {\n type: \"m.room.message\",\n content: {\n msgtype: \"m.bad.encrypted\",\n body: \"** Unable to decrypt: \" + reason + \" **\",\n },\n },\n };\n }\n\n /**\n * Update the cleartext data on this event.\n *\n * (This is used after decrypting an event; it should not be used by applications).\n *\n * @internal\n *\n * @fires module:models/event.MatrixEvent#\"Event.decrypted\"\n *\n * @param {module:crypto~EventDecryptionResult} decryptionResult\n * the decryption result, including the plaintext and some key info\n */\n private setClearData(decryptionResult: IDecryptionResult): void {\n this.clearEvent = decryptionResult.clearEvent;\n this.senderCurve25519Key =\n decryptionResult.senderCurve25519Key || null;\n this.claimedEd25519Key =\n decryptionResult.claimedEd25519Key || null;\n this.forwardingCurve25519KeyChain =\n decryptionResult.forwardingCurve25519KeyChain || [];\n this.untrusted = decryptionResult.untrusted || false;\n }\n\n /**\n * Gets the cleartext content for this event. If the event is not encrypted,\n * or encryption has not been completed, this will return null.\n *\n * @returns {Object} The cleartext (decrypted) content for the event\n */\n public getClearContent(): IContent | null {\n return this.clearEvent ? this.clearEvent.content : null;\n }\n\n /**\n * Check if the event is encrypted.\n * @return {boolean} True if this event is encrypted.\n */\n public isEncrypted(): boolean {\n return !this.isState() && this.event.type === \"m.room.encrypted\";\n }\n\n /**\n * The curve25519 key for the device that we think sent this event\n *\n * For an Olm-encrypted event, this is inferred directly from the DH\n * exchange at the start of the session: the curve25519 key is involved in\n * the DH exchange, so only a device which holds the private part of that\n * key can establish such a session.\n *\n * For a megolm-encrypted event, it is inferred from the Olm message which\n * established the megolm session\n *\n * @return {string}\n */\n public getSenderKey(): string | null {\n return this.senderCurve25519Key;\n }\n\n /**\n * The additional keys the sender of this encrypted event claims to possess.\n *\n * Just a wrapper for #getClaimedEd25519Key (q.v.)\n *\n * @return {Object}\n */\n public getKeysClaimed(): Record<\"ed25519\", string> {\n return {\n ed25519: this.claimedEd25519Key,\n };\n }\n\n /**\n * Get the ed25519 the sender of this event claims to own.\n *\n * For Olm messages, this claim is encoded directly in the plaintext of the\n * event itself. For megolm messages, it is implied by the m.room_key event\n * which established the megolm session.\n *\n * Until we download the device list of the sender, it's just a claim: the\n * device list gives a proof that the owner of the curve25519 key used for\n * this event (and returned by #getSenderKey) also owns the ed25519 key by\n * signing the public curve25519 key with the ed25519 key.\n *\n * In general, applications should not use this method directly, but should\n * instead use MatrixClient.getEventSenderDeviceInfo.\n *\n * @return {string}\n */\n public getClaimedEd25519Key(): string | null {\n return this.claimedEd25519Key;\n }\n\n /**\n * Get the curve25519 keys of the devices which were involved in telling us\n * about the claimedEd25519Key and sender curve25519 key.\n *\n * Normally this will be empty, but in the case of a forwarded megolm\n * session, the sender keys are sent to us by another device (the forwarding\n * device), which we need to trust to do this. In that case, the result will\n * be a list consisting of one entry.\n *\n * If the device that sent us the key (A) got it from another device which\n * it wasn't prepared to vouch for (B), the result will be [A, B]. And so on.\n *\n * @return {string[]} base64-encoded curve25519 keys, from oldest to newest.\n */\n public getForwardingCurve25519KeyChain(): string[] {\n return this.forwardingCurve25519KeyChain;\n }\n\n /**\n * Whether the decryption key was obtained from an untrusted source. If so,\n * we cannot verify the authenticity of the message.\n *\n * @return {boolean}\n */\n public isKeySourceUntrusted(): boolean {\n return this.untrusted;\n }\n\n public getUnsigned(): IUnsigned {\n return this.event.unsigned || {};\n }\n\n public unmarkLocallyRedacted(): boolean {\n const value = this._localRedactionEvent;\n this._localRedactionEvent = null;\n if (this.event.unsigned) {\n this.event.unsigned.redacted_because = null;\n }\n return !!value;\n }\n\n public markLocallyRedacted(redactionEvent: MatrixEvent): void {\n if (this._localRedactionEvent) return;\n this.emit(\"Event.beforeRedaction\", this, redactionEvent);\n this._localRedactionEvent = redactionEvent;\n if (!this.event.unsigned) {\n this.event.unsigned = {};\n }\n this.event.unsigned.redacted_because = redactionEvent.event as IEvent;\n }\n\n /**\n * Update the content of an event in the same way it would be by the server\n * if it were redacted before it was sent to us\n *\n * @param {module:models/event.MatrixEvent} redactionEvent\n * event causing the redaction\n */\n public makeRedacted(redactionEvent: MatrixEvent): void {\n // quick sanity-check\n if (!redactionEvent.event) {\n throw new Error(\"invalid redactionEvent in makeRedacted\");\n }\n\n this._localRedactionEvent = null;\n\n this.emit(\"Event.beforeRedaction\", this, redactionEvent);\n\n this._replacingEvent = null;\n // we attempt to replicate what we would see from the server if\n // the event had been redacted before we saw it.\n //\n // The server removes (most of) the content of the event, and adds a\n // \"redacted_because\" key to the unsigned section containing the\n // redacted event.\n if (!this.event.unsigned) {\n this.event.unsigned = {};\n }\n this.event.unsigned.redacted_because = redactionEvent.event as IEvent;\n\n let key;\n for (key in this.event) {\n if (!this.event.hasOwnProperty(key)) {\n continue;\n }\n if (!REDACT_KEEP_KEYS.has(key)) {\n delete this.event[key];\n }\n }\n\n const keeps = REDACT_KEEP_CONTENT_MAP[this.getType()] || {};\n const content = this.getContent();\n for (key in content) {\n if (!content.hasOwnProperty(key)) {\n continue;\n }\n if (!keeps[key]) {\n delete content[key];\n }\n }\n }\n\n /**\n * Check if this event has been redacted\n *\n * @return {boolean} True if this event has been redacted\n */\n public isRedacted(): boolean {\n return Boolean(this.getUnsigned().redacted_because);\n }\n\n /**\n * Check if this event is a redaction of another event\n *\n * @return {boolean} True if this event is a redaction\n */\n public isRedaction(): boolean {\n return this.getType() === \"m.room.redaction\";\n }\n\n /**\n * Get the (decrypted, if necessary) redaction event JSON\n * if event was redacted\n *\n * @returns {object} The redaction event JSON, or an empty object\n */\n public getRedactionEvent(): object | null {\n if (!this.isRedacted()) return null;\n\n if (this.clearEvent?.unsigned) {\n return this.clearEvent?.unsigned.redacted_because;\n } else if (this.event.unsigned.redacted_because) {\n return this.event.unsigned.redacted_because;\n } else {\n return {};\n }\n }\n\n /**\n * Get the push actions, if known, for this event\n *\n * @return {?Object} push actions\n */\n public getPushActions(): object | null {\n return this.pushActions;\n }\n\n /**\n * Set the push actions for this event.\n *\n * @param {Object} pushActions push actions\n */\n public setPushActions(pushActions: object): void {\n this.pushActions = pushActions;\n }\n\n /**\n * Replace the `event` property and recalculate any properties based on it.\n * @param {Object} event the object to assign to the `event` property\n */\n public handleRemoteEcho(event: object): void {\n const oldUnsigned = this.getUnsigned();\n const oldId = this.getId();\n this.event = event;\n // if this event was redacted before it was sent, it's locally marked as redacted.\n // At this point, we've received the remote echo for the event, but not yet for\n // the redaction that we are sending ourselves. Preserve the locally redacted\n // state by copying over redacted_because so we don't get a flash of\n // redacted, not-redacted, redacted as remote echos come in\n if (oldUnsigned.redacted_because) {\n if (!this.event.unsigned) {\n this.event.unsigned = {};\n }\n this.event.unsigned.redacted_because = oldUnsigned.redacted_because;\n }\n // successfully sent.\n this.setStatus(null);\n if (this.getId() !== oldId) {\n // emit the event if it changed\n this.emit(\"Event.localEventIdReplaced\", this);\n }\n }\n\n /**\n * Whether the event is in any phase of sending, send failure, waiting for\n * remote echo, etc.\n *\n * @return {boolean}\n */\n public isSending(): boolean {\n return !!this.status;\n }\n\n /**\n * Update the event's sending status and emit an event as well.\n *\n * @param {String} status The new status\n */\n public setStatus(status: EventStatus): void {\n this.status = status;\n this.emit(\"Event.status\", this, status);\n }\n\n public replaceLocalEventId(eventId: string): void {\n this.event.event_id = eventId;\n this.emit(\"Event.localEventIdReplaced\", this);\n }\n\n /**\n * Get whether the event is a relation event, and of a given type if\n * `relType` is passed in.\n *\n * @param {string?} relType if given, checks that the relation is of the\n * given type\n * @return {boolean}\n */\n public isRelation(relType: string = undefined): boolean {\n // Relation info is lifted out of the encrypted content when sent to\n // encrypted rooms, so we have to check `getWireContent` for this.\n const content = this.getWireContent();\n const relation = content && content[\"m.relates_to\"];\n return relation && relation.rel_type && relation.event_id &&\n ((relType && relation.rel_type === relType) || !relType);\n }\n\n /**\n * Get relation info for the event, if any.\n *\n * @return {Object}\n */\n public getRelation(): IEventRelation | null {\n if (!this.isRelation()) {\n return null;\n }\n return this.getWireContent()[\"m.relates_to\"];\n }\n\n /**\n * Set an event that replaces the content of this event, through an m.replace relation.\n *\n * @fires module:models/event.MatrixEvent#\"Event.replaced\"\n *\n * @param {MatrixEvent?} newEvent the event with the replacing content, if any.\n */\n public makeReplaced(newEvent?: MatrixEvent): void {\n // don't allow redacted events to be replaced.\n // if newEvent is null we allow to go through though,\n // as with local redaction, the replacing event might get\n // cancelled, which should be reflected on the target event.\n if (this.isRedacted() && newEvent) {\n return;\n }\n if (this._replacingEvent !== newEvent) {\n this._replacingEvent = newEvent;\n this.emit(\"Event.replaced\", this);\n }\n }\n\n /**\n * Returns the status of any associated edit or redaction\n * (not for reactions/annotations as their local echo doesn't affect the original event),\n * or else the status of the event.\n *\n * @return {EventStatus}\n */\n public getAssociatedStatus(): EventStatus | undefined {\n if (this._replacingEvent) {\n return this._replacingEvent.status;\n } else if (this._localRedactionEvent) {\n return this._localRedactionEvent.status;\n }\n return this.status;\n }\n\n public getServerAggregatedRelation(relType: RelationType): IAggregatedRelation {\n const relations = this.getUnsigned()[\"m.relations\"];\n if (relations) {\n return relations[relType];\n }\n }\n\n /**\n * Returns the event ID of the event replacing the content of this event, if any.\n *\n * @return {string?}\n */\n public replacingEventId(): string | undefined {\n const replaceRelation = this.getServerAggregatedRelation(RelationType.Replace);\n if (replaceRelation) {\n return replaceRelation.event_id;\n } else if (this._replacingEvent) {\n return this._replacingEvent.getId();\n }\n }\n\n /**\n * Returns the event replacing the content of this event, if any.\n * Replacements are aggregated on the server, so this would only\n * return an event in case it came down the sync, or for local echo of edits.\n *\n * @return {MatrixEvent?}\n */\n public replacingEvent(): MatrixEvent | undefined {\n return this._replacingEvent;\n }\n\n /**\n * Returns the origin_server_ts of the event replacing the content of this event, if any.\n *\n * @return {Date?}\n */\n public replacingEventDate(): Date | undefined {\n const replaceRelation = this.getServerAggregatedRelation(RelationType.Replace);\n if (replaceRelation) {\n const ts = replaceRelation.origin_server_ts;\n if (Number.isFinite(ts)) {\n return new Date(ts);\n }\n } else if (this._replacingEvent) {\n return this._replacingEvent.getDate();\n }\n }\n\n /**\n * Returns the event that wants to redact this event, but hasn't been sent yet.\n * @return {MatrixEvent} the event\n */\n public localRedactionEvent(): MatrixEvent | undefined {\n return this._localRedactionEvent;\n }\n\n /**\n * For relations and redactions, returns the event_id this event is referring to.\n *\n * @return {string?}\n */\n public getAssociatedId(): string | undefined {\n const relation = this.getRelation();\n if (relation) {\n return relation.event_id;\n } else if (this.isRedaction()) {\n return this.event.redacts;\n }\n }\n\n /**\n * Checks if this event is associated with another event. See `getAssociatedId`.\n *\n * @return {boolean}\n */\n public hasAssocation(): boolean {\n return !!this.getAssociatedId();\n }\n\n /**\n * Update the related id with a new one.\n *\n * Used to replace a local id with remote one before sending\n * an event with a related id.\n *\n * @param {string} eventId the new event id\n */\n public updateAssociatedId(eventId: string): void {\n const relation = this.getRelation();\n if (relation) {\n relation.event_id = eventId;\n } else if (this.isRedaction()) {\n this.event.redacts = eventId;\n }\n }\n\n /**\n * Flags an event as cancelled due to future conditions. For example, a verification\n * request event in the same sync transaction may be flagged as cancelled to warn\n * listeners that a cancellation event is coming down the same pipe shortly.\n * @param {boolean} cancelled Whether the event is to be cancelled or not.\n */\n public flagCancelled(cancelled = true): void {\n this._isCancelled = cancelled;\n }\n\n /**\n * Gets whether or not the event is flagged as cancelled. See flagCancelled() for\n * more information.\n * @returns {boolean} True if the event is cancelled, false otherwise.\n */\n isCancelled(): boolean {\n return this._isCancelled;\n }\n\n /**\n * Get a copy/snapshot of this event. The returned copy will be loosely linked\n * back to this instance, though will have \"frozen\" event information. Other\n * properties of this MatrixEvent instance will be copied verbatim, which can\n * mean they are in reference to this instance despite being on the copy too.\n * The reference the snapshot uses does not change, however members aside from\n * the underlying event will not be deeply cloned, thus may be mutated internally.\n * For example, the sender profile will be copied over at snapshot time, and\n * the sender profile internally may mutate without notice to the consumer.\n *\n * This is meant to be used to snapshot the event details themselves, not the\n * features (such as sender) surrounding the event.\n * @returns {MatrixEvent} A snapshot of this event.\n */\n toSnapshot(): MatrixEvent {\n const ev = new MatrixEvent(JSON.parse(JSON.stringify(this.event)));\n for (const [p, v] of Object.entries(this)) {\n if (p !== \"event\") { // exclude the thing we just cloned\n ev[p] = v;\n }\n }\n return ev;\n }\n\n /**\n * Determines if this event is equivalent to the given event. This only checks\n * the event object itself, not the other properties of the event. Intended for\n * use with toSnapshot() to identify events changing.\n * @param {MatrixEvent} otherEvent The other event to check against.\n * @returns {boolean} True if the events are the same, false otherwise.\n */\n isEquivalentTo(otherEvent: MatrixEvent): boolean {\n if (!otherEvent) return false;\n if (otherEvent === this) return true;\n const myProps = deepSortedObjectEntries(this.event);\n const theirProps = deepSortedObjectEntries(otherEvent.event);\n return JSON.stringify(myProps) === JSON.stringify(theirProps);\n }\n\n /**\n * Summarise the event as JSON for debugging. If encrypted, include both the\n * decrypted and encrypted view of the event. This is named `toJSON` for use\n * with `JSON.stringify` which checks objects for functions named `toJSON`\n * and will call them to customise the output if they are defined.\n *\n * @return {Object}\n */\n public toJSON(): object {\n const event = this.getEffectiveEvent();\n\n if (!this.isEncrypted()) {\n return event;\n }\n\n return {\n decrypted: event,\n encrypted: this.event,\n };\n }\n\n public setVerificationRequest(request: VerificationRequest): void {\n this.verificationRequest = request;\n }\n\n public setTxnId(txnId: string): void {\n this.txnId = txnId;\n }\n\n public getTxnId(): string | undefined {\n return this.txnId;\n }\n}\n\n/* REDACT_KEEP_KEYS gives the keys we keep when an event is redacted\n *\n * This is specified here:\n * http://matrix.org/speculator/spec/HEAD/client_server/latest.html#redactions\n *\n * Also:\n * - We keep 'unsigned' since that is created by the local server\n * - We keep user_id for backwards-compat with v1\n */\nconst REDACT_KEEP_KEYS = new Set([\n 'event_id', 'type', 'room_id', 'user_id', 'sender', 'state_key', 'prev_state',\n 'content', 'unsigned', 'origin_server_ts',\n]);\n\n// a map from event type to the .content keys we keep when an event is redacted\nconst REDACT_KEEP_CONTENT_MAP = {\n 'm.room.member': { 'membership': 1 },\n 'm.room.create': { 'creator': 1 },\n 'm.room.join_rules': { 'join_rule': 1 },\n 'm.room.power_levels': {\n 'ban': 1, 'events': 1, 'events_default': 1,\n 'kick': 1, 'redact': 1, 'state_default': 1,\n 'users': 1, 'users_default': 1,\n },\n 'm.room.aliases': { 'aliases': 1 },\n};\n\n/**\n * Fires when an event is decrypted\n *\n * @event module:models/event.MatrixEvent#\"Event.decrypted\"\n *\n * @param {module:models/event.MatrixEvent} event\n * The matrix event which has been decrypted\n * @param {module:crypto/algorithms/base.DecryptionError?} err\n * The error that occurred during decryption, or `undefined` if no\n * error occurred.\n */\n", - "/*\nCopyright 2017 New Vector Ltd\nCopyright 2019 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n/**\n * @module models/group\n */\n\nimport * as utils from \"../utils\";\nimport { EventEmitter } from \"events\";\n\n/**\n * Construct a new Group.\n *\n * @param {string} groupId The ID of this group.\n *\n * @prop {string} groupId The ID of this group.\n * @prop {string} name The human-readable display name for this group.\n * @prop {string} avatarUrl The mxc URL for this group's avatar.\n * @prop {string} myMembership The logged in user's membership of this group\n * @prop {Object} inviter Infomation about the user who invited the logged in user\n * to the group, if myMembership is 'invite'.\n * @prop {string} inviter.userId The user ID of the inviter\n */\nexport function Group(groupId) {\n this.groupId = groupId;\n this.name = null;\n this.avatarUrl = null;\n this.myMembership = null;\n this.inviter = null;\n}\nutils.inherits(Group, EventEmitter);\n\nGroup.prototype.setProfile = function(name, avatarUrl) {\n if (this.name === name && this.avatarUrl === avatarUrl) return;\n\n this.name = name || this.groupId;\n this.avatarUrl = avatarUrl;\n\n this.emit(\"Group.profile\", this);\n};\n\nGroup.prototype.setMyMembership = function(membership) {\n if (this.myMembership === membership) return;\n\n this.myMembership = membership;\n\n this.emit(\"Group.myMembership\", this);\n};\n\n/**\n * Sets the 'inviter' property. This does not emit an event (the inviter\n * will only change when the user is revited / reinvited to a room),\n * so set this before setting myMembership.\n * @param {Object} inviter Infomation about who invited us to the room\n */\nGroup.prototype.setInviter = function(inviter) {\n this.inviter = inviter;\n};\n\n/**\n * Fires whenever a group's profile information is updated.\n * This means the 'name' and 'avatarUrl' properties.\n * @event module:client~MatrixClient#\"Group.profile\"\n * @param {Group} group The group whose profile was updated.\n * @example\n * matrixClient.on(\"Group.profile\", function(group){\n * var name = group.name;\n * });\n */\n\n/**\n * Fires whenever the logged in user's membership status of\n * the group is updated.\n * @event module:client~MatrixClient#\"Group.myMembership\"\n * @param {Group} group The group in which the user's membership changed\n * @example\n * matrixClient.on(\"Group.myMembership\", function(group){\n * var myMembership = group.myMembership;\n * });\n */\n", + "/*\nCopyright 2015 - 2021 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n/**\n * This is an internal module. See {@link MatrixEvent} and {@link RoomEvent} for\n * the public classes.\n * @module models/event\n */\n\nimport { EventEmitter } from 'events';\n\nimport { logger } from '../logger';\nimport { VerificationRequest } from \"../crypto/verification/request/VerificationRequest\";\nimport { EventType, MsgType, RelationType } from \"../@types/event\";\nimport { Crypto } from \"../crypto\";\nimport { deepSortedObjectEntries } from \"../utils\";\nimport { RoomMember } from \"./room-member\";\nimport { Thread } from \"./thread\";\nimport { IActionsObject } from '../pushprocessor';\nimport { ReEmitter } from '../ReEmitter';\n\n/**\n * Enum for event statuses.\n * @readonly\n * @enum {string}\n */\nexport enum EventStatus {\n /** The event was not sent and will no longer be retried. */\n NOT_SENT = \"not_sent\",\n\n /** The message is being encrypted */\n ENCRYPTING = \"encrypting\",\n\n /** The event is in the process of being sent. */\n SENDING = \"sending\",\n\n /** The event is in a queue waiting to be sent. */\n QUEUED = \"queued\",\n\n /** The event has been sent to the server, but we have not yet received the echo. */\n SENT = \"sent\",\n\n /** The event was cancelled before it was successfully sent. */\n CANCELLED = \"cancelled\",\n}\n\nconst interns: Record = {};\nfunction intern(str: string): string {\n if (!interns[str]) {\n interns[str] = str;\n }\n return interns[str];\n}\n\n/* eslint-disable camelcase */\nexport interface IContent {\n [key: string]: any;\n msgtype?: MsgType | string;\n membership?: string;\n avatar_url?: string;\n displayname?: string;\n \"m.relates_to\"?: IEventRelation;\n}\n\ntype StrippedState = Required>;\n\nexport interface IUnsigned {\n age?: number;\n prev_sender?: string;\n prev_content?: IContent;\n redacted_because?: IEvent;\n transaction_id?: string;\n invite_room_state?: StrippedState[];\n}\n\nexport interface IEvent {\n event_id: string;\n type: string;\n content: IContent;\n sender: string;\n room_id: string;\n origin_server_ts: number;\n txn_id?: string;\n state_key?: string;\n membership?: string;\n unsigned: IUnsigned;\n redacts?: string;\n\n // v1 legacy fields\n user_id?: string;\n prev_content?: IContent;\n age?: number;\n}\n\ninterface IAggregatedRelation {\n origin_server_ts: number;\n event_id?: string;\n sender?: string;\n type?: string;\n count?: number;\n key?: string;\n}\n\ninterface IEventRelation {\n rel_type: RelationType | string;\n event_id: string;\n key?: string;\n}\n\ninterface IDecryptionResult {\n clearEvent: {\n room_id?: string;\n type: string;\n content: IContent;\n unsigned?: IUnsigned;\n };\n forwardingCurve25519KeyChain?: string[];\n senderCurve25519Key?: string;\n claimedEd25519Key?: string;\n untrusted?: boolean;\n}\n/* eslint-enable camelcase */\n\nexport interface IClearEvent {\n type: string;\n content: Omit;\n unsigned?: IUnsigned;\n}\n\ninterface IKeyRequestRecipient {\n userId: string;\n deviceId: \"*\" | string;\n}\n\nexport interface IDecryptOptions {\n emit?: boolean;\n isRetry?: boolean;\n}\n\nexport class MatrixEvent extends EventEmitter {\n private pushActions: IActionsObject = null;\n private _replacingEvent: MatrixEvent = null;\n private _localRedactionEvent: MatrixEvent = null;\n private _isCancelled = false;\n private clearEvent?: IClearEvent;\n\n /* curve25519 key which we believe belongs to the sender of the event. See\n * getSenderKey()\n */\n private senderCurve25519Key: string = null;\n\n /* ed25519 key which the sender of this event (for olm) or the creator of\n * the megolm session (for megolm) claims to own. See getClaimedEd25519Key()\n */\n private claimedEd25519Key: string = null;\n\n /* curve25519 keys of devices involved in telling us about the\n * senderCurve25519Key and claimedEd25519Key.\n * See getForwardingCurve25519KeyChain().\n */\n private forwardingCurve25519KeyChain: string[] = [];\n\n /* where the decryption key is untrusted\n */\n private untrusted: boolean = null;\n\n /* if we have a process decrypting this event, a Promise which resolves\n * when it is finished. Normally null.\n */\n private _decryptionPromise: Promise = null;\n\n /* flag to indicate if we should retry decrypting this event after the\n * first attempt (eg, we have received new data which means that a second\n * attempt may succeed)\n */\n private retryDecryption = false;\n\n /* The txnId with which this event was sent if it was during this session,\n * allows for a unique ID which does not change when the event comes back down sync.\n */\n private txnId: string = null;\n\n /**\n * @experimental\n * A reference to the thread this event belongs to\n */\n private thread: Thread = null;\n\n /* Set an approximate timestamp for the event relative the local clock.\n * This will inherently be approximate because it doesn't take into account\n * the time between the server putting the 'age' field on the event as it sent\n * it to us and the time we're now constructing this event, but that's better\n * than assuming the local clock is in sync with the origin HS's clock.\n */\n private readonly localTimestamp: number;\n\n // XXX: these should be read-only\n public sender: RoomMember = null;\n public target: RoomMember = null;\n public status: EventStatus = null;\n public error = null;\n public forwardLooking = true;\n\n /* If the event is a `m.key.verification.request` (or to_device `m.key.verification.start`) event,\n * `Crypto` will set this the `VerificationRequest` for the event\n * so it can be easily accessed from the timeline.\n */\n public verificationRequest = null;\n\n private readonly reEmitter: ReEmitter;\n\n /**\n * Construct a Matrix Event object\n * @constructor\n *\n * @param {Object} event The raw event to be wrapped in this DAO\n *\n * @prop {Object} event The raw (possibly encrypted) event. Do not access\n * this property directly unless you absolutely have to. Prefer the getter\n * methods defined on this class. Using the getter methods shields your app\n * from changes to event JSON between Matrix versions.\n *\n * @prop {RoomMember} sender The room member who sent this event, or null e.g.\n * this is a presence event. This is only guaranteed to be set for events that\n * appear in a timeline, ie. do not guarantee that it will be set on state\n * events.\n * @prop {RoomMember} target The room member who is the target of this event, e.g.\n * the invitee, the person being banned, etc.\n * @prop {EventStatus} status The sending status of the event.\n * @prop {Error} error most recent error associated with sending the event, if any\n * @prop {boolean} forwardLooking True if this event is 'forward looking', meaning\n * that getDirectionalContent() will return event.content and not event.prev_content.\n * Default: true. This property is experimental and may change.\n */\n constructor(public event: Partial = {}) {\n super();\n\n // intern the values of matrix events to force share strings and reduce the\n // amount of needless string duplication. This can save moderate amounts of\n // memory (~10% on a 350MB heap).\n // 'membership' at the event level (rather than the content level) is a legacy\n // field that Element never otherwise looks at, but it will still take up a lot\n // of space if we don't intern it.\n [\"state_key\", \"type\", \"sender\", \"room_id\", \"membership\"].forEach((prop) => {\n if (typeof event[prop] !== \"string\") return;\n event[prop] = intern(event[prop]);\n });\n\n [\"membership\", \"avatar_url\", \"displayname\"].forEach((prop) => {\n if (typeof event.content?.[prop] !== \"string\") return;\n event.content[prop] = intern(event.content[prop]);\n });\n\n [\"rel_type\"].forEach((prop) => {\n if (typeof event.content?.[\"m.relates_to\"]?.[prop] !== \"string\") return;\n event.content[\"m.relates_to\"][prop] = intern(event.content[\"m.relates_to\"][prop]);\n });\n\n this.txnId = event.txn_id || null;\n this.localTimestamp = Date.now() - this.getAge();\n this.reEmitter = new ReEmitter(this);\n }\n\n /**\n * Gets the event as though it would appear unencrypted. If the event is already not\n * encrypted, it is simply returned as-is.\n * @returns {IEvent} The event in wire format.\n */\n public getEffectiveEvent(): IEvent {\n // clearEvent doesn't have all the fields, so we'll copy what we can from this.event\n return Object.assign({}, this.event, this.clearEvent) as IEvent;\n }\n\n /**\n * Get the event_id for this event.\n * @return {string} The event ID, e.g. $143350589368169JsLZx:localhost\n * \n */\n public getId(): string {\n return this.event.event_id;\n }\n\n /**\n * Get the user_id for this event.\n * @return {string} The user ID, e.g. @alice:matrix.org\n */\n public getSender(): string {\n return this.event.sender || this.event.user_id; // v2 / v1\n }\n\n /**\n * Get the (decrypted, if necessary) type of event.\n *\n * @return {string} The event type, e.g. m.room.message\n */\n public getType(): EventType | string {\n if (this.clearEvent) {\n return this.clearEvent.type;\n }\n return this.event.type;\n }\n\n /**\n * Get the (possibly encrypted) type of the event that will be sent to the\n * homeserver.\n *\n * @return {string} The event type.\n */\n public getWireType(): EventType | string {\n return this.event.type;\n }\n\n /**\n * Get the room_id for this event. This will return undefined\n * for m.presence events.\n * @return {string} The room ID, e.g. !cURbafjkfsMDVwdRDQ:matrix.org\n * \n */\n public getRoomId(): string {\n return this.event.room_id;\n }\n\n /**\n * Get the timestamp of this event.\n * @return {Number} The event timestamp, e.g. 1433502692297\n */\n public getTs(): number {\n return this.event.origin_server_ts;\n }\n\n /**\n * Get the timestamp of this event, as a Date object.\n * @return {Date} The event date, e.g. new Date(1433502692297)\n */\n public getDate(): Date | null {\n return this.event.origin_server_ts ? new Date(this.event.origin_server_ts) : null;\n }\n\n /**\n * Get the (decrypted, if necessary) event content JSON, even if the event\n * was replaced by another event.\n *\n * @return {Object} The event content JSON, or an empty object.\n */\n public getOriginalContent(): T {\n if (this._localRedactionEvent) {\n return {} as T;\n }\n if (this.clearEvent) {\n return (this.clearEvent.content || {}) as T;\n }\n return (this.event.content || {}) as T;\n }\n\n /**\n * Get the (decrypted, if necessary) event content JSON,\n * or the content from the replacing event, if any.\n * See `makeReplaced`.\n *\n * @return {Object} The event content JSON, or an empty object.\n */\n public getContent(): T {\n if (this._localRedactionEvent) {\n return {} as T;\n } else if (this._replacingEvent) {\n return this._replacingEvent.getContent()[\"m.new_content\"] || {};\n } else {\n return this.getOriginalContent();\n }\n }\n\n /**\n * Get the (possibly encrypted) event content JSON that will be sent to the\n * homeserver.\n *\n * @return {Object} The event content JSON, or an empty object.\n */\n public getWireContent(): IContent {\n return this.event.content || {};\n }\n\n /**\n * @experimental\n * Get the event ID of the replied event\n */\n public get replyEventId(): string {\n const relations = this.getWireContent()[\"m.relates_to\"];\n return relations?.[\"m.in_reply_to\"]?.[\"event_id\"];\n }\n\n /**\n * Get the previous event content JSON. This will only return something for\n * state events which exist in the timeline.\n * @return {Object} The previous event content JSON, or an empty object.\n */\n public getPrevContent(): IContent {\n // v2 then v1 then default\n return this.getUnsigned().prev_content || this.event.prev_content || {};\n }\n\n /**\n * Get either 'content' or 'prev_content' depending on if this event is\n * 'forward-looking' or not. This can be modified via event.forwardLooking.\n * In practice, this means we get the chronologically earlier content value\n * for this event (this method should surely be called getEarlierContent)\n * This method is experimental and may change.\n * @return {Object} event.content if this event is forward-looking, else\n * event.prev_content.\n */\n public getDirectionalContent(): IContent {\n return this.forwardLooking ? this.getContent() : this.getPrevContent();\n }\n\n /**\n * Get the age of this event. This represents the age of the event when the\n * event arrived at the device, and not the age of the event when this\n * function was called.\n * @return {Number} The age of this event in milliseconds.\n */\n public getAge(): number {\n return this.getUnsigned().age || this.event.age; // v2 / v1\n }\n\n /**\n * Get the age of the event when this function was called.\n * This is the 'age' field adjusted according to how long this client has\n * had the event.\n * @return {Number} The age of this event in milliseconds.\n */\n public getLocalAge(): number {\n return Date.now() - this.localTimestamp;\n }\n\n /**\n * Get the event state_key if it has one. This will return undefined\n * for message events.\n * @return {string} The event's state_key.\n */\n public getStateKey(): string | undefined {\n return this.event.state_key;\n }\n\n /**\n * Check if this event is a state event.\n * @return {boolean} True if this is a state event.\n */\n public isState(): boolean {\n return this.event.state_key !== undefined;\n }\n\n /**\n * Replace the content of this event with encrypted versions.\n * (This is used when sending an event; it should not be used by applications).\n *\n * @internal\n *\n * @param {string} cryptoType type of the encrypted event - typically\n * \"m.room.encrypted\"\n *\n * @param {object} cryptoContent raw 'content' for the encrypted event.\n *\n * @param {string} senderCurve25519Key curve25519 key to record for the\n * sender of this event.\n * See {@link module:models/event.MatrixEvent#getSenderKey}.\n *\n * @param {string} claimedEd25519Key claimed ed25519 key to record for the\n * sender if this event.\n * See {@link module:models/event.MatrixEvent#getClaimedEd25519Key}\n */\n public makeEncrypted(\n cryptoType: string,\n cryptoContent: object,\n senderCurve25519Key: string,\n claimedEd25519Key: string,\n ): void {\n // keep the plain-text data for 'view source'\n this.clearEvent = {\n type: this.event.type,\n content: this.event.content,\n };\n this.event.type = cryptoType;\n this.event.content = cryptoContent;\n this.senderCurve25519Key = senderCurve25519Key;\n this.claimedEd25519Key = claimedEd25519Key;\n }\n\n /**\n * Check if this event is currently being decrypted.\n *\n * @return {boolean} True if this event is currently being decrypted, else false.\n */\n public isBeingDecrypted(): boolean {\n return this._decryptionPromise != null;\n }\n\n public getDecryptionPromise(): Promise {\n return this._decryptionPromise;\n }\n\n /**\n * Check if this event is an encrypted event which we failed to decrypt\n *\n * (This implies that we might retry decryption at some point in the future)\n *\n * @return {boolean} True if this event is an encrypted event which we\n * couldn't decrypt.\n */\n public isDecryptionFailure(): boolean {\n return this.clearEvent?.content?.msgtype === \"m.bad.encrypted\";\n }\n\n public shouldAttemptDecryption() {\n return this.isEncrypted() && !this.isBeingDecrypted() && !this.clearEvent;\n }\n\n /**\n * Start the process of trying to decrypt this event.\n *\n * (This is used within the SDK: it isn't intended for use by applications)\n *\n * @internal\n *\n * @param {module:crypto} crypto crypto module\n * @param {object} options\n * @param {boolean} options.isRetry True if this is a retry (enables more logging)\n * @param {boolean} options.emit Emits \"event.decrypted\" if set to true\n *\n * @returns {Promise} promise which resolves (to undefined) when the decryption\n * attempt is completed.\n */\n public async attemptDecryption(crypto: Crypto, options: IDecryptOptions = {}): Promise {\n // For backwards compatibility purposes\n // The function signature used to be attemptDecryption(crypto, isRetry)\n if (typeof options === \"boolean\") {\n options = {\n isRetry: options,\n };\n }\n\n // start with a couple of sanity checks.\n if (!this.isEncrypted()) {\n throw new Error(\"Attempt to decrypt event which isn't encrypted\");\n }\n\n if (this.clearEvent && !this.isDecryptionFailure()) {\n // we may want to just ignore this? let's start with rejecting it.\n throw new Error(\n \"Attempt to decrypt event which has already been decrypted\",\n );\n }\n\n // if we already have a decryption attempt in progress, then it may\n // fail because it was using outdated info. We now have reason to\n // succeed where it failed before, but we don't want to have multiple\n // attempts going at the same time, so just set a flag that says we have\n // new info.\n //\n if (this._decryptionPromise) {\n logger.log(\n `Event ${this.getId()} already being decrypted; queueing a retry`,\n );\n this.retryDecryption = true;\n return this._decryptionPromise;\n }\n\n this._decryptionPromise = this.decryptionLoop(crypto, options);\n return this._decryptionPromise;\n }\n\n /**\n * Cancel any room key request for this event and resend another.\n *\n * @param {module:crypto} crypto crypto module\n * @param {string} userId the user who received this event\n *\n * @returns {Promise} a promise that resolves when the request is queued\n */\n public cancelAndResendKeyRequest(crypto: Crypto, userId: string): Promise {\n const wireContent = this.getWireContent();\n return crypto.requestRoomKey({\n algorithm: wireContent.algorithm,\n room_id: this.getRoomId(),\n session_id: wireContent.session_id,\n sender_key: wireContent.sender_key,\n }, this.getKeyRequestRecipients(userId), true);\n }\n\n /**\n * Calculate the recipients for keyshare requests.\n *\n * @param {string} userId the user who received this event.\n *\n * @returns {Array} array of recipients\n */\n public getKeyRequestRecipients(userId: string): IKeyRequestRecipient[] {\n // send the request to all of our own devices, and the\n // original sending device if it wasn't us.\n const wireContent = this.getWireContent();\n const recipients = [{\n userId, deviceId: '*',\n }];\n const sender = this.getSender();\n if (sender !== userId) {\n recipients.push({\n userId: sender, deviceId: wireContent.device_id,\n });\n }\n return recipients;\n }\n\n private async decryptionLoop(crypto: Crypto, options: IDecryptOptions = {}): Promise {\n // make sure that this method never runs completely synchronously.\n // (doing so would mean that we would clear _decryptionPromise *before*\n // it is set in attemptDecryption - and hence end up with a stuck\n // `_decryptionPromise`).\n await Promise.resolve();\n\n // eslint-disable-next-line no-constant-condition\n while (true) {\n this.retryDecryption = false;\n\n let res;\n let err;\n try {\n if (!crypto) {\n res = this.badEncryptedMessage(\"Encryption not enabled\");\n } else {\n res = await crypto.decryptEvent(this);\n if (options.isRetry === true) {\n logger.info(`Decrypted event on retry (id=${this.getId()})`);\n }\n }\n } catch (e) {\n if (e.name !== \"DecryptionError\") {\n // not a decryption error: log the whole exception as an error\n // (and don't bother with a retry)\n const re = options.isRetry ? 're' : '';\n logger.error(\n `Error ${re}decrypting event ` +\n `(id=${this.getId()}): ${e.stack || e}`,\n );\n this._decryptionPromise = null;\n this.retryDecryption = false;\n return;\n }\n\n err = e;\n\n // see if we have a retry queued.\n //\n // NB: make sure to keep this check in the same tick of the\n // event loop as `_decryptionPromise = null` below - otherwise we\n // risk a race:\n //\n // * A: we check retryDecryption here and see that it is\n // false\n // * B: we get a second call to attemptDecryption, which sees\n // that _decryptionPromise is set so sets\n // retryDecryption\n // * A: we continue below, clear _decryptionPromise, and\n // never do the retry.\n //\n if (this.retryDecryption) {\n // decryption error, but we have a retry queued.\n logger.log(\n `Got error decrypting event (id=${this.getId()}: ` +\n `${e}), but retrying`,\n );\n continue;\n }\n\n // decryption error, no retries queued. Warn about the error and\n // set it to m.bad.encrypted.\n logger.warn(\n `Error decrypting event (id=${this.getId()}): ${e.detailedString}`,\n );\n\n res = this.badEncryptedMessage(e.message);\n }\n\n // at this point, we've either successfully decrypted the event, or have given up\n // (and set res to a 'badEncryptedMessage'). Either way, we can now set the\n // cleartext of the event and raise Event.decrypted.\n //\n // make sure we clear '_decryptionPromise' before sending the 'Event.decrypted' event,\n // otherwise the app will be confused to see `isBeingDecrypted` still set when\n // there isn't an `Event.decrypted` on the way.\n //\n // see also notes on retryDecryption above.\n //\n this._decryptionPromise = null;\n this.retryDecryption = false;\n this.setClearData(res);\n\n // Before we emit the event, clear the push actions so that they can be recalculated\n // by relevant code. We do this because the clear event has now changed, making it\n // so that existing rules can be re-run over the applicable properties. Stuff like\n // highlighting when the user's name is mentioned rely on this happening. We also want\n // to set the push actions before emitting so that any notification listeners don't\n // pick up the wrong contents.\n this.setPushActions(null);\n\n if (options.emit !== false) {\n this.emit(\"Event.decrypted\", this, err);\n }\n\n return;\n }\n }\n\n private badEncryptedMessage(reason: string): IDecryptionResult {\n return {\n clearEvent: {\n type: \"m.room.message\",\n content: {\n msgtype: \"m.bad.encrypted\",\n body: \"** Unable to decrypt: \" + reason + \" **\",\n },\n },\n };\n }\n\n /**\n * Update the cleartext data on this event.\n *\n * (This is used after decrypting an event; it should not be used by applications).\n *\n * @internal\n *\n * @fires module:models/event.MatrixEvent#\"Event.decrypted\"\n *\n * @param {module:crypto~EventDecryptionResult} decryptionResult\n * the decryption result, including the plaintext and some key info\n */\n private setClearData(decryptionResult: IDecryptionResult): void {\n this.clearEvent = decryptionResult.clearEvent;\n this.senderCurve25519Key =\n decryptionResult.senderCurve25519Key || null;\n this.claimedEd25519Key =\n decryptionResult.claimedEd25519Key || null;\n this.forwardingCurve25519KeyChain =\n decryptionResult.forwardingCurve25519KeyChain || [];\n this.untrusted = decryptionResult.untrusted || false;\n }\n\n /**\n * Gets the cleartext content for this event. If the event is not encrypted,\n * or encryption has not been completed, this will return null.\n *\n * @returns {Object} The cleartext (decrypted) content for the event\n */\n public getClearContent(): IContent | null {\n return this.clearEvent ? this.clearEvent.content : null;\n }\n\n /**\n * Check if the event is encrypted.\n * @return {boolean} True if this event is encrypted.\n */\n public isEncrypted(): boolean {\n return !this.isState() && this.event.type === \"m.room.encrypted\";\n }\n\n /**\n * The curve25519 key for the device that we think sent this event\n *\n * For an Olm-encrypted event, this is inferred directly from the DH\n * exchange at the start of the session: the curve25519 key is involved in\n * the DH exchange, so only a device which holds the private part of that\n * key can establish such a session.\n *\n * For a megolm-encrypted event, it is inferred from the Olm message which\n * established the megolm session\n *\n * @return {string}\n */\n public getSenderKey(): string | null {\n return this.senderCurve25519Key;\n }\n\n /**\n * The additional keys the sender of this encrypted event claims to possess.\n *\n * Just a wrapper for #getClaimedEd25519Key (q.v.)\n *\n * @return {Object}\n */\n public getKeysClaimed(): Record<\"ed25519\", string> {\n return {\n ed25519: this.claimedEd25519Key,\n };\n }\n\n /**\n * Get the ed25519 the sender of this event claims to own.\n *\n * For Olm messages, this claim is encoded directly in the plaintext of the\n * event itself. For megolm messages, it is implied by the m.room_key event\n * which established the megolm session.\n *\n * Until we download the device list of the sender, it's just a claim: the\n * device list gives a proof that the owner of the curve25519 key used for\n * this event (and returned by #getSenderKey) also owns the ed25519 key by\n * signing the public curve25519 key with the ed25519 key.\n *\n * In general, applications should not use this method directly, but should\n * instead use MatrixClient.getEventSenderDeviceInfo.\n *\n * @return {string}\n */\n public getClaimedEd25519Key(): string | null {\n return this.claimedEd25519Key;\n }\n\n /**\n * Get the curve25519 keys of the devices which were involved in telling us\n * about the claimedEd25519Key and sender curve25519 key.\n *\n * Normally this will be empty, but in the case of a forwarded megolm\n * session, the sender keys are sent to us by another device (the forwarding\n * device), which we need to trust to do this. In that case, the result will\n * be a list consisting of one entry.\n *\n * If the device that sent us the key (A) got it from another device which\n * it wasn't prepared to vouch for (B), the result will be [A, B]. And so on.\n *\n * @return {string[]} base64-encoded curve25519 keys, from oldest to newest.\n */\n public getForwardingCurve25519KeyChain(): string[] {\n return this.forwardingCurve25519KeyChain;\n }\n\n /**\n * Whether the decryption key was obtained from an untrusted source. If so,\n * we cannot verify the authenticity of the message.\n *\n * @return {boolean}\n */\n public isKeySourceUntrusted(): boolean {\n return this.untrusted;\n }\n\n public getUnsigned(): IUnsigned {\n return this.event.unsigned || {};\n }\n\n public unmarkLocallyRedacted(): boolean {\n const value = this._localRedactionEvent;\n this._localRedactionEvent = null;\n if (this.event.unsigned) {\n this.event.unsigned.redacted_because = null;\n }\n return !!value;\n }\n\n public markLocallyRedacted(redactionEvent: MatrixEvent): void {\n if (this._localRedactionEvent) return;\n this.emit(\"Event.beforeRedaction\", this, redactionEvent);\n this._localRedactionEvent = redactionEvent;\n if (!this.event.unsigned) {\n this.event.unsigned = {};\n }\n this.event.unsigned.redacted_because = redactionEvent.event as IEvent;\n }\n\n /**\n * Update the content of an event in the same way it would be by the server\n * if it were redacted before it was sent to us\n *\n * @param {module:models/event.MatrixEvent} redactionEvent\n * event causing the redaction\n */\n public makeRedacted(redactionEvent: MatrixEvent): void {\n // quick sanity-check\n if (!redactionEvent.event) {\n throw new Error(\"invalid redactionEvent in makeRedacted\");\n }\n\n this._localRedactionEvent = null;\n\n this.emit(\"Event.beforeRedaction\", this, redactionEvent);\n\n this._replacingEvent = null;\n // we attempt to replicate what we would see from the server if\n // the event had been redacted before we saw it.\n //\n // The server removes (most of) the content of the event, and adds a\n // \"redacted_because\" key to the unsigned section containing the\n // redacted event.\n if (!this.event.unsigned) {\n this.event.unsigned = {};\n }\n this.event.unsigned.redacted_because = redactionEvent.event as IEvent;\n\n let key;\n for (key in this.event) {\n if (!this.event.hasOwnProperty(key)) {\n continue;\n }\n if (!REDACT_KEEP_KEYS.has(key)) {\n delete this.event[key];\n }\n }\n\n const keeps = REDACT_KEEP_CONTENT_MAP[this.getType()] || {};\n const content = this.getContent();\n for (key in content) {\n if (!content.hasOwnProperty(key)) {\n continue;\n }\n if (!keeps[key]) {\n delete content[key];\n }\n }\n }\n\n /**\n * Check if this event has been redacted\n *\n * @return {boolean} True if this event has been redacted\n */\n public isRedacted(): boolean {\n return Boolean(this.getUnsigned().redacted_because);\n }\n\n /**\n * Check if this event is a redaction of another event\n *\n * @return {boolean} True if this event is a redaction\n */\n public isRedaction(): boolean {\n return this.getType() === \"m.room.redaction\";\n }\n\n /**\n * Get the (decrypted, if necessary) redaction event JSON\n * if event was redacted\n *\n * @returns {object} The redaction event JSON, or an empty object\n */\n public getRedactionEvent(): object | null {\n if (!this.isRedacted()) return null;\n\n if (this.clearEvent?.unsigned) {\n return this.clearEvent?.unsigned.redacted_because;\n } else if (this.event.unsigned.redacted_because) {\n return this.event.unsigned.redacted_because;\n } else {\n return {};\n }\n }\n\n /**\n * Get the push actions, if known, for this event\n *\n * @return {?Object} push actions\n */\n public getPushActions(): IActionsObject | null {\n return this.pushActions;\n }\n\n /**\n * Set the push actions for this event.\n *\n * @param {Object} pushActions push actions\n */\n public setPushActions(pushActions: IActionsObject): void {\n this.pushActions = pushActions;\n }\n\n /**\n * Replace the `event` property and recalculate any properties based on it.\n * @param {Object} event the object to assign to the `event` property\n */\n public handleRemoteEcho(event: object): void {\n const oldUnsigned = this.getUnsigned();\n const oldId = this.getId();\n this.event = event;\n // if this event was redacted before it was sent, it's locally marked as redacted.\n // At this point, we've received the remote echo for the event, but not yet for\n // the redaction that we are sending ourselves. Preserve the locally redacted\n // state by copying over redacted_because so we don't get a flash of\n // redacted, not-redacted, redacted as remote echos come in\n if (oldUnsigned.redacted_because) {\n if (!this.event.unsigned) {\n this.event.unsigned = {};\n }\n this.event.unsigned.redacted_because = oldUnsigned.redacted_because;\n }\n // successfully sent.\n this.setStatus(null);\n if (this.getId() !== oldId) {\n // emit the event if it changed\n this.emit(\"Event.localEventIdReplaced\", this);\n }\n }\n\n /**\n * Whether the event is in any phase of sending, send failure, waiting for\n * remote echo, etc.\n *\n * @return {boolean}\n */\n public isSending(): boolean {\n return !!this.status;\n }\n\n /**\n * Update the event's sending status and emit an event as well.\n *\n * @param {String} status The new status\n */\n public setStatus(status: EventStatus): void {\n this.status = status;\n this.emit(\"Event.status\", this, status);\n }\n\n public replaceLocalEventId(eventId: string): void {\n this.event.event_id = eventId;\n this.emit(\"Event.localEventIdReplaced\", this);\n }\n\n /**\n * Get whether the event is a relation event, and of a given type if\n * `relType` is passed in.\n *\n * @param {string?} relType if given, checks that the relation is of the\n * given type\n * @return {boolean}\n */\n public isRelation(relType: string = undefined): boolean {\n // Relation info is lifted out of the encrypted content when sent to\n // encrypted rooms, so we have to check `getWireContent` for this.\n const content = this.getWireContent();\n const relation = content && content[\"m.relates_to\"];\n return relation && relation.rel_type && relation.event_id &&\n ((relType && relation.rel_type === relType) || !relType);\n }\n\n /**\n * Get relation info for the event, if any.\n *\n * @return {Object}\n */\n public getRelation(): IEventRelation | null {\n if (!this.isRelation()) {\n return null;\n }\n return this.getWireContent()[\"m.relates_to\"];\n }\n\n /**\n * Set an event that replaces the content of this event, through an m.replace relation.\n *\n * @fires module:models/event.MatrixEvent#\"Event.replaced\"\n *\n * @param {MatrixEvent?} newEvent the event with the replacing content, if any.\n */\n public makeReplaced(newEvent?: MatrixEvent): void {\n // don't allow redacted events to be replaced.\n // if newEvent is null we allow to go through though,\n // as with local redaction, the replacing event might get\n // cancelled, which should be reflected on the target event.\n if (this.isRedacted() && newEvent) {\n return;\n }\n if (this._replacingEvent !== newEvent) {\n this._replacingEvent = newEvent;\n this.emit(\"Event.replaced\", this);\n }\n }\n\n /**\n * Returns the status of any associated edit or redaction\n * (not for reactions/annotations as their local echo doesn't affect the original event),\n * or else the status of the event.\n *\n * @return {EventStatus}\n */\n public getAssociatedStatus(): EventStatus | undefined {\n if (this._replacingEvent) {\n return this._replacingEvent.status;\n } else if (this._localRedactionEvent) {\n return this._localRedactionEvent.status;\n }\n return this.status;\n }\n\n public getServerAggregatedRelation(relType: RelationType): IAggregatedRelation {\n const relations = this.getUnsigned()[\"m.relations\"];\n if (relations) {\n return relations[relType];\n }\n }\n\n /**\n * Returns the event ID of the event replacing the content of this event, if any.\n *\n * @return {string?}\n */\n public replacingEventId(): string | undefined {\n const replaceRelation = this.getServerAggregatedRelation(RelationType.Replace);\n if (replaceRelation) {\n return replaceRelation.event_id;\n } else if (this._replacingEvent) {\n return this._replacingEvent.getId();\n }\n }\n\n /**\n * Returns the event replacing the content of this event, if any.\n * Replacements are aggregated on the server, so this would only\n * return an event in case it came down the sync, or for local echo of edits.\n *\n * @return {MatrixEvent?}\n */\n public replacingEvent(): MatrixEvent | undefined {\n return this._replacingEvent;\n }\n\n /**\n * Returns the origin_server_ts of the event replacing the content of this event, if any.\n *\n * @return {Date?}\n */\n public replacingEventDate(): Date | undefined {\n const replaceRelation = this.getServerAggregatedRelation(RelationType.Replace);\n if (replaceRelation) {\n const ts = replaceRelation.origin_server_ts;\n if (Number.isFinite(ts)) {\n return new Date(ts);\n }\n } else if (this._replacingEvent) {\n return this._replacingEvent.getDate();\n }\n }\n\n /**\n * Returns the event that wants to redact this event, but hasn't been sent yet.\n * @return {MatrixEvent} the event\n */\n public localRedactionEvent(): MatrixEvent | undefined {\n return this._localRedactionEvent;\n }\n\n /**\n * For relations and redactions, returns the event_id this event is referring to.\n *\n * @return {string?}\n */\n public getAssociatedId(): string | undefined {\n const relation = this.getRelation();\n if (relation) {\n return relation.event_id;\n } else if (this.isRedaction()) {\n return this.event.redacts;\n }\n }\n\n /**\n * Checks if this event is associated with another event. See `getAssociatedId`.\n *\n * @return {boolean}\n */\n public hasAssocation(): boolean {\n return !!this.getAssociatedId();\n }\n\n /**\n * Update the related id with a new one.\n *\n * Used to replace a local id with remote one before sending\n * an event with a related id.\n *\n * @param {string} eventId the new event id\n */\n public updateAssociatedId(eventId: string): void {\n const relation = this.getRelation();\n if (relation) {\n relation.event_id = eventId;\n } else if (this.isRedaction()) {\n this.event.redacts = eventId;\n }\n }\n\n /**\n * Flags an event as cancelled due to future conditions. For example, a verification\n * request event in the same sync transaction may be flagged as cancelled to warn\n * listeners that a cancellation event is coming down the same pipe shortly.\n * @param {boolean} cancelled Whether the event is to be cancelled or not.\n */\n public flagCancelled(cancelled = true): void {\n this._isCancelled = cancelled;\n }\n\n /**\n * Gets whether or not the event is flagged as cancelled. See flagCancelled() for\n * more information.\n * @returns {boolean} True if the event is cancelled, false otherwise.\n */\n isCancelled(): boolean {\n return this._isCancelled;\n }\n\n /**\n * Get a copy/snapshot of this event. The returned copy will be loosely linked\n * back to this instance, though will have \"frozen\" event information. Other\n * properties of this MatrixEvent instance will be copied verbatim, which can\n * mean they are in reference to this instance despite being on the copy too.\n * The reference the snapshot uses does not change, however members aside from\n * the underlying event will not be deeply cloned, thus may be mutated internally.\n * For example, the sender profile will be copied over at snapshot time, and\n * the sender profile internally may mutate without notice to the consumer.\n *\n * This is meant to be used to snapshot the event details themselves, not the\n * features (such as sender) surrounding the event.\n * @returns {MatrixEvent} A snapshot of this event.\n */\n toSnapshot(): MatrixEvent {\n const ev = new MatrixEvent(JSON.parse(JSON.stringify(this.event)));\n for (const [p, v] of Object.entries(this)) {\n if (p !== \"event\") { // exclude the thing we just cloned\n ev[p] = v;\n }\n }\n return ev;\n }\n\n /**\n * Determines if this event is equivalent to the given event. This only checks\n * the event object itself, not the other properties of the event. Intended for\n * use with toSnapshot() to identify events changing.\n * @param {MatrixEvent} otherEvent The other event to check against.\n * @returns {boolean} True if the events are the same, false otherwise.\n */\n isEquivalentTo(otherEvent: MatrixEvent): boolean {\n if (!otherEvent) return false;\n if (otherEvent === this) return true;\n const myProps = deepSortedObjectEntries(this.event);\n const theirProps = deepSortedObjectEntries(otherEvent.event);\n return JSON.stringify(myProps) === JSON.stringify(theirProps);\n }\n\n /**\n * Summarise the event as JSON. This is currently used by React SDK's view\n * event source feature and Seshat's event indexing, so take care when\n * adjusting the output here.\n *\n * If encrypted, include both the decrypted and encrypted view of the event.\n *\n * This is named `toJSON` for use with `JSON.stringify` which checks objects\n * for functions named `toJSON` and will call them to customise the output\n * if they are defined.\n *\n * @return {Object}\n */\n public toJSON(): object {\n const event = this.getEffectiveEvent();\n\n if (!this.isEncrypted()) {\n return event;\n }\n\n return {\n decrypted: event,\n encrypted: this.event,\n };\n }\n\n public setVerificationRequest(request: VerificationRequest): void {\n this.verificationRequest = request;\n }\n\n public setTxnId(txnId: string): void {\n this.txnId = txnId;\n }\n\n public getTxnId(): string | undefined {\n return this.txnId;\n }\n\n /**\n * @experimental\n */\n public setThread(thread: Thread): void {\n this.thread = thread;\n this.reEmitter.reEmit(thread, [\"Thread.ready\", \"Thread.update\"]);\n }\n\n /**\n * @experimental\n */\n public getThread(): Thread {\n return this.thread;\n }\n}\n\n/* REDACT_KEEP_KEYS gives the keys we keep when an event is redacted\n *\n * This is specified here:\n * http://matrix.org/speculator/spec/HEAD/client_server/latest.html#redactions\n *\n * Also:\n * - We keep 'unsigned' since that is created by the local server\n * - We keep user_id for backwards-compat with v1\n */\nconst REDACT_KEEP_KEYS = new Set([\n 'event_id', 'type', 'room_id', 'user_id', 'sender', 'state_key', 'prev_state',\n 'content', 'unsigned', 'origin_server_ts',\n]);\n\n// a map from event type to the .content keys we keep when an event is redacted\nconst REDACT_KEEP_CONTENT_MAP = {\n 'm.room.member': { 'membership': 1 },\n 'm.room.create': { 'creator': 1 },\n 'm.room.join_rules': { 'join_rule': 1 },\n 'm.room.power_levels': {\n 'ban': 1, 'events': 1, 'events_default': 1,\n 'kick': 1, 'redact': 1, 'state_default': 1,\n 'users': 1, 'users_default': 1,\n },\n 'm.room.aliases': { 'aliases': 1 },\n};\n\n/**\n * Fires when an event is decrypted\n *\n * @event module:models/event.MatrixEvent#\"Event.decrypted\"\n *\n * @param {module:models/event.MatrixEvent} event\n * The matrix event which has been decrypted\n * @param {module:crypto/algorithms/base.DecryptionError?} err\n * The error that occurred during decryption, or `undefined` if no\n * error occurred.\n */\n", + "/*\nCopyright 2017 New Vector Ltd\nCopyright 2019 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n/**\n * @module models/group\n * @deprecated groups/communities never made it to the spec and support for them is being discontinued.\n */\n\nimport * as utils from \"../utils\";\nimport { EventEmitter } from \"events\";\n\n/**\n * Construct a new Group.\n *\n * @param {string} groupId The ID of this group.\n *\n * @prop {string} groupId The ID of this group.\n * @prop {string} name The human-readable display name for this group.\n * @prop {string} avatarUrl The mxc URL for this group's avatar.\n * @prop {string} myMembership The logged in user's membership of this group\n * @prop {Object} inviter Infomation about the user who invited the logged in user\n * to the group, if myMembership is 'invite'.\n * @prop {string} inviter.userId The user ID of the inviter\n * @deprecated groups/communities never made it to the spec and support for them is being discontinued.\n */\nexport function Group(groupId) {\n this.groupId = groupId;\n this.name = null;\n this.avatarUrl = null;\n this.myMembership = null;\n this.inviter = null;\n}\nutils.inherits(Group, EventEmitter);\n\nGroup.prototype.setProfile = function(name, avatarUrl) {\n if (this.name === name && this.avatarUrl === avatarUrl) return;\n\n this.name = name || this.groupId;\n this.avatarUrl = avatarUrl;\n\n this.emit(\"Group.profile\", this);\n};\n\nGroup.prototype.setMyMembership = function(membership) {\n if (this.myMembership === membership) return;\n\n this.myMembership = membership;\n\n this.emit(\"Group.myMembership\", this);\n};\n\n/**\n * Sets the 'inviter' property. This does not emit an event (the inviter\n * will only change when the user is revited / reinvited to a room),\n * so set this before setting myMembership.\n * @param {Object} inviter Infomation about who invited us to the room\n */\nGroup.prototype.setInviter = function(inviter) {\n this.inviter = inviter;\n};\n\n/**\n * Fires whenever a group's profile information is updated.\n * This means the 'name' and 'avatarUrl' properties.\n * @event module:client~MatrixClient#\"Group.profile\"\n * @param {Group} group The group whose profile was updated.\n * @deprecated groups/communities never made it to the spec and support for them is being discontinued.\n * @example\n * matrixClient.on(\"Group.profile\", function(group){\n * var name = group.name;\n * });\n */\n\n/**\n * Fires whenever the logged in user's membership status of\n * the group is updated.\n * @event module:client~MatrixClient#\"Group.myMembership\"\n * @param {Group} group The group in which the user's membership changed\n * @deprecated groups/communities never made it to the spec and support for them is being discontinued.\n * @example\n * matrixClient.on(\"Group.myMembership\", function(group){\n * var myMembership = group.myMembership;\n * });\n */\n", "/*\nCopyright 2019, 2021 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\nimport { EventEmitter } from 'events';\n\nimport { EventStatus, MatrixEvent } from './event';\nimport { Room } from './room';\nimport { logger } from '../logger';\nimport { RelationType } from \"../@types/event\";\n\n/**\n * A container for relation events that supports easy access to common ways of\n * aggregating such events. Each instance holds events that of a single relation\n * type and event type. All of the events also relate to the same original event.\n *\n * The typical way to get one of these containers is via\n * EventTimelineSet#getRelationsForEvent.\n */\nexport class Relations extends EventEmitter {\n private relationEventIds = new Set();\n private relations = new Set();\n private annotationsByKey: Record> = {};\n private annotationsBySender: Record> = {};\n private sortedAnnotationsByKey: [string, Set][] = [];\n private targetEvent: MatrixEvent = null;\n private creationEmitted = false;\n\n /**\n * @param {RelationType} relationType\n * The type of relation involved, such as \"m.annotation\", \"m.reference\",\n * \"m.replace\", etc.\n * @param {String} eventType\n * The relation event's type, such as \"m.reaction\", etc.\n * @param {?Room} room\n * Room for this container. May be null for non-room cases, such as the\n * notification timeline.\n */\n constructor(\n public readonly relationType: RelationType | string,\n public readonly eventType: string,\n private readonly room: Room,\n ) {\n super();\n }\n\n /**\n * Add relation events to this collection.\n *\n * @param {MatrixEvent} event\n * The new relation event to be added.\n */\n public async addEvent(event: MatrixEvent) {\n if (this.relationEventIds.has(event.getId())) {\n return;\n }\n\n const relation = event.getRelation();\n if (!relation) {\n logger.error(\"Event must have relation info\");\n return;\n }\n\n const relationType = relation.rel_type;\n const eventType = event.getType();\n\n if (this.relationType !== relationType || this.eventType !== eventType) {\n logger.error(\"Event relation info doesn't match this container\");\n return;\n }\n\n // If the event is in the process of being sent, listen for cancellation\n // so we can remove the event from the collection.\n if (event.isSending()) {\n event.on(\"Event.status\", this.onEventStatus);\n }\n\n this.relations.add(event);\n this.relationEventIds.add(event.getId());\n\n if (this.relationType === RelationType.Annotation) {\n this.addAnnotationToAggregation(event);\n } else if (this.relationType === RelationType.Replace && this.targetEvent) {\n const lastReplacement = await this.getLastReplacement();\n this.targetEvent.makeReplaced(lastReplacement);\n }\n\n event.on(\"Event.beforeRedaction\", this.onBeforeRedaction);\n\n this.emit(\"Relations.add\", event);\n\n this.maybeEmitCreated();\n }\n\n /**\n * Remove relation event from this collection.\n *\n * @param {MatrixEvent} event\n * The relation event to remove.\n */\n private async removeEvent(event: MatrixEvent) {\n if (!this.relations.has(event)) {\n return;\n }\n\n const relation = event.getRelation();\n if (!relation) {\n logger.error(\"Event must have relation info\");\n return;\n }\n\n const relationType = relation.rel_type;\n const eventType = event.getType();\n\n if (this.relationType !== relationType || this.eventType !== eventType) {\n logger.error(\"Event relation info doesn't match this container\");\n return;\n }\n\n this.relations.delete(event);\n\n if (this.relationType === RelationType.Annotation) {\n this.removeAnnotationFromAggregation(event);\n } else if (this.relationType === RelationType.Replace && this.targetEvent) {\n const lastReplacement = await this.getLastReplacement();\n this.targetEvent.makeReplaced(lastReplacement);\n }\n\n this.emit(\"Relations.remove\", event);\n }\n\n /**\n * Listens for event status changes to remove cancelled events.\n *\n * @param {MatrixEvent} event The event whose status has changed\n * @param {EventStatus} status The new status\n */\n private onEventStatus = (event: MatrixEvent, status: EventStatus) => {\n if (!event.isSending()) {\n // Sending is done, so we don't need to listen anymore\n event.removeListener(\"Event.status\", this.onEventStatus);\n return;\n }\n if (status !== EventStatus.CANCELLED) {\n return;\n }\n // Event was cancelled, remove from the collection\n event.removeListener(\"Event.status\", this.onEventStatus);\n this.removeEvent(event);\n };\n\n /**\n * Get all relation events in this collection.\n *\n * These are currently in the order of insertion to this collection, which\n * won't match timeline order in the case of scrollback.\n * TODO: Tweak `addEvent` to insert correctly for scrollback.\n *\n * @return {Array}\n * Relation events in insertion order.\n */\n public getRelations() {\n return [...this.relations];\n }\n\n private addAnnotationToAggregation(event: MatrixEvent) {\n const { key } = event.getRelation();\n if (!key) {\n return;\n }\n\n let eventsForKey = this.annotationsByKey[key];\n if (!eventsForKey) {\n eventsForKey = this.annotationsByKey[key] = new Set();\n this.sortedAnnotationsByKey.push([key, eventsForKey]);\n }\n // Add the new event to the set for this key\n eventsForKey.add(event);\n // Re-sort the [key, events] pairs in descending order of event count\n this.sortedAnnotationsByKey.sort((a, b) => {\n const aEvents = a[1];\n const bEvents = b[1];\n return bEvents.size - aEvents.size;\n });\n\n const sender = event.getSender();\n let eventsFromSender = this.annotationsBySender[sender];\n if (!eventsFromSender) {\n eventsFromSender = this.annotationsBySender[sender] = new Set();\n }\n // Add the new event to the set for this sender\n eventsFromSender.add(event);\n }\n\n private removeAnnotationFromAggregation(event: MatrixEvent) {\n const { key } = event.getRelation();\n if (!key) {\n return;\n }\n\n const eventsForKey = this.annotationsByKey[key];\n if (eventsForKey) {\n eventsForKey.delete(event);\n\n // Re-sort the [key, events] pairs in descending order of event count\n this.sortedAnnotationsByKey.sort((a, b) => {\n const aEvents = a[1];\n const bEvents = b[1];\n return bEvents.size - aEvents.size;\n });\n }\n\n const sender = event.getSender();\n const eventsFromSender = this.annotationsBySender[sender];\n if (eventsFromSender) {\n eventsFromSender.delete(event);\n }\n }\n\n /**\n * For relations that have been redacted, we want to remove them from\n * aggregation data sets and emit an update event.\n *\n * To do so, we listen for `Event.beforeRedaction`, which happens:\n * - after the server accepted the redaction and remote echoed back to us\n * - before the original event has been marked redacted in the client\n *\n * @param {MatrixEvent} redactedEvent\n * The original relation event that is about to be redacted.\n */\n private onBeforeRedaction = async (redactedEvent: MatrixEvent) => {\n if (!this.relations.has(redactedEvent)) {\n return;\n }\n\n this.relations.delete(redactedEvent);\n\n if (this.relationType === RelationType.Annotation) {\n // Remove the redacted annotation from aggregation by key\n this.removeAnnotationFromAggregation(redactedEvent);\n } else if (this.relationType === RelationType.Replace && this.targetEvent) {\n const lastReplacement = await this.getLastReplacement();\n this.targetEvent.makeReplaced(lastReplacement);\n }\n\n redactedEvent.removeListener(\"Event.beforeRedaction\", this.onBeforeRedaction);\n\n this.emit(\"Relations.redaction\", redactedEvent);\n };\n\n /**\n * Get all events in this collection grouped by key and sorted by descending\n * event count in each group.\n *\n * This is currently only supported for the annotation relation type.\n *\n * @return {Array}\n * An array of [key, events] pairs sorted by descending event count.\n * The events are stored in a Set (which preserves insertion order).\n */\n public getSortedAnnotationsByKey() {\n if (this.relationType !== RelationType.Annotation) {\n // Other relation types are not grouped currently.\n return null;\n }\n\n return this.sortedAnnotationsByKey;\n }\n\n /**\n * Get all events in this collection grouped by sender.\n *\n * This is currently only supported for the annotation relation type.\n *\n * @return {Object}\n * An object with each relation sender as a key and the matching Set of\n * events for that sender as a value.\n */\n public getAnnotationsBySender() {\n if (this.relationType !== RelationType.Annotation) {\n // Other relation types are not grouped currently.\n return null;\n }\n\n return this.annotationsBySender;\n }\n\n /**\n * Returns the most recent (and allowed) m.replace relation, if any.\n *\n * This is currently only supported for the m.replace relation type,\n * once the target event is known, see `addEvent`.\n *\n * @return {MatrixEvent?}\n */\n public async getLastReplacement(): Promise {\n if (this.relationType !== RelationType.Replace) {\n // Aggregating on last only makes sense for this relation type\n return null;\n }\n if (!this.targetEvent) {\n // Don't know which replacements to accept yet.\n // This method shouldn't be called before the original\n // event is known anyway.\n return null;\n }\n\n // the all-knowning server tells us that the event at some point had\n // this timestamp for its replacement, so any following replacement should definitely not be less\n const replaceRelation = this.targetEvent.getServerAggregatedRelation(RelationType.Replace);\n const minTs = replaceRelation && replaceRelation.origin_server_ts;\n\n const lastReplacement = this.getRelations().reduce((last, event) => {\n if (event.getSender() !== this.targetEvent.getSender()) {\n return last;\n }\n if (minTs && minTs > event.getTs()) {\n return last;\n }\n if (last && last.getTs() > event.getTs()) {\n return last;\n }\n return event;\n }, null);\n\n if (lastReplacement?.shouldAttemptDecryption()) {\n await lastReplacement.attemptDecryption(this.room.client.crypto);\n } else if (lastReplacement?.isBeingDecrypted()) {\n await lastReplacement.getDecryptionPromise();\n }\n\n return lastReplacement;\n }\n\n /*\n * @param {MatrixEvent} targetEvent the event the relations are related to.\n */\n public async setTargetEvent(event: MatrixEvent) {\n if (this.targetEvent) {\n return;\n }\n this.targetEvent = event;\n\n if (this.relationType === RelationType.Replace) {\n const replacement = await this.getLastReplacement();\n // this is the initial update, so only call it if we already have something\n // to not emit Event.replaced needlessly\n if (replacement) {\n this.targetEvent.makeReplaced(replacement);\n }\n }\n\n this.maybeEmitCreated();\n }\n\n private maybeEmitCreated() {\n if (this.creationEmitted) {\n return;\n }\n // Only emit we're \"created\" once we have a target event instance _and_\n // at least one related event.\n if (!this.targetEvent || !this.relations.size) {\n return;\n }\n this.creationEmitted = true;\n this.targetEvent.emit(\"Event.relationsCreated\", this.relationType, this.eventType);\n }\n}\n", "/*\nCopyright 2015 - 2021 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n/**\n * @module models/room-member\n */\n\nimport { EventEmitter } from \"events\";\n\nimport { getHttpUriForMxc } from \"../content-repo\";\nimport * as utils from \"../utils\";\nimport { User } from \"./user\";\nimport { MatrixEvent } from \"./event\";\nimport { RoomState } from \"./room-state\";\n\nexport class RoomMember extends EventEmitter {\n private _isOutOfBand = false;\n private _modified: number;\n public _requestedProfileInfo: boolean; // used by sync.ts\n\n // XXX these should be read-only\n public typing = false;\n public name: string;\n public rawDisplayName: string;\n public powerLevel = 0;\n public powerLevelNorm = 0;\n public user?: User = null;\n public membership: string = null;\n public disambiguate = false;\n public events: {\n member?: MatrixEvent;\n } = {\n member: null,\n };\n\n /**\n * Construct a new room member.\n *\n * @constructor\n * @alias module:models/room-member\n *\n * @param {string} roomId The room ID of the member.\n * @param {string} userId The user ID of the member.\n * @prop {string} roomId The room ID for this member.\n * @prop {string} userId The user ID of this member.\n * @prop {boolean} typing True if the room member is currently typing.\n * @prop {string} name The human-readable name for this room member. This will be\n * disambiguated with a suffix of \" (@user_id:matrix.org)\" if another member shares the\n * same displayname.\n * @prop {string} rawDisplayName The ambiguous displayname of this room member.\n * @prop {Number} powerLevel The power level for this room member.\n * @prop {Number} powerLevelNorm The normalised power level (0-100) for this\n * room member.\n * @prop {User} user The User object for this room member, if one exists.\n * @prop {string} membership The membership state for this room member e.g. 'join'.\n * @prop {Object} events The events describing this RoomMember.\n * @prop {MatrixEvent} events.member The m.room.member event for this RoomMember.\n * @prop {boolean} disambiguate True if the member's name is disambiguated.\n */\n constructor(public readonly roomId: string, public readonly userId: string) {\n super();\n\n this.name = userId;\n this.rawDisplayName = userId;\n this.updateModifiedTime();\n }\n\n /**\n * Mark the member as coming from a channel that is not sync\n */\n public markOutOfBand(): void {\n this._isOutOfBand = true;\n }\n\n /**\n * @return {boolean} does the member come from a channel that is not sync?\n * This is used to store the member seperately\n * from the sync state so it available across browser sessions.\n */\n public isOutOfBand(): boolean {\n return this._isOutOfBand;\n }\n\n /**\n * Update this room member's membership event. May fire \"RoomMember.name\" if\n * this event updates this member's name.\n * @param {MatrixEvent} event The m.room.member event\n * @param {RoomState} roomState Optional. The room state to take into account\n * when calculating (e.g. for disambiguating users with the same name).\n * @fires module:client~MatrixClient#event:\"RoomMember.name\"\n * @fires module:client~MatrixClient#event:\"RoomMember.membership\"\n */\n public setMembershipEvent(event: MatrixEvent, roomState: RoomState): void {\n const displayName = event.getDirectionalContent().displayname;\n\n if (event.getType() !== \"m.room.member\") {\n return;\n }\n\n this._isOutOfBand = false;\n\n this.events.member = event;\n\n const oldMembership = this.membership;\n this.membership = event.getDirectionalContent().membership;\n\n this.disambiguate = shouldDisambiguate(\n this.userId,\n displayName,\n roomState,\n );\n\n const oldName = this.name;\n this.name = calculateDisplayName(\n this.userId,\n displayName,\n roomState,\n this.disambiguate,\n );\n\n this.rawDisplayName = event.getDirectionalContent().displayname;\n if (!this.rawDisplayName || !utils.removeHiddenChars(this.rawDisplayName)) {\n this.rawDisplayName = this.userId;\n }\n\n if (oldMembership !== this.membership) {\n this.updateModifiedTime();\n this.emit(\"RoomMember.membership\", event, this, oldMembership);\n }\n if (oldName !== this.name) {\n this.updateModifiedTime();\n this.emit(\"RoomMember.name\", event, this, oldName);\n }\n }\n\n /**\n * Update this room member's power level event. May fire\n * \"RoomMember.powerLevel\" if this event updates this member's power levels.\n * @param {MatrixEvent} powerLevelEvent The m.room.power_levels\n * event\n * @fires module:client~MatrixClient#event:\"RoomMember.powerLevel\"\n */\n public setPowerLevelEvent(powerLevelEvent: MatrixEvent): void {\n if (powerLevelEvent.getType() !== \"m.room.power_levels\") {\n return;\n }\n\n const evContent = powerLevelEvent.getDirectionalContent();\n\n let maxLevel = evContent.users_default || 0;\n const users = evContent.users || {};\n Object.values(users).forEach(function(lvl: number) {\n maxLevel = Math.max(maxLevel, lvl);\n });\n const oldPowerLevel = this.powerLevel;\n const oldPowerLevelNorm = this.powerLevelNorm;\n\n if (users[this.userId] !== undefined && Number.isInteger(users[this.userId])) {\n this.powerLevel = users[this.userId];\n } else if (evContent.users_default !== undefined) {\n this.powerLevel = evContent.users_default;\n } else {\n this.powerLevel = 0;\n }\n this.powerLevelNorm = 0;\n if (maxLevel > 0) {\n this.powerLevelNorm = (this.powerLevel * 100) / maxLevel;\n }\n\n // emit for changes in powerLevelNorm as well (since the app will need to\n // redraw everyone's level if the max has changed)\n if (oldPowerLevel !== this.powerLevel || oldPowerLevelNorm !== this.powerLevelNorm) {\n this.updateModifiedTime();\n this.emit(\"RoomMember.powerLevel\", powerLevelEvent, this);\n }\n }\n\n /**\n * Update this room member's typing event. May fire \"RoomMember.typing\" if\n * this event changes this member's typing state.\n * @param {MatrixEvent} event The typing event\n * @fires module:client~MatrixClient#event:\"RoomMember.typing\"\n */\n public setTypingEvent(event: MatrixEvent): void {\n if (event.getType() !== \"m.typing\") {\n return;\n }\n const oldTyping = this.typing;\n this.typing = false;\n const typingList = event.getContent().user_ids;\n if (!Array.isArray(typingList)) {\n // malformed event :/ bail early. TODO: whine?\n return;\n }\n if (typingList.indexOf(this.userId) !== -1) {\n this.typing = true;\n }\n if (oldTyping !== this.typing) {\n this.updateModifiedTime();\n this.emit(\"RoomMember.typing\", event, this);\n }\n }\n\n /**\n * Update the last modified time to the current time.\n */\n private updateModifiedTime() {\n this._modified = Date.now();\n }\n\n /**\n * Get the timestamp when this RoomMember was last updated. This timestamp is\n * updated when properties on this RoomMember are updated.\n * It is updated before firing events.\n * @return {number} The timestamp\n */\n public getLastModifiedTime(): number {\n return this._modified;\n }\n\n public isKicked(): boolean {\n return this.membership === \"leave\" &&\n this.events.member.getSender() !== this.events.member.getStateKey();\n }\n\n /**\n * If this member was invited with the is_direct flag set, return\n * the user that invited this member\n * @return {string} user id of the inviter\n */\n public getDMInviter(): string {\n // when not available because that room state hasn't been loaded in,\n // we don't really know, but more likely to not be a direct chat\n if (this.events.member) {\n // TODO: persist the is_direct flag on the member as more member events\n // come in caused by displayName changes.\n\n // the is_direct flag is set on the invite member event.\n // This is copied on the prev_content section of the join member event\n // when the invite is accepted.\n\n const memberEvent = this.events.member;\n let memberContent = memberEvent.getContent();\n let inviteSender = memberEvent.getSender();\n\n if (memberContent.membership === \"join\") {\n memberContent = memberEvent.getPrevContent();\n inviteSender = memberEvent.getUnsigned().prev_sender;\n }\n\n if (memberContent.membership === \"invite\" && memberContent.is_direct) {\n return inviteSender;\n }\n }\n }\n\n /**\n * Get the avatar URL for a room member.\n * @param {string} baseUrl The base homeserver URL See\n * {@link module:client~MatrixClient#getHomeserverUrl}.\n * @param {Number} width The desired width of the thumbnail.\n * @param {Number} height The desired height of the thumbnail.\n * @param {string} resizeMethod The thumbnail resize method to use, either\n * \"crop\" or \"scale\".\n * @param {Boolean} allowDefault (optional) Passing false causes this method to\n * return null if the user has no avatar image. Otherwise, a default image URL\n * will be returned. Default: true. (Deprecated)\n * @param {Boolean} allowDirectLinks (optional) If true, the avatar URL will be\n * returned even if it is a direct hyperlink rather than a matrix content URL.\n * If false, any non-matrix content URLs will be ignored. Setting this option to\n * true will expose URLs that, if fetched, will leak information about the user\n * to anyone who they share a room with.\n * @return {?string} the avatar URL or null.\n */\n public getAvatarUrl(\n baseUrl: string,\n width: number,\n height: number,\n resizeMethod: string,\n allowDefault = true,\n allowDirectLinks: boolean,\n ): string | null {\n const rawUrl = this.getMxcAvatarUrl();\n\n if (!rawUrl && !allowDefault) {\n return null;\n }\n const httpUrl = getHttpUriForMxc(baseUrl, rawUrl, width, height, resizeMethod, allowDirectLinks);\n if (httpUrl) {\n return httpUrl;\n }\n return null;\n }\n\n /**\n * get the mxc avatar url, either from a state event, or from a lazily loaded member\n * @return {string} the mxc avatar url\n */\n public getMxcAvatarUrl(): string | null {\n if (this.events.member) {\n return this.events.member.getDirectionalContent().avatar_url;\n } else if (this.user) {\n return this.user.avatarUrl;\n }\n return null;\n }\n}\n\nconst MXID_PATTERN = /@.+:.+/;\nconst LTR_RTL_PATTERN = /[\\u200E\\u200F\\u202A-\\u202F]/;\n\nfunction shouldDisambiguate(selfUserId: string, displayName: string, roomState: RoomState): boolean {\n if (!displayName || displayName === selfUserId) return false;\n\n // First check if the displayname is something we consider truthy\n // after stripping it of zero width characters and padding spaces\n if (!utils.removeHiddenChars(displayName)) return false;\n\n if (!roomState) return false;\n\n // Next check if the name contains something that look like a mxid\n // If it does, it may be someone trying to impersonate someone else\n // Show full mxid in this case\n if (MXID_PATTERN.test(displayName)) return true;\n\n // Also show mxid if the display name contains any LTR/RTL characters as these\n // make it very difficult for us to find similar *looking* display names\n // E.g \"Mark\" could be cloned by writing \"kraM\" but in RTL.\n if (LTR_RTL_PATTERN.test(displayName)) return true;\n\n // Also show mxid if there are other people with the same or similar\n // displayname, after hidden character removal.\n const userIds = roomState.getUserIdsWithDisplayName(displayName);\n if (userIds.some((u) => u !== selfUserId)) return true;\n\n return false;\n}\n\nfunction calculateDisplayName(\n selfUserId: string,\n displayName: string,\n roomState: RoomState,\n disambiguate: boolean,\n): string {\n if (disambiguate) return displayName + \" (\" + selfUserId + \")\";\n\n if (!displayName || displayName === selfUserId) return selfUserId;\n\n // First check if the displayname is something we consider truthy\n // after stripping it of zero width characters and padding spaces\n if (!utils.removeHiddenChars(displayName)) return selfUserId;\n\n return displayName;\n}\n\n/**\n * Fires whenever any room member's name changes.\n * @event module:client~MatrixClient#\"RoomMember.name\"\n * @param {MatrixEvent} event The matrix event which caused this event to fire.\n * @param {RoomMember} member The member whose RoomMember.name changed.\n * @param {string?} oldName The previous name. Null if the member didn't have a\n * name previously.\n * @example\n * matrixClient.on(\"RoomMember.name\", function(event, member){\n * var newName = member.name;\n * });\n */\n\n/**\n * Fires whenever any room member's membership state changes.\n * @event module:client~MatrixClient#\"RoomMember.membership\"\n * @param {MatrixEvent} event The matrix event which caused this event to fire.\n * @param {RoomMember} member The member whose RoomMember.membership changed.\n * @param {string?} oldMembership The previous membership state. Null if it's a\n * new member.\n * @example\n * matrixClient.on(\"RoomMember.membership\", function(event, member, oldMembership){\n * var newState = member.membership;\n * });\n */\n\n/**\n * Fires whenever any room member's typing state changes.\n * @event module:client~MatrixClient#\"RoomMember.typing\"\n * @param {MatrixEvent} event The matrix event which caused this event to fire.\n * @param {RoomMember} member The member whose RoomMember.typing changed.\n * @example\n * matrixClient.on(\"RoomMember.typing\", function(event, member){\n * var isTyping = member.typing;\n * });\n */\n\n/**\n * Fires whenever any room member's power level changes.\n * @event module:client~MatrixClient#\"RoomMember.powerLevel\"\n * @param {MatrixEvent} event The matrix event which caused this event to fire.\n * @param {RoomMember} member The member whose RoomMember.powerLevel changed.\n * @example\n * matrixClient.on(\"RoomMember.powerLevel\", function(event, member){\n * var newPowerLevel = member.powerLevel;\n * var newNormPowerLevel = member.powerLevelNorm;\n * });\n */\n", "/*\nCopyright 2015 - 2021 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n/**\n * @module models/room-state\n */\n\nimport { EventEmitter } from \"events\";\n\nimport { RoomMember } from \"./room-member\";\nimport { logger } from '../logger';\nimport * as utils from \"../utils\";\nimport { EventType } from \"../@types/event\";\nimport { MatrixEvent } from \"./event\";\nimport { MatrixClient } from \"../client\";\n\n// possible statuses for out-of-band member loading\nenum OobStatus {\n NotStarted,\n InProgress,\n Finished,\n}\n\nexport class RoomState extends EventEmitter {\n private sentinels: Record = {}; // userId: RoomMember\n // stores fuzzy matches to a list of userIDs (applies utils.removeHiddenChars to keys)\n private displayNameToUserIds: Record = {};\n private userIdsToDisplayNames: Record = {};\n private tokenToInvite: Record = {}; // 3pid invite state_key to m.room.member invite\n private joinedMemberCount: number = null; // cache of the number of joined members\n // joined members count from summary api\n // once set, we know the server supports the summary api\n // and we should only trust that\n // we could also only trust that before OOB members\n // are loaded but doesn't seem worth the hassle atm\n private summaryJoinedMemberCount: number = null;\n // same for invited member count\n private invitedMemberCount: number = null;\n private summaryInvitedMemberCount: number = null;\n private modified: number;\n\n // XXX: Should be read-only\n public members: Record = {}; // userId: RoomMember\n public events = new Map>(); // Map>\n public paginationToken: string = null;\n\n /**\n * Construct room state.\n *\n * Room State represents the state of the room at a given point.\n * It can be mutated by adding state events to it.\n * There are two types of room member associated with a state event:\n * normal member objects (accessed via getMember/getMembers) which mutate\n * with the state to represent the current state of that room/user, eg.\n * the object returned by getMember('@bob:example.com') will mutate to\n * get a different display name if Bob later changes his display name\n * in the room.\n * There are also 'sentinel' members (accessed via getSentinelMember).\n * These also represent the state of room members at the point in time\n * represented by the RoomState object, but unlike objects from getMember,\n * sentinel objects will always represent the room state as at the time\n * getSentinelMember was called, so if Bob subsequently changes his display\n * name, a room member object previously acquired with getSentinelMember\n * will still have his old display name. Calling getSentinelMember again\n * after the display name change will return a new RoomMember object\n * with Bob's new display name.\n *\n * @constructor\n * @param {?string} roomId Optional. The ID of the room which has this state.\n * If none is specified it just tracks paginationTokens, useful for notifTimelineSet\n * @param {?object} oobMemberFlags Optional. The state of loading out of bound members.\n * As the timeline might get reset while they are loading, this state needs to be inherited\n * and shared when the room state is cloned for the new timeline.\n * This should only be passed from clone.\n * @prop {Object.} members The room member dictionary, keyed\n * on the user's ID.\n * @prop {Object.>} events The state\n * events dictionary, keyed on the event type and then the state_key value.\n * @prop {string} paginationToken The pagination token for this state.\n */\n constructor(public readonly roomId: string, private oobMemberFlags = { status: OobStatus.NotStarted }) {\n super();\n this.updateModifiedTime();\n }\n\n /**\n * Returns the number of joined members in this room\n * This method caches the result.\n * @return {number} The number of members in this room whose membership is 'join'\n */\n public getJoinedMemberCount(): number {\n if (this.summaryJoinedMemberCount !== null) {\n return this.summaryJoinedMemberCount;\n }\n if (this.joinedMemberCount === null) {\n this.joinedMemberCount = this.getMembers().reduce((count, m) => {\n return m.membership === 'join' ? count + 1 : count;\n }, 0);\n }\n return this.joinedMemberCount;\n }\n\n /**\n * Set the joined member count explicitly (like from summary part of the sync response)\n * @param {number} count the amount of joined members\n */\n public setJoinedMemberCount(count: number): void {\n this.summaryJoinedMemberCount = count;\n }\n\n /**\n * Returns the number of invited members in this room\n * @return {number} The number of members in this room whose membership is 'invite'\n */\n public getInvitedMemberCount(): number {\n if (this.summaryInvitedMemberCount !== null) {\n return this.summaryInvitedMemberCount;\n }\n if (this.invitedMemberCount === null) {\n this.invitedMemberCount = this.getMembers().reduce((count, m) => {\n return m.membership === 'invite' ? count + 1 : count;\n }, 0);\n }\n return this.invitedMemberCount;\n }\n\n /**\n * Set the amount of invited members in this room\n * @param {number} count the amount of invited members\n */\n public setInvitedMemberCount(count: number): void {\n this.summaryInvitedMemberCount = count;\n }\n\n /**\n * Get all RoomMembers in this room.\n * @return {Array} A list of RoomMembers.\n */\n public getMembers(): RoomMember[] {\n return Object.values(this.members);\n }\n\n /**\n * Get all RoomMembers in this room, excluding the user IDs provided.\n * @param {Array} excludedIds The user IDs to exclude.\n * @return {Array} A list of RoomMembers.\n */\n public getMembersExcept(excludedIds: string[]): RoomMember[] {\n return this.getMembers().filter((m) => !excludedIds.includes(m.userId));\n }\n\n /**\n * Get a room member by their user ID.\n * @param {string} userId The room member's user ID.\n * @return {RoomMember} The member or null if they do not exist.\n */\n public getMember(userId: string): RoomMember | null {\n return this.members[userId] || null;\n }\n\n /**\n * Get a room member whose properties will not change with this room state. You\n * typically want this if you want to attach a RoomMember to a MatrixEvent which\n * may no longer be represented correctly by Room.currentState or Room.oldState.\n * The term 'sentinel' refers to the fact that this RoomMember is an unchanging\n * guardian for state at this particular point in time.\n * @param {string} userId The room member's user ID.\n * @return {RoomMember} The member or null if they do not exist.\n */\n public getSentinelMember(userId: string): RoomMember | null {\n if (!userId) return null;\n let sentinel = this.sentinels[userId];\n\n if (sentinel === undefined) {\n sentinel = new RoomMember(this.roomId, userId);\n const member = this.members[userId];\n if (member) {\n sentinel.setMembershipEvent(member.events.member, this);\n }\n this.sentinels[userId] = sentinel;\n }\n return sentinel;\n }\n\n /**\n * Get state events from the state of the room.\n * @param {string} eventType The event type of the state event.\n * @param {string} stateKey Optional. The state_key of the state event. If\n * this is undefined then all matching state events will be\n * returned.\n * @return {MatrixEvent[]|MatrixEvent} A list of events if state_key was\n * undefined, else a single event (or null if no match found).\n */\n public getStateEvents(eventType: EventType | string): MatrixEvent[];\n public getStateEvents(eventType: EventType | string, stateKey: string): MatrixEvent;\n public getStateEvents(eventType: EventType | string, stateKey?: string) {\n if (!this.events.has(eventType)) {\n // no match\n return stateKey === undefined ? [] : null;\n }\n if (stateKey === undefined) { // return all values\n return Array.from(this.events.get(eventType).values());\n }\n const event = this.events.get(eventType).get(stateKey);\n return event ? event : null;\n }\n\n /**\n * Creates a copy of this room state so that mutations to either won't affect the other.\n * @return {RoomState} the copy of the room state\n */\n public clone(): RoomState {\n const copy = new RoomState(this.roomId, this.oobMemberFlags);\n\n // Ugly hack: because setStateEvents will mark\n // members as susperseding future out of bound members\n // if loading is in progress (through oobMemberFlags)\n // since these are not new members, we're merely copying them\n // set the status to not started\n // after copying, we set back the status\n const status = this.oobMemberFlags.status;\n this.oobMemberFlags.status = OobStatus.NotStarted;\n\n Array.from(this.events.values()).forEach((eventsByStateKey) => {\n copy.setStateEvents(Array.from(eventsByStateKey.values()));\n });\n\n // Ugly hack: see above\n this.oobMemberFlags.status = status;\n\n if (this.summaryInvitedMemberCount !== null) {\n copy.setInvitedMemberCount(this.getInvitedMemberCount());\n }\n if (this.summaryJoinedMemberCount !== null) {\n copy.setJoinedMemberCount(this.getJoinedMemberCount());\n }\n\n // copy out of band flags if needed\n if (this.oobMemberFlags.status == OobStatus.Finished) {\n // copy markOutOfBand flags\n this.getMembers().forEach((member) => {\n if (member.isOutOfBand()) {\n const copyMember = copy.getMember(member.userId);\n copyMember.markOutOfBand();\n }\n });\n }\n\n return copy;\n }\n\n /**\n * Add previously unknown state events.\n * When lazy loading members while back-paginating,\n * the relevant room state for the timeline chunk at the end\n * of the chunk can be set with this method.\n * @param {MatrixEvent[]} events state events to prepend\n */\n public setUnknownStateEvents(events: MatrixEvent[]): void {\n const unknownStateEvents = events.filter((event) => {\n return !this.events.has(event.getType()) ||\n !this.events.get(event.getType()).has(event.getStateKey());\n });\n\n this.setStateEvents(unknownStateEvents);\n }\n\n /**\n * Add an array of one or more state MatrixEvents, overwriting\n * any existing state with the same {type, stateKey} tuple. Will fire\n * \"RoomState.events\" for every event added. May fire \"RoomState.members\"\n * if there are m.room.member events.\n * @param {MatrixEvent[]} stateEvents a list of state events for this room.\n * @fires module:client~MatrixClient#event:\"RoomState.members\"\n * @fires module:client~MatrixClient#event:\"RoomState.newMember\"\n * @fires module:client~MatrixClient#event:\"RoomState.events\"\n */\n public setStateEvents(stateEvents: MatrixEvent[]) {\n this.updateModifiedTime();\n\n // update the core event dict\n stateEvents.forEach((event) => {\n if (event.getRoomId() !== this.roomId) {\n return;\n }\n if (!event.isState()) {\n return;\n }\n\n const lastStateEvent = this.getStateEventMatching(event);\n this.setStateEvent(event);\n if (event.getType() === EventType.RoomMember) {\n this.updateDisplayNameCache(event.getStateKey(), event.getContent().displayname);\n this.updateThirdPartyTokenCache(event);\n }\n this.emit(\"RoomState.events\", event, this, lastStateEvent);\n });\n\n // update higher level data structures. This needs to be done AFTER the\n // core event dict as these structures may depend on other state events in\n // the given array (e.g. disambiguating display names in one go to do both\n // clashing names rather than progressively which only catches 1 of them).\n stateEvents.forEach((event) => {\n if (event.getRoomId() !== this.roomId) {\n return;\n }\n if (!event.isState()) {\n return;\n }\n\n if (event.getType() === EventType.RoomMember) {\n const userId = event.getStateKey();\n\n // leave events apparently elide the displayname or avatar_url,\n // so let's fake one up so that we don't leak user ids\n // into the timeline\n if (event.getContent().membership === \"leave\" ||\n event.getContent().membership === \"ban\") {\n event.getContent().avatar_url =\n event.getContent().avatar_url ||\n event.getPrevContent().avatar_url;\n event.getContent().displayname =\n event.getContent().displayname ||\n event.getPrevContent().displayname;\n }\n\n const member = this.getOrCreateMember(userId, event);\n member.setMembershipEvent(event, this);\n\n this.updateMember(member);\n this.emit(\"RoomState.members\", event, this, member);\n } else if (event.getType() === EventType.RoomPowerLevels) {\n // events with unknown state keys should be ignored\n // and should not aggregate onto members power levels\n if (event.getStateKey() !== \"\") {\n return;\n }\n const members = Object.values(this.members);\n members.forEach((member) => {\n // We only propagate `RoomState.members` event if the\n // power levels has been changed\n // large room suffer from large re-rendering especially when not needed\n const oldLastModified = member.getLastModifiedTime();\n member.setPowerLevelEvent(event);\n if (oldLastModified !== member.getLastModifiedTime()) {\n this.emit(\"RoomState.members\", event, this, member);\n }\n });\n\n // assume all our sentinels are now out-of-date\n this.sentinels = {};\n }\n });\n }\n\n /**\n * Looks up a member by the given userId, and if it doesn't exist,\n * create it and emit the `RoomState.newMember` event.\n * This method makes sure the member is added to the members dictionary\n * before emitting, as this is done from setStateEvents and setOutOfBandMember.\n * @param {string} userId the id of the user to look up\n * @param {MatrixEvent} event the membership event for the (new) member. Used to emit.\n * @fires module:client~MatrixClient#event:\"RoomState.newMember\"\n * @returns {RoomMember} the member, existing or newly created.\n */\n private getOrCreateMember(userId: string, event: MatrixEvent): RoomMember {\n let member = this.members[userId];\n if (!member) {\n member = new RoomMember(this.roomId, userId);\n // add member to members before emitting any events,\n // as event handlers often lookup the member\n this.members[userId] = member;\n this.emit(\"RoomState.newMember\", event, this, member);\n }\n return member;\n }\n\n private setStateEvent(event: MatrixEvent): void {\n if (!this.events.has(event.getType())) {\n this.events.set(event.getType(), new Map());\n }\n this.events.get(event.getType()).set(event.getStateKey(), event);\n }\n\n private getStateEventMatching(event: MatrixEvent): MatrixEvent | null {\n if (!this.events.has(event.getType())) return null;\n return this.events.get(event.getType()).get(event.getStateKey());\n }\n\n private updateMember(member: RoomMember): void {\n // this member may have a power level already, so set it.\n const pwrLvlEvent = this.getStateEvents(EventType.RoomPowerLevels, \"\");\n if (pwrLvlEvent) {\n member.setPowerLevelEvent(pwrLvlEvent);\n }\n\n // blow away the sentinel which is now outdated\n delete this.sentinels[member.userId];\n\n this.members[member.userId] = member;\n this.joinedMemberCount = null;\n this.invitedMemberCount = null;\n }\n\n /**\n * Get the out-of-band members loading state, whether loading is needed or not.\n * Note that loading might be in progress and hence isn't needed.\n * @return {boolean} whether or not the members of this room need to be loaded\n */\n public needsOutOfBandMembers(): boolean {\n return this.oobMemberFlags.status === OobStatus.NotStarted;\n }\n\n /**\n * Mark this room state as waiting for out-of-band members,\n * ensuring it doesn't ask for them to be requested again\n * through needsOutOfBandMembers\n */\n public markOutOfBandMembersStarted(): void {\n if (this.oobMemberFlags.status !== OobStatus.NotStarted) {\n return;\n }\n this.oobMemberFlags.status = OobStatus.InProgress;\n }\n\n /**\n * Mark this room state as having failed to fetch out-of-band members\n */\n public markOutOfBandMembersFailed(): void {\n if (this.oobMemberFlags.status !== OobStatus.InProgress) {\n return;\n }\n this.oobMemberFlags.status = OobStatus.NotStarted;\n }\n\n /**\n * Clears the loaded out-of-band members\n */\n public clearOutOfBandMembers(): void {\n let count = 0;\n Object.keys(this.members).forEach((userId) => {\n const member = this.members[userId];\n if (member.isOutOfBand()) {\n ++count;\n delete this.members[userId];\n }\n });\n logger.log(`LL: RoomState removed ${count} members...`);\n this.oobMemberFlags.status = OobStatus.NotStarted;\n }\n\n /**\n * Sets the loaded out-of-band members.\n * @param {MatrixEvent[]} stateEvents array of membership state events\n */\n public setOutOfBandMembers(stateEvents: MatrixEvent[]): void {\n logger.log(`LL: RoomState about to set ${stateEvents.length} OOB members ...`);\n if (this.oobMemberFlags.status !== OobStatus.InProgress) {\n return;\n }\n logger.log(`LL: RoomState put in finished state ...`);\n this.oobMemberFlags.status = OobStatus.Finished;\n stateEvents.forEach((e) => this.setOutOfBandMember(e));\n }\n\n /**\n * Sets a single out of band member, used by both setOutOfBandMembers and clone\n * @param {MatrixEvent} stateEvent membership state event\n */\n private setOutOfBandMember(stateEvent: MatrixEvent): void {\n if (stateEvent.getType() !== EventType.RoomMember) {\n return;\n }\n const userId = stateEvent.getStateKey();\n const existingMember = this.getMember(userId);\n // never replace members received as part of the sync\n if (existingMember && !existingMember.isOutOfBand()) {\n return;\n }\n\n const member = this.getOrCreateMember(userId, stateEvent);\n member.setMembershipEvent(stateEvent, this);\n // needed to know which members need to be stored seperately\n // as they are not part of the sync accumulator\n // this is cleared by setMembershipEvent so when it's updated through /sync\n member.markOutOfBand();\n\n this.updateDisplayNameCache(member.userId, member.name);\n\n this.setStateEvent(stateEvent);\n this.updateMember(member);\n this.emit(\"RoomState.members\", stateEvent, this, member);\n }\n\n /**\n * Set the current typing event for this room.\n * @param {MatrixEvent} event The typing event\n */\n public setTypingEvent(event: MatrixEvent): void {\n Object.values(this.members).forEach(function(member) {\n member.setTypingEvent(event);\n });\n }\n\n /**\n * Get the m.room.member event which has the given third party invite token.\n *\n * @param {string} token The token\n * @return {?MatrixEvent} The m.room.member event or null\n */\n public getInviteForThreePidToken(token: string): MatrixEvent | null {\n return this.tokenToInvite[token] || null;\n }\n\n /**\n * Update the last modified time to the current time.\n */\n private updateModifiedTime(): void {\n this.modified = Date.now();\n }\n\n /**\n * Get the timestamp when this room state was last updated. This timestamp is\n * updated when this object has received new state events.\n * @return {number} The timestamp\n */\n public getLastModifiedTime(): number {\n return this.modified;\n }\n\n /**\n * Get user IDs with the specified or similar display names.\n * @param {string} displayName The display name to get user IDs from.\n * @return {string[]} An array of user IDs or an empty array.\n */\n public getUserIdsWithDisplayName(displayName: string): string[] {\n return this.displayNameToUserIds[utils.removeHiddenChars(displayName)] || [];\n }\n\n /**\n * Returns true if userId is in room, event is not redacted and either sender of\n * mxEvent or has power level sufficient to redact events other than their own.\n * @param {MatrixEvent} mxEvent The event to test permission for\n * @param {string} userId The user ID of the user to test permission for\n * @return {boolean} true if the given used ID can redact given event\n */\n public maySendRedactionForEvent(mxEvent: MatrixEvent, userId: string): boolean {\n const member = this.getMember(userId);\n if (!member || member.membership === 'leave') return false;\n\n if (mxEvent.status || mxEvent.isRedacted()) return false;\n\n // The user may have been the sender, but they can't redact their own message\n // if redactions are blocked.\n const canRedact = this.maySendEvent(EventType.RoomRedaction, userId);\n if (mxEvent.getSender() === userId) return canRedact;\n\n return this.hasSufficientPowerLevelFor('redact', member.powerLevel);\n }\n\n /**\n * Returns true if the given power level is sufficient for action\n * @param {string} action The type of power level to check\n * @param {number} powerLevel The power level of the member\n * @return {boolean} true if the given power level is sufficient\n */\n private hasSufficientPowerLevelFor(action: string, powerLevel: number): boolean {\n const powerLevelsEvent = this.getStateEvents(EventType.RoomPowerLevels, \"\");\n\n let powerLevels = {};\n if (powerLevelsEvent) {\n powerLevels = powerLevelsEvent.getContent();\n }\n\n let requiredLevel = 50;\n if (utils.isNumber(powerLevels[action])) {\n requiredLevel = powerLevels[action];\n }\n\n return powerLevel >= requiredLevel;\n }\n\n /**\n * Short-form for maySendEvent('m.room.message', userId)\n * @param {string} userId The user ID of the user to test permission for\n * @return {boolean} true if the given user ID should be permitted to send\n * message events into the given room.\n */\n public maySendMessage(userId: string): boolean {\n return this.maySendEventOfType(EventType.RoomMessage, userId, false);\n }\n\n /**\n * Returns true if the given user ID has permission to send a normal\n * event of type `eventType` into this room.\n * @param {string} eventType The type of event to test\n * @param {string} userId The user ID of the user to test permission for\n * @return {boolean} true if the given user ID should be permitted to send\n * the given type of event into this room,\n * according to the room's state.\n */\n public maySendEvent(eventType: EventType | string, userId: string): boolean {\n return this.maySendEventOfType(eventType, userId, false);\n }\n\n /**\n * Returns true if the given MatrixClient has permission to send a state\n * event of type `stateEventType` into this room.\n * @param {string} stateEventType The type of state events to test\n * @param {MatrixClient} cli The client to test permission for\n * @return {boolean} true if the given client should be permitted to send\n * the given type of state event into this room,\n * according to the room's state.\n */\n public mayClientSendStateEvent(stateEventType: EventType | string, cli: MatrixClient): boolean {\n if (cli.isGuest()) {\n return false;\n }\n return this.maySendStateEvent(stateEventType, cli.credentials.userId);\n }\n\n /**\n * Returns true if the given user ID has permission to send a state\n * event of type `stateEventType` into this room.\n * @param {string} stateEventType The type of state events to test\n * @param {string} userId The user ID of the user to test permission for\n * @return {boolean} true if the given user ID should be permitted to send\n * the given type of state event into this room,\n * according to the room's state.\n */\n public maySendStateEvent(stateEventType: EventType | string, userId: string): boolean {\n return this.maySendEventOfType(stateEventType, userId, true);\n }\n\n /**\n * Returns true if the given user ID has permission to send a normal or state\n * event of type `eventType` into this room.\n * @param {string} eventType The type of event to test\n * @param {string} userId The user ID of the user to test permission for\n * @param {boolean} state If true, tests if the user may send a state\n event of this type. Otherwise tests whether\n they may send a regular event.\n * @return {boolean} true if the given user ID should be permitted to send\n * the given type of event into this room,\n * according to the room's state.\n */\n private maySendEventOfType(eventType: EventType | string, userId: string, state: boolean): boolean {\n const powerLevelsEvent = this.getStateEvents(EventType.RoomPowerLevels, '');\n\n let powerLevels;\n let eventsLevels = {};\n\n let stateDefault = 0;\n let eventsDefault = 0;\n let powerLevel = 0;\n if (powerLevelsEvent) {\n powerLevels = powerLevelsEvent.getContent();\n eventsLevels = powerLevels.events || {};\n\n if (Number.isSafeInteger(powerLevels.state_default)) {\n stateDefault = powerLevels.state_default;\n } else {\n stateDefault = 50;\n }\n\n const userPowerLevel = powerLevels.users && powerLevels.users[userId];\n if (Number.isSafeInteger(userPowerLevel)) {\n powerLevel = userPowerLevel;\n } else if (Number.isSafeInteger(powerLevels.users_default)) {\n powerLevel = powerLevels.users_default;\n }\n\n if (Number.isSafeInteger(powerLevels.events_default)) {\n eventsDefault = powerLevels.events_default;\n }\n }\n\n let requiredLevel = state ? stateDefault : eventsDefault;\n if (Number.isSafeInteger(eventsLevels[eventType])) {\n requiredLevel = eventsLevels[eventType];\n }\n return powerLevel >= requiredLevel;\n }\n\n /**\n * Returns true if the given user ID has permission to trigger notification\n * of type `notifLevelKey`\n * @param {string} notifLevelKey The level of notification to test (eg. 'room')\n * @param {string} userId The user ID of the user to test permission for\n * @return {boolean} true if the given user ID has permission to trigger a\n * notification of this type.\n */\n public mayTriggerNotifOfType(notifLevelKey: string, userId: string): boolean {\n const member = this.getMember(userId);\n if (!member) {\n return false;\n }\n\n const powerLevelsEvent = this.getStateEvents(EventType.RoomPowerLevels, '');\n\n let notifLevel = 50;\n if (\n powerLevelsEvent &&\n powerLevelsEvent.getContent() &&\n powerLevelsEvent.getContent().notifications &&\n utils.isNumber(powerLevelsEvent.getContent().notifications[notifLevelKey])\n ) {\n notifLevel = powerLevelsEvent.getContent().notifications[notifLevelKey];\n }\n\n return member.powerLevel >= notifLevel;\n }\n\n /**\n * Returns the join rule based on the m.room.join_rule state event, defaulting to `invite`.\n * @returns {string} the join_rule applied to this room\n */\n public getJoinRule(): string {\n const joinRuleEvent = this.getStateEvents(EventType.RoomJoinRules, \"\");\n const joinRuleContent = joinRuleEvent ? joinRuleEvent.getContent() : {};\n return joinRuleContent[\"join_rule\"] || \"invite\";\n }\n\n private updateThirdPartyTokenCache(memberEvent: MatrixEvent): void {\n if (!memberEvent.getContent().third_party_invite) {\n return;\n }\n const token = (memberEvent.getContent().third_party_invite.signed || {}).token;\n if (!token) {\n return;\n }\n const threePidInvite = this.getStateEvents(EventType.RoomThirdPartyInvite, token);\n if (!threePidInvite) {\n return;\n }\n this.tokenToInvite[token] = memberEvent;\n }\n\n private updateDisplayNameCache(userId: string, displayName: string): void {\n const oldName = this.userIdsToDisplayNames[userId];\n delete this.userIdsToDisplayNames[userId];\n if (oldName) {\n // Remove the old name from the cache.\n // We clobber the user_id > name lookup but the name -> [user_id] lookup\n // means we need to remove that user ID from that array rather than nuking\n // the lot.\n const strippedOldName = utils.removeHiddenChars(oldName);\n\n const existingUserIds = this.displayNameToUserIds[strippedOldName];\n if (existingUserIds) {\n // remove this user ID from this array\n const filteredUserIDs = existingUserIds.filter((id) => id !== userId);\n this.displayNameToUserIds[strippedOldName] = filteredUserIDs;\n }\n }\n\n this.userIdsToDisplayNames[userId] = displayName;\n\n const strippedDisplayname = displayName && utils.removeHiddenChars(displayName);\n // an empty stripped displayname (undefined/'') will be set to MXID in room-member.js\n if (strippedDisplayname) {\n if (!this.displayNameToUserIds[strippedDisplayname]) {\n this.displayNameToUserIds[strippedDisplayname] = [];\n }\n this.displayNameToUserIds[strippedDisplayname].push(userId);\n }\n }\n}\n\n/**\n * Fires whenever the event dictionary in room state is updated.\n * @event module:client~MatrixClient#\"RoomState.events\"\n * @param {MatrixEvent} event The matrix event which caused this event to fire.\n * @param {RoomState} state The room state whose RoomState.events dictionary\n * was updated.\n * @param {MatrixEvent} prevEvent The event being replaced by the new state, if\n * known. Note that this can differ from `getPrevContent()` on the new state event\n * as this is the store's view of the last state, not the previous state provided\n * by the server.\n * @example\n * matrixClient.on(\"RoomState.events\", function(event, state, prevEvent){\n * var newStateEvent = event;\n * });\n */\n\n/**\n * Fires whenever a member in the members dictionary is updated in any way.\n * @event module:client~MatrixClient#\"RoomState.members\"\n * @param {MatrixEvent} event The matrix event which caused this event to fire.\n * @param {RoomState} state The room state whose RoomState.members dictionary\n * was updated.\n * @param {RoomMember} member The room member that was updated.\n * @example\n * matrixClient.on(\"RoomState.members\", function(event, state, member){\n * var newMembershipState = member.membership;\n * });\n */\n\n/**\n * Fires whenever a member is added to the members dictionary. The RoomMember\n * will not be fully populated yet (e.g. no membership state) but will already\n * be available in the members dictionary.\n * @event module:client~MatrixClient#\"RoomState.newMember\"\n * @param {MatrixEvent} event The matrix event which caused this event to fire.\n * @param {RoomState} state The room state whose RoomState.members dictionary\n * was updated with a new entry.\n * @param {RoomMember} member The room member that was added.\n * @example\n * matrixClient.on(\"RoomState.newMember\", function(event, state, member){\n * // add event listeners on 'member'\n * });\n */\n", "/*\nCopyright 2015 - 2021 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n/**\n * @module models/room-summary\n */\n\nexport interface IRoomSummary {\n \"m.heroes\": string[];\n \"m.joined_member_count\": number;\n \"m.invited_member_count\": number;\n}\n\ninterface IInfo {\n title: string;\n desc?: string;\n numMembers?: number;\n aliases?: string[];\n timestamp?: number;\n}\n\n/**\n * Construct a new Room Summary. A summary can be used for display on a recent\n * list, without having to load the entire room list into memory.\n * @constructor\n * @param {string} roomId Required. The ID of this room.\n * @param {Object} info Optional. The summary info. Additional keys are supported.\n * @param {string} info.title The title of the room (e.g. m.room.name)\n * @param {string} info.desc The description of the room (e.g.\n * m.room.topic)\n * @param {Number} info.numMembers The number of joined users.\n * @param {string[]} info.aliases The list of aliases for this room.\n * @param {Number} info.timestamp The timestamp for this room.\n */\nexport class RoomSummary {\n constructor(public readonly roomId: string, info?: IInfo) {}\n}\n\n", - "/*\nCopyright 2015 - 2021 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n/**\n * @module models/room\n */\n\nimport { EventEmitter } from \"events\";\n\nimport { EventTimelineSet } from \"./event-timeline-set\";\nimport { EventTimeline } from \"./event-timeline\";\nimport { getHttpUriForMxc } from \"../content-repo\";\nimport * as utils from \"../utils\";\nimport { normalize } from \"../utils\";\nimport { EventStatus, IEvent, MatrixEvent } from \"./event\";\nimport { RoomMember } from \"./room-member\";\nimport { IRoomSummary, RoomSummary } from \"./room-summary\";\nimport { logger } from '../logger';\nimport { ReEmitter } from '../ReEmitter';\nimport { EventType, RoomCreateTypeField, RoomType, UNSTABLE_ELEMENT_FUNCTIONAL_USERS } from \"../@types/event\";\nimport { IRoomVersionsCapability, MatrixClient, PendingEventOrdering, RoomVersionStability } from \"../client\";\nimport { ResizeMethod } from \"../@types/partials\";\nimport { Filter } from \"../filter\";\nimport { RoomState } from \"./room-state\";\n\n// These constants are used as sane defaults when the homeserver doesn't support\n// the m.room_versions capability. In practice, KNOWN_SAFE_ROOM_VERSION should be\n// the same as the common default room version whereas SAFE_ROOM_VERSIONS are the\n// room versions which are considered okay for people to run without being asked\n// to upgrade (ie: \"stable\"). Eventually, we should remove these when all homeservers\n// return an m.room_versions capability.\nconst KNOWN_SAFE_ROOM_VERSION = '6';\nconst SAFE_ROOM_VERSIONS = ['1', '2', '3', '4', '5', '6'];\n\nfunction synthesizeReceipt(userId: string, event: MatrixEvent, receiptType: string): MatrixEvent {\n // console.log(\"synthesizing receipt for \"+event.getId());\n // This is really ugly because JS has no way to express an object literal\n // where the name of a key comes from an expression\n const fakeReceipt = {\n content: {},\n type: \"m.receipt\",\n room_id: event.getRoomId(),\n };\n fakeReceipt.content[event.getId()] = {};\n fakeReceipt.content[event.getId()][receiptType] = {};\n fakeReceipt.content[event.getId()][receiptType][userId] = {\n ts: event.getTs(),\n };\n return new MatrixEvent(fakeReceipt);\n}\n\ninterface IOpts {\n storageToken?: string;\n pendingEventOrdering?: PendingEventOrdering;\n timelineSupport?: boolean;\n unstableClientRelationAggregation?: boolean;\n lazyLoadMembers?: boolean;\n}\n\nexport interface IRecommendedVersion {\n version: string;\n needsUpgrade: boolean;\n urgent: boolean;\n}\n\ninterface IReceipt {\n ts: number;\n}\n\ninterface IWrappedReceipt {\n eventId: string;\n data: IReceipt;\n}\n\ninterface ICachedReceipt {\n type: string;\n userId: string;\n data: IReceipt;\n}\n\ntype ReceiptCache = Record;\n\ninterface IReceiptContent {\n [eventId: string]: {\n [type: string]: {\n [userId: string]: IReceipt;\n };\n };\n}\n\ntype Receipts = Record>;\n\nexport enum NotificationCountType {\n Highlight = \"highlight\",\n Total = \"total\",\n}\n\nexport class Room extends EventEmitter {\n private readonly reEmitter: ReEmitter;\n private txnToEvent: Record = {}; // Pending in-flight requests { string: MatrixEvent }\n // receipts should clobber based on receipt_type and user_id pairs hence\n // the form of this structure. This is sub-optimal for the exposed APIs\n // which pass in an event ID and get back some receipts, so we also store\n // a pre-cached list for this purpose.\n private receipts: Receipts = {}; // { receipt_type: { user_id: IReceipt } }\n private receiptCacheByEventId: ReceiptCache = {}; // { event_id: IReceipt2[] }\n // only receipts that came from the server, not synthesized ones\n private realReceipts: Receipts = {};\n private notificationCounts: Partial> = {};\n private readonly timelineSets: EventTimelineSet[];\n // any filtered timeline sets we're maintaining for this room\n private readonly filteredTimelineSets: Record = {}; // filter_id: timelineSet\n private readonly pendingEventList?: MatrixEvent[];\n // read by megolm via getter; boolean value - null indicates \"use global value\"\n private blacklistUnverifiedDevices: boolean = null;\n private selfMembership: string = null;\n private summaryHeroes: string[] = null;\n // flags to stop logspam about missing m.room.create events\n private getTypeWarning = false;\n private getVersionWarning = false;\n private membersPromise?: Promise;\n\n // XXX: These should be read-only\n public name: string;\n public normalizedName: string;\n public tags: Record> = {}; // $tagName: { $metadata: $value }\n public accountData: Record = {}; // $eventType: $event\n public summary: RoomSummary = null;\n public readonly storageToken?: string;\n // legacy fields\n public timeline: MatrixEvent[];\n public oldState: RoomState;\n public currentState: RoomState;\n\n /**\n * Construct a new Room.\n *\n *

For a room, we store an ordered sequence of timelines, which may or may not\n * be continuous. Each timeline lists a series of events, as well as tracking\n * the room state at the start and the end of the timeline. It also tracks\n * forward and backward pagination tokens, as well as containing links to the\n * next timeline in the sequence.\n *\n *

There is one special timeline - the 'live' timeline, which represents the\n * timeline to which events are being added in real-time as they are received\n * from the /sync API. Note that you should not retain references to this\n * timeline - even if it is the current timeline right now, it may not remain\n * so if the server gives us a timeline gap in /sync.\n *\n *

In order that we can find events from their ids later, we also maintain a\n * map from event_id to timeline and index.\n *\n * @constructor\n * @alias module:models/room\n * @param {string} roomId Required. The ID of this room.\n * @param {MatrixClient} client Required. The client, used to lazy load members.\n * @param {string} myUserId Required. The ID of the syncing user.\n * @param {Object=} opts Configuration options\n * @param {*} opts.storageToken Optional. The token which a data store can use\n * to remember the state of the room. What this means is dependent on the store\n * implementation.\n *\n * @param {String=} opts.pendingEventOrdering Controls where pending messages\n * appear in a room's timeline. If \"chronological\", messages will appear\n * in the timeline when the call to sendEvent was made. If\n * \"detached\", pending messages will appear in a separate list,\n * accessible via {@link module:models/room#getPendingEvents}. Default:\n * \"chronological\".\n * @param {boolean} [opts.timelineSupport = false] Set to true to enable improved\n * timeline support.\n * @param {boolean} [opts.unstableClientRelationAggregation = false]\n * Optional. Set to true to enable client-side aggregation of event relations\n * via `EventTimelineSet#getRelationsForEvent`.\n * This feature is currently unstable and the API may change without notice.\n *\n * @prop {string} roomId The ID of this room.\n * @prop {string} name The human-readable display name for this room.\n * @prop {string} normalizedName The un-homoglyphed name for this room.\n * @prop {Array} timeline The live event timeline for this room,\n * with the oldest event at index 0. Present for backwards compatibility -\n * prefer getLiveTimeline().getEvents().\n * @prop {object} tags Dict of room tags; the keys are the tag name and the values\n * are any metadata associated with the tag - e.g. { \"fav\" : { order: 1 } }\n * @prop {object} accountData Dict of per-room account_data events; the keys are the\n * event type and the values are the events.\n * @prop {RoomState} oldState The state of the room at the time of the oldest\n * event in the live timeline. Present for backwards compatibility -\n * prefer getLiveTimeline().getState(EventTimeline.BACKWARDS).\n * @prop {RoomState} currentState The state of the room at the time of the\n * newest event in the timeline. Present for backwards compatibility -\n * prefer getLiveTimeline().getState(EventTimeline.FORWARDS).\n * @prop {RoomSummary} summary The room summary.\n * @prop {*} storageToken A token which a data store can use to remember\n * the state of the room.\n */\n constructor(\n public readonly roomId: string,\n public readonly client: MatrixClient,\n public readonly myUserId: string,\n private readonly opts: IOpts = {},\n ) {\n super();\n // In some cases, we add listeners for every displayed Matrix event, so it's\n // common to have quite a few more than the default limit.\n this.setMaxListeners(100);\n this.reEmitter = new ReEmitter(this);\n\n opts.pendingEventOrdering = opts.pendingEventOrdering || PendingEventOrdering.Chronological;\n if ([\"chronological\", \"detached\"].indexOf(opts.pendingEventOrdering) === -1) {\n throw new Error(\n \"opts.pendingEventOrdering MUST be either 'chronological' or \" +\n \"'detached'. Got: '\" + opts.pendingEventOrdering + \"'\",\n );\n }\n\n this.name = roomId;\n\n // all our per-room timeline sets. the first one is the unfiltered ones;\n // the subsequent ones are the filtered ones in no particular order.\n this.timelineSets = [new EventTimelineSet(this, opts)];\n this.reEmitter.reEmit(this.getUnfilteredTimelineSet(), [\"Room.timeline\", \"Room.timelineReset\"]);\n\n this.fixUpLegacyTimelineFields();\n\n if (this.opts.pendingEventOrdering == \"detached\") {\n this.pendingEventList = [];\n const serializedPendingEventList = client.sessionStore.store.getItem(pendingEventsKey(this.roomId));\n if (serializedPendingEventList) {\n JSON.parse(serializedPendingEventList)\n .forEach(async serializedEvent => {\n const event = new MatrixEvent(serializedEvent);\n if (event.getType() === EventType.RoomMessageEncrypted) {\n await event.attemptDecryption(this.client.crypto);\n }\n event.setStatus(EventStatus.NOT_SENT);\n this.addPendingEvent(event, event.getTxnId());\n });\n }\n }\n\n // awaited by getEncryptionTargetMembers while room members are loading\n if (!this.opts.lazyLoadMembers) {\n this.membersPromise = Promise.resolve(false);\n } else {\n this.membersPromise = null;\n }\n }\n\n /**\n * Bulk decrypt critical events in a room\n *\n * Critical events represents the minimal set of events to decrypt\n * for a typical UI to function properly\n *\n * - Last event of every room (to generate likely message preview)\n * - All events up to the read receipt (to calculate an accurate notification count)\n *\n * @returns {Promise} Signals when all events have been decrypted\n */\n public decryptCriticalEvents(): Promise {\n const readReceiptEventId = this.getEventReadUpTo(this.client.getUserId(), true);\n const events = this.getLiveTimeline().getEvents();\n const readReceiptTimelineIndex = events.findIndex(matrixEvent => {\n return matrixEvent.event.event_id === readReceiptEventId;\n });\n\n const decryptionPromises = events\n .slice(readReceiptTimelineIndex)\n .filter(event => event.shouldAttemptDecryption())\n .reverse()\n .map(event => event.attemptDecryption(this.client.crypto, { isRetry: true }));\n\n return Promise.allSettled(decryptionPromises) as unknown as Promise;\n }\n\n /**\n * Bulk decrypt events in a room\n *\n * @returns {Promise} Signals when all events have been decrypted\n */\n public decryptAllEvents(): Promise {\n const decryptionPromises = this\n .getUnfilteredTimelineSet()\n .getLiveTimeline()\n .getEvents()\n .filter(event => event.shouldAttemptDecryption())\n .reverse()\n .map(event => event.attemptDecryption(this.client.crypto, { isRetry: true }));\n\n return Promise.allSettled(decryptionPromises) as unknown as Promise;\n }\n\n /**\n * Gets the version of the room\n * @returns {string} The version of the room, or null if it could not be determined\n */\n public getVersion(): string | null {\n const createEvent = this.currentState.getStateEvents(EventType.RoomCreate, \"\");\n if (!createEvent) {\n if (!this.getVersionWarning) {\n logger.warn(\"[getVersion] Room \" + this.roomId + \" does not have an m.room.create event\");\n this.getVersionWarning = true;\n }\n return '1';\n }\n const ver = createEvent.getContent()['room_version'];\n if (ver === undefined) return '1';\n return ver;\n }\n\n /**\n * Determines whether this room needs to be upgraded to a new version\n * @returns {string?} What version the room should be upgraded to, or null if\n * the room does not require upgrading at this time.\n * @deprecated Use #getRecommendedVersion() instead\n */\n public shouldUpgradeToVersion(): string | null {\n // TODO: Remove this function.\n // This makes assumptions about which versions are safe, and can easily\n // be wrong. Instead, people are encouraged to use getRecommendedVersion\n // which determines a safer value. This function doesn't use that function\n // because this is not async-capable, and to avoid breaking the contract\n // we're deprecating this.\n\n if (!SAFE_ROOM_VERSIONS.includes(this.getVersion())) {\n return KNOWN_SAFE_ROOM_VERSION;\n }\n\n return null;\n }\n\n /**\n * Determines the recommended room version for the room. This returns an\n * object with 3 properties: version as the new version the\n * room should be upgraded to (may be the same as the current version);\n * needsUpgrade to indicate if the room actually can be\n * upgraded (ie: does the current version not match?); and urgent\n * to indicate if the new version patches a vulnerability in a previous\n * version.\n * @returns {Promise<{version: string, needsUpgrade: boolean, urgent: boolean}>}\n * Resolves to the version the room should be upgraded to.\n */\n public async getRecommendedVersion(): Promise {\n const capabilities = await this.client.getCapabilities();\n let versionCap = capabilities[\"m.room_versions\"];\n if (!versionCap) {\n versionCap = {\n default: KNOWN_SAFE_ROOM_VERSION,\n available: {},\n };\n for (const safeVer of SAFE_ROOM_VERSIONS) {\n versionCap.available[safeVer] = RoomVersionStability.Stable;\n }\n }\n\n let result = this.checkVersionAgainstCapability(versionCap);\n if (result.urgent && result.needsUpgrade) {\n // Something doesn't feel right: we shouldn't need to update\n // because the version we're on should be in the protocol's\n // namespace. This usually means that the server was updated\n // before the client was, making us think the newest possible\n // room version is not stable. As a solution, we'll refresh\n // the capability we're using to determine this.\n logger.warn(\n \"Refreshing room version capability because the server looks \" +\n \"to be supporting a newer room version we don't know about.\",\n );\n\n const caps = await this.client.getCapabilities(true);\n versionCap = caps[\"m.room_versions\"];\n if (!versionCap) {\n logger.warn(\"No room version capability - assuming upgrade required.\");\n return result;\n } else {\n result = this.checkVersionAgainstCapability(versionCap);\n }\n }\n\n return result;\n }\n\n private checkVersionAgainstCapability(versionCap: IRoomVersionsCapability): IRecommendedVersion {\n const currentVersion = this.getVersion();\n logger.log(`[${this.roomId}] Current version: ${currentVersion}`);\n logger.log(`[${this.roomId}] Version capability: `, versionCap);\n\n const result = {\n version: currentVersion,\n needsUpgrade: false,\n urgent: false,\n };\n\n // If the room is on the default version then nothing needs to change\n if (currentVersion === versionCap.default) return result;\n\n const stableVersions = Object.keys(versionCap.available)\n .filter((v) => versionCap.available[v] === 'stable');\n\n // Check if the room is on an unstable version. We determine urgency based\n // off the version being in the Matrix spec namespace or not (if the version\n // is in the current namespace and unstable, the room is probably vulnerable).\n if (!stableVersions.includes(currentVersion)) {\n result.version = versionCap.default;\n result.needsUpgrade = true;\n result.urgent = !!this.getVersion().match(/^[0-9]+[0-9.]*$/g);\n if (result.urgent) {\n logger.warn(`URGENT upgrade required on ${this.roomId}`);\n } else {\n logger.warn(`Non-urgent upgrade required on ${this.roomId}`);\n }\n return result;\n }\n\n // The room is on a stable, but non-default, version by this point.\n // No upgrade needed.\n return result;\n }\n\n /**\n * Determines whether the given user is permitted to perform a room upgrade\n * @param {String} userId The ID of the user to test against\n * @returns {boolean} True if the given user is permitted to upgrade the room\n */\n public userMayUpgradeRoom(userId: string): boolean {\n return this.currentState.maySendStateEvent(EventType.RoomTombstone, userId);\n }\n\n /**\n * Get the list of pending sent events for this room\n *\n * @return {module:models/event.MatrixEvent[]} A list of the sent events\n * waiting for remote echo.\n *\n * @throws If opts.pendingEventOrdering was not 'detached'\n */\n public getPendingEvents(): MatrixEvent[] {\n if (this.opts.pendingEventOrdering !== \"detached\") {\n throw new Error(\n \"Cannot call getPendingEvents with pendingEventOrdering == \" +\n this.opts.pendingEventOrdering);\n }\n\n return this.pendingEventList;\n }\n\n /**\n * Removes a pending event for this room\n *\n * @param {string} eventId\n * @return {boolean} True if an element was removed.\n */\n public removePendingEvent(eventId: string): boolean {\n if (this.opts.pendingEventOrdering !== \"detached\") {\n throw new Error(\n \"Cannot call removePendingEvent with pendingEventOrdering == \" +\n this.opts.pendingEventOrdering);\n }\n\n const removed = utils.removeElement(\n this.pendingEventList,\n function(ev) {\n return ev.getId() == eventId;\n }, false,\n );\n\n this.savePendingEvents();\n\n return removed;\n }\n\n /**\n * Check whether the pending event list contains a given event by ID.\n * If pending event ordering is not \"detached\" then this returns false.\n *\n * @param {string} eventId The event ID to check for.\n * @return {boolean}\n */\n public hasPendingEvent(eventId: string): boolean {\n if (this.opts.pendingEventOrdering !== \"detached\") {\n return false;\n }\n\n return this.pendingEventList.some(event => event.getId() === eventId);\n }\n\n /**\n * Get a specific event from the pending event list, if configured, null otherwise.\n *\n * @param {string} eventId The event ID to check for.\n * @return {MatrixEvent}\n */\n public getPendingEvent(eventId: string): MatrixEvent | null {\n if (this.opts.pendingEventOrdering !== \"detached\") {\n return null;\n }\n\n return this.pendingEventList.find(event => event.getId() === eventId);\n }\n\n /**\n * Get the live unfiltered timeline for this room.\n *\n * @return {module:models/event-timeline~EventTimeline} live timeline\n */\n public getLiveTimeline(): EventTimeline {\n return this.getUnfilteredTimelineSet().getLiveTimeline();\n }\n\n /**\n * Get the timestamp of the last message in the room\n *\n * @return {number} the timestamp of the last message in the room\n */\n public getLastActiveTimestamp(): number {\n const timeline = this.getLiveTimeline();\n const events = timeline.getEvents();\n if (events.length) {\n const lastEvent = events[events.length - 1];\n return lastEvent.getTs();\n } else {\n return Number.MIN_SAFE_INTEGER;\n }\n }\n\n /**\n * @return {string} the membership type (join | leave | invite) for the logged in user\n */\n public getMyMembership(): string {\n return this.selfMembership;\n }\n\n /**\n * If this room is a DM we're invited to,\n * try to find out who invited us\n * @return {string} user id of the inviter\n */\n public getDMInviter(): string {\n if (this.myUserId) {\n const me = this.getMember(this.myUserId);\n if (me) {\n return me.getDMInviter();\n }\n }\n if (this.selfMembership === \"invite\") {\n // fall back to summary information\n const memberCount = this.getInvitedAndJoinedMemberCount();\n if (memberCount == 2 && this.summaryHeroes.length) {\n return this.summaryHeroes[0];\n }\n }\n }\n\n /**\n * Assuming this room is a DM room, tries to guess with which user.\n * @return {string} user id of the other member (could be syncing user)\n */\n public guessDMUserId(): string {\n const me = this.getMember(this.myUserId);\n if (me) {\n const inviterId = me.getDMInviter();\n if (inviterId) {\n return inviterId;\n }\n }\n // remember, we're assuming this room is a DM,\n // so returning the first member we find should be fine\n const hasHeroes = Array.isArray(this.summaryHeroes) &&\n this.summaryHeroes.length;\n if (hasHeroes) {\n return this.summaryHeroes[0];\n }\n const members = this.currentState.getMembers();\n const anyMember = members.find((m) => m.userId !== this.myUserId);\n if (anyMember) {\n return anyMember.userId;\n }\n // it really seems like I'm the only user in the room\n // so I probably created a room with just me in it\n // and marked it as a DM. Ok then\n return this.myUserId;\n }\n\n public getAvatarFallbackMember(): RoomMember {\n const memberCount = this.getInvitedAndJoinedMemberCount();\n if (memberCount > 2) {\n return;\n }\n const hasHeroes = Array.isArray(this.summaryHeroes) &&\n this.summaryHeroes.length;\n if (hasHeroes) {\n const availableMember = this.summaryHeroes.map((userId) => {\n return this.getMember(userId);\n }).find((member) => !!member);\n if (availableMember) {\n return availableMember;\n }\n }\n const members = this.currentState.getMembers();\n // could be different than memberCount\n // as this includes left members\n if (members.length <= 2) {\n const availableMember = members.find((m) => {\n return m.userId !== this.myUserId;\n });\n if (availableMember) {\n return availableMember;\n }\n }\n // if all else fails, try falling back to a user,\n // and create a one-off member for it\n if (hasHeroes) {\n const availableUser = this.summaryHeroes.map((userId) => {\n return this.client.getUser(userId);\n }).find((user) => !!user);\n if (availableUser) {\n const member = new RoomMember(\n this.roomId, availableUser.userId);\n member.user = availableUser;\n return member;\n }\n }\n }\n\n /**\n * Sets the membership this room was received as during sync\n * @param {string} membership join | leave | invite\n */\n public updateMyMembership(membership: string): void {\n const prevMembership = this.selfMembership;\n this.selfMembership = membership;\n if (prevMembership !== membership) {\n if (membership === \"leave\") {\n this.cleanupAfterLeaving();\n }\n this.emit(\"Room.myMembership\", this, membership, prevMembership);\n }\n }\n\n private async loadMembersFromServer(): Promise {\n const lastSyncToken = this.client.store.getSyncToken();\n const queryString = utils.encodeParams({\n not_membership: \"leave\",\n at: lastSyncToken,\n });\n const path = utils.encodeUri(\"/rooms/$roomId/members?\" + queryString,\n { $roomId: this.roomId });\n const http = this.client.http;\n const response = await http.authedRequest(undefined, \"GET\", path);\n return response.chunk;\n }\n\n private async loadMembers(): Promise<{ memberEvents: MatrixEvent[], fromServer: boolean }> {\n // were the members loaded from the server?\n let fromServer = false;\n let rawMembersEvents = await this.client.store.getOutOfBandMembers(this.roomId);\n if (rawMembersEvents === null) {\n fromServer = true;\n rawMembersEvents = await this.loadMembersFromServer();\n logger.log(`LL: got ${rawMembersEvents.length} ` +\n `members from server for room ${this.roomId}`);\n }\n const memberEvents = rawMembersEvents.map(this.client.getEventMapper());\n return { memberEvents, fromServer };\n }\n\n /**\n * Preloads the member list in case lazy loading\n * of memberships is in use. Can be called multiple times,\n * it will only preload once.\n * @return {Promise} when preloading is done and\n * accessing the members on the room will take\n * all members in the room into account\n */\n public loadMembersIfNeeded(): Promise {\n if (this.membersPromise) {\n return this.membersPromise;\n }\n\n // mark the state so that incoming messages while\n // the request is in flight get marked as superseding\n // the OOB members\n this.currentState.markOutOfBandMembersStarted();\n\n const inMemoryUpdate = this.loadMembers().then((result) => {\n this.currentState.setOutOfBandMembers(result.memberEvents);\n // now the members are loaded, start to track the e2e devices if needed\n if (this.client.isCryptoEnabled() && this.client.isRoomEncrypted(this.roomId)) {\n this.client.crypto.trackRoomDevices(this.roomId);\n }\n return result.fromServer;\n }).catch((err) => {\n // allow retries on fail\n this.membersPromise = null;\n this.currentState.markOutOfBandMembersFailed();\n throw err;\n });\n // update members in storage, but don't wait for it\n inMemoryUpdate.then((fromServer) => {\n if (fromServer) {\n const oobMembers = this.currentState.getMembers()\n .filter((m) => m.isOutOfBand())\n .map((m) => m.events.member.event as IEvent);\n logger.log(`LL: telling store to write ${oobMembers.length}`\n + ` members for room ${this.roomId}`);\n const store = this.client.store;\n return store.setOutOfBandMembers(this.roomId, oobMembers)\n // swallow any IDB error as we don't want to fail\n // because of this\n .catch((err) => {\n logger.log(\"LL: storing OOB room members failed, oh well\",\n err);\n });\n }\n }).catch((err) => {\n // as this is not awaited anywhere,\n // at least show the error in the console\n logger.error(err);\n });\n\n this.membersPromise = inMemoryUpdate;\n\n return this.membersPromise;\n }\n\n /**\n * Removes the lazily loaded members from storage if needed\n */\n public async clearLoadedMembersIfNeeded(): Promise {\n if (this.opts.lazyLoadMembers && this.membersPromise) {\n await this.loadMembersIfNeeded();\n await this.client.store.clearOutOfBandMembers(this.roomId);\n this.currentState.clearOutOfBandMembers();\n this.membersPromise = null;\n }\n }\n\n /**\n * called when sync receives this room in the leave section\n * to do cleanup after leaving a room. Possibly called multiple times.\n */\n private cleanupAfterLeaving(): void {\n this.clearLoadedMembersIfNeeded().catch((err) => {\n logger.error(`error after clearing loaded members from ` +\n `room ${this.roomId} after leaving`);\n logger.log(err);\n });\n }\n\n /**\n * Reset the live timeline of all timelineSets, and start new ones.\n *\n *

This is used when /sync returns a 'limited' timeline.\n *\n * @param {string=} backPaginationToken token for back-paginating the new timeline\n * @param {string=} forwardPaginationToken token for forward-paginating the old live timeline,\n * if absent or null, all timelines are reset, removing old ones (including the previous live\n * timeline which would otherwise be unable to paginate forwards without this token).\n * Removing just the old live timeline whilst preserving previous ones is not supported.\n */\n public resetLiveTimeline(backPaginationToken: string, forwardPaginationToken: string): void {\n for (let i = 0; i < this.timelineSets.length; i++) {\n this.timelineSets[i].resetLiveTimeline(\n backPaginationToken, forwardPaginationToken,\n );\n }\n\n this.fixUpLegacyTimelineFields();\n }\n\n /**\n * Fix up this.timeline, this.oldState and this.currentState\n *\n * @private\n */\n private fixUpLegacyTimelineFields(): void {\n // maintain this.timeline as a reference to the live timeline,\n // and this.oldState and this.currentState as references to the\n // state at the start and end of that timeline. These are more\n // for backwards-compatibility than anything else.\n this.timeline = this.getLiveTimeline().getEvents();\n this.oldState = this.getLiveTimeline()\n .getState(EventTimeline.BACKWARDS);\n this.currentState = this.getLiveTimeline()\n .getState(EventTimeline.FORWARDS);\n }\n\n /**\n * Returns whether there are any devices in the room that are unverified\n *\n * Note: Callers should first check if crypto is enabled on this device. If it is\n * disabled, then we aren't tracking room devices at all, so we can't answer this, and an\n * error will be thrown.\n *\n * @return {boolean} the result\n */\n public async hasUnverifiedDevices(): Promise {\n if (!this.client.isRoomEncrypted(this.roomId)) {\n return false;\n }\n const e2eMembers = await this.getEncryptionTargetMembers();\n for (const member of e2eMembers) {\n const devices = this.client.getStoredDevicesForUser(member.userId);\n if (devices.some((device) => device.isUnverified())) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * Return the timeline sets for this room.\n * @return {EventTimelineSet[]} array of timeline sets for this room\n */\n public getTimelineSets(): EventTimelineSet[] {\n return this.timelineSets;\n }\n\n /**\n * Helper to return the main unfiltered timeline set for this room\n * @return {EventTimelineSet} room's unfiltered timeline set\n */\n public getUnfilteredTimelineSet(): EventTimelineSet {\n return this.timelineSets[0];\n }\n\n /**\n * Get the timeline which contains the given event from the unfiltered set, if any\n *\n * @param {string} eventId event ID to look for\n * @return {?module:models/event-timeline~EventTimeline} timeline containing\n * the given event, or null if unknown\n */\n public getTimelineForEvent(eventId: string): EventTimeline {\n return this.getUnfilteredTimelineSet().getTimelineForEvent(eventId);\n }\n\n /**\n * Add a new timeline to this room's unfiltered timeline set\n *\n * @return {module:models/event-timeline~EventTimeline} newly-created timeline\n */\n public addTimeline(): EventTimeline {\n return this.getUnfilteredTimelineSet().addTimeline();\n }\n\n /**\n * Get an event which is stored in our unfiltered timeline set\n *\n * @param {string} eventId event ID to look for\n * @return {?module:models/event.MatrixEvent} the given event, or undefined if unknown\n */\n public findEventById(eventId: string): MatrixEvent | undefined {\n return this.getUnfilteredTimelineSet().findEventById(eventId);\n }\n\n /**\n * Get one of the notification counts for this room\n * @param {String} type The type of notification count to get. default: 'total'\n * @return {Number} The notification count, or undefined if there is no count\n * for this type.\n */\n public getUnreadNotificationCount(type = NotificationCountType.Total): number | undefined {\n return this.notificationCounts[type];\n }\n\n /**\n * Set one of the notification counts for this room\n * @param {String} type The type of notification count to set.\n * @param {Number} count The new count\n */\n public setUnreadNotificationCount(type: NotificationCountType, count: number): void {\n this.notificationCounts[type] = count;\n }\n\n public setSummary(summary: IRoomSummary): void {\n const heroes = summary[\"m.heroes\"];\n const joinedCount = summary[\"m.joined_member_count\"];\n const invitedCount = summary[\"m.invited_member_count\"];\n if (Number.isInteger(joinedCount)) {\n this.currentState.setJoinedMemberCount(joinedCount);\n }\n if (Number.isInteger(invitedCount)) {\n this.currentState.setInvitedMemberCount(invitedCount);\n }\n if (Array.isArray(heroes)) {\n // be cautious about trusting server values,\n // and make sure heroes doesn't contain our own id\n // just to be sure\n this.summaryHeroes = heroes.filter((userId) => {\n return userId !== this.myUserId;\n });\n }\n }\n\n /**\n * Whether to send encrypted messages to devices within this room.\n * @param {Boolean} value true to blacklist unverified devices, null\n * to use the global value for this room.\n */\n public setBlacklistUnverifiedDevices(value: boolean): void {\n this.blacklistUnverifiedDevices = value;\n }\n\n /**\n * Whether to send encrypted messages to devices within this room.\n * @return {Boolean} true if blacklisting unverified devices, null\n * if the global value should be used for this room.\n */\n public getBlacklistUnverifiedDevices(): boolean {\n return this.blacklistUnverifiedDevices;\n }\n\n /**\n * Get the avatar URL for a room if one was set.\n * @param {String} baseUrl The homeserver base URL. See\n * {@link module:client~MatrixClient#getHomeserverUrl}.\n * @param {Number} width The desired width of the thumbnail.\n * @param {Number} height The desired height of the thumbnail.\n * @param {string} resizeMethod The thumbnail resize method to use, either\n * \"crop\" or \"scale\".\n * @param {boolean} allowDefault True to allow an identicon for this room if an\n * avatar URL wasn't explicitly set. Default: true. (Deprecated)\n * @return {?string} the avatar URL or null.\n */\n public getAvatarUrl(\n baseUrl: string,\n width: number,\n height: number,\n resizeMethod: ResizeMethod,\n allowDefault = true,\n ): string | null {\n const roomAvatarEvent = this.currentState.getStateEvents(EventType.RoomAvatar, \"\");\n if (!roomAvatarEvent && !allowDefault) {\n return null;\n }\n\n const mainUrl = roomAvatarEvent ? roomAvatarEvent.getContent().url : null;\n if (mainUrl) {\n return getHttpUriForMxc(baseUrl, mainUrl, width, height, resizeMethod);\n }\n\n return null;\n }\n\n /**\n * Get the mxc avatar url for the room, if one was set.\n * @return {string} the mxc avatar url or falsy\n */\n public getMxcAvatarUrl(): string | null {\n return this.currentState.getStateEvents(EventType.RoomAvatar, \"\")?.getContent()?.url || null;\n }\n\n /**\n * Get the aliases this room has according to the room's state\n * The aliases returned by this function may not necessarily\n * still point to this room.\n * @return {array} The room's alias as an array of strings\n */\n public getAliases(): string[] {\n const aliasStrings = [];\n\n const aliasEvents = this.currentState.getStateEvents(EventType.RoomAliases);\n if (aliasEvents) {\n for (let i = 0; i < aliasEvents.length; ++i) {\n const aliasEvent = aliasEvents[i];\n if (Array.isArray(aliasEvent.getContent().aliases)) {\n const filteredAliases = aliasEvent.getContent().aliases.filter(a => {\n if (typeof(a) !== \"string\") return false;\n if (a[0] !== '#') return false;\n if (!a.endsWith(`:${aliasEvent.getStateKey()}`)) return false;\n\n // It's probably valid by here.\n return true;\n });\n Array.prototype.push.apply(aliasStrings, filteredAliases);\n }\n }\n }\n return aliasStrings;\n }\n\n /**\n * Get this room's canonical alias\n * The alias returned by this function may not necessarily\n * still point to this room.\n * @return {?string} The room's canonical alias, or null if there is none\n */\n public getCanonicalAlias(): string | null {\n const canonicalAlias = this.currentState.getStateEvents(EventType.RoomCanonicalAlias, \"\");\n if (canonicalAlias) {\n return canonicalAlias.getContent().alias || null;\n }\n return null;\n }\n\n /**\n * Get this room's alternative aliases\n * @return {array} The room's alternative aliases, or an empty array\n */\n public getAltAliases(): string[] {\n const canonicalAlias = this.currentState.getStateEvents(EventType.RoomCanonicalAlias, \"\");\n if (canonicalAlias) {\n return canonicalAlias.getContent().alt_aliases || [];\n }\n return [];\n }\n\n /**\n * Add events to a timeline\n *\n *

Will fire \"Room.timeline\" for each event added.\n *\n * @param {MatrixEvent[]} events A list of events to add.\n *\n * @param {boolean} toStartOfTimeline True to add these events to the start\n * (oldest) instead of the end (newest) of the timeline. If true, the oldest\n * event will be the last element of 'events'.\n *\n * @param {module:models/event-timeline~EventTimeline} timeline timeline to\n * add events to.\n *\n * @param {string=} paginationToken token for the next batch of events\n *\n * @fires module:client~MatrixClient#event:\"Room.timeline\"\n *\n */\n public addEventsToTimeline(\n events: MatrixEvent[],\n toStartOfTimeline: boolean,\n timeline: EventTimeline,\n paginationToken?: string,\n ): void {\n timeline.getTimelineSet().addEventsToTimeline(\n events, toStartOfTimeline,\n timeline, paginationToken,\n );\n }\n\n /**\n * Get a member from the current room state.\n * @param {string} userId The user ID of the member.\n * @return {RoomMember} The member or null.\n */\n public getMember(userId: string): RoomMember | null {\n return this.currentState.getMember(userId);\n }\n\n /**\n * Get all currently loaded members from the current\n * room state.\n * @returns {RoomMember[]} Room members\n */\n public getMembers(): RoomMember[] {\n return this.currentState.getMembers();\n }\n\n /**\n * Get a list of members whose membership state is \"join\".\n * @return {RoomMember[]} A list of currently joined members.\n */\n public getJoinedMembers(): RoomMember[] {\n return this.getMembersWithMembership(\"join\");\n }\n\n /**\n * Returns the number of joined members in this room\n * This method caches the result.\n * This is a wrapper around the method of the same name in roomState, returning\n * its result for the room's current state.\n * @return {number} The number of members in this room whose membership is 'join'\n */\n public getJoinedMemberCount(): number {\n return this.currentState.getJoinedMemberCount();\n }\n\n /**\n * Returns the number of invited members in this room\n * @return {number} The number of members in this room whose membership is 'invite'\n */\n public getInvitedMemberCount(): number {\n return this.currentState.getInvitedMemberCount();\n }\n\n /**\n * Returns the number of invited + joined members in this room\n * @return {number} The number of members in this room whose membership is 'invite' or 'join'\n */\n public getInvitedAndJoinedMemberCount(): number {\n return this.getInvitedMemberCount() + this.getJoinedMemberCount();\n }\n\n /**\n * Get a list of members with given membership state.\n * @param {string} membership The membership state.\n * @return {RoomMember[]} A list of members with the given membership state.\n */\n public getMembersWithMembership(membership: string): RoomMember[] {\n return this.currentState.getMembers().filter(function(m) {\n return m.membership === membership;\n });\n }\n\n /**\n * Get a list of members we should be encrypting for in this room\n * @return {Promise} A list of members who\n * we should encrypt messages for in this room.\n */\n public async getEncryptionTargetMembers(): Promise {\n await this.loadMembersIfNeeded();\n let members = this.getMembersWithMembership(\"join\");\n if (this.shouldEncryptForInvitedMembers()) {\n members = members.concat(this.getMembersWithMembership(\"invite\"));\n }\n return members;\n }\n\n /**\n * Determine whether we should encrypt messages for invited users in this room\n * @return {boolean} if we should encrypt messages for invited users\n */\n public shouldEncryptForInvitedMembers(): boolean {\n const ev = this.currentState.getStateEvents(EventType.RoomHistoryVisibility, \"\");\n return ev?.getContent()?.history_visibility !== \"joined\";\n }\n\n /**\n * Get the default room name (i.e. what a given user would see if the\n * room had no m.room.name)\n * @param {string} userId The userId from whose perspective we want\n * to calculate the default name\n * @return {string} The default room name\n */\n public getDefaultRoomName(userId: string): string {\n return this.calculateRoomName(userId, true);\n }\n\n /**\n * Check if the given user_id has the given membership state.\n * @param {string} userId The user ID to check.\n * @param {string} membership The membership e.g. 'join'\n * @return {boolean} True if this user_id has the given membership state.\n */\n public hasMembershipState(userId: string, membership: string): boolean {\n const member = this.getMember(userId);\n if (!member) {\n return false;\n }\n return member.membership === membership;\n }\n\n /**\n * Add a timelineSet for this room with the given filter\n * @param {Filter} filter The filter to be applied to this timelineSet\n * @return {EventTimelineSet} The timelineSet\n */\n public getOrCreateFilteredTimelineSet(filter: Filter): EventTimelineSet {\n if (this.filteredTimelineSets[filter.filterId]) {\n return this.filteredTimelineSets[filter.filterId];\n }\n const opts = Object.assign({ filter: filter }, this.opts);\n const timelineSet = new EventTimelineSet(this, opts);\n this.reEmitter.reEmit(timelineSet, [\"Room.timeline\", \"Room.timelineReset\"]);\n this.filteredTimelineSets[filter.filterId] = timelineSet;\n this.timelineSets.push(timelineSet);\n\n // populate up the new timelineSet with filtered events from our live\n // unfiltered timeline.\n //\n // XXX: This is risky as our timeline\n // may have grown huge and so take a long time to filter.\n // see https://github.com/vector-im/vector-web/issues/2109\n\n const unfilteredLiveTimeline = this.getLiveTimeline();\n\n unfilteredLiveTimeline.getEvents().forEach(function(event) {\n timelineSet.addLiveEvent(event);\n });\n\n // find the earliest unfiltered timeline\n let timeline = unfilteredLiveTimeline;\n while (timeline.getNeighbouringTimeline(EventTimeline.BACKWARDS)) {\n timeline = timeline.getNeighbouringTimeline(EventTimeline.BACKWARDS);\n }\n\n timelineSet.getLiveTimeline().setPaginationToken(\n timeline.getPaginationToken(EventTimeline.BACKWARDS),\n EventTimeline.BACKWARDS,\n );\n\n // alternatively, we could try to do something like this to try and re-paginate\n // in the filtered events from nothing, but Mark says it's an abuse of the API\n // to do so:\n //\n // timelineSet.resetLiveTimeline(\n // unfilteredLiveTimeline.getPaginationToken(EventTimeline.FORWARDS)\n // );\n\n return timelineSet;\n }\n\n /**\n * Forget the timelineSet for this room with the given filter\n *\n * @param {Filter} filter the filter whose timelineSet is to be forgotten\n */\n public removeFilteredTimelineSet(filter: Filter): void {\n const timelineSet = this.filteredTimelineSets[filter.filterId];\n delete this.filteredTimelineSets[filter.filterId];\n const i = this.timelineSets.indexOf(timelineSet);\n if (i > -1) {\n this.timelineSets.splice(i, 1);\n }\n }\n\n /**\n * Add an event to the end of this room's live timelines. Will fire\n * \"Room.timeline\".\n *\n * @param {MatrixEvent} event Event to be added\n * @param {string?} duplicateStrategy 'ignore' or 'replace'\n * @param {boolean} fromCache whether the sync response came from cache\n * @fires module:client~MatrixClient#event:\"Room.timeline\"\n * @private\n */\n private addLiveEvent(event: MatrixEvent, duplicateStrategy?: \"ignore\" | \"replace\", fromCache = false): void {\n if (event.isRedaction()) {\n const redactId = event.event.redacts;\n\n // if we know about this event, redact its contents now.\n const redactedEvent = this.getUnfilteredTimelineSet().findEventById(redactId);\n if (redactedEvent) {\n redactedEvent.makeRedacted(event);\n\n // If this is in the current state, replace it with the redacted version\n if (redactedEvent.getStateKey()) {\n const currentStateEvent = this.currentState.getStateEvents(\n redactedEvent.getType(),\n redactedEvent.getStateKey(),\n );\n if (currentStateEvent.getId() === redactedEvent.getId()) {\n this.currentState.setStateEvents([redactedEvent]);\n }\n }\n\n this.emit(\"Room.redaction\", event, this);\n\n // TODO: we stash user displaynames (among other things) in\n // RoomMember objects which are then attached to other events\n // (in the sender and target fields). We should get those\n // RoomMember objects to update themselves when the events that\n // they are based on are changed.\n }\n\n // FIXME: apply redactions to notification list\n\n // NB: We continue to add the redaction event to the timeline so\n // clients can say \"so and so redacted an event\" if they wish to. Also\n // this may be needed to trigger an update.\n }\n\n if (event.getUnsigned().transaction_id) {\n const existingEvent = this.txnToEvent[event.getUnsigned().transaction_id];\n if (existingEvent) {\n // remote echo of an event we sent earlier\n this.handleRemoteEcho(event, existingEvent);\n return;\n }\n }\n\n // add to our timeline sets\n for (let i = 0; i < this.timelineSets.length; i++) {\n this.timelineSets[i].addLiveEvent(event, duplicateStrategy, fromCache);\n }\n\n // synthesize and inject implicit read receipts\n // Done after adding the event because otherwise the app would get a read receipt\n // pointing to an event that wasn't yet in the timeline\n // Don't synthesize RR for m.room.redaction as this causes the RR to go missing.\n if (event.sender && event.getType() !== EventType.RoomRedaction) {\n this.addReceipt(synthesizeReceipt(\n event.sender.userId, event, \"m.read\",\n ), true);\n\n // Any live events from a user could be taken as implicit\n // presence information: evidence that they are currently active.\n // ...except in a world where we use 'user.currentlyActive' to reduce\n // presence spam, this isn't very useful - we'll get a transition when\n // they are no longer currently active anyway. So don't bother to\n // reset the lastActiveAgo and lastPresenceTs from the RoomState's user.\n }\n }\n\n /**\n * Add a pending outgoing event to this room.\n *\n *

The event is added to either the pendingEventList, or the live timeline,\n * depending on the setting of opts.pendingEventOrdering.\n *\n *

This is an internal method, intended for use by MatrixClient.\n *\n * @param {module:models/event.MatrixEvent} event The event to add.\n *\n * @param {string} txnId Transaction id for this outgoing event\n *\n * @fires module:client~MatrixClient#event:\"Room.localEchoUpdated\"\n *\n * @throws if the event doesn't have status SENDING, or we aren't given a\n * unique transaction id.\n */\n public addPendingEvent(event: MatrixEvent, txnId: string): void {\n if (event.status !== EventStatus.SENDING && event.status !== EventStatus.NOT_SENT) {\n throw new Error(\"addPendingEvent called on an event with status \" +\n event.status);\n }\n\n if (this.txnToEvent[txnId]) {\n throw new Error(\"addPendingEvent called on an event with known txnId \" +\n txnId);\n }\n\n // call setEventMetadata to set up event.sender etc\n // as event is shared over all timelineSets, we set up its metadata based\n // on the unfiltered timelineSet.\n EventTimeline.setEventMetadata(event, this.getLiveTimeline().getState(EventTimeline.FORWARDS), false);\n\n this.txnToEvent[txnId] = event;\n\n if (this.opts.pendingEventOrdering == \"detached\") {\n if (this.pendingEventList.some((e) => e.status === EventStatus.NOT_SENT)) {\n logger.warn(\"Setting event as NOT_SENT due to messages in the same state\");\n event.setStatus(EventStatus.NOT_SENT);\n }\n this.pendingEventList.push(event);\n this.savePendingEvents();\n if (event.isRelation()) {\n // For pending events, add them to the relations collection immediately.\n // (The alternate case below already covers this as part of adding to\n // the timeline set.)\n this.aggregateNonLiveRelation(event);\n }\n\n if (event.isRedaction()) {\n const redactId = event.event.redacts;\n let redactedEvent = this.pendingEventList &&\n this.pendingEventList.find(e => e.getId() === redactId);\n if (!redactedEvent) {\n redactedEvent = this.getUnfilteredTimelineSet().findEventById(redactId);\n }\n if (redactedEvent) {\n redactedEvent.markLocallyRedacted(event);\n this.emit(\"Room.redaction\", event, this);\n }\n }\n } else {\n for (let i = 0; i < this.timelineSets.length; i++) {\n const timelineSet = this.timelineSets[i];\n if (timelineSet.getFilter()) {\n if (timelineSet.getFilter().filterRoomTimeline([event]).length) {\n timelineSet.addEventToTimeline(event,\n timelineSet.getLiveTimeline(), false);\n }\n } else {\n timelineSet.addEventToTimeline(event,\n timelineSet.getLiveTimeline(), false);\n }\n }\n }\n\n this.emit(\"Room.localEchoUpdated\", event, this, null, null);\n }\n\n /**\n * Persists all pending events to local storage\n *\n * If the current room is encrypted only encrypted events will be persisted\n * all messages that are not yet encrypted will be discarded\n *\n * This is because the flow of EVENT_STATUS transition is\n * queued => sending => encrypting => sending => sent\n *\n * Steps 3 and 4 are skipped for unencrypted room.\n * It is better to discard an unencrypted message rather than persisting\n * it locally for everyone to read\n */\n private savePendingEvents(): void {\n if (this.pendingEventList) {\n const pendingEvents = this.pendingEventList.map(event => {\n return {\n ...event.event,\n txn_id: event.getTxnId(),\n };\n }).filter(event => {\n // Filter out the unencrypted messages if the room is encrypted\n const isEventEncrypted = event.type === EventType.RoomMessageEncrypted;\n const isRoomEncrypted = this.client.isRoomEncrypted(this.roomId);\n return isEventEncrypted || !isRoomEncrypted;\n });\n\n const { store } = this.client.sessionStore;\n if (this.pendingEventList.length > 0) {\n store.setItem(\n pendingEventsKey(this.roomId),\n JSON.stringify(pendingEvents),\n );\n } else {\n store.removeItem(pendingEventsKey(this.roomId));\n }\n }\n }\n\n /**\n * Used to aggregate the local echo for a relation, and also\n * for re-applying a relation after it's redaction has been cancelled,\n * as the local echo for the redaction of the relation would have\n * un-aggregated the relation. Note that this is different from regular messages,\n * which are just kept detached for their local echo.\n *\n * Also note that live events are aggregated in the live EventTimelineSet.\n * @param {module:models/event.MatrixEvent} event the relation event that needs to be aggregated.\n */\n private aggregateNonLiveRelation(event: MatrixEvent): void {\n // TODO: We should consider whether this means it would be a better\n // design to lift the relations handling up to the room instead.\n for (let i = 0; i < this.timelineSets.length; i++) {\n const timelineSet = this.timelineSets[i];\n if (timelineSet.getFilter()) {\n if (timelineSet.getFilter().filterRoomTimeline([event]).length) {\n timelineSet.aggregateRelations(event);\n }\n } else {\n timelineSet.aggregateRelations(event);\n }\n }\n }\n\n /**\n * Deal with the echo of a message we sent.\n *\n *

We move the event to the live timeline if it isn't there already, and\n * update it.\n *\n * @param {module:models/event.MatrixEvent} remoteEvent The event received from\n * /sync\n * @param {module:models/event.MatrixEvent} localEvent The local echo, which\n * should be either in the pendingEventList or the timeline.\n *\n * @fires module:client~MatrixClient#event:\"Room.localEchoUpdated\"\n * @private\n */\n private handleRemoteEcho(remoteEvent: MatrixEvent, localEvent: MatrixEvent): void {\n const oldEventId = localEvent.getId();\n const newEventId = remoteEvent.getId();\n const oldStatus = localEvent.status;\n\n logger.debug(\n `Got remote echo for event ${oldEventId} -> ${newEventId} ` +\n `old status ${oldStatus}`,\n );\n\n // no longer pending\n delete this.txnToEvent[remoteEvent.getUnsigned().transaction_id];\n\n // if it's in the pending list, remove it\n if (this.pendingEventList) {\n this.removePendingEvent(oldEventId);\n }\n\n // replace the event source (this will preserve the plaintext payload if\n // any, which is good, because we don't want to try decoding it again).\n localEvent.handleRemoteEcho(remoteEvent.event);\n\n for (let i = 0; i < this.timelineSets.length; i++) {\n const timelineSet = this.timelineSets[i];\n\n // if it's already in the timeline, update the timeline map. If it's not, add it.\n timelineSet.handleRemoteEcho(localEvent, oldEventId, newEventId);\n }\n\n this.emit(\"Room.localEchoUpdated\", localEvent, this,\n oldEventId, oldStatus);\n }\n\n /**\n * Update the status / event id on a pending event, to reflect its transmission\n * progress.\n *\n *

This is an internal method.\n *\n * @param {MatrixEvent} event local echo event\n * @param {EventStatus} newStatus status to assign\n * @param {string} newEventId new event id to assign. Ignored unless\n * newStatus == EventStatus.SENT.\n * @fires module:client~MatrixClient#event:\"Room.localEchoUpdated\"\n */\n public updatePendingEvent(event: MatrixEvent, newStatus: EventStatus, newEventId?: string): void {\n logger.log(\n `setting pendingEvent status to ${newStatus} in ${event.getRoomId()} ` +\n `event ID ${event.getId()} -> ${newEventId}`,\n );\n\n // if the message was sent, we expect an event id\n if (newStatus == EventStatus.SENT && !newEventId) {\n throw new Error(\"updatePendingEvent called with status=SENT, \" +\n \"but no new event id\");\n }\n\n // SENT races against /sync, so we have to special-case it.\n if (newStatus == EventStatus.SENT) {\n const timeline = this.getUnfilteredTimelineSet().eventIdToTimeline(newEventId);\n if (timeline) {\n // we've already received the event via the event stream.\n // nothing more to do here.\n return;\n }\n }\n\n const oldStatus = event.status;\n const oldEventId = event.getId();\n\n if (!oldStatus) {\n throw new Error(\"updatePendingEventStatus called on an event which is \" +\n \"not a local echo.\");\n }\n\n const allowed = ALLOWED_TRANSITIONS[oldStatus];\n if (!allowed || allowed.indexOf(newStatus) < 0) {\n throw new Error(\"Invalid EventStatus transition \" + oldStatus + \"->\" +\n newStatus);\n }\n\n event.setStatus(newStatus);\n\n if (newStatus == EventStatus.SENT) {\n // update the event id\n event.replaceLocalEventId(newEventId);\n\n // if the event was already in the timeline (which will be the case if\n // opts.pendingEventOrdering==chronological), we need to update the\n // timeline map.\n for (let i = 0; i < this.timelineSets.length; i++) {\n this.timelineSets[i].replaceEventId(oldEventId, newEventId);\n }\n } else if (newStatus == EventStatus.CANCELLED) {\n // remove it from the pending event list, or the timeline.\n if (this.pendingEventList) {\n const idx = this.pendingEventList.findIndex(ev => ev.getId() === oldEventId);\n if (idx !== -1) {\n const [removedEvent] = this.pendingEventList.splice(idx, 1);\n if (removedEvent.isRedaction()) {\n this.revertRedactionLocalEcho(removedEvent);\n }\n }\n }\n this.removeEvent(oldEventId);\n }\n this.savePendingEvents();\n\n this.emit(\"Room.localEchoUpdated\", event, this, oldEventId, oldStatus);\n }\n\n private revertRedactionLocalEcho(redactionEvent: MatrixEvent): void {\n const redactId = redactionEvent.event.redacts;\n if (!redactId) {\n return;\n }\n const redactedEvent = this.getUnfilteredTimelineSet()\n .findEventById(redactId);\n if (redactedEvent) {\n redactedEvent.unmarkLocallyRedacted();\n // re-render after undoing redaction\n this.emit(\"Room.redactionCancelled\", redactionEvent, this);\n // reapply relation now redaction failed\n if (redactedEvent.isRelation()) {\n this.aggregateNonLiveRelation(redactedEvent);\n }\n }\n }\n\n /**\n * Add some events to this room. This can include state events, message\n * events and typing notifications. These events are treated as \"live\" so\n * they will go to the end of the timeline.\n *\n * @param {MatrixEvent[]} events A list of events to add.\n *\n * @param {string} duplicateStrategy Optional. Applies to events in the\n * timeline only. If this is 'replace' then if a duplicate is encountered, the\n * event passed to this function will replace the existing event in the\n * timeline. If this is not specified, or is 'ignore', then the event passed to\n * this function will be ignored entirely, preserving the existing event in the\n * timeline. Events are identical based on their event ID only.\n *\n * @param {boolean} fromCache whether the sync response came from cache\n * @throws If duplicateStrategy is not falsey, 'replace' or 'ignore'.\n */\n public addLiveEvents(events: MatrixEvent[], duplicateStrategy?: \"replace\" | \"ignore\", fromCache = false): void {\n let i;\n if (duplicateStrategy && [\"replace\", \"ignore\"].indexOf(duplicateStrategy) === -1) {\n throw new Error(\"duplicateStrategy MUST be either 'replace' or 'ignore'\");\n }\n\n // sanity check that the live timeline is still live\n for (i = 0; i < this.timelineSets.length; i++) {\n const liveTimeline = this.timelineSets[i].getLiveTimeline();\n if (liveTimeline.getPaginationToken(EventTimeline.FORWARDS)) {\n throw new Error(\n \"live timeline \" + i + \" is no longer live - it has a pagination token \" +\n \"(\" + liveTimeline.getPaginationToken(EventTimeline.FORWARDS) + \")\",\n );\n }\n if (liveTimeline.getNeighbouringTimeline(EventTimeline.FORWARDS)) {\n throw new Error(\n \"live timeline \" + i + \" is no longer live - \" +\n \"it has a neighbouring timeline\",\n );\n }\n }\n\n for (i = 0; i < events.length; i++) {\n // TODO: We should have a filter to say \"only add state event\n // types X Y Z to the timeline\".\n this.addLiveEvent(events[i], duplicateStrategy, fromCache);\n }\n }\n\n /**\n * Adds/handles ephemeral events such as typing notifications and read receipts.\n * @param {MatrixEvent[]} events A list of events to process\n */\n public addEphemeralEvents(events: MatrixEvent[]): void {\n for (const event of events) {\n if (event.getType() === 'm.typing') {\n this.currentState.setTypingEvent(event);\n } else if (event.getType() === 'm.receipt') {\n this.addReceipt(event);\n } // else ignore - life is too short for us to care about these events\n }\n }\n\n /**\n * Removes events from this room.\n * @param {String[]} eventIds A list of eventIds to remove.\n */\n public removeEvents(eventIds: string[]): void {\n for (let i = 0; i < eventIds.length; ++i) {\n this.removeEvent(eventIds[i]);\n }\n }\n\n /**\n * Removes a single event from this room.\n *\n * @param {String} eventId The id of the event to remove\n *\n * @return {boolean} true if the event was removed from any of the room's timeline sets\n */\n public removeEvent(eventId: string): boolean {\n let removedAny = false;\n for (let i = 0; i < this.timelineSets.length; i++) {\n const removed = this.timelineSets[i].removeEvent(eventId);\n if (removed) {\n if (removed.isRedaction()) {\n this.revertRedactionLocalEcho(removed);\n }\n removedAny = true;\n }\n }\n return removedAny;\n }\n\n /**\n * Recalculate various aspects of the room, including the room name and\n * room summary. Call this any time the room's current state is modified.\n * May fire \"Room.name\" if the room name is updated.\n * @fires module:client~MatrixClient#event:\"Room.name\"\n */\n public recalculate(): void {\n // set fake stripped state events if this is an invite room so logic remains\n // consistent elsewhere.\n const membershipEvent = this.currentState.getStateEvents(EventType.RoomMember, this.myUserId);\n if (membershipEvent && membershipEvent.getContent().membership === \"invite\") {\n const strippedStateEvents = membershipEvent.getUnsigned().invite_room_state || [];\n strippedStateEvents.forEach((strippedEvent) => {\n const existingEvent = this.currentState.getStateEvents(strippedEvent.type, strippedEvent.state_key);\n if (!existingEvent) {\n // set the fake stripped event instead\n this.currentState.setStateEvents([new MatrixEvent({\n type: strippedEvent.type,\n state_key: strippedEvent.state_key,\n content: strippedEvent.content,\n event_id: \"$fake\" + Date.now(),\n room_id: this.roomId,\n user_id: this.myUserId, // technically a lie\n })]);\n }\n });\n }\n\n const oldName = this.name;\n this.name = this.calculateRoomName(this.myUserId);\n this.normalizedName = normalize(this.name);\n this.summary = new RoomSummary(this.roomId, {\n title: this.name,\n });\n\n if (oldName !== this.name) {\n this.emit(\"Room.name\", this);\n }\n }\n\n /**\n * Get a list of user IDs who have read up to the given event.\n * @param {MatrixEvent} event the event to get read receipts for.\n * @return {String[]} A list of user IDs.\n */\n public getUsersReadUpTo(event: MatrixEvent): string[] {\n return this.getReceiptsForEvent(event).filter(function(receipt) {\n return receipt.type === \"m.read\";\n }).map(function(receipt) {\n return receipt.userId;\n });\n }\n\n /**\n * Get the ID of the event that a given user has read up to, or null if we\n * have received no read receipts from them.\n * @param {String} userId The user ID to get read receipt event ID for\n * @param {Boolean} ignoreSynthesized If true, return only receipts that have been\n * sent by the server, not implicit ones generated\n * by the JS SDK.\n * @return {String} ID of the latest event that the given user has read, or null.\n */\n public getEventReadUpTo(userId: string, ignoreSynthesized = false): string | null {\n let receipts = this.receipts;\n if (ignoreSynthesized) {\n receipts = this.realReceipts;\n }\n\n if (\n receipts[\"m.read\"] === undefined ||\n receipts[\"m.read\"][userId] === undefined\n ) {\n return null;\n }\n\n return receipts[\"m.read\"][userId].eventId;\n }\n\n /**\n * Determines if the given user has read a particular event ID with the known\n * history of the room. This is not a definitive check as it relies only on\n * what is available to the room at the time of execution.\n * @param {String} userId The user ID to check the read state of.\n * @param {String} eventId The event ID to check if the user read.\n * @returns {Boolean} True if the user has read the event, false otherwise.\n */\n public hasUserReadEvent(userId: string, eventId: string): boolean {\n const readUpToId = this.getEventReadUpTo(userId, false);\n if (readUpToId === eventId) return true;\n\n if (this.timeline.length\n && this.timeline[this.timeline.length - 1].getSender()\n && this.timeline[this.timeline.length - 1].getSender() === userId) {\n // It doesn't matter where the event is in the timeline, the user has read\n // it because they've sent the latest event.\n return true;\n }\n\n for (let i = this.timeline.length - 1; i >= 0; --i) {\n const ev = this.timeline[i];\n\n // If we encounter the target event first, the user hasn't read it\n // however if we encounter the readUpToId first then the user has read\n // it. These rules apply because we're iterating bottom-up.\n if (ev.getId() === eventId) return false;\n if (ev.getId() === readUpToId) return true;\n }\n\n // We don't know if the user has read it, so assume not.\n return false;\n }\n\n /**\n * Get a list of receipts for the given event.\n * @param {MatrixEvent} event the event to get receipts for\n * @return {Object[]} A list of receipts with a userId, type and data keys or\n * an empty list.\n */\n public getReceiptsForEvent(event: MatrixEvent): ICachedReceipt[] {\n return this.receiptCacheByEventId[event.getId()] || [];\n }\n\n /**\n * Add a receipt event to the room.\n * @param {MatrixEvent} event The m.receipt event.\n * @param {Boolean} fake True if this event is implicit\n */\n public addReceipt(event: MatrixEvent, fake = false): void {\n if (!fake) {\n this.addReceiptsToStructure(event, this.realReceipts);\n // we don't bother caching real receipts by event ID\n // as there's nothing that would read it.\n }\n this.addReceiptsToStructure(event, this.receipts);\n this.receiptCacheByEventId = this.buildReceiptCache(this.receipts);\n\n // send events after we've regenerated the cache, otherwise things that\n // listened for the event would read from a stale cache\n this.emit(\"Room.receipt\", event, this);\n }\n\n /**\n * Add a receipt event to the room.\n * @param {MatrixEvent} event The m.receipt event.\n * @param {Object} receipts The object to add receipts to\n */\n private addReceiptsToStructure(event: MatrixEvent, receipts: Receipts): void {\n const content = event.getContent();\n Object.keys(content).forEach((eventId) => {\n Object.keys(content[eventId]).forEach((receiptType) => {\n Object.keys(content[eventId][receiptType]).forEach((userId) => {\n const receipt = content[eventId][receiptType][userId];\n\n if (!receipts[receiptType]) {\n receipts[receiptType] = {};\n }\n\n const existingReceipt = receipts[receiptType][userId];\n\n if (!existingReceipt) {\n receipts[receiptType][userId] = {} as IWrappedReceipt;\n } else {\n // we only want to add this receipt if we think it is later\n // than the one we already have. (This is managed\n // server-side, but because we synthesize RRs locally we\n // have to do it here too.)\n const ordering = this.getUnfilteredTimelineSet().compareEventOrdering(\n existingReceipt.eventId, eventId);\n if (ordering !== null && ordering >= 0) {\n return;\n }\n }\n\n receipts[receiptType][userId] = {\n eventId: eventId,\n data: receipt,\n };\n });\n });\n });\n }\n\n /**\n * Build and return a map of receipts by event ID\n * @param {Object} receipts A map of receipts\n * @return {Object} Map of receipts by event ID\n */\n private buildReceiptCache(receipts: Receipts): ReceiptCache {\n const receiptCacheByEventId = {};\n Object.keys(receipts).forEach(function(receiptType) {\n Object.keys(receipts[receiptType]).forEach(function(userId) {\n const receipt = receipts[receiptType][userId];\n if (!receiptCacheByEventId[receipt.eventId]) {\n receiptCacheByEventId[receipt.eventId] = [];\n }\n receiptCacheByEventId[receipt.eventId].push({\n userId: userId,\n type: receiptType,\n data: receipt.data,\n });\n });\n });\n return receiptCacheByEventId;\n }\n\n /**\n * Add a temporary local-echo receipt to the room to reflect in the\n * client the fact that we've sent one.\n * @param {string} userId The user ID if the receipt sender\n * @param {MatrixEvent} e The event that is to be acknowledged\n * @param {string} receiptType The type of receipt\n */\n public addLocalEchoReceipt(userId: string, e: MatrixEvent, receiptType: string): void {\n this.addReceipt(synthesizeReceipt(userId, e, receiptType), true);\n }\n\n /**\n * Update the room-tag event for the room. The previous one is overwritten.\n * @param {MatrixEvent} event the m.tag event\n */\n public addTags(event: MatrixEvent): void {\n // event content looks like:\n // content: {\n // tags: {\n // $tagName: { $metadata: $value },\n // $tagName: { $metadata: $value },\n // }\n // }\n\n // XXX: do we need to deep copy here?\n this.tags = event.getContent().tags || {};\n\n // XXX: we could do a deep-comparison to see if the tags have really\n // changed - but do we want to bother?\n this.emit(\"Room.tags\", event, this);\n }\n\n /**\n * Update the account_data events for this room, overwriting events of the same type.\n * @param {Array} events an array of account_data events to add\n */\n public addAccountData(events: MatrixEvent[]): void {\n for (let i = 0; i < events.length; i++) {\n const event = events[i];\n if (event.getType() === \"m.tag\") {\n this.addTags(event);\n }\n const lastEvent = this.accountData[event.getType()];\n this.accountData[event.getType()] = event;\n this.emit(\"Room.accountData\", event, this, lastEvent);\n }\n }\n\n /**\n * Access account_data event of given event type for this room\n * @param {string} type the type of account_data event to be accessed\n * @return {?MatrixEvent} the account_data event in question\n */\n public getAccountData(type: EventType | string): MatrixEvent | undefined {\n return this.accountData[type];\n }\n\n /**\n * Returns whether the syncing user has permission to send a message in the room\n * @return {boolean} true if the user should be permitted to send\n * message events into the room.\n */\n public maySendMessage(): boolean {\n return this.getMyMembership() === 'join' &&\n this.currentState.maySendEvent(EventType.RoomMessage, this.myUserId);\n }\n\n /**\n * Returns whether the given user has permissions to issue an invite for this room.\n * @param {string} userId the ID of the Matrix user to check permissions for\n * @returns {boolean} true if the user should be permitted to issue invites for this room.\n */\n public canInvite(userId: string): boolean {\n let canInvite = this.getMyMembership() === \"join\";\n const powerLevelsEvent = this.currentState.getStateEvents(EventType.RoomPowerLevels, \"\");\n const powerLevels = powerLevelsEvent && powerLevelsEvent.getContent();\n const me = this.getMember(userId);\n if (powerLevels && me && powerLevels.invite > me.powerLevel) {\n canInvite = false;\n }\n return canInvite;\n }\n\n /**\n * Returns the join rule based on the m.room.join_rule state event, defaulting to `invite`.\n * @returns {string} the join_rule applied to this room\n */\n public getJoinRule(): string {\n return this.currentState.getJoinRule();\n }\n\n /**\n * Returns the type of the room from the `m.room.create` event content or undefined if none is set\n * @returns {?string} the type of the room. Currently only RoomType.Space is known.\n */\n public getType(): RoomType | string | undefined {\n const createEvent = this.currentState.getStateEvents(EventType.RoomCreate, \"\");\n if (!createEvent) {\n if (!this.getTypeWarning) {\n logger.warn(\"[getType] Room \" + this.roomId + \" does not have an m.room.create event\");\n this.getTypeWarning = true;\n }\n return undefined;\n }\n return createEvent.getContent()[RoomCreateTypeField];\n }\n\n /**\n * Returns whether the room is a space-room as defined by MSC1772.\n * @returns {boolean} true if the room's type is RoomType.Space\n */\n public isSpaceRoom(): boolean {\n return this.getType() === RoomType.Space;\n }\n\n /**\n * This is an internal method. Calculates the name of the room from the current\n * room state.\n * @param {string} userId The client's user ID. Used to filter room members\n * correctly.\n * @param {boolean} ignoreRoomNameEvent Return the implicit room name that we'd see if there\n * was no m.room.name event.\n * @return {string} The calculated room name.\n */\n private calculateRoomName(userId: string, ignoreRoomNameEvent = false): string {\n if (!ignoreRoomNameEvent) {\n // check for an alias, if any. for now, assume first alias is the\n // official one.\n const mRoomName = this.currentState.getStateEvents(EventType.RoomName, \"\");\n if (mRoomName && mRoomName.getContent() && mRoomName.getContent().name) {\n return mRoomName.getContent().name;\n }\n }\n\n let alias = this.getCanonicalAlias();\n\n if (!alias) {\n const aliases = this.getAltAliases();\n\n if (aliases.length) {\n alias = aliases[0];\n }\n }\n if (alias) {\n return alias;\n }\n\n const joinedMemberCount = this.currentState.getJoinedMemberCount();\n const invitedMemberCount = this.currentState.getInvitedMemberCount();\n // -1 because these numbers include the syncing user\n let inviteJoinCount = joinedMemberCount + invitedMemberCount - 1;\n\n // get service members (e.g. helper bots) for exclusion\n let excludedUserIds: string[] = [];\n const mFunctionalMembers = this.currentState.getStateEvents(UNSTABLE_ELEMENT_FUNCTIONAL_USERS.name, \"\");\n if (Array.isArray(mFunctionalMembers?.getContent().service_members)) {\n excludedUserIds = mFunctionalMembers.getContent().service_members;\n }\n\n // get members that are NOT ourselves and are actually in the room.\n let otherNames = null;\n if (this.summaryHeroes) {\n // if we have a summary, the member state events\n // should be in the room state\n otherNames = [];\n this.summaryHeroes.forEach((userId) => {\n // filter service members\n if (excludedUserIds.includes(userId)) {\n inviteJoinCount--;\n return;\n }\n const member = this.getMember(userId);\n otherNames.push(member ? member.name : userId);\n });\n } else {\n let otherMembers = this.currentState.getMembers().filter((m) => {\n return m.userId !== userId &&\n (m.membership === \"invite\" || m.membership === \"join\");\n });\n otherMembers = otherMembers.filter(({ userId }) => {\n // filter service members\n if (excludedUserIds.includes(userId)) {\n inviteJoinCount--;\n return false;\n }\n return true;\n });\n // make sure members have stable order\n otherMembers.sort((a, b) => utils.compare(a.userId, b.userId));\n // only 5 first members, immitate summaryHeroes\n otherMembers = otherMembers.slice(0, 5);\n otherNames = otherMembers.map((m) => m.name);\n }\n\n if (inviteJoinCount) {\n return memberNamesToRoomName(otherNames, inviteJoinCount);\n }\n\n const myMembership = this.getMyMembership();\n // if I have created a room and invited people through\n // 3rd party invites\n if (myMembership == 'join') {\n const thirdPartyInvites =\n this.currentState.getStateEvents(EventType.RoomThirdPartyInvite);\n\n if (thirdPartyInvites && thirdPartyInvites.length) {\n const thirdPartyNames = thirdPartyInvites.map((i) => {\n return i.getContent().display_name;\n });\n\n return `Inviting ${memberNamesToRoomName(thirdPartyNames)}`;\n }\n }\n // let's try to figure out who was here before\n let leftNames = otherNames;\n // if we didn't have heroes, try finding them in the room state\n if (!leftNames.length) {\n leftNames = this.currentState.getMembers().filter((m) => {\n return m.userId !== userId &&\n m.membership !== \"invite\" &&\n m.membership !== \"join\";\n }).map((m) => m.name);\n }\n if (leftNames.length) {\n return `Empty room (was ${memberNamesToRoomName(leftNames)})`;\n } else {\n return \"Empty room\";\n }\n }\n}\n\n/**\n * @param {string} roomId ID of the current room\n * @returns {string} Storage key to retrieve pending events\n */\nfunction pendingEventsKey(roomId: string): string {\n return `mx_pending_events_${roomId}`;\n}\n\n/* a map from current event status to a list of allowed next statuses\n */\nconst ALLOWED_TRANSITIONS = {};\n\nALLOWED_TRANSITIONS[EventStatus.ENCRYPTING] = [\n EventStatus.SENDING,\n EventStatus.NOT_SENT,\n];\n\nALLOWED_TRANSITIONS[EventStatus.SENDING] = [\n EventStatus.ENCRYPTING,\n EventStatus.QUEUED,\n EventStatus.NOT_SENT,\n EventStatus.SENT,\n];\n\nALLOWED_TRANSITIONS[EventStatus.QUEUED] =\n [EventStatus.SENDING, EventStatus.CANCELLED];\n\nALLOWED_TRANSITIONS[EventStatus.SENT] =\n [];\n\nALLOWED_TRANSITIONS[EventStatus.NOT_SENT] =\n [EventStatus.SENDING, EventStatus.QUEUED, EventStatus.CANCELLED];\n\nALLOWED_TRANSITIONS[EventStatus.CANCELLED] =\n [];\n\n// TODO i18n\nfunction memberNamesToRoomName(names: string[], count = (names.length + 1)) {\n const countWithoutMe = count - 1;\n if (!names.length) {\n return \"Empty room\";\n } else if (names.length === 1 && countWithoutMe <= 1) {\n return names[0];\n } else if (names.length === 2 && countWithoutMe <= 2) {\n return `${names[0]} and ${names[1]}`;\n } else {\n const plural = countWithoutMe > 1;\n if (plural) {\n return `${names[0]} and ${countWithoutMe} others`;\n } else {\n return `${names[0]} and 1 other`;\n }\n }\n}\n\n/**\n * Fires when an event we had previously received is redacted.\n *\n * (Note this is *not* fired when the redaction happens before we receive the\n * event).\n *\n * @event module:client~MatrixClient#\"Room.redaction\"\n * @param {MatrixEvent} event The matrix redaction event\n * @param {Room} room The room containing the redacted event\n */\n\n/**\n * Fires when an event that was previously redacted isn't anymore.\n * This happens when the redaction couldn't be sent and\n * was subsequently cancelled by the user. Redactions have a local echo\n * which is undone in this scenario.\n *\n * @event module:client~MatrixClient#\"Room.redactionCancelled\"\n * @param {MatrixEvent} event The matrix redaction event that was cancelled.\n * @param {Room} room The room containing the unredacted event\n */\n\n/**\n * Fires whenever the name of a room is updated.\n * @event module:client~MatrixClient#\"Room.name\"\n * @param {Room} room The room whose Room.name was updated.\n * @example\n * matrixClient.on(\"Room.name\", function(room){\n * var newName = room.name;\n * });\n */\n\n/**\n * Fires whenever a receipt is received for a room\n * @event module:client~MatrixClient#\"Room.receipt\"\n * @param {event} event The receipt event\n * @param {Room} room The room whose receipts was updated.\n * @example\n * matrixClient.on(\"Room.receipt\", function(event, room){\n * var receiptContent = event.getContent();\n * });\n */\n\n/**\n * Fires whenever a room's tags are updated.\n * @event module:client~MatrixClient#\"Room.tags\"\n * @param {event} event The tags event\n * @param {Room} room The room whose Room.tags was updated.\n * @example\n * matrixClient.on(\"Room.tags\", function(event, room){\n * var newTags = event.getContent().tags;\n * if (newTags[\"favourite\"]) showStar(room);\n * });\n */\n\n/**\n * Fires whenever a room's account_data is updated.\n * @event module:client~MatrixClient#\"Room.accountData\"\n * @param {event} event The account_data event\n * @param {Room} room The room whose account_data was updated.\n * @param {MatrixEvent} prevEvent The event being replaced by\n * the new account data, if known.\n * @example\n * matrixClient.on(\"Room.accountData\", function(event, room, oldEvent){\n * if (event.getType() === \"m.room.colorscheme\") {\n * applyColorScheme(event.getContents());\n * }\n * });\n */\n\n/**\n * Fires when the status of a transmitted event is updated.\n *\n *

When an event is first transmitted, a temporary copy of the event is\n * inserted into the timeline, with a temporary event id, and a status of\n * 'SENDING'.\n *\n *

Once the echo comes back from the server, the content of the event\n * (MatrixEvent.event) is replaced by the complete event from the homeserver,\n * thus updating its event id, as well as server-generated fields such as the\n * timestamp. Its status is set to null.\n *\n *

Once the /send request completes, if the remote echo has not already\n * arrived, the event is updated with a new event id and the status is set to\n * 'SENT'. The server-generated fields are of course not updated yet.\n *\n *

If the /send fails, In this case, the event's status is set to\n * 'NOT_SENT'. If it is later resent, the process starts again, setting the\n * status to 'SENDING'. Alternatively, the message may be cancelled, which\n * removes the event from the room, and sets the status to 'CANCELLED'.\n *\n *

This event is raised to reflect each of the transitions above.\n *\n * @event module:client~MatrixClient#\"Room.localEchoUpdated\"\n *\n * @param {MatrixEvent} event The matrix event which has been updated\n *\n * @param {Room} room The room containing the redacted event\n *\n * @param {string} oldEventId The previous event id (the temporary event id,\n * except when updating a successfully-sent event when its echo arrives)\n *\n * @param {EventStatus} oldStatus The previous event status.\n */\n\n/**\n * Fires when the logged in user's membership in the room is updated.\n *\n * @event module:models/room~Room#\"Room.myMembership\"\n * @param {Room} room The room in which the membership has been updated\n * @param {string} membership The new membership value\n * @param {string} prevMembership The previous membership value\n */\n", - "/*\nCopyright 2015 - 2021 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n/**\n * @module models/search-result\n */\n\nimport { EventContext } from \"./event-context\";\nimport { EventMapper } from \"../event-mapper\";\nimport { IResultContext, ISearchResult } from \"../@types/search\";\n\nexport class SearchResult {\n /**\n * Create a SearchResponse from the response to /search\n * @static\n * @param {Object} jsonObj\n * @param {function} eventMapper\n * @return {SearchResult}\n */\n\n static fromJson(jsonObj: ISearchResult, eventMapper: EventMapper): SearchResult {\n const jsonContext = jsonObj.context || {} as IResultContext;\n const eventsBefore = jsonContext.events_before || [];\n const eventsAfter = jsonContext.events_after || [];\n\n const context = new EventContext(eventMapper(jsonObj.result));\n\n context.setPaginateToken(jsonContext.start, true);\n context.addEvents(eventsBefore.map(eventMapper), true);\n context.addEvents(eventsAfter.map(eventMapper), false);\n context.setPaginateToken(jsonContext.end, false);\n\n return new SearchResult(jsonObj.rank, context);\n }\n\n /**\n * Construct a new SearchResult\n *\n * @param {number} rank where this SearchResult ranks in the results\n * @param {event-context.EventContext} context the matching event and its\n * context\n *\n * @constructor\n */\n constructor(public readonly rank: number, public readonly context: EventContext) {}\n}\n\n", + "/*\nCopyright 2015 - 2021 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n/**\n * @module models/room\n */\n\nimport { EventEmitter } from \"events\";\n\nimport { EventTimelineSet } from \"./event-timeline-set\";\nimport { EventTimeline } from \"./event-timeline\";\nimport { getHttpUriForMxc } from \"../content-repo\";\nimport * as utils from \"../utils\";\nimport { normalize } from \"../utils\";\nimport { EventStatus, IEvent, MatrixEvent } from \"./event\";\nimport { RoomMember } from \"./room-member\";\nimport { IRoomSummary, RoomSummary } from \"./room-summary\";\nimport { logger } from '../logger';\nimport { ReEmitter } from '../ReEmitter';\nimport { EventType, RoomCreateTypeField, RoomType, UNSTABLE_ELEMENT_FUNCTIONAL_USERS } from \"../@types/event\";\nimport { IRoomVersionsCapability, MatrixClient, PendingEventOrdering, RoomVersionStability } from \"../client\";\nimport { ResizeMethod } from \"../@types/partials\";\nimport { Filter } from \"../filter\";\nimport { RoomState } from \"./room-state\";\nimport { Thread } from \"./thread\";\n\n// These constants are used as sane defaults when the homeserver doesn't support\n// the m.room_versions capability. In practice, KNOWN_SAFE_ROOM_VERSION should be\n// the same as the common default room version whereas SAFE_ROOM_VERSIONS are the\n// room versions which are considered okay for people to run without being asked\n// to upgrade (ie: \"stable\"). Eventually, we should remove these when all homeservers\n// return an m.room_versions capability.\nconst KNOWN_SAFE_ROOM_VERSION = '6';\nconst SAFE_ROOM_VERSIONS = ['1', '2', '3', '4', '5', '6'];\n\nfunction synthesizeReceipt(userId: string, event: MatrixEvent, receiptType: string): MatrixEvent {\n // console.log(\"synthesizing receipt for \"+event.getId());\n // This is really ugly because JS has no way to express an object literal\n // where the name of a key comes from an expression\n const fakeReceipt = {\n content: {},\n type: \"m.receipt\",\n room_id: event.getRoomId(),\n };\n fakeReceipt.content[event.getId()] = {};\n fakeReceipt.content[event.getId()][receiptType] = {};\n fakeReceipt.content[event.getId()][receiptType][userId] = {\n ts: event.getTs(),\n };\n return new MatrixEvent(fakeReceipt);\n}\n\ninterface IOpts {\n storageToken?: string;\n pendingEventOrdering?: PendingEventOrdering;\n timelineSupport?: boolean;\n unstableClientRelationAggregation?: boolean;\n lazyLoadMembers?: boolean;\n}\n\nexport interface IRecommendedVersion {\n version: string;\n needsUpgrade: boolean;\n urgent: boolean;\n}\n\ninterface IReceipt {\n ts: number;\n}\n\ninterface IWrappedReceipt {\n eventId: string;\n data: IReceipt;\n}\n\ninterface ICachedReceipt {\n type: string;\n userId: string;\n data: IReceipt;\n}\n\ntype ReceiptCache = Record;\n\ninterface IReceiptContent {\n [eventId: string]: {\n [type: string]: {\n [userId: string]: IReceipt;\n };\n };\n}\n\ntype Receipts = Record>;\n\nexport enum NotificationCountType {\n Highlight = \"highlight\",\n Total = \"total\",\n}\n\nexport class Room extends EventEmitter {\n private readonly reEmitter: ReEmitter;\n private txnToEvent: Record = {}; // Pending in-flight requests { string: MatrixEvent }\n // receipts should clobber based on receipt_type and user_id pairs hence\n // the form of this structure. This is sub-optimal for the exposed APIs\n // which pass in an event ID and get back some receipts, so we also store\n // a pre-cached list for this purpose.\n private receipts: Receipts = {}; // { receipt_type: { user_id: IReceipt } }\n private receiptCacheByEventId: ReceiptCache = {}; // { event_id: IReceipt2[] }\n // only receipts that came from the server, not synthesized ones\n private realReceipts: Receipts = {};\n private notificationCounts: Partial> = {};\n private readonly timelineSets: EventTimelineSet[];\n // any filtered timeline sets we're maintaining for this room\n private readonly filteredTimelineSets: Record = {}; // filter_id: timelineSet\n private readonly pendingEventList?: MatrixEvent[];\n // read by megolm via getter; boolean value - null indicates \"use global value\"\n private blacklistUnverifiedDevices: boolean = null;\n private selfMembership: string = null;\n private summaryHeroes: string[] = null;\n // flags to stop logspam about missing m.room.create events\n private getTypeWarning = false;\n private getVersionWarning = false;\n private membersPromise?: Promise;\n\n // XXX: These should be read-only\n public name: string;\n public normalizedName: string;\n public tags: Record> = {}; // $tagName: { $metadata: $value }\n public accountData: Record = {}; // $eventType: $event\n public summary: RoomSummary = null;\n public readonly storageToken?: string;\n // legacy fields\n public timeline: MatrixEvent[];\n public oldState: RoomState;\n public currentState: RoomState;\n\n /**\n * @experimental\n */\n public threads = new Set();\n\n /**\n * Construct a new Room.\n *\n *

For a room, we store an ordered sequence of timelines, which may or may not\n * be continuous. Each timeline lists a series of events, as well as tracking\n * the room state at the start and the end of the timeline. It also tracks\n * forward and backward pagination tokens, as well as containing links to the\n * next timeline in the sequence.\n *\n *

There is one special timeline - the 'live' timeline, which represents the\n * timeline to which events are being added in real-time as they are received\n * from the /sync API. Note that you should not retain references to this\n * timeline - even if it is the current timeline right now, it may not remain\n * so if the server gives us a timeline gap in /sync.\n *\n *

In order that we can find events from their ids later, we also maintain a\n * map from event_id to timeline and index.\n *\n * @constructor\n * @alias module:models/room\n * @param {string} roomId Required. The ID of this room.\n * @param {MatrixClient} client Required. The client, used to lazy load members.\n * @param {string} myUserId Required. The ID of the syncing user.\n * @param {Object=} opts Configuration options\n * @param {*} opts.storageToken Optional. The token which a data store can use\n * to remember the state of the room. What this means is dependent on the store\n * implementation.\n *\n * @param {String=} opts.pendingEventOrdering Controls where pending messages\n * appear in a room's timeline. If \"chronological\", messages will appear\n * in the timeline when the call to sendEvent was made. If\n * \"detached\", pending messages will appear in a separate list,\n * accessible via {@link module:models/room#getPendingEvents}. Default:\n * \"chronological\".\n * @param {boolean} [opts.timelineSupport = false] Set to true to enable improved\n * timeline support.\n * @param {boolean} [opts.unstableClientRelationAggregation = false]\n * Optional. Set to true to enable client-side aggregation of event relations\n * via `EventTimelineSet#getRelationsForEvent`.\n * This feature is currently unstable and the API may change without notice.\n *\n * @prop {string} roomId The ID of this room.\n * @prop {string} name The human-readable display name for this room.\n * @prop {string} normalizedName The un-homoglyphed name for this room.\n * @prop {Array} timeline The live event timeline for this room,\n * with the oldest event at index 0. Present for backwards compatibility -\n * prefer getLiveTimeline().getEvents().\n * @prop {object} tags Dict of room tags; the keys are the tag name and the values\n * are any metadata associated with the tag - e.g. { \"fav\" : { order: 1 } }\n * @prop {object} accountData Dict of per-room account_data events; the keys are the\n * event type and the values are the events.\n * @prop {RoomState} oldState The state of the room at the time of the oldest\n * event in the live timeline. Present for backwards compatibility -\n * prefer getLiveTimeline().getState(EventTimeline.BACKWARDS).\n * @prop {RoomState} currentState The state of the room at the time of the\n * newest event in the timeline. Present for backwards compatibility -\n * prefer getLiveTimeline().getState(EventTimeline.FORWARDS).\n * @prop {RoomSummary} summary The room summary.\n * @prop {*} storageToken A token which a data store can use to remember\n * the state of the room.\n */\n constructor(\n public readonly roomId: string,\n public readonly client: MatrixClient,\n public readonly myUserId: string,\n private readonly opts: IOpts = {},\n ) {\n super();\n // In some cases, we add listeners for every displayed Matrix event, so it's\n // common to have quite a few more than the default limit.\n this.setMaxListeners(100);\n this.reEmitter = new ReEmitter(this);\n\n opts.pendingEventOrdering = opts.pendingEventOrdering || PendingEventOrdering.Chronological;\n if ([\"chronological\", \"detached\"].indexOf(opts.pendingEventOrdering) === -1) {\n throw new Error(\n \"opts.pendingEventOrdering MUST be either 'chronological' or \" +\n \"'detached'. Got: '\" + opts.pendingEventOrdering + \"'\",\n );\n }\n\n this.name = roomId;\n\n // all our per-room timeline sets. the first one is the unfiltered ones;\n // the subsequent ones are the filtered ones in no particular order.\n this.timelineSets = [new EventTimelineSet(this, opts)];\n this.reEmitter.reEmit(this.getUnfilteredTimelineSet(), [\"Room.timeline\", \"Room.timelineReset\"]);\n\n this.fixUpLegacyTimelineFields();\n\n if (this.opts.pendingEventOrdering == \"detached\") {\n this.pendingEventList = [];\n const serializedPendingEventList = client.sessionStore.store.getItem(pendingEventsKey(this.roomId));\n if (serializedPendingEventList) {\n JSON.parse(serializedPendingEventList)\n .forEach(async serializedEvent => {\n const event = new MatrixEvent(serializedEvent);\n if (event.getType() === EventType.RoomMessageEncrypted) {\n await event.attemptDecryption(this.client.crypto);\n }\n event.setStatus(EventStatus.NOT_SENT);\n this.addPendingEvent(event, event.getTxnId());\n });\n }\n }\n\n // awaited by getEncryptionTargetMembers while room members are loading\n if (!this.opts.lazyLoadMembers) {\n this.membersPromise = Promise.resolve(false);\n } else {\n this.membersPromise = null;\n }\n }\n\n /**\n * Bulk decrypt critical events in a room\n *\n * Critical events represents the minimal set of events to decrypt\n * for a typical UI to function properly\n *\n * - Last event of every room (to generate likely message preview)\n * - All events up to the read receipt (to calculate an accurate notification count)\n *\n * @returns {Promise} Signals when all events have been decrypted\n */\n public decryptCriticalEvents(): Promise {\n const readReceiptEventId = this.getEventReadUpTo(this.client.getUserId(), true);\n const events = this.getLiveTimeline().getEvents();\n const readReceiptTimelineIndex = events.findIndex(matrixEvent => {\n return matrixEvent.event.event_id === readReceiptEventId;\n });\n\n const decryptionPromises = events\n .slice(readReceiptTimelineIndex)\n .filter(event => event.shouldAttemptDecryption())\n .reverse()\n .map(event => event.attemptDecryption(this.client.crypto, { isRetry: true }));\n\n return Promise.allSettled(decryptionPromises) as unknown as Promise;\n }\n\n /**\n * Bulk decrypt events in a room\n *\n * @returns {Promise} Signals when all events have been decrypted\n */\n public decryptAllEvents(): Promise {\n const decryptionPromises = this\n .getUnfilteredTimelineSet()\n .getLiveTimeline()\n .getEvents()\n .filter(event => event.shouldAttemptDecryption())\n .reverse()\n .map(event => event.attemptDecryption(this.client.crypto, { isRetry: true }));\n\n return Promise.allSettled(decryptionPromises) as unknown as Promise;\n }\n\n /**\n * Gets the version of the room\n * @returns {string} The version of the room, or null if it could not be determined\n */\n public getVersion(): string | null {\n const createEvent = this.currentState.getStateEvents(EventType.RoomCreate, \"\");\n if (!createEvent) {\n if (!this.getVersionWarning) {\n logger.warn(\"[getVersion] Room \" + this.roomId + \" does not have an m.room.create event\");\n this.getVersionWarning = true;\n }\n return '1';\n }\n const ver = createEvent.getContent()['room_version'];\n if (ver === undefined) return '1';\n return ver;\n }\n\n /**\n * Determines whether this room needs to be upgraded to a new version\n * @returns {string?} What version the room should be upgraded to, or null if\n * the room does not require upgrading at this time.\n * @deprecated Use #getRecommendedVersion() instead\n */\n public shouldUpgradeToVersion(): string | null {\n // TODO: Remove this function.\n // This makes assumptions about which versions are safe, and can easily\n // be wrong. Instead, people are encouraged to use getRecommendedVersion\n // which determines a safer value. This function doesn't use that function\n // because this is not async-capable, and to avoid breaking the contract\n // we're deprecating this.\n\n if (!SAFE_ROOM_VERSIONS.includes(this.getVersion())) {\n return KNOWN_SAFE_ROOM_VERSION;\n }\n\n return null;\n }\n\n /**\n * Determines the recommended room version for the room. This returns an\n * object with 3 properties: version as the new version the\n * room should be upgraded to (may be the same as the current version);\n * needsUpgrade to indicate if the room actually can be\n * upgraded (ie: does the current version not match?); and urgent\n * to indicate if the new version patches a vulnerability in a previous\n * version.\n * @returns {Promise<{version: string, needsUpgrade: boolean, urgent: boolean}>}\n * Resolves to the version the room should be upgraded to.\n */\n public async getRecommendedVersion(): Promise {\n const capabilities = await this.client.getCapabilities();\n let versionCap = capabilities[\"m.room_versions\"];\n if (!versionCap) {\n versionCap = {\n default: KNOWN_SAFE_ROOM_VERSION,\n available: {},\n };\n for (const safeVer of SAFE_ROOM_VERSIONS) {\n versionCap.available[safeVer] = RoomVersionStability.Stable;\n }\n }\n\n let result = this.checkVersionAgainstCapability(versionCap);\n if (result.urgent && result.needsUpgrade) {\n // Something doesn't feel right: we shouldn't need to update\n // because the version we're on should be in the protocol's\n // namespace. This usually means that the server was updated\n // before the client was, making us think the newest possible\n // room version is not stable. As a solution, we'll refresh\n // the capability we're using to determine this.\n logger.warn(\n \"Refreshing room version capability because the server looks \" +\n \"to be supporting a newer room version we don't know about.\",\n );\n\n const caps = await this.client.getCapabilities(true);\n versionCap = caps[\"m.room_versions\"];\n if (!versionCap) {\n logger.warn(\"No room version capability - assuming upgrade required.\");\n return result;\n } else {\n result = this.checkVersionAgainstCapability(versionCap);\n }\n }\n\n return result;\n }\n\n private checkVersionAgainstCapability(versionCap: IRoomVersionsCapability): IRecommendedVersion {\n const currentVersion = this.getVersion();\n logger.log(`[${this.roomId}] Current version: ${currentVersion}`);\n logger.log(`[${this.roomId}] Version capability: `, versionCap);\n\n const result = {\n version: currentVersion,\n needsUpgrade: false,\n urgent: false,\n };\n\n // If the room is on the default version then nothing needs to change\n if (currentVersion === versionCap.default) return result;\n\n const stableVersions = Object.keys(versionCap.available)\n .filter((v) => versionCap.available[v] === 'stable');\n\n // Check if the room is on an unstable version. We determine urgency based\n // off the version being in the Matrix spec namespace or not (if the version\n // is in the current namespace and unstable, the room is probably vulnerable).\n if (!stableVersions.includes(currentVersion)) {\n result.version = versionCap.default;\n result.needsUpgrade = true;\n result.urgent = !!this.getVersion().match(/^[0-9]+[0-9.]*$/g);\n if (result.urgent) {\n logger.warn(`URGENT upgrade required on ${this.roomId}`);\n } else {\n logger.warn(`Non-urgent upgrade required on ${this.roomId}`);\n }\n return result;\n }\n\n // The room is on a stable, but non-default, version by this point.\n // No upgrade needed.\n return result;\n }\n\n /**\n * Determines whether the given user is permitted to perform a room upgrade\n * @param {String} userId The ID of the user to test against\n * @returns {boolean} True if the given user is permitted to upgrade the room\n */\n public userMayUpgradeRoom(userId: string): boolean {\n return this.currentState.maySendStateEvent(EventType.RoomTombstone, userId);\n }\n\n /**\n * Get the list of pending sent events for this room\n *\n * @return {module:models/event.MatrixEvent[]} A list of the sent events\n * waiting for remote echo.\n *\n * @throws If opts.pendingEventOrdering was not 'detached'\n */\n public getPendingEvents(): MatrixEvent[] {\n if (this.opts.pendingEventOrdering !== \"detached\") {\n throw new Error(\n \"Cannot call getPendingEvents with pendingEventOrdering == \" +\n this.opts.pendingEventOrdering);\n }\n\n return this.pendingEventList;\n }\n\n /**\n * Removes a pending event for this room\n *\n * @param {string} eventId\n * @return {boolean} True if an element was removed.\n */\n public removePendingEvent(eventId: string): boolean {\n if (this.opts.pendingEventOrdering !== \"detached\") {\n throw new Error(\n \"Cannot call removePendingEvent with pendingEventOrdering == \" +\n this.opts.pendingEventOrdering);\n }\n\n const removed = utils.removeElement(\n this.pendingEventList,\n function(ev) {\n return ev.getId() == eventId;\n }, false,\n );\n\n this.savePendingEvents();\n\n return removed;\n }\n\n /**\n * Check whether the pending event list contains a given event by ID.\n * If pending event ordering is not \"detached\" then this returns false.\n *\n * @param {string} eventId The event ID to check for.\n * @return {boolean}\n */\n public hasPendingEvent(eventId: string): boolean {\n if (this.opts.pendingEventOrdering !== \"detached\") {\n return false;\n }\n\n return this.pendingEventList.some(event => event.getId() === eventId);\n }\n\n /**\n * Get a specific event from the pending event list, if configured, null otherwise.\n *\n * @param {string} eventId The event ID to check for.\n * @return {MatrixEvent}\n */\n public getPendingEvent(eventId: string): MatrixEvent | null {\n if (this.opts.pendingEventOrdering !== \"detached\") {\n return null;\n }\n\n return this.pendingEventList.find(event => event.getId() === eventId);\n }\n\n /**\n * Get the live unfiltered timeline for this room.\n *\n * @return {module:models/event-timeline~EventTimeline} live timeline\n */\n public getLiveTimeline(): EventTimeline {\n return this.getUnfilteredTimelineSet().getLiveTimeline();\n }\n\n /**\n * Get the timestamp of the last message in the room\n *\n * @return {number} the timestamp of the last message in the room\n */\n public getLastActiveTimestamp(): number {\n const timeline = this.getLiveTimeline();\n const events = timeline.getEvents();\n if (events.length) {\n const lastEvent = events[events.length - 1];\n return lastEvent.getTs();\n } else {\n return Number.MIN_SAFE_INTEGER;\n }\n }\n\n /**\n * @return {string} the membership type (join | leave | invite) for the logged in user\n */\n public getMyMembership(): string {\n return this.selfMembership;\n }\n\n /**\n * If this room is a DM we're invited to,\n * try to find out who invited us\n * @return {string} user id of the inviter\n */\n public getDMInviter(): string {\n if (this.myUserId) {\n const me = this.getMember(this.myUserId);\n if (me) {\n return me.getDMInviter();\n }\n }\n if (this.selfMembership === \"invite\") {\n // fall back to summary information\n const memberCount = this.getInvitedAndJoinedMemberCount();\n if (memberCount == 2 && this.summaryHeroes.length) {\n return this.summaryHeroes[0];\n }\n }\n }\n\n /**\n * Assuming this room is a DM room, tries to guess with which user.\n * @return {string} user id of the other member (could be syncing user)\n */\n public guessDMUserId(): string {\n const me = this.getMember(this.myUserId);\n if (me) {\n const inviterId = me.getDMInviter();\n if (inviterId) {\n return inviterId;\n }\n }\n // remember, we're assuming this room is a DM,\n // so returning the first member we find should be fine\n const hasHeroes = Array.isArray(this.summaryHeroes) &&\n this.summaryHeroes.length;\n if (hasHeroes) {\n return this.summaryHeroes[0];\n }\n const members = this.currentState.getMembers();\n const anyMember = members.find((m) => m.userId !== this.myUserId);\n if (anyMember) {\n return anyMember.userId;\n }\n // it really seems like I'm the only user in the room\n // so I probably created a room with just me in it\n // and marked it as a DM. Ok then\n return this.myUserId;\n }\n\n public getAvatarFallbackMember(): RoomMember {\n const memberCount = this.getInvitedAndJoinedMemberCount();\n if (memberCount > 2) {\n return;\n }\n const hasHeroes = Array.isArray(this.summaryHeroes) &&\n this.summaryHeroes.length;\n if (hasHeroes) {\n const availableMember = this.summaryHeroes.map((userId) => {\n return this.getMember(userId);\n }).find((member) => !!member);\n if (availableMember) {\n return availableMember;\n }\n }\n const members = this.currentState.getMembers();\n // could be different than memberCount\n // as this includes left members\n if (members.length <= 2) {\n const availableMember = members.find((m) => {\n return m.userId !== this.myUserId;\n });\n if (availableMember) {\n return availableMember;\n }\n }\n // if all else fails, try falling back to a user,\n // and create a one-off member for it\n if (hasHeroes) {\n const availableUser = this.summaryHeroes.map((userId) => {\n return this.client.getUser(userId);\n }).find((user) => !!user);\n if (availableUser) {\n const member = new RoomMember(\n this.roomId, availableUser.userId);\n member.user = availableUser;\n return member;\n }\n }\n }\n\n /**\n * Sets the membership this room was received as during sync\n * @param {string} membership join | leave | invite\n */\n public updateMyMembership(membership: string): void {\n const prevMembership = this.selfMembership;\n this.selfMembership = membership;\n if (prevMembership !== membership) {\n if (membership === \"leave\") {\n this.cleanupAfterLeaving();\n }\n this.emit(\"Room.myMembership\", this, membership, prevMembership);\n }\n }\n\n private async loadMembersFromServer(): Promise {\n const lastSyncToken = this.client.store.getSyncToken();\n const queryString = utils.encodeParams({\n not_membership: \"leave\",\n at: lastSyncToken,\n });\n const path = utils.encodeUri(\"/rooms/$roomId/members?\" + queryString,\n { $roomId: this.roomId });\n const http = this.client.http;\n const response = await http.authedRequest(undefined, \"GET\", path);\n return response.chunk;\n }\n\n private async loadMembers(): Promise<{ memberEvents: MatrixEvent[], fromServer: boolean }> {\n // were the members loaded from the server?\n let fromServer = false;\n let rawMembersEvents = await this.client.store.getOutOfBandMembers(this.roomId);\n if (rawMembersEvents === null) {\n fromServer = true;\n rawMembersEvents = await this.loadMembersFromServer();\n logger.log(`LL: got ${rawMembersEvents.length} ` +\n `members from server for room ${this.roomId}`);\n }\n const memberEvents = rawMembersEvents.map(this.client.getEventMapper());\n return { memberEvents, fromServer };\n }\n\n /**\n * Preloads the member list in case lazy loading\n * of memberships is in use. Can be called multiple times,\n * it will only preload once.\n * @return {Promise} when preloading is done and\n * accessing the members on the room will take\n * all members in the room into account\n */\n public loadMembersIfNeeded(): Promise {\n if (this.membersPromise) {\n return this.membersPromise;\n }\n\n // mark the state so that incoming messages while\n // the request is in flight get marked as superseding\n // the OOB members\n this.currentState.markOutOfBandMembersStarted();\n\n const inMemoryUpdate = this.loadMembers().then((result) => {\n this.currentState.setOutOfBandMembers(result.memberEvents);\n // now the members are loaded, start to track the e2e devices if needed\n if (this.client.isCryptoEnabled() && this.client.isRoomEncrypted(this.roomId)) {\n this.client.crypto.trackRoomDevices(this.roomId);\n }\n return result.fromServer;\n }).catch((err) => {\n // allow retries on fail\n this.membersPromise = null;\n this.currentState.markOutOfBandMembersFailed();\n throw err;\n });\n // update members in storage, but don't wait for it\n inMemoryUpdate.then((fromServer) => {\n if (fromServer) {\n const oobMembers = this.currentState.getMembers()\n .filter((m) => m.isOutOfBand())\n .map((m) => m.events.member.event as IEvent);\n logger.log(`LL: telling store to write ${oobMembers.length}`\n + ` members for room ${this.roomId}`);\n const store = this.client.store;\n return store.setOutOfBandMembers(this.roomId, oobMembers)\n // swallow any IDB error as we don't want to fail\n // because of this\n .catch((err) => {\n logger.log(\"LL: storing OOB room members failed, oh well\",\n err);\n });\n }\n }).catch((err) => {\n // as this is not awaited anywhere,\n // at least show the error in the console\n logger.error(err);\n });\n\n this.membersPromise = inMemoryUpdate;\n\n return this.membersPromise;\n }\n\n /**\n * Removes the lazily loaded members from storage if needed\n */\n public async clearLoadedMembersIfNeeded(): Promise {\n if (this.opts.lazyLoadMembers && this.membersPromise) {\n await this.loadMembersIfNeeded();\n await this.client.store.clearOutOfBandMembers(this.roomId);\n this.currentState.clearOutOfBandMembers();\n this.membersPromise = null;\n }\n }\n\n /**\n * called when sync receives this room in the leave section\n * to do cleanup after leaving a room. Possibly called multiple times.\n */\n private cleanupAfterLeaving(): void {\n this.clearLoadedMembersIfNeeded().catch((err) => {\n logger.error(`error after clearing loaded members from ` +\n `room ${this.roomId} after leaving`);\n logger.log(err);\n });\n }\n\n /**\n * Reset the live timeline of all timelineSets, and start new ones.\n *\n *

This is used when /sync returns a 'limited' timeline.\n *\n * @param {string=} backPaginationToken token for back-paginating the new timeline\n * @param {string=} forwardPaginationToken token for forward-paginating the old live timeline,\n * if absent or null, all timelines are reset, removing old ones (including the previous live\n * timeline which would otherwise be unable to paginate forwards without this token).\n * Removing just the old live timeline whilst preserving previous ones is not supported.\n */\n public resetLiveTimeline(backPaginationToken: string, forwardPaginationToken: string): void {\n for (let i = 0; i < this.timelineSets.length; i++) {\n this.timelineSets[i].resetLiveTimeline(\n backPaginationToken, forwardPaginationToken,\n );\n }\n\n this.fixUpLegacyTimelineFields();\n }\n\n /**\n * Fix up this.timeline, this.oldState and this.currentState\n *\n * @private\n */\n private fixUpLegacyTimelineFields(): void {\n // maintain this.timeline as a reference to the live timeline,\n // and this.oldState and this.currentState as references to the\n // state at the start and end of that timeline. These are more\n // for backwards-compatibility than anything else.\n this.timeline = this.getLiveTimeline().getEvents();\n this.oldState = this.getLiveTimeline()\n .getState(EventTimeline.BACKWARDS);\n this.currentState = this.getLiveTimeline()\n .getState(EventTimeline.FORWARDS);\n }\n\n /**\n * Returns whether there are any devices in the room that are unverified\n *\n * Note: Callers should first check if crypto is enabled on this device. If it is\n * disabled, then we aren't tracking room devices at all, so we can't answer this, and an\n * error will be thrown.\n *\n * @return {boolean} the result\n */\n public async hasUnverifiedDevices(): Promise {\n if (!this.client.isRoomEncrypted(this.roomId)) {\n return false;\n }\n const e2eMembers = await this.getEncryptionTargetMembers();\n for (const member of e2eMembers) {\n const devices = this.client.getStoredDevicesForUser(member.userId);\n if (devices.some((device) => device.isUnverified())) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * Return the timeline sets for this room.\n * @return {EventTimelineSet[]} array of timeline sets for this room\n */\n public getTimelineSets(): EventTimelineSet[] {\n return this.timelineSets;\n }\n\n /**\n * Helper to return the main unfiltered timeline set for this room\n * @return {EventTimelineSet} room's unfiltered timeline set\n */\n public getUnfilteredTimelineSet(): EventTimelineSet {\n return this.timelineSets[0];\n }\n\n /**\n * Get the timeline which contains the given event from the unfiltered set, if any\n *\n * @param {string} eventId event ID to look for\n * @return {?module:models/event-timeline~EventTimeline} timeline containing\n * the given event, or null if unknown\n */\n public getTimelineForEvent(eventId: string): EventTimeline {\n return this.getUnfilteredTimelineSet().getTimelineForEvent(eventId);\n }\n\n /**\n * Add a new timeline to this room's unfiltered timeline set\n *\n * @return {module:models/event-timeline~EventTimeline} newly-created timeline\n */\n public addTimeline(): EventTimeline {\n return this.getUnfilteredTimelineSet().addTimeline();\n }\n\n /**\n * Get an event which is stored in our unfiltered timeline set or in a thread\n *\n * @param {string} eventId event ID to look for\n * @return {?module:models/event.MatrixEvent} the given event, or undefined if unknown\n */\n public findEventById(eventId: string): MatrixEvent | undefined {\n let event = this.getUnfilteredTimelineSet().findEventById(eventId);\n\n if (event) {\n return event;\n } else {\n const threads = this.getThreads();\n for (let i = 0; i < threads.length; i++) {\n const thread = threads[i];\n event = thread.findEventById(eventId);\n if (event) {\n return event;\n }\n }\n }\n }\n\n /**\n * Get one of the notification counts for this room\n * @param {String} type The type of notification count to get. default: 'total'\n * @return {Number} The notification count, or undefined if there is no count\n * for this type.\n */\n public getUnreadNotificationCount(type = NotificationCountType.Total): number | undefined {\n return this.notificationCounts[type];\n }\n\n /**\n * Set one of the notification counts for this room\n * @param {String} type The type of notification count to set.\n * @param {Number} count The new count\n */\n public setUnreadNotificationCount(type: NotificationCountType, count: number): void {\n this.notificationCounts[type] = count;\n }\n\n public setSummary(summary: IRoomSummary): void {\n const heroes = summary[\"m.heroes\"];\n const joinedCount = summary[\"m.joined_member_count\"];\n const invitedCount = summary[\"m.invited_member_count\"];\n if (Number.isInteger(joinedCount)) {\n this.currentState.setJoinedMemberCount(joinedCount);\n }\n if (Number.isInteger(invitedCount)) {\n this.currentState.setInvitedMemberCount(invitedCount);\n }\n if (Array.isArray(heroes)) {\n // be cautious about trusting server values,\n // and make sure heroes doesn't contain our own id\n // just to be sure\n this.summaryHeroes = heroes.filter((userId) => {\n return userId !== this.myUserId;\n });\n }\n }\n\n /**\n * Whether to send encrypted messages to devices within this room.\n * @param {Boolean} value true to blacklist unverified devices, null\n * to use the global value for this room.\n */\n public setBlacklistUnverifiedDevices(value: boolean): void {\n this.blacklistUnverifiedDevices = value;\n }\n\n /**\n * Whether to send encrypted messages to devices within this room.\n * @return {Boolean} true if blacklisting unverified devices, null\n * if the global value should be used for this room.\n */\n public getBlacklistUnverifiedDevices(): boolean {\n return this.blacklistUnverifiedDevices;\n }\n\n /**\n * Get the avatar URL for a room if one was set.\n * @param {String} baseUrl The homeserver base URL. See\n * {@link module:client~MatrixClient#getHomeserverUrl}.\n * @param {Number} width The desired width of the thumbnail.\n * @param {Number} height The desired height of the thumbnail.\n * @param {string} resizeMethod The thumbnail resize method to use, either\n * \"crop\" or \"scale\".\n * @param {boolean} allowDefault True to allow an identicon for this room if an\n * avatar URL wasn't explicitly set. Default: true. (Deprecated)\n * @return {?string} the avatar URL or null.\n */\n public getAvatarUrl(\n baseUrl: string,\n width: number,\n height: number,\n resizeMethod: ResizeMethod,\n allowDefault = true,\n ): string | null {\n const roomAvatarEvent = this.currentState.getStateEvents(EventType.RoomAvatar, \"\");\n if (!roomAvatarEvent && !allowDefault) {\n return null;\n }\n\n const mainUrl = roomAvatarEvent ? roomAvatarEvent.getContent().url : null;\n if (mainUrl) {\n return getHttpUriForMxc(baseUrl, mainUrl, width, height, resizeMethod);\n }\n\n return null;\n }\n\n /**\n * Get the mxc avatar url for the room, if one was set.\n * @return {string} the mxc avatar url or falsy\n */\n public getMxcAvatarUrl(): string | null {\n return this.currentState.getStateEvents(EventType.RoomAvatar, \"\")?.getContent()?.url || null;\n }\n\n /**\n * Get the aliases this room has according to the room's state\n * The aliases returned by this function may not necessarily\n * still point to this room.\n * @return {array} The room's alias as an array of strings\n */\n public getAliases(): string[] {\n const aliasStrings = [];\n\n const aliasEvents = this.currentState.getStateEvents(EventType.RoomAliases);\n if (aliasEvents) {\n for (let i = 0; i < aliasEvents.length; ++i) {\n const aliasEvent = aliasEvents[i];\n if (Array.isArray(aliasEvent.getContent().aliases)) {\n const filteredAliases = aliasEvent.getContent().aliases.filter(a => {\n if (typeof(a) !== \"string\") return false;\n if (a[0] !== '#') return false;\n if (!a.endsWith(`:${aliasEvent.getStateKey()}`)) return false;\n\n // It's probably valid by here.\n return true;\n });\n Array.prototype.push.apply(aliasStrings, filteredAliases);\n }\n }\n }\n return aliasStrings;\n }\n\n /**\n * Get this room's canonical alias\n * The alias returned by this function may not necessarily\n * still point to this room.\n * @return {?string} The room's canonical alias, or null if there is none\n */\n public getCanonicalAlias(): string | null {\n const canonicalAlias = this.currentState.getStateEvents(EventType.RoomCanonicalAlias, \"\");\n if (canonicalAlias) {\n return canonicalAlias.getContent().alias || null;\n }\n return null;\n }\n\n /**\n * Get this room's alternative aliases\n * @return {array} The room's alternative aliases, or an empty array\n */\n public getAltAliases(): string[] {\n const canonicalAlias = this.currentState.getStateEvents(EventType.RoomCanonicalAlias, \"\");\n if (canonicalAlias) {\n return canonicalAlias.getContent().alt_aliases || [];\n }\n return [];\n }\n\n /**\n * Add events to a timeline\n *\n *

Will fire \"Room.timeline\" for each event added.\n *\n * @param {MatrixEvent[]} events A list of events to add.\n *\n * @param {boolean} toStartOfTimeline True to add these events to the start\n * (oldest) instead of the end (newest) of the timeline. If true, the oldest\n * event will be the last element of 'events'.\n *\n * @param {module:models/event-timeline~EventTimeline} timeline timeline to\n * add events to.\n *\n * @param {string=} paginationToken token for the next batch of events\n *\n * @fires module:client~MatrixClient#event:\"Room.timeline\"\n *\n */\n public addEventsToTimeline(\n events: MatrixEvent[],\n toStartOfTimeline: boolean,\n timeline: EventTimeline,\n paginationToken?: string,\n ): void {\n timeline.getTimelineSet().addEventsToTimeline(\n events, toStartOfTimeline,\n timeline, paginationToken,\n );\n }\n\n /**\n * @experimental\n */\n public addThread(thread: Thread): Set {\n this.threads.add(thread);\n if (!thread.ready) {\n thread.once(\"Thread.ready\", this.dedupeThreads);\n this.emit(\"Thread.update\", thread);\n this.reEmitter.reEmit(thread, [\"Thread.update\", \"Thread.ready\"]);\n }\n return this.threads;\n }\n\n /**\n * @experimental\n */\n public getThread(eventId: string): Thread {\n return this.getThreads().find(thread => {\n return thread.id === eventId;\n });\n }\n\n /**\n * @experimental\n */\n public getThreads(): Thread[] {\n return Array.from(this.threads.values());\n }\n\n /**\n * Two threads starting from a different child event can end up\n * with the same event root. This method ensures that the duplicates\n * are removed\n * @experimental\n */\n private dedupeThreads = (readyThread): void => {\n const threads = Array.from(this.threads);\n if (threads.includes(readyThread)) {\n this.threads = new Set(threads.filter(thread => {\n if (readyThread.id === thread.id && readyThread !== thread) {\n return false;\n } else {\n return true;\n }\n }));\n }\n };\n\n /**\n * Get a member from the current room state.\n * @param {string} userId The user ID of the member.\n * @return {RoomMember} The member or null.\n */\n public getMember(userId: string): RoomMember | null {\n return this.currentState.getMember(userId);\n }\n\n /**\n * Get all currently loaded members from the current\n * room state.\n * @returns {RoomMember[]} Room members\n */\n public getMembers(): RoomMember[] {\n return this.currentState.getMembers();\n }\n\n /**\n * Get a list of members whose membership state is \"join\".\n * @return {RoomMember[]} A list of currently joined members.\n */\n public getJoinedMembers(): RoomMember[] {\n return this.getMembersWithMembership(\"join\");\n }\n\n /**\n * Returns the number of joined members in this room\n * This method caches the result.\n * This is a wrapper around the method of the same name in roomState, returning\n * its result for the room's current state.\n * @return {number} The number of members in this room whose membership is 'join'\n */\n public getJoinedMemberCount(): number {\n return this.currentState.getJoinedMemberCount();\n }\n\n /**\n * Returns the number of invited members in this room\n * @return {number} The number of members in this room whose membership is 'invite'\n */\n public getInvitedMemberCount(): number {\n return this.currentState.getInvitedMemberCount();\n }\n\n /**\n * Returns the number of invited + joined members in this room\n * @return {number} The number of members in this room whose membership is 'invite' or 'join'\n */\n public getInvitedAndJoinedMemberCount(): number {\n return this.getInvitedMemberCount() + this.getJoinedMemberCount();\n }\n\n /**\n * Get a list of members with given membership state.\n * @param {string} membership The membership state.\n * @return {RoomMember[]} A list of members with the given membership state.\n */\n public getMembersWithMembership(membership: string): RoomMember[] {\n return this.currentState.getMembers().filter(function(m) {\n return m.membership === membership;\n });\n }\n\n /**\n * Get a list of members we should be encrypting for in this room\n * @return {Promise} A list of members who\n * we should encrypt messages for in this room.\n */\n public async getEncryptionTargetMembers(): Promise {\n await this.loadMembersIfNeeded();\n let members = this.getMembersWithMembership(\"join\");\n if (this.shouldEncryptForInvitedMembers()) {\n members = members.concat(this.getMembersWithMembership(\"invite\"));\n }\n return members;\n }\n\n /**\n * Determine whether we should encrypt messages for invited users in this room\n * @return {boolean} if we should encrypt messages for invited users\n */\n public shouldEncryptForInvitedMembers(): boolean {\n const ev = this.currentState.getStateEvents(EventType.RoomHistoryVisibility, \"\");\n return ev?.getContent()?.history_visibility !== \"joined\";\n }\n\n /**\n * Get the default room name (i.e. what a given user would see if the\n * room had no m.room.name)\n * @param {string} userId The userId from whose perspective we want\n * to calculate the default name\n * @return {string} The default room name\n */\n public getDefaultRoomName(userId: string): string {\n return this.calculateRoomName(userId, true);\n }\n\n /**\n * Check if the given user_id has the given membership state.\n * @param {string} userId The user ID to check.\n * @param {string} membership The membership e.g. 'join'\n * @return {boolean} True if this user_id has the given membership state.\n */\n public hasMembershipState(userId: string, membership: string): boolean {\n const member = this.getMember(userId);\n if (!member) {\n return false;\n }\n return member.membership === membership;\n }\n\n /**\n * Add a timelineSet for this room with the given filter\n * @param {Filter} filter The filter to be applied to this timelineSet\n * @return {EventTimelineSet} The timelineSet\n */\n public getOrCreateFilteredTimelineSet(filter: Filter): EventTimelineSet {\n if (this.filteredTimelineSets[filter.filterId]) {\n return this.filteredTimelineSets[filter.filterId];\n }\n const opts = Object.assign({ filter: filter }, this.opts);\n const timelineSet = new EventTimelineSet(this, opts);\n this.reEmitter.reEmit(timelineSet, [\"Room.timeline\", \"Room.timelineReset\"]);\n this.filteredTimelineSets[filter.filterId] = timelineSet;\n this.timelineSets.push(timelineSet);\n\n // populate up the new timelineSet with filtered events from our live\n // unfiltered timeline.\n //\n // XXX: This is risky as our timeline\n // may have grown huge and so take a long time to filter.\n // see https://github.com/vector-im/vector-web/issues/2109\n\n const unfilteredLiveTimeline = this.getLiveTimeline();\n\n unfilteredLiveTimeline.getEvents().forEach(function(event) {\n timelineSet.addLiveEvent(event);\n });\n\n // find the earliest unfiltered timeline\n let timeline = unfilteredLiveTimeline;\n while (timeline.getNeighbouringTimeline(EventTimeline.BACKWARDS)) {\n timeline = timeline.getNeighbouringTimeline(EventTimeline.BACKWARDS);\n }\n\n timelineSet.getLiveTimeline().setPaginationToken(\n timeline.getPaginationToken(EventTimeline.BACKWARDS),\n EventTimeline.BACKWARDS,\n );\n\n // alternatively, we could try to do something like this to try and re-paginate\n // in the filtered events from nothing, but Mark says it's an abuse of the API\n // to do so:\n //\n // timelineSet.resetLiveTimeline(\n // unfilteredLiveTimeline.getPaginationToken(EventTimeline.FORWARDS)\n // );\n\n return timelineSet;\n }\n\n /**\n * Forget the timelineSet for this room with the given filter\n *\n * @param {Filter} filter the filter whose timelineSet is to be forgotten\n */\n public removeFilteredTimelineSet(filter: Filter): void {\n const timelineSet = this.filteredTimelineSets[filter.filterId];\n delete this.filteredTimelineSets[filter.filterId];\n const i = this.timelineSets.indexOf(timelineSet);\n if (i > -1) {\n this.timelineSets.splice(i, 1);\n }\n }\n\n /**\n * Add an event to a thread's timeline. Will fire \"Thread.update\"\n * @experimental\n */\n public addThreadedEvent(event: MatrixEvent): void {\n if (event.getUnsigned().transaction_id) {\n const existingEvent = this.txnToEvent[event.getUnsigned().transaction_id];\n if (existingEvent) {\n // remote echo of an event we sent earlier\n this.handleRemoteEcho(event, existingEvent);\n }\n }\n\n let thread = this.findEventById(event.replyEventId)?.getThread();\n if (thread) {\n thread.addEvent(event);\n } else {\n thread = new Thread([event], this, this.client);\n this.addThread(thread);\n }\n }\n\n /**\n * Add an event to the end of this room's live timelines. Will fire\n * \"Room.timeline\".\n *\n * @param {MatrixEvent} event Event to be added\n * @param {string?} duplicateStrategy 'ignore' or 'replace'\n * @param {boolean} fromCache whether the sync response came from cache\n * @fires module:client~MatrixClient#event:\"Room.timeline\"\n * @private\n */\n private addLiveEvent(event: MatrixEvent, duplicateStrategy?: \"ignore\" | \"replace\", fromCache = false): void {\n if (event.isRedaction()) {\n const redactId = event.event.redacts;\n\n // if we know about this event, redact its contents now.\n const redactedEvent = this.getUnfilteredTimelineSet().findEventById(redactId);\n if (redactedEvent) {\n redactedEvent.makeRedacted(event);\n\n // If this is in the current state, replace it with the redacted version\n if (redactedEvent.getStateKey()) {\n const currentStateEvent = this.currentState.getStateEvents(\n redactedEvent.getType(),\n redactedEvent.getStateKey(),\n );\n if (currentStateEvent.getId() === redactedEvent.getId()) {\n this.currentState.setStateEvents([redactedEvent]);\n }\n }\n\n this.emit(\"Room.redaction\", event, this);\n\n // TODO: we stash user displaynames (among other things) in\n // RoomMember objects which are then attached to other events\n // (in the sender and target fields). We should get those\n // RoomMember objects to update themselves when the events that\n // they are based on are changed.\n }\n\n // FIXME: apply redactions to notification list\n\n // NB: We continue to add the redaction event to the timeline so\n // clients can say \"so and so redacted an event\" if they wish to. Also\n // this may be needed to trigger an update.\n }\n\n if (event.getUnsigned().transaction_id) {\n const existingEvent = this.txnToEvent[event.getUnsigned().transaction_id];\n if (existingEvent) {\n // remote echo of an event we sent earlier\n this.handleRemoteEcho(event, existingEvent);\n return;\n }\n }\n\n // add to our timeline sets\n for (let i = 0; i < this.timelineSets.length; i++) {\n this.timelineSets[i].addLiveEvent(event, duplicateStrategy, fromCache);\n }\n\n // synthesize and inject implicit read receipts\n // Done after adding the event because otherwise the app would get a read receipt\n // pointing to an event that wasn't yet in the timeline\n // Don't synthesize RR for m.room.redaction as this causes the RR to go missing.\n if (event.sender && event.getType() !== EventType.RoomRedaction) {\n this.addReceipt(synthesizeReceipt(\n event.sender.userId, event, \"m.read\",\n ), true);\n\n // Any live events from a user could be taken as implicit\n // presence information: evidence that they are currently active.\n // ...except in a world where we use 'user.currentlyActive' to reduce\n // presence spam, this isn't very useful - we'll get a transition when\n // they are no longer currently active anyway. So don't bother to\n // reset the lastActiveAgo and lastPresenceTs from the RoomState's user.\n }\n }\n\n /**\n * Add a pending outgoing event to this room.\n *\n *

The event is added to either the pendingEventList, or the live timeline,\n * depending on the setting of opts.pendingEventOrdering.\n *\n *

This is an internal method, intended for use by MatrixClient.\n *\n * @param {module:models/event.MatrixEvent} event The event to add.\n *\n * @param {string} txnId Transaction id for this outgoing event\n *\n * @fires module:client~MatrixClient#event:\"Room.localEchoUpdated\"\n *\n * @throws if the event doesn't have status SENDING, or we aren't given a\n * unique transaction id.\n */\n public addPendingEvent(event: MatrixEvent, txnId: string): void {\n if (event.status !== EventStatus.SENDING && event.status !== EventStatus.NOT_SENT) {\n throw new Error(\"addPendingEvent called on an event with status \" +\n event.status);\n }\n\n if (this.txnToEvent[txnId]) {\n throw new Error(\"addPendingEvent called on an event with known txnId \" +\n txnId);\n }\n\n // call setEventMetadata to set up event.sender etc\n // as event is shared over all timelineSets, we set up its metadata based\n // on the unfiltered timelineSet.\n EventTimeline.setEventMetadata(event, this.getLiveTimeline().getState(EventTimeline.FORWARDS), false);\n\n this.txnToEvent[txnId] = event;\n\n if (this.opts.pendingEventOrdering == \"detached\") {\n if (this.pendingEventList.some((e) => e.status === EventStatus.NOT_SENT)) {\n logger.warn(\"Setting event as NOT_SENT due to messages in the same state\");\n event.setStatus(EventStatus.NOT_SENT);\n }\n this.pendingEventList.push(event);\n this.savePendingEvents();\n if (event.isRelation()) {\n // For pending events, add them to the relations collection immediately.\n // (The alternate case below already covers this as part of adding to\n // the timeline set.)\n this.aggregateNonLiveRelation(event);\n }\n\n if (event.isRedaction()) {\n const redactId = event.event.redacts;\n let redactedEvent = this.pendingEventList &&\n this.pendingEventList.find(e => e.getId() === redactId);\n if (!redactedEvent) {\n redactedEvent = this.getUnfilteredTimelineSet().findEventById(redactId);\n }\n if (redactedEvent) {\n redactedEvent.markLocallyRedacted(event);\n this.emit(\"Room.redaction\", event, this);\n }\n }\n } else {\n for (let i = 0; i < this.timelineSets.length; i++) {\n const timelineSet = this.timelineSets[i];\n if (timelineSet.getFilter()) {\n if (timelineSet.getFilter().filterRoomTimeline([event]).length) {\n timelineSet.addEventToTimeline(event,\n timelineSet.getLiveTimeline(), false);\n }\n } else {\n timelineSet.addEventToTimeline(event,\n timelineSet.getLiveTimeline(), false);\n }\n }\n }\n\n this.emit(\"Room.localEchoUpdated\", event, this, null, null);\n }\n\n /**\n * Persists all pending events to local storage\n *\n * If the current room is encrypted only encrypted events will be persisted\n * all messages that are not yet encrypted will be discarded\n *\n * This is because the flow of EVENT_STATUS transition is\n * queued => sending => encrypting => sending => sent\n *\n * Steps 3 and 4 are skipped for unencrypted room.\n * It is better to discard an unencrypted message rather than persisting\n * it locally for everyone to read\n */\n private savePendingEvents(): void {\n if (this.pendingEventList) {\n const pendingEvents = this.pendingEventList.map(event => {\n return {\n ...event.event,\n txn_id: event.getTxnId(),\n };\n }).filter(event => {\n // Filter out the unencrypted messages if the room is encrypted\n const isEventEncrypted = event.type === EventType.RoomMessageEncrypted;\n const isRoomEncrypted = this.client.isRoomEncrypted(this.roomId);\n return isEventEncrypted || !isRoomEncrypted;\n });\n\n const { store } = this.client.sessionStore;\n if (this.pendingEventList.length > 0) {\n store.setItem(\n pendingEventsKey(this.roomId),\n JSON.stringify(pendingEvents),\n );\n } else {\n store.removeItem(pendingEventsKey(this.roomId));\n }\n }\n }\n\n /**\n * Used to aggregate the local echo for a relation, and also\n * for re-applying a relation after it's redaction has been cancelled,\n * as the local echo for the redaction of the relation would have\n * un-aggregated the relation. Note that this is different from regular messages,\n * which are just kept detached for their local echo.\n *\n * Also note that live events are aggregated in the live EventTimelineSet.\n * @param {module:models/event.MatrixEvent} event the relation event that needs to be aggregated.\n */\n private aggregateNonLiveRelation(event: MatrixEvent): void {\n // TODO: We should consider whether this means it would be a better\n // design to lift the relations handling up to the room instead.\n for (let i = 0; i < this.timelineSets.length; i++) {\n const timelineSet = this.timelineSets[i];\n if (timelineSet.getFilter()) {\n if (timelineSet.getFilter().filterRoomTimeline([event]).length) {\n timelineSet.aggregateRelations(event);\n }\n } else {\n timelineSet.aggregateRelations(event);\n }\n }\n }\n\n /**\n * Deal with the echo of a message we sent.\n *\n *

We move the event to the live timeline if it isn't there already, and\n * update it.\n *\n * @param {module:models/event.MatrixEvent} remoteEvent The event received from\n * /sync\n * @param {module:models/event.MatrixEvent} localEvent The local echo, which\n * should be either in the pendingEventList or the timeline.\n *\n * @fires module:client~MatrixClient#event:\"Room.localEchoUpdated\"\n * @private\n */\n private handleRemoteEcho(remoteEvent: MatrixEvent, localEvent: MatrixEvent): void {\n const oldEventId = localEvent.getId();\n const newEventId = remoteEvent.getId();\n const oldStatus = localEvent.status;\n\n logger.debug(\n `Got remote echo for event ${oldEventId} -> ${newEventId} ` +\n `old status ${oldStatus}`,\n );\n\n // no longer pending\n delete this.txnToEvent[remoteEvent.getUnsigned().transaction_id];\n\n // if it's in the pending list, remove it\n if (this.pendingEventList) {\n this.removePendingEvent(oldEventId);\n }\n\n // replace the event source (this will preserve the plaintext payload if\n // any, which is good, because we don't want to try decoding it again).\n localEvent.handleRemoteEcho(remoteEvent.event);\n\n for (let i = 0; i < this.timelineSets.length; i++) {\n const timelineSet = this.timelineSets[i];\n\n // if it's already in the timeline, update the timeline map. If it's not, add it.\n timelineSet.handleRemoteEcho(localEvent, oldEventId, newEventId);\n }\n\n this.emit(\"Room.localEchoUpdated\", localEvent, this,\n oldEventId, oldStatus);\n }\n\n /**\n * Update the status / event id on a pending event, to reflect its transmission\n * progress.\n *\n *

This is an internal method.\n *\n * @param {MatrixEvent} event local echo event\n * @param {EventStatus} newStatus status to assign\n * @param {string} newEventId new event id to assign. Ignored unless\n * newStatus == EventStatus.SENT.\n * @fires module:client~MatrixClient#event:\"Room.localEchoUpdated\"\n */\n public updatePendingEvent(event: MatrixEvent, newStatus: EventStatus, newEventId?: string): void {\n logger.log(\n `setting pendingEvent status to ${newStatus} in ${event.getRoomId()} ` +\n `event ID ${event.getId()} -> ${newEventId}`,\n );\n\n // if the message was sent, we expect an event id\n if (newStatus == EventStatus.SENT && !newEventId) {\n throw new Error(\"updatePendingEvent called with status=SENT, \" +\n \"but no new event id\");\n }\n\n // SENT races against /sync, so we have to special-case it.\n if (newStatus == EventStatus.SENT) {\n const timeline = this.getUnfilteredTimelineSet().eventIdToTimeline(newEventId);\n if (timeline) {\n // we've already received the event via the event stream.\n // nothing more to do here.\n return;\n }\n }\n\n const oldStatus = event.status;\n const oldEventId = event.getId();\n\n if (!oldStatus) {\n throw new Error(\"updatePendingEventStatus called on an event which is \" +\n \"not a local echo.\");\n }\n\n const allowed = ALLOWED_TRANSITIONS[oldStatus];\n if (!allowed || allowed.indexOf(newStatus) < 0) {\n throw new Error(\"Invalid EventStatus transition \" + oldStatus + \"->\" +\n newStatus);\n }\n\n event.setStatus(newStatus);\n\n if (newStatus == EventStatus.SENT) {\n // update the event id\n event.replaceLocalEventId(newEventId);\n\n // if the event was already in the timeline (which will be the case if\n // opts.pendingEventOrdering==chronological), we need to update the\n // timeline map.\n for (let i = 0; i < this.timelineSets.length; i++) {\n this.timelineSets[i].replaceEventId(oldEventId, newEventId);\n }\n } else if (newStatus == EventStatus.CANCELLED) {\n // remove it from the pending event list, or the timeline.\n if (this.pendingEventList) {\n const idx = this.pendingEventList.findIndex(ev => ev.getId() === oldEventId);\n if (idx !== -1) {\n const [removedEvent] = this.pendingEventList.splice(idx, 1);\n if (removedEvent.isRedaction()) {\n this.revertRedactionLocalEcho(removedEvent);\n }\n }\n }\n this.removeEvent(oldEventId);\n }\n this.savePendingEvents();\n\n this.emit(\"Room.localEchoUpdated\", event, this, oldEventId, oldStatus);\n }\n\n private revertRedactionLocalEcho(redactionEvent: MatrixEvent): void {\n const redactId = redactionEvent.event.redacts;\n if (!redactId) {\n return;\n }\n const redactedEvent = this.getUnfilteredTimelineSet()\n .findEventById(redactId);\n if (redactedEvent) {\n redactedEvent.unmarkLocallyRedacted();\n // re-render after undoing redaction\n this.emit(\"Room.redactionCancelled\", redactionEvent, this);\n // reapply relation now redaction failed\n if (redactedEvent.isRelation()) {\n this.aggregateNonLiveRelation(redactedEvent);\n }\n }\n }\n\n /**\n * Add some events to this room. This can include state events, message\n * events and typing notifications. These events are treated as \"live\" so\n * they will go to the end of the timeline.\n *\n * @param {MatrixEvent[]} events A list of events to add.\n *\n * @param {string} duplicateStrategy Optional. Applies to events in the\n * timeline only. If this is 'replace' then if a duplicate is encountered, the\n * event passed to this function will replace the existing event in the\n * timeline. If this is not specified, or is 'ignore', then the event passed to\n * this function will be ignored entirely, preserving the existing event in the\n * timeline. Events are identical based on their event ID only.\n *\n * @param {boolean} fromCache whether the sync response came from cache\n * @throws If duplicateStrategy is not falsey, 'replace' or 'ignore'.\n */\n public addLiveEvents(events: MatrixEvent[], duplicateStrategy?: \"replace\" | \"ignore\", fromCache = false): void {\n let i;\n if (duplicateStrategy && [\"replace\", \"ignore\"].indexOf(duplicateStrategy) === -1) {\n throw new Error(\"duplicateStrategy MUST be either 'replace' or 'ignore'\");\n }\n\n // sanity check that the live timeline is still live\n for (i = 0; i < this.timelineSets.length; i++) {\n const liveTimeline = this.timelineSets[i].getLiveTimeline();\n if (liveTimeline.getPaginationToken(EventTimeline.FORWARDS)) {\n throw new Error(\n \"live timeline \" + i + \" is no longer live - it has a pagination token \" +\n \"(\" + liveTimeline.getPaginationToken(EventTimeline.FORWARDS) + \")\",\n );\n }\n if (liveTimeline.getNeighbouringTimeline(EventTimeline.FORWARDS)) {\n throw new Error(\n \"live timeline \" + i + \" is no longer live - \" +\n \"it has a neighbouring timeline\",\n );\n }\n }\n\n for (i = 0; i < events.length; i++) {\n // TODO: We should have a filter to say \"only add state event\n // types X Y Z to the timeline\".\n this.addLiveEvent(events[i], duplicateStrategy, fromCache);\n }\n }\n\n /**\n * Adds/handles ephemeral events such as typing notifications and read receipts.\n * @param {MatrixEvent[]} events A list of events to process\n */\n public addEphemeralEvents(events: MatrixEvent[]): void {\n for (const event of events) {\n if (event.getType() === 'm.typing') {\n this.currentState.setTypingEvent(event);\n } else if (event.getType() === 'm.receipt') {\n this.addReceipt(event);\n } // else ignore - life is too short for us to care about these events\n }\n }\n\n /**\n * Removes events from this room.\n * @param {String[]} eventIds A list of eventIds to remove.\n */\n public removeEvents(eventIds: string[]): void {\n for (let i = 0; i < eventIds.length; ++i) {\n this.removeEvent(eventIds[i]);\n }\n }\n\n /**\n * Removes a single event from this room.\n *\n * @param {String} eventId The id of the event to remove\n *\n * @return {boolean} true if the event was removed from any of the room's timeline sets\n */\n public removeEvent(eventId: string): boolean {\n let removedAny = false;\n for (let i = 0; i < this.timelineSets.length; i++) {\n const removed = this.timelineSets[i].removeEvent(eventId);\n if (removed) {\n if (removed.isRedaction()) {\n this.revertRedactionLocalEcho(removed);\n }\n removedAny = true;\n }\n }\n return removedAny;\n }\n\n /**\n * Recalculate various aspects of the room, including the room name and\n * room summary. Call this any time the room's current state is modified.\n * May fire \"Room.name\" if the room name is updated.\n * @fires module:client~MatrixClient#event:\"Room.name\"\n */\n public recalculate(): void {\n // set fake stripped state events if this is an invite room so logic remains\n // consistent elsewhere.\n const membershipEvent = this.currentState.getStateEvents(EventType.RoomMember, this.myUserId);\n if (membershipEvent && membershipEvent.getContent().membership === \"invite\") {\n const strippedStateEvents = membershipEvent.getUnsigned().invite_room_state || [];\n strippedStateEvents.forEach((strippedEvent) => {\n const existingEvent = this.currentState.getStateEvents(strippedEvent.type, strippedEvent.state_key);\n if (!existingEvent) {\n // set the fake stripped event instead\n this.currentState.setStateEvents([new MatrixEvent({\n type: strippedEvent.type,\n state_key: strippedEvent.state_key,\n content: strippedEvent.content,\n event_id: \"$fake\" + Date.now(),\n room_id: this.roomId,\n user_id: this.myUserId, // technically a lie\n })]);\n }\n });\n }\n\n const oldName = this.name;\n this.name = this.calculateRoomName(this.myUserId);\n this.normalizedName = normalize(this.name);\n this.summary = new RoomSummary(this.roomId, {\n title: this.name,\n });\n\n if (oldName !== this.name) {\n this.emit(\"Room.name\", this);\n }\n }\n\n /**\n * Get a list of user IDs who have read up to the given event.\n * @param {MatrixEvent} event the event to get read receipts for.\n * @return {String[]} A list of user IDs.\n */\n public getUsersReadUpTo(event: MatrixEvent): string[] {\n return this.getReceiptsForEvent(event).filter(function(receipt) {\n return receipt.type === \"m.read\";\n }).map(function(receipt) {\n return receipt.userId;\n });\n }\n\n /**\n * Get the ID of the event that a given user has read up to, or null if we\n * have received no read receipts from them.\n * @param {String} userId The user ID to get read receipt event ID for\n * @param {Boolean} ignoreSynthesized If true, return only receipts that have been\n * sent by the server, not implicit ones generated\n * by the JS SDK.\n * @return {String} ID of the latest event that the given user has read, or null.\n */\n public getEventReadUpTo(userId: string, ignoreSynthesized = false): string | null {\n let receipts = this.receipts;\n if (ignoreSynthesized) {\n receipts = this.realReceipts;\n }\n\n if (\n receipts[\"m.read\"] === undefined ||\n receipts[\"m.read\"][userId] === undefined\n ) {\n return null;\n }\n\n return receipts[\"m.read\"][userId].eventId;\n }\n\n /**\n * Determines if the given user has read a particular event ID with the known\n * history of the room. This is not a definitive check as it relies only on\n * what is available to the room at the time of execution.\n * @param {String} userId The user ID to check the read state of.\n * @param {String} eventId The event ID to check if the user read.\n * @returns {Boolean} True if the user has read the event, false otherwise.\n */\n public hasUserReadEvent(userId: string, eventId: string): boolean {\n const readUpToId = this.getEventReadUpTo(userId, false);\n if (readUpToId === eventId) return true;\n\n if (this.timeline.length\n && this.timeline[this.timeline.length - 1].getSender()\n && this.timeline[this.timeline.length - 1].getSender() === userId) {\n // It doesn't matter where the event is in the timeline, the user has read\n // it because they've sent the latest event.\n return true;\n }\n\n for (let i = this.timeline.length - 1; i >= 0; --i) {\n const ev = this.timeline[i];\n\n // If we encounter the target event first, the user hasn't read it\n // however if we encounter the readUpToId first then the user has read\n // it. These rules apply because we're iterating bottom-up.\n if (ev.getId() === eventId) return false;\n if (ev.getId() === readUpToId) return true;\n }\n\n // We don't know if the user has read it, so assume not.\n return false;\n }\n\n /**\n * Get a list of receipts for the given event.\n * @param {MatrixEvent} event the event to get receipts for\n * @return {Object[]} A list of receipts with a userId, type and data keys or\n * an empty list.\n */\n public getReceiptsForEvent(event: MatrixEvent): ICachedReceipt[] {\n return this.receiptCacheByEventId[event.getId()] || [];\n }\n\n /**\n * Add a receipt event to the room.\n * @param {MatrixEvent} event The m.receipt event.\n * @param {Boolean} fake True if this event is implicit\n */\n public addReceipt(event: MatrixEvent, fake = false): void {\n if (!fake) {\n this.addReceiptsToStructure(event, this.realReceipts);\n // we don't bother caching real receipts by event ID\n // as there's nothing that would read it.\n }\n this.addReceiptsToStructure(event, this.receipts);\n this.receiptCacheByEventId = this.buildReceiptCache(this.receipts);\n\n // send events after we've regenerated the cache, otherwise things that\n // listened for the event would read from a stale cache\n this.emit(\"Room.receipt\", event, this);\n }\n\n /**\n * Add a receipt event to the room.\n * @param {MatrixEvent} event The m.receipt event.\n * @param {Object} receipts The object to add receipts to\n */\n private addReceiptsToStructure(event: MatrixEvent, receipts: Receipts): void {\n const content = event.getContent();\n Object.keys(content).forEach((eventId) => {\n Object.keys(content[eventId]).forEach((receiptType) => {\n Object.keys(content[eventId][receiptType]).forEach((userId) => {\n const receipt = content[eventId][receiptType][userId];\n\n if (!receipts[receiptType]) {\n receipts[receiptType] = {};\n }\n\n const existingReceipt = receipts[receiptType][userId];\n\n if (!existingReceipt) {\n receipts[receiptType][userId] = {} as IWrappedReceipt;\n } else {\n // we only want to add this receipt if we think it is later\n // than the one we already have. (This is managed\n // server-side, but because we synthesize RRs locally we\n // have to do it here too.)\n const ordering = this.getUnfilteredTimelineSet().compareEventOrdering(\n existingReceipt.eventId, eventId);\n if (ordering !== null && ordering >= 0) {\n return;\n }\n }\n\n receipts[receiptType][userId] = {\n eventId: eventId,\n data: receipt,\n };\n });\n });\n });\n }\n\n /**\n * Build and return a map of receipts by event ID\n * @param {Object} receipts A map of receipts\n * @return {Object} Map of receipts by event ID\n */\n private buildReceiptCache(receipts: Receipts): ReceiptCache {\n const receiptCacheByEventId = {};\n Object.keys(receipts).forEach(function(receiptType) {\n Object.keys(receipts[receiptType]).forEach(function(userId) {\n const receipt = receipts[receiptType][userId];\n if (!receiptCacheByEventId[receipt.eventId]) {\n receiptCacheByEventId[receipt.eventId] = [];\n }\n receiptCacheByEventId[receipt.eventId].push({\n userId: userId,\n type: receiptType,\n data: receipt.data,\n });\n });\n });\n return receiptCacheByEventId;\n }\n\n /**\n * Add a temporary local-echo receipt to the room to reflect in the\n * client the fact that we've sent one.\n * @param {string} userId The user ID if the receipt sender\n * @param {MatrixEvent} e The event that is to be acknowledged\n * @param {string} receiptType The type of receipt\n */\n public addLocalEchoReceipt(userId: string, e: MatrixEvent, receiptType: string): void {\n this.addReceipt(synthesizeReceipt(userId, e, receiptType), true);\n }\n\n /**\n * Update the room-tag event for the room. The previous one is overwritten.\n * @param {MatrixEvent} event the m.tag event\n */\n public addTags(event: MatrixEvent): void {\n // event content looks like:\n // content: {\n // tags: {\n // $tagName: { $metadata: $value },\n // $tagName: { $metadata: $value },\n // }\n // }\n\n // XXX: do we need to deep copy here?\n this.tags = event.getContent().tags || {};\n\n // XXX: we could do a deep-comparison to see if the tags have really\n // changed - but do we want to bother?\n this.emit(\"Room.tags\", event, this);\n }\n\n /**\n * Update the account_data events for this room, overwriting events of the same type.\n * @param {Array} events an array of account_data events to add\n */\n public addAccountData(events: MatrixEvent[]): void {\n for (let i = 0; i < events.length; i++) {\n const event = events[i];\n if (event.getType() === \"m.tag\") {\n this.addTags(event);\n }\n const lastEvent = this.accountData[event.getType()];\n this.accountData[event.getType()] = event;\n this.emit(\"Room.accountData\", event, this, lastEvent);\n }\n }\n\n /**\n * Access account_data event of given event type for this room\n * @param {string} type the type of account_data event to be accessed\n * @return {?MatrixEvent} the account_data event in question\n */\n public getAccountData(type: EventType | string): MatrixEvent | undefined {\n return this.accountData[type];\n }\n\n /**\n * Returns whether the syncing user has permission to send a message in the room\n * @return {boolean} true if the user should be permitted to send\n * message events into the room.\n */\n public maySendMessage(): boolean {\n return this.getMyMembership() === 'join' &&\n this.currentState.maySendEvent(EventType.RoomMessage, this.myUserId);\n }\n\n /**\n * Returns whether the given user has permissions to issue an invite for this room.\n * @param {string} userId the ID of the Matrix user to check permissions for\n * @returns {boolean} true if the user should be permitted to issue invites for this room.\n */\n public canInvite(userId: string): boolean {\n let canInvite = this.getMyMembership() === \"join\";\n const powerLevelsEvent = this.currentState.getStateEvents(EventType.RoomPowerLevels, \"\");\n const powerLevels = powerLevelsEvent && powerLevelsEvent.getContent();\n const me = this.getMember(userId);\n if (powerLevels && me && powerLevels.invite > me.powerLevel) {\n canInvite = false;\n }\n return canInvite;\n }\n\n /**\n * Returns the join rule based on the m.room.join_rule state event, defaulting to `invite`.\n * @returns {string} the join_rule applied to this room\n */\n public getJoinRule(): string {\n return this.currentState.getJoinRule();\n }\n\n /**\n * Returns the type of the room from the `m.room.create` event content or undefined if none is set\n * @returns {?string} the type of the room. Currently only RoomType.Space is known.\n */\n public getType(): RoomType | string | undefined {\n const createEvent = this.currentState.getStateEvents(EventType.RoomCreate, \"\");\n if (!createEvent) {\n if (!this.getTypeWarning) {\n logger.warn(\"[getType] Room \" + this.roomId + \" does not have an m.room.create event\");\n this.getTypeWarning = true;\n }\n return undefined;\n }\n return createEvent.getContent()[RoomCreateTypeField];\n }\n\n /**\n * Returns whether the room is a space-room as defined by MSC1772.\n * @returns {boolean} true if the room's type is RoomType.Space\n */\n public isSpaceRoom(): boolean {\n return this.getType() === RoomType.Space;\n }\n\n /**\n * This is an internal method. Calculates the name of the room from the current\n * room state.\n * @param {string} userId The client's user ID. Used to filter room members\n * correctly.\n * @param {boolean} ignoreRoomNameEvent Return the implicit room name that we'd see if there\n * was no m.room.name event.\n * @return {string} The calculated room name.\n */\n private calculateRoomName(userId: string, ignoreRoomNameEvent = false): string {\n if (!ignoreRoomNameEvent) {\n // check for an alias, if any. for now, assume first alias is the\n // official one.\n const mRoomName = this.currentState.getStateEvents(EventType.RoomName, \"\");\n if (mRoomName && mRoomName.getContent() && mRoomName.getContent().name) {\n return mRoomName.getContent().name;\n }\n }\n\n let alias = this.getCanonicalAlias();\n\n if (!alias) {\n const aliases = this.getAltAliases();\n\n if (aliases.length) {\n alias = aliases[0];\n }\n }\n if (alias) {\n return alias;\n }\n\n const joinedMemberCount = this.currentState.getJoinedMemberCount();\n const invitedMemberCount = this.currentState.getInvitedMemberCount();\n // -1 because these numbers include the syncing user\n let inviteJoinCount = joinedMemberCount + invitedMemberCount - 1;\n\n // get service members (e.g. helper bots) for exclusion\n let excludedUserIds: string[] = [];\n const mFunctionalMembers = this.currentState.getStateEvents(UNSTABLE_ELEMENT_FUNCTIONAL_USERS.name, \"\");\n if (Array.isArray(mFunctionalMembers?.getContent().service_members)) {\n excludedUserIds = mFunctionalMembers.getContent().service_members;\n }\n\n // get members that are NOT ourselves and are actually in the room.\n let otherNames = null;\n if (this.summaryHeroes) {\n // if we have a summary, the member state events\n // should be in the room state\n otherNames = [];\n this.summaryHeroes.forEach((userId) => {\n // filter service members\n if (excludedUserIds.includes(userId)) {\n inviteJoinCount--;\n return;\n }\n const member = this.getMember(userId);\n otherNames.push(member ? member.name : userId);\n });\n } else {\n let otherMembers = this.currentState.getMembers().filter((m) => {\n return m.userId !== userId &&\n (m.membership === \"invite\" || m.membership === \"join\");\n });\n otherMembers = otherMembers.filter(({ userId }) => {\n // filter service members\n if (excludedUserIds.includes(userId)) {\n inviteJoinCount--;\n return false;\n }\n return true;\n });\n // make sure members have stable order\n otherMembers.sort((a, b) => utils.compare(a.userId, b.userId));\n // only 5 first members, immitate summaryHeroes\n otherMembers = otherMembers.slice(0, 5);\n otherNames = otherMembers.map((m) => m.name);\n }\n\n if (inviteJoinCount) {\n return memberNamesToRoomName(otherNames, inviteJoinCount);\n }\n\n const myMembership = this.getMyMembership();\n // if I have created a room and invited people through\n // 3rd party invites\n if (myMembership == 'join') {\n const thirdPartyInvites =\n this.currentState.getStateEvents(EventType.RoomThirdPartyInvite);\n\n if (thirdPartyInvites && thirdPartyInvites.length) {\n const thirdPartyNames = thirdPartyInvites.map((i) => {\n return i.getContent().display_name;\n });\n\n return `Inviting ${memberNamesToRoomName(thirdPartyNames)}`;\n }\n }\n // let's try to figure out who was here before\n let leftNames = otherNames;\n // if we didn't have heroes, try finding them in the room state\n if (!leftNames.length) {\n leftNames = this.currentState.getMembers().filter((m) => {\n return m.userId !== userId &&\n m.membership !== \"invite\" &&\n m.membership !== \"join\";\n }).map((m) => m.name);\n }\n if (leftNames.length) {\n return `Empty room (was ${memberNamesToRoomName(leftNames)})`;\n } else {\n return \"Empty room\";\n }\n }\n}\n\n/**\n * @param {string} roomId ID of the current room\n * @returns {string} Storage key to retrieve pending events\n */\nfunction pendingEventsKey(roomId: string): string {\n return `mx_pending_events_${roomId}`;\n}\n\n/* a map from current event status to a list of allowed next statuses\n */\nconst ALLOWED_TRANSITIONS = {};\n\nALLOWED_TRANSITIONS[EventStatus.ENCRYPTING] = [\n EventStatus.SENDING,\n EventStatus.NOT_SENT,\n];\n\nALLOWED_TRANSITIONS[EventStatus.SENDING] = [\n EventStatus.ENCRYPTING,\n EventStatus.QUEUED,\n EventStatus.NOT_SENT,\n EventStatus.SENT,\n];\n\nALLOWED_TRANSITIONS[EventStatus.QUEUED] =\n [EventStatus.SENDING, EventStatus.CANCELLED];\n\nALLOWED_TRANSITIONS[EventStatus.SENT] =\n [];\n\nALLOWED_TRANSITIONS[EventStatus.NOT_SENT] =\n [EventStatus.SENDING, EventStatus.QUEUED, EventStatus.CANCELLED];\n\nALLOWED_TRANSITIONS[EventStatus.CANCELLED] =\n [];\n\n// TODO i18n\nfunction memberNamesToRoomName(names: string[], count = (names.length + 1)) {\n const countWithoutMe = count - 1;\n if (!names.length) {\n return \"Empty room\";\n } else if (names.length === 1 && countWithoutMe <= 1) {\n return names[0];\n } else if (names.length === 2 && countWithoutMe <= 2) {\n return `${names[0]} and ${names[1]}`;\n } else {\n const plural = countWithoutMe > 1;\n if (plural) {\n return `${names[0]} and ${countWithoutMe} others`;\n } else {\n return `${names[0]} and 1 other`;\n }\n }\n}\n\n/**\n * Fires when an event we had previously received is redacted.\n *\n * (Note this is *not* fired when the redaction happens before we receive the\n * event).\n *\n * @event module:client~MatrixClient#\"Room.redaction\"\n * @param {MatrixEvent} event The matrix redaction event\n * @param {Room} room The room containing the redacted event\n */\n\n/**\n * Fires when an event that was previously redacted isn't anymore.\n * This happens when the redaction couldn't be sent and\n * was subsequently cancelled by the user. Redactions have a local echo\n * which is undone in this scenario.\n *\n * @event module:client~MatrixClient#\"Room.redactionCancelled\"\n * @param {MatrixEvent} event The matrix redaction event that was cancelled.\n * @param {Room} room The room containing the unredacted event\n */\n\n/**\n * Fires whenever the name of a room is updated.\n * @event module:client~MatrixClient#\"Room.name\"\n * @param {Room} room The room whose Room.name was updated.\n * @example\n * matrixClient.on(\"Room.name\", function(room){\n * var newName = room.name;\n * });\n */\n\n/**\n * Fires whenever a receipt is received for a room\n * @event module:client~MatrixClient#\"Room.receipt\"\n * @param {event} event The receipt event\n * @param {Room} room The room whose receipts was updated.\n * @example\n * matrixClient.on(\"Room.receipt\", function(event, room){\n * var receiptContent = event.getContent();\n * });\n */\n\n/**\n * Fires whenever a room's tags are updated.\n * @event module:client~MatrixClient#\"Room.tags\"\n * @param {event} event The tags event\n * @param {Room} room The room whose Room.tags was updated.\n * @example\n * matrixClient.on(\"Room.tags\", function(event, room){\n * var newTags = event.getContent().tags;\n * if (newTags[\"favourite\"]) showStar(room);\n * });\n */\n\n/**\n * Fires whenever a room's account_data is updated.\n * @event module:client~MatrixClient#\"Room.accountData\"\n * @param {event} event The account_data event\n * @param {Room} room The room whose account_data was updated.\n * @param {MatrixEvent} prevEvent The event being replaced by\n * the new account data, if known.\n * @example\n * matrixClient.on(\"Room.accountData\", function(event, room, oldEvent){\n * if (event.getType() === \"m.room.colorscheme\") {\n * applyColorScheme(event.getContents());\n * }\n * });\n */\n\n/**\n * Fires when the status of a transmitted event is updated.\n *\n *

When an event is first transmitted, a temporary copy of the event is\n * inserted into the timeline, with a temporary event id, and a status of\n * 'SENDING'.\n *\n *

Once the echo comes back from the server, the content of the event\n * (MatrixEvent.event) is replaced by the complete event from the homeserver,\n * thus updating its event id, as well as server-generated fields such as the\n * timestamp. Its status is set to null.\n *\n *

Once the /send request completes, if the remote echo has not already\n * arrived, the event is updated with a new event id and the status is set to\n * 'SENT'. The server-generated fields are of course not updated yet.\n *\n *

If the /send fails, In this case, the event's status is set to\n * 'NOT_SENT'. If it is later resent, the process starts again, setting the\n * status to 'SENDING'. Alternatively, the message may be cancelled, which\n * removes the event from the room, and sets the status to 'CANCELLED'.\n *\n *

This event is raised to reflect each of the transitions above.\n *\n * @event module:client~MatrixClient#\"Room.localEchoUpdated\"\n *\n * @param {MatrixEvent} event The matrix event which has been updated\n *\n * @param {Room} room The room containing the redacted event\n *\n * @param {string} oldEventId The previous event id (the temporary event id,\n * except when updating a successfully-sent event when its echo arrives)\n *\n * @param {EventStatus} oldStatus The previous event status.\n */\n\n/**\n * Fires when the logged in user's membership in the room is updated.\n *\n * @event module:models/room~Room#\"Room.myMembership\"\n * @param {Room} room The room in which the membership has been updated\n * @param {string} membership The new membership value\n * @param {string} prevMembership The previous membership value\n */\n", + "/*\nCopyright 2015 - 2021 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n/**\n * @module models/search-result\n */\n\nimport { EventContext } from \"./event-context\";\nimport { EventMapper } from \"../event-mapper\";\nimport { IResultContext, ISearchResult } from \"../@types/search\";\n\nexport class SearchResult {\n /**\n * Create a SearchResponse from the response to /search\n * @static\n * @param {Object} jsonObj\n * @param {function} eventMapper\n * @return {SearchResult}\n */\n\n public static fromJson(jsonObj: ISearchResult, eventMapper: EventMapper): SearchResult {\n const jsonContext = jsonObj.context || {} as IResultContext;\n const eventsBefore = jsonContext.events_before || [];\n const eventsAfter = jsonContext.events_after || [];\n\n const context = new EventContext(eventMapper(jsonObj.result));\n\n context.setPaginateToken(jsonContext.start, true);\n context.addEvents(eventsBefore.map(eventMapper), true);\n context.addEvents(eventsAfter.map(eventMapper), false);\n context.setPaginateToken(jsonContext.end, false);\n\n return new SearchResult(jsonObj.rank, context);\n }\n\n /**\n * Construct a new SearchResult\n *\n * @param {number} rank where this SearchResult ranks in the results\n * @param {event-context.EventContext} context the matching event and its\n * context\n *\n * @constructor\n */\n constructor(public readonly rank: number, public readonly context: EventContext) {}\n}\n", + "/*\nCopyright 2021 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\nimport { EventEmitter } from \"events\";\nimport { MatrixClient } from \"../matrix\";\nimport { MatrixEvent } from \"./event\";\nimport { EventTimelineSet } from './event-timeline-set';\nimport { Room } from './room';\n\n/**\n * @experimental\n */\nexport class Thread extends EventEmitter {\n /**\n * A reference to the event ID at the top of the thread\n */\n private root: string;\n /**\n * A reference to all the events ID at the bottom of the threads\n */\n public tail = new Set();\n private _timelineSet: EventTimelineSet;\n\n constructor(\n events: MatrixEvent[] = [],\n public readonly room: Room,\n public readonly client: MatrixClient,\n ) {\n super();\n this._timelineSet = new EventTimelineSet(room, {\n unstableClientRelationAggregation: true,\n timelineSupport: true,\n });\n events.forEach(event => this.addEvent(event));\n }\n\n /**\n * Add an event to the thread and updates\n * the tail/root references if needed\n * Will fire \"Thread.update\"\n * @param event The event to add\n */\n public async addEvent(event: MatrixEvent): Promise {\n if (this._timelineSet.findEventById(event.getId()) || event.status !== null) {\n return;\n }\n\n if (this.tail.has(event.replyEventId)) {\n this.tail.delete(event.replyEventId);\n }\n this.tail.add(event.getId());\n\n if (!event.replyEventId || !this._timelineSet.findEventById(event.replyEventId)) {\n this.root = event.getId();\n }\n\n event.setThread(this);\n this._timelineSet.addLiveEvent(event);\n\n if (this.ready) {\n this.client.decryptEventIfNeeded(event, {});\n this.emit(\"Thread.update\", this);\n } else {\n this.emit(\"Thread.update\", this);\n }\n }\n\n /**\n * Completes the reply chain with all events\n * missing from the current sync data\n * Will fire \"Thread.ready\"\n */\n public async fetchReplyChain(): Promise {\n if (!this.ready) {\n let mxEvent = this.room.findEventById(this.rootEvent.replyEventId);\n if (!mxEvent) {\n mxEvent = await this.fetchEventById(\n this.rootEvent.getRoomId(),\n this.rootEvent.replyEventId,\n );\n }\n\n this.addEvent(mxEvent);\n if (mxEvent.replyEventId) {\n await this.fetchReplyChain();\n } else {\n await this.decryptEvents();\n this.emit(\"Thread.ready\", this);\n }\n }\n }\n\n private async decryptEvents(): Promise {\n await Promise.allSettled(\n Array.from(this._timelineSet.getLiveTimeline().getEvents()).map(event => {\n return this.client.decryptEventIfNeeded(event, {});\n }),\n );\n }\n\n /**\n * Fetches an event over the network\n */\n private async fetchEventById(roomId: string, eventId: string): Promise {\n const response = await this.client.http.authedRequest(\n undefined,\n \"GET\",\n `/rooms/${roomId}/event/${eventId}`,\n );\n return new MatrixEvent(response);\n }\n\n /**\n * Finds an event by ID in the current thread\n */\n public findEventById(eventId: string) {\n return this._timelineSet.findEventById(eventId);\n }\n\n /**\n * Determines thread's ready status\n */\n public get ready(): boolean {\n return this.rootEvent.replyEventId === undefined;\n }\n\n /**\n * The thread ID, which is the same as the root event ID\n */\n public get id(): string {\n return this.root;\n }\n\n /**\n * The thread root event\n */\n public get rootEvent(): MatrixEvent {\n return this.findEventById(this.root);\n }\n\n /**\n * The number of messages in the thread\n */\n public get length(): number {\n return this._timelineSet.getLiveTimeline().getEvents().length;\n }\n\n /**\n * A set of mxid participating to the thread\n */\n public get participants(): Set {\n const participants = new Set();\n this._timelineSet.getLiveTimeline().getEvents().forEach(event => {\n participants.add(event.getSender());\n });\n return participants;\n }\n\n /**\n * A read-only getter to access the timeline set\n */\n public get timelineSet(): EventTimelineSet {\n return this._timelineSet;\n }\n\n /**\n * A getter for the last event added to the thread\n */\n public get replyToEvent(): MatrixEvent {\n const events = this._timelineSet.getLiveTimeline().getEvents();\n return events[events.length -1];\n }\n}\n", "/*\nCopyright 2015 - 2021 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n/**\n * @module models/user\n */\n\nimport { EventEmitter } from \"events\";\n\nimport { MatrixEvent } from \"./event\";\n\nexport class User extends EventEmitter {\n // eslint-disable-next-line camelcase\n private modified: number;\n\n // XXX these should be read-only\n public displayName: string;\n public rawDisplayName: string;\n public avatarUrl: string;\n public presenceStatusMsg: string = null;\n public presence = \"offline\";\n public lastActiveAgo = 0;\n public lastPresenceTs = 0;\n public currentlyActive = false;\n public events: {\n presence?: MatrixEvent;\n profile?: MatrixEvent;\n } = {\n presence: null,\n profile: null,\n };\n // eslint-disable-next-line camelcase\n public unstable_statusMessage = \"\";\n\n /**\n * Construct a new User. A User must have an ID and can optionally have extra\n * information associated with it.\n * @constructor\n * @param {string} userId Required. The ID of this user.\n * @prop {string} userId The ID of the user.\n * @prop {Object} info The info object supplied in the constructor.\n * @prop {string} displayName The 'displayname' of the user if known.\n * @prop {string} avatarUrl The 'avatar_url' of the user if known.\n * @prop {string} presence The presence enum if known.\n * @prop {string} presenceStatusMsg The presence status message if known.\n * @prop {Number} lastActiveAgo The time elapsed in ms since the user interacted\n * proactively with the server, or we saw a message from the user\n * @prop {Number} lastPresenceTs Timestamp (ms since the epoch) for when we last\n * received presence data for this user. We can subtract\n * lastActiveAgo from this to approximate an absolute value for\n * when a user was last active.\n * @prop {Boolean} currentlyActive Whether we should consider lastActiveAgo to be\n * an approximation and that the user should be seen as active 'now'\n * @prop {string} unstable_statusMessage The status message for the user, if known. This is\n * different from the presenceStatusMsg in that this is not tied to\n * the user's presence, and should be represented differently.\n * @prop {Object} events The events describing this user.\n * @prop {MatrixEvent} events.presence The m.presence event for this user.\n */\n constructor(public readonly userId: string) {\n super();\n this.displayName = userId;\n this.rawDisplayName = userId;\n this.avatarUrl = null;\n this.updateModifiedTime();\n }\n\n /**\n * Update this User with the given presence event. May fire \"User.presence\",\n * \"User.avatarUrl\" and/or \"User.displayName\" if this event updates this user's\n * properties.\n * @param {MatrixEvent} event The m.presence event.\n * @fires module:client~MatrixClient#event:\"User.presence\"\n * @fires module:client~MatrixClient#event:\"User.displayName\"\n * @fires module:client~MatrixClient#event:\"User.avatarUrl\"\n */\n public setPresenceEvent(event: MatrixEvent): void {\n if (event.getType() !== \"m.presence\") {\n return;\n }\n const firstFire = this.events.presence === null;\n this.events.presence = event;\n\n const eventsToFire = [];\n if (event.getContent().presence !== this.presence || firstFire) {\n eventsToFire.push(\"User.presence\");\n }\n if (event.getContent().avatar_url &&\n event.getContent().avatar_url !== this.avatarUrl) {\n eventsToFire.push(\"User.avatarUrl\");\n }\n if (event.getContent().displayname &&\n event.getContent().displayname !== this.displayName) {\n eventsToFire.push(\"User.displayName\");\n }\n if (event.getContent().currently_active !== undefined &&\n event.getContent().currently_active !== this.currentlyActive) {\n eventsToFire.push(\"User.currentlyActive\");\n }\n\n this.presence = event.getContent().presence;\n eventsToFire.push(\"User.lastPresenceTs\");\n\n if (event.getContent().status_msg) {\n this.presenceStatusMsg = event.getContent().status_msg;\n }\n if (event.getContent().displayname) {\n this.displayName = event.getContent().displayname;\n }\n if (event.getContent().avatar_url) {\n this.avatarUrl = event.getContent().avatar_url;\n }\n this.lastActiveAgo = event.getContent().last_active_ago;\n this.lastPresenceTs = Date.now();\n this.currentlyActive = event.getContent().currently_active;\n\n this.updateModifiedTime();\n\n for (let i = 0; i < eventsToFire.length; i++) {\n this.emit(eventsToFire[i], event, this);\n }\n }\n\n /**\n * Manually set this user's display name. No event is emitted in response to this\n * as there is no underlying MatrixEvent to emit with.\n * @param {string} name The new display name.\n */\n public setDisplayName(name: string): void {\n const oldName = this.displayName;\n if (typeof name === \"string\") {\n this.displayName = name;\n } else {\n this.displayName = undefined;\n }\n if (name !== oldName) {\n this.updateModifiedTime();\n }\n }\n\n /**\n * Manually set this user's non-disambiguated display name. No event is emitted\n * in response to this as there is no underlying MatrixEvent to emit with.\n * @param {string} name The new display name.\n */\n public setRawDisplayName(name: string): void {\n if (typeof name === \"string\") {\n this.rawDisplayName = name;\n } else {\n this.rawDisplayName = undefined;\n }\n }\n\n /**\n * Manually set this user's avatar URL. No event is emitted in response to this\n * as there is no underlying MatrixEvent to emit with.\n * @param {string} url The new avatar URL.\n */\n public setAvatarUrl(url: string): void {\n const oldUrl = this.avatarUrl;\n this.avatarUrl = url;\n if (url !== oldUrl) {\n this.updateModifiedTime();\n }\n }\n\n /**\n * Update the last modified time to the current time.\n */\n private updateModifiedTime(): void {\n this.modified = Date.now();\n }\n\n /**\n * Get the timestamp when this User was last updated. This timestamp is\n * updated when this User receives a new Presence event which has updated a\n * property on this object. It is updated before firing events.\n * @return {number} The timestamp\n */\n public getLastModifiedTime(): number {\n return this.modified;\n }\n\n /**\n * Get the absolute timestamp when this User was last known active on the server.\n * It is *NOT* accurate if this.currentlyActive is true.\n * @return {number} The timestamp\n */\n public getLastActiveTs(): number {\n return this.lastPresenceTs - this.lastActiveAgo;\n }\n\n /**\n * Manually set the user's status message.\n * @param {MatrixEvent} event The im.vector.user_status event.\n * @fires module:client~MatrixClient#event:\"User.unstable_statusMessage\"\n */\n // eslint-disable-next-line\n public unstable_updateStatusMessage(event: MatrixEvent): void {\n if (!event.getContent()) this.unstable_statusMessage = \"\";\n else this.unstable_statusMessage = event.getContent()[\"status\"];\n this.updateModifiedTime();\n this.emit(\"User.unstable_statusMessage\", this);\n }\n}\n\n/**\n * Fires whenever any user's lastPresenceTs changes,\n * ie. whenever any presence event is received for a user.\n * @event module:client~MatrixClient#\"User.lastPresenceTs\"\n * @param {MatrixEvent} event The matrix event which caused this event to fire.\n * @param {User} user The user whose User.lastPresenceTs changed.\n * @example\n * matrixClient.on(\"User.lastPresenceTs\", function(event, user){\n * var newlastPresenceTs = user.lastPresenceTs;\n * });\n */\n\n/**\n * Fires whenever any user's presence changes.\n * @event module:client~MatrixClient#\"User.presence\"\n * @param {MatrixEvent} event The matrix event which caused this event to fire.\n * @param {User} user The user whose User.presence changed.\n * @example\n * matrixClient.on(\"User.presence\", function(event, user){\n * var newPresence = user.presence;\n * });\n */\n\n/**\n * Fires whenever any user's currentlyActive changes.\n * @event module:client~MatrixClient#\"User.currentlyActive\"\n * @param {MatrixEvent} event The matrix event which caused this event to fire.\n * @param {User} user The user whose User.currentlyActive changed.\n * @example\n * matrixClient.on(\"User.currentlyActive\", function(event, user){\n * var newCurrentlyActive = user.currentlyActive;\n * });\n */\n\n/**\n * Fires whenever any user's display name changes.\n * @event module:client~MatrixClient#\"User.displayName\"\n * @param {MatrixEvent} event The matrix event which caused this event to fire.\n * @param {User} user The user whose User.displayName changed.\n * @example\n * matrixClient.on(\"User.displayName\", function(event, user){\n * var newName = user.displayName;\n * });\n */\n\n/**\n * Fires whenever any user's avatar URL changes.\n * @event module:client~MatrixClient#\"User.avatarUrl\"\n * @param {MatrixEvent} event The matrix event which caused this event to fire.\n * @param {User} user The user whose User.avatarUrl changed.\n * @example\n * matrixClient.on(\"User.avatarUrl\", function(event, user){\n * var newUrl = user.avatarUrl;\n * });\n */\n", - "/*\nCopyright 2015, 2016 OpenMarket Ltd\nCopyright 2017 New Vector Ltd\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\nimport { escapeRegExp, globToRegexp, isNullOrUndefined } from \"./utils\";\nimport { logger } from './logger';\n\n/**\n * @module pushprocessor\n */\n\nconst RULEKINDS_IN_ORDER = ['override', 'content', 'room', 'sender', 'underride'];\n\n// The default override rules to apply to the push rules that arrive from the server.\n// We do this for two reasons:\n// 1. Synapse is unlikely to send us the push rule in an incremental sync - see\n// https://github.com/matrix-org/synapse/pull/4867#issuecomment-481446072 for\n// more details.\n// 2. We often want to start using push rules ahead of the server supporting them,\n// and so we can put them here.\nconst DEFAULT_OVERRIDE_RULES = [\n {\n // For homeservers which don't support MSC1930 yet\n rule_id: \".m.rule.tombstone\",\n default: true,\n enabled: true,\n conditions: [\n {\n kind: \"event_match\",\n key: \"type\",\n pattern: \"m.room.tombstone\",\n },\n {\n kind: \"event_match\",\n key: \"state_key\",\n pattern: \"\",\n },\n ],\n actions: [\n \"notify\",\n {\n set_tweak: \"highlight\",\n value: true,\n },\n ],\n },\n {\n // For homeservers which don't support MSC2153 yet\n rule_id: \".m.rule.reaction\",\n default: true,\n enabled: true,\n conditions: [\n {\n kind: \"event_match\",\n key: \"type\",\n pattern: \"m.reaction\",\n },\n ],\n actions: [\n \"dont_notify\",\n ],\n },\n];\n\n/**\n * Construct a Push Processor.\n * @constructor\n * @param {Object} client The Matrix client object to use\n */\nexport function PushProcessor(client) {\n const cachedGlobToRegex = {\n // $glob: RegExp,\n };\n\n const matchingRuleFromKindSet = (ev, kindset) => {\n for (let ruleKindIndex = 0;\n ruleKindIndex < RULEKINDS_IN_ORDER.length;\n ++ruleKindIndex) {\n const kind = RULEKINDS_IN_ORDER[ruleKindIndex];\n const ruleset = kindset[kind];\n if (!ruleset) {\n continue;\n }\n\n for (let ruleIndex = 0; ruleIndex < ruleset.length; ++ruleIndex) {\n const rule = ruleset[ruleIndex];\n if (!rule.enabled) {\n continue;\n }\n\n const rawrule = templateRuleToRaw(kind, rule);\n if (!rawrule) {\n continue;\n }\n\n if (this.ruleMatchesEvent(rawrule, ev)) {\n rule.kind = kind;\n return rule;\n }\n }\n }\n return null;\n };\n\n const templateRuleToRaw = function(kind, tprule) {\n const rawrule = {\n 'rule_id': tprule.rule_id,\n 'actions': tprule.actions,\n 'conditions': [],\n };\n switch (kind) {\n case 'underride':\n case 'override':\n rawrule.conditions = tprule.conditions;\n break;\n case 'room':\n if (!tprule.rule_id) {\n return null;\n }\n rawrule.conditions.push({\n 'kind': 'event_match',\n 'key': 'room_id',\n 'value': tprule.rule_id,\n });\n break;\n case 'sender':\n if (!tprule.rule_id) {\n return null;\n }\n rawrule.conditions.push({\n 'kind': 'event_match',\n 'key': 'user_id',\n 'value': tprule.rule_id,\n });\n break;\n case 'content':\n if (!tprule.pattern) {\n return null;\n }\n rawrule.conditions.push({\n 'kind': 'event_match',\n 'key': 'content.body',\n 'pattern': tprule.pattern,\n });\n break;\n }\n return rawrule;\n };\n\n const eventFulfillsCondition = function(cond, ev) {\n const condition_functions = {\n \"event_match\": eventFulfillsEventMatchCondition,\n \"contains_display_name\": eventFulfillsDisplayNameCondition,\n \"room_member_count\": eventFulfillsRoomMemberCountCondition,\n \"sender_notification_permission\": eventFulfillsSenderNotifPermCondition,\n };\n if (condition_functions[cond.kind]) {\n return condition_functions[cond.kind](cond, ev);\n }\n // unknown conditions: we previously matched all unknown conditions,\n // but given that rules can be added to the base rules on a server,\n // it's probably better to not match unknown conditions.\n return false;\n };\n\n const eventFulfillsSenderNotifPermCondition = function(cond, ev) {\n const notifLevelKey = cond['key'];\n if (!notifLevelKey) {\n return false;\n }\n\n const room = client.getRoom(ev.getRoomId());\n if (!room || !room.currentState) {\n return false;\n }\n\n // Note that this should not be the current state of the room but the state at\n // the point the event is in the DAG. Unfortunately the js-sdk does not store\n // this.\n return room.currentState.mayTriggerNotifOfType(notifLevelKey, ev.getSender());\n };\n\n const eventFulfillsRoomMemberCountCondition = function(cond, ev) {\n if (!cond.is) {\n return false;\n }\n\n const room = client.getRoom(ev.getRoomId());\n if (!room || !room.currentState || !room.currentState.members) {\n return false;\n }\n\n const memberCount = room.currentState.getJoinedMemberCount();\n\n const m = cond.is.match(/^([=<>]*)([0-9]*)$/);\n if (!m) {\n return false;\n }\n const ineq = m[1];\n const rhs = parseInt(m[2]);\n if (isNaN(rhs)) {\n return false;\n }\n switch (ineq) {\n case '':\n case '==':\n return memberCount == rhs;\n case '<':\n return memberCount < rhs;\n case '>':\n return memberCount > rhs;\n case '<=':\n return memberCount <= rhs;\n case '>=':\n return memberCount >= rhs;\n default:\n return false;\n }\n };\n\n const eventFulfillsDisplayNameCondition = function(cond, ev) {\n let content = ev.getContent();\n if (ev.isEncrypted() && ev.getClearContent()) {\n content = ev.getClearContent();\n }\n if (!content || !content.body || typeof content.body != 'string') {\n return false;\n }\n\n const room = client.getRoom(ev.getRoomId());\n if (!room || !room.currentState || !room.currentState.members ||\n !room.currentState.getMember(client.credentials.userId)) {\n return false;\n }\n\n const displayName = room.currentState.getMember(client.credentials.userId).name;\n\n // N.B. we can't use \\b as it chokes on unicode. however \\W seems to be okay\n // as shorthand for [^0-9A-Za-z_].\n const pat = new RegExp(\"(^|\\\\W)\" + escapeRegExp(displayName) + \"(\\\\W|$)\", 'i');\n return content.body.search(pat) > -1;\n };\n\n const eventFulfillsEventMatchCondition = function(cond, ev) {\n if (!cond.key) {\n return false;\n }\n\n const val = valueForDottedKey(cond.key, ev);\n if (typeof val !== 'string') {\n return false;\n }\n\n if (cond.value) {\n return cond.value === val;\n }\n\n if (typeof cond.pattern !== 'string') {\n return false;\n }\n\n let regex;\n\n if (cond.key == 'content.body') {\n regex = createCachedRegex('(^|\\\\W)', cond.pattern, '(\\\\W|$)');\n } else {\n regex = createCachedRegex('^', cond.pattern, '$');\n }\n\n return !!val.match(regex);\n };\n\n const createCachedRegex = function(prefix, glob, suffix) {\n if (cachedGlobToRegex[glob]) {\n return cachedGlobToRegex[glob];\n }\n cachedGlobToRegex[glob] = new RegExp(\n prefix + globToRegexp(glob) + suffix,\n 'i', // Case insensitive\n );\n return cachedGlobToRegex[glob];\n };\n\n const valueForDottedKey = function(key, ev) {\n const parts = key.split('.');\n let val;\n\n // special-case the first component to deal with encrypted messages\n const firstPart = parts[0];\n if (firstPart === 'content') {\n val = ev.getContent();\n parts.shift();\n } else if (firstPart === 'type') {\n val = ev.getType();\n parts.shift();\n } else {\n // use the raw event for any other fields\n val = ev.event;\n }\n\n while (parts.length > 0) {\n const thisPart = parts.shift();\n if (isNullOrUndefined(val[thisPart])) {\n return null;\n }\n val = val[thisPart];\n }\n return val;\n };\n\n const matchingRuleForEventWithRulesets = function(ev, rulesets) {\n if (!rulesets) {\n return null;\n }\n if (ev.getSender() === client.credentials.userId) {\n return null;\n }\n\n return matchingRuleFromKindSet(ev, rulesets.global);\n };\n\n const pushActionsForEventAndRulesets = function(ev, rulesets) {\n const rule = matchingRuleForEventWithRulesets(ev, rulesets);\n if (!rule) {\n return {};\n }\n\n const actionObj = PushProcessor.actionListToActionsObject(rule.actions);\n\n // Some actions are implicit in some situations: we add those here\n if (actionObj.tweaks.highlight === undefined) {\n // if it isn't specified, highlight if it's a content\n // rule but otherwise not\n actionObj.tweaks.highlight = (rule.kind == 'content');\n }\n\n return actionObj;\n };\n\n this.ruleMatchesEvent = function(rule, ev) {\n let ret = true;\n for (let i = 0; i < rule.conditions.length; ++i) {\n const cond = rule.conditions[i];\n ret &= eventFulfillsCondition(cond, ev);\n }\n //console.log(\"Rule \"+rule.rule_id+(ret ? \" matches\" : \" doesn't match\"));\n return ret;\n };\n\n /**\n * Get the user's push actions for the given event\n *\n * @param {module:models/event.MatrixEvent} ev\n *\n * @return {PushAction}\n */\n this.actionsForEvent = function(ev) {\n return pushActionsForEventAndRulesets(ev, client.pushRules);\n };\n\n /**\n * Get one of the users push rules by its ID\n *\n * @param {string} ruleId The ID of the rule to search for\n * @return {object} The push rule, or null if no such rule was found\n */\n this.getPushRuleById = function(ruleId) {\n for (const scope of ['global']) {\n if (client.pushRules[scope] === undefined) continue;\n\n for (const kind of RULEKINDS_IN_ORDER) {\n if (client.pushRules[scope][kind] === undefined) continue;\n\n for (const rule of client.pushRules[scope][kind]) {\n if (rule.rule_id === ruleId) return rule;\n }\n }\n }\n return null;\n };\n}\n\n/**\n * Convert a list of actions into a object with the actions as keys and their values\n * eg. [ 'notify', { set_tweak: 'sound', value: 'default' } ]\n * becomes { notify: true, tweaks: { sound: 'default' } }\n * @param {array} actionlist The actions list\n *\n * @return {object} A object with key 'notify' (true or false) and an object of actions\n */\nPushProcessor.actionListToActionsObject = function(actionlist) {\n const actionobj = { 'notify': false, 'tweaks': {} };\n for (let i = 0; i < actionlist.length; ++i) {\n const action = actionlist[i];\n if (action === 'notify') {\n actionobj.notify = true;\n } else if (typeof action === 'object') {\n if (action.value === undefined) {\n action.value = true;\n }\n actionobj.tweaks[action.set_tweak] = action.value;\n }\n }\n return actionobj;\n};\n\n/**\n * Rewrites conditions on a client's push rules to match the defaults\n * where applicable. Useful for upgrading push rules to more strict\n * conditions when the server is falling behind on defaults.\n * @param {object} incomingRules The client's existing push rules\n * @returns {object} The rewritten rules\n */\nPushProcessor.rewriteDefaultRules = function(incomingRules) {\n let newRules = JSON.parse(JSON.stringify(incomingRules)); // deep clone\n\n // These lines are mostly to make the tests happy. We shouldn't run into these\n // properties missing in practice.\n if (!newRules) newRules = {};\n if (!newRules.global) newRules.global = {};\n if (!newRules.global.override) newRules.global.override = [];\n\n // Merge the client-level defaults with the ones from the server\n const globalOverrides = newRules.global.override;\n for (const override of DEFAULT_OVERRIDE_RULES) {\n const existingRule = globalOverrides\n .find((r) => r.rule_id === override.rule_id);\n\n if (existingRule) {\n // Copy over the actions, default, and conditions. Don't touch the user's\n // preference.\n existingRule.default = override.default;\n existingRule.conditions = override.conditions;\n existingRule.actions = override.actions;\n } else {\n // Add the rule\n const ruleId = override.rule_id;\n logger.warn(`Adding default global override for ${ruleId}`);\n globalOverrides.push(override);\n }\n }\n\n return newRules;\n};\n\n/**\n * @typedef {Object} PushAction\n * @type {Object}\n * @property {boolean} notify Whether this event should notify the user or not.\n * @property {Object} tweaks How this event should be notified.\n * @property {boolean} tweaks.highlight Whether this event should be highlighted\n * on the UI.\n * @property {boolean} tweaks.sound Whether this notification should produce a\n * noise.\n */\n\n", + "/*\nCopyright 2015 - 2021 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\nimport { escapeRegExp, globToRegexp, isNullOrUndefined } from \"./utils\";\nimport { logger } from './logger';\nimport { MatrixClient } from \"./client\";\nimport { MatrixEvent } from \"./models/event\";\nimport {\n ConditionKind,\n IAnnotatedPushRule,\n IContainsDisplayNameCondition,\n IEventMatchCondition,\n IPushRule,\n IPushRules,\n IRoomMemberCountCondition,\n ISenderNotificationPermissionCondition,\n PushRuleAction,\n PushRuleActionName,\n PushRuleCondition,\n PushRuleKind,\n PushRuleSet,\n TweakName,\n} from \"./@types/PushRules\";\n\n/**\n * @module pushprocessor\n */\n\nconst RULEKINDS_IN_ORDER = [\n PushRuleKind.Override,\n PushRuleKind.ContentSpecific,\n PushRuleKind.RoomSpecific,\n PushRuleKind.SenderSpecific,\n PushRuleKind.Underride,\n];\n\n// The default override rules to apply to the push rules that arrive from the server.\n// We do this for two reasons:\n// 1. Synapse is unlikely to send us the push rule in an incremental sync - see\n// https://github.com/matrix-org/synapse/pull/4867#issuecomment-481446072 for\n// more details.\n// 2. We often want to start using push rules ahead of the server supporting them,\n// and so we can put them here.\nconst DEFAULT_OVERRIDE_RULES: IPushRule[] = [\n {\n // For homeservers which don't support MSC1930 yet\n rule_id: \".m.rule.tombstone\",\n default: true,\n enabled: true,\n conditions: [\n {\n kind: ConditionKind.EventMatch,\n key: \"type\",\n pattern: \"m.room.tombstone\",\n },\n {\n kind: ConditionKind.EventMatch,\n key: \"state_key\",\n pattern: \"\",\n },\n ],\n actions: [\n PushRuleActionName.Notify,\n {\n set_tweak: TweakName.Highlight,\n value: true,\n },\n ],\n },\n {\n // For homeservers which don't support MSC2153 yet\n rule_id: \".m.rule.reaction\",\n default: true,\n enabled: true,\n conditions: [\n {\n kind: ConditionKind.EventMatch,\n key: \"type\",\n pattern: \"m.reaction\",\n },\n ],\n actions: [\n PushRuleActionName.DontNotify,\n ],\n },\n];\n\nexport interface IActionsObject {\n notify: boolean;\n tweaks: Partial>;\n}\n\nexport class PushProcessor {\n /**\n * Construct a Push Processor.\n * @constructor\n * @param {Object} client The Matrix client object to use\n */\n constructor(private readonly client: MatrixClient) {}\n\n /**\n * Convert a list of actions into a object with the actions as keys and their values\n * eg. [ 'notify', { set_tweak: 'sound', value: 'default' } ]\n * becomes { notify: true, tweaks: { sound: 'default' } }\n * @param {array} actionList The actions list\n *\n * @return {object} A object with key 'notify' (true or false) and an object of actions\n */\n public static actionListToActionsObject(actionList: PushRuleAction[]): IActionsObject {\n const actionObj: IActionsObject = { notify: false, tweaks: {} };\n for (let i = 0; i < actionList.length; ++i) {\n const action = actionList[i];\n if (action === PushRuleActionName.Notify) {\n actionObj.notify = true;\n } else if (typeof action === 'object') {\n if (action.value === undefined) {\n action.value = true;\n }\n actionObj.tweaks[action.set_tweak] = action.value;\n }\n }\n return actionObj;\n }\n\n /**\n * Rewrites conditions on a client's push rules to match the defaults\n * where applicable. Useful for upgrading push rules to more strict\n * conditions when the server is falling behind on defaults.\n * @param {object} incomingRules The client's existing push rules\n * @returns {object} The rewritten rules\n */\n public static rewriteDefaultRules(incomingRules: IPushRules): IPushRules {\n let newRules: IPushRules = JSON.parse(JSON.stringify(incomingRules)); // deep clone\n\n // These lines are mostly to make the tests happy. We shouldn't run into these\n // properties missing in practice.\n if (!newRules) newRules = {} as IPushRules;\n if (!newRules.global) newRules.global = {} as PushRuleSet;\n if (!newRules.global.override) newRules.global.override = [];\n\n // Merge the client-level defaults with the ones from the server\n const globalOverrides = newRules.global.override;\n for (const override of DEFAULT_OVERRIDE_RULES) {\n const existingRule = globalOverrides\n .find((r) => r.rule_id === override.rule_id);\n\n if (existingRule) {\n // Copy over the actions, default, and conditions. Don't touch the user's\n // preference.\n existingRule.default = override.default;\n existingRule.conditions = override.conditions;\n existingRule.actions = override.actions;\n } else {\n // Add the rule\n const ruleId = override.rule_id;\n logger.warn(`Adding default global override for ${ruleId}`);\n globalOverrides.push(override);\n }\n }\n\n return newRules;\n }\n\n private static cachedGlobToRegex: Record = {}; // $glob: RegExp\n\n private matchingRuleFromKindSet(ev: MatrixEvent, kindset: PushRuleSet): IAnnotatedPushRule {\n for (let ruleKindIndex = 0; ruleKindIndex < RULEKINDS_IN_ORDER.length; ++ruleKindIndex) {\n const kind = RULEKINDS_IN_ORDER[ruleKindIndex];\n const ruleset = kindset[kind];\n if (!ruleset) {\n continue;\n }\n\n for (let ruleIndex = 0; ruleIndex < ruleset.length; ++ruleIndex) {\n const rule = ruleset[ruleIndex];\n if (!rule.enabled) {\n continue;\n }\n\n const rawrule = this.templateRuleToRaw(kind, rule);\n if (!rawrule) {\n continue;\n }\n\n if (this.ruleMatchesEvent(rawrule, ev)) {\n return {\n ...rule,\n kind,\n };\n }\n }\n }\n return null;\n }\n\n private templateRuleToRaw(kind: PushRuleKind, tprule: any): any {\n const rawrule = {\n 'rule_id': tprule.rule_id,\n 'actions': tprule.actions,\n 'conditions': [],\n };\n switch (kind) {\n case PushRuleKind.Underride:\n case PushRuleKind.Override:\n rawrule.conditions = tprule.conditions;\n break;\n case PushRuleKind.RoomSpecific:\n if (!tprule.rule_id) {\n return null;\n }\n rawrule.conditions.push({\n 'kind': ConditionKind.EventMatch,\n 'key': 'room_id',\n 'value': tprule.rule_id,\n });\n break;\n case PushRuleKind.SenderSpecific:\n if (!tprule.rule_id) {\n return null;\n }\n rawrule.conditions.push({\n 'kind': ConditionKind.EventMatch,\n 'key': 'user_id',\n 'value': tprule.rule_id,\n });\n break;\n case PushRuleKind.ContentSpecific:\n if (!tprule.pattern) {\n return null;\n }\n rawrule.conditions.push({\n 'kind': ConditionKind.EventMatch,\n 'key': 'content.body',\n 'pattern': tprule.pattern,\n });\n break;\n }\n return rawrule;\n }\n\n private eventFulfillsCondition(cond: PushRuleCondition, ev: MatrixEvent): boolean {\n switch (cond.kind) {\n case ConditionKind.EventMatch:\n return this.eventFulfillsEventMatchCondition(cond, ev);\n case ConditionKind.ContainsDisplayName:\n return this.eventFulfillsDisplayNameCondition(cond, ev);\n case ConditionKind.RoomMemberCount:\n return this.eventFulfillsRoomMemberCountCondition(cond, ev);\n case ConditionKind.SenderNotificationPermission:\n return this.eventFulfillsSenderNotifPermCondition(cond, ev);\n }\n\n // unknown conditions: we previously matched all unknown conditions,\n // but given that rules can be added to the base rules on a server,\n // it's probably better to not match unknown conditions.\n return false;\n }\n\n private eventFulfillsSenderNotifPermCondition(\n cond: ISenderNotificationPermissionCondition,\n ev: MatrixEvent,\n ): boolean {\n const notifLevelKey = cond['key'];\n if (!notifLevelKey) {\n return false;\n }\n\n const room = this.client.getRoom(ev.getRoomId());\n if (!room?.currentState) {\n return false;\n }\n\n // Note that this should not be the current state of the room but the state at\n // the point the event is in the DAG. Unfortunately the js-sdk does not store\n // this.\n return room.currentState.mayTriggerNotifOfType(notifLevelKey, ev.getSender());\n }\n\n private eventFulfillsRoomMemberCountCondition(cond: IRoomMemberCountCondition, ev: MatrixEvent): boolean {\n if (!cond.is) {\n return false;\n }\n\n const room = this.client.getRoom(ev.getRoomId());\n if (!room || !room.currentState || !room.currentState.members) {\n return false;\n }\n\n const memberCount = room.currentState.getJoinedMemberCount();\n\n const m = cond.is.match(/^([=<>]*)([0-9]*)$/);\n if (!m) {\n return false;\n }\n const ineq = m[1];\n const rhs = parseInt(m[2]);\n if (isNaN(rhs)) {\n return false;\n }\n switch (ineq) {\n case '':\n case '==':\n return memberCount == rhs;\n case '<':\n return memberCount < rhs;\n case '>':\n return memberCount > rhs;\n case '<=':\n return memberCount <= rhs;\n case '>=':\n return memberCount >= rhs;\n default:\n return false;\n }\n }\n\n private eventFulfillsDisplayNameCondition(cond: IContainsDisplayNameCondition, ev: MatrixEvent): boolean {\n let content = ev.getContent();\n if (ev.isEncrypted() && ev.getClearContent()) {\n content = ev.getClearContent();\n }\n if (!content || !content.body || typeof content.body != 'string') {\n return false;\n }\n\n const room = this.client.getRoom(ev.getRoomId());\n if (!room || !room.currentState || !room.currentState.members ||\n !room.currentState.getMember(this.client.credentials.userId)) {\n return false;\n }\n\n const displayName = room.currentState.getMember(this.client.credentials.userId).name;\n\n // N.B. we can't use \\b as it chokes on unicode. however \\W seems to be okay\n // as shorthand for [^0-9A-Za-z_].\n const pat = new RegExp(\"(^|\\\\W)\" + escapeRegExp(displayName) + \"(\\\\W|$)\", 'i');\n return content.body.search(pat) > -1;\n }\n\n private eventFulfillsEventMatchCondition(cond: IEventMatchCondition, ev: MatrixEvent): boolean {\n if (!cond.key) {\n return false;\n }\n\n const val = this.valueForDottedKey(cond.key, ev);\n if (typeof val !== 'string') {\n return false;\n }\n\n if (cond.value) {\n return cond.value === val;\n }\n\n if (typeof cond.pattern !== 'string') {\n return false;\n }\n\n let regex;\n\n if (cond.key == 'content.body') {\n regex = this.createCachedRegex('(^|\\\\W)', cond.pattern, '(\\\\W|$)');\n } else {\n regex = this.createCachedRegex('^', cond.pattern, '$');\n }\n\n return !!val.match(regex);\n }\n\n private createCachedRegex(prefix: string, glob: string, suffix: string): RegExp {\n if (PushProcessor.cachedGlobToRegex[glob]) {\n return PushProcessor.cachedGlobToRegex[glob];\n }\n PushProcessor.cachedGlobToRegex[glob] = new RegExp(\n prefix + globToRegexp(glob) + suffix,\n 'i', // Case insensitive\n );\n return PushProcessor.cachedGlobToRegex[glob];\n }\n\n private valueForDottedKey(key: string, ev: MatrixEvent): any {\n const parts = key.split('.');\n let val;\n\n // special-case the first component to deal with encrypted messages\n const firstPart = parts[0];\n if (firstPart === 'content') {\n val = ev.getContent();\n parts.shift();\n } else if (firstPart === 'type') {\n val = ev.getType();\n parts.shift();\n } else {\n // use the raw event for any other fields\n val = ev.event;\n }\n\n while (parts.length > 0) {\n const thisPart = parts.shift();\n if (isNullOrUndefined(val[thisPart])) {\n return null;\n }\n val = val[thisPart];\n }\n return val;\n }\n\n private matchingRuleForEventWithRulesets(ev: MatrixEvent, rulesets): IAnnotatedPushRule {\n if (!rulesets) {\n return null;\n }\n if (ev.getSender() === this.client.credentials.userId) {\n return null;\n }\n\n return this.matchingRuleFromKindSet(ev, rulesets.global);\n }\n\n private pushActionsForEventAndRulesets(ev: MatrixEvent, rulesets): IActionsObject {\n const rule = this.matchingRuleForEventWithRulesets(ev, rulesets);\n if (!rule) {\n return {} as IActionsObject;\n }\n\n const actionObj = PushProcessor.actionListToActionsObject(rule.actions);\n\n // Some actions are implicit in some situations: we add those here\n if (actionObj.tweaks.highlight === undefined) {\n // if it isn't specified, highlight if it's a content\n // rule but otherwise not\n actionObj.tweaks.highlight = (rule.kind == PushRuleKind.ContentSpecific);\n }\n\n return actionObj;\n }\n\n public ruleMatchesEvent(rule: IPushRule, ev: MatrixEvent): boolean {\n let ret = true;\n for (let i = 0; i < rule.conditions.length; ++i) {\n const cond = rule.conditions[i];\n // @ts-ignore\n ret &= this.eventFulfillsCondition(cond, ev);\n }\n //console.log(\"Rule \"+rule.rule_id+(ret ? \" matches\" : \" doesn't match\"));\n return ret;\n }\n\n /**\n * Get the user's push actions for the given event\n *\n * @param {module:models/event.MatrixEvent} ev\n *\n * @return {PushAction}\n */\n public actionsForEvent(ev: MatrixEvent): IActionsObject {\n return this.pushActionsForEventAndRulesets(ev, this.client.pushRules);\n }\n\n /**\n * Get one of the users push rules by its ID\n *\n * @param {string} ruleId The ID of the rule to search for\n * @return {object} The push rule, or null if no such rule was found\n */\n public getPushRuleById(ruleId: string): IPushRule {\n for (const scope of ['global']) {\n if (this.client.pushRules[scope] === undefined) continue;\n\n for (const kind of RULEKINDS_IN_ORDER) {\n if (this.client.pushRules[scope][kind] === undefined) continue;\n\n for (const rule of this.client.pushRules[scope][kind]) {\n if (rule.rule_id === ruleId) return rule;\n }\n }\n }\n return null;\n }\n}\n\n/**\n * @typedef {Object} PushAction\n * @type {Object}\n * @property {boolean} notify Whether this event should notify the user or not.\n * @property {Object} tweaks How this event should be notified.\n * @property {boolean} tweaks.highlight Whether this event should be highlighted\n * on the UI.\n * @property {boolean} tweaks.sound Whether this notification should produce a\n * noise.\n */\n\n", "/*\nCopyright 2018 New Vector Ltd\nCopyright 2019 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\nconst LOWERCASE = \"abcdefghijklmnopqrstuvwxyz\";\nconst UPPERCASE = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\nconst DIGITS = \"0123456789\";\n\nexport function randomString(len: number): string {\n return randomStringFrom(len, UPPERCASE + LOWERCASE + DIGITS);\n}\n\nexport function randomLowercaseString(len: number): string {\n return randomStringFrom(len, LOWERCASE);\n}\n\nexport function randomUppercaseString(len: number): string {\n return randomStringFrom(len, UPPERCASE);\n}\n\nfunction randomStringFrom(len: number, chars: string): string {\n let ret = \"\";\n\n for (let i = 0; i < len; ++i) {\n ret += chars.charAt(Math.floor(Math.random() * chars.length));\n }\n\n return ret;\n}\n", "/*\nCopyright 2016 OpenMarket Ltd\nCopyright 2019 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n/* A re-implementation of the javascript callback functions (setTimeout,\n * clearTimeout; setInterval and clearInterval are not yet implemented) which\n * try to improve handling of large clock jumps (as seen when\n * suspending/resuming the system).\n *\n * In particular, if a timeout would have fired while the system was suspended,\n * it will instead fire as soon as possible after resume.\n */\n\nimport { logger } from './logger';\n\n// we schedule a callback at least this often, to check if we've missed out on\n// some wall-clock time due to being suspended.\nconst TIMER_CHECK_PERIOD_MS = 1000;\n\n// counter, for making up ids to return from setTimeout\nlet _count = 0;\n\n// the key for our callback with the real global.setTimeout\nlet _realCallbackKey;\n\n// a sorted list of the callbacks to be run.\n// each is an object with keys [runAt, func, params, key].\nconst _callbackList = [];\n\n// var debuglog = logger.log.bind(logger);\nconst debuglog = function() {};\n\n/**\n * Replace the function used by this module to get the current time.\n *\n * Intended for use by the unit tests.\n *\n * @param {function} [f] function which should return a millisecond counter\n *\n * @internal\n */\nexport function setNow(f) {\n _now = f || Date.now;\n}\nlet _now = Date.now;\n\n/**\n * reimplementation of window.setTimeout, which will call the callback if\n * the wallclock time goes past the deadline.\n *\n * @param {function} func callback to be called after a delay\n * @param {Number} delayMs number of milliseconds to delay by\n *\n * @return {Number} an identifier for this callback, which may be passed into\n * clearTimeout later.\n */\nexport function setTimeout(func, delayMs) {\n delayMs = delayMs || 0;\n if (delayMs < 0) {\n delayMs = 0;\n }\n\n const params = Array.prototype.slice.call(arguments, 2);\n const runAt = _now() + delayMs;\n const key = _count++;\n debuglog(\"setTimeout: scheduling cb\", key, \"at\", runAt,\n \"(delay\", delayMs, \")\");\n const data = {\n runAt: runAt,\n func: func,\n params: params,\n key: key,\n };\n\n // figure out where it goes in the list\n const idx = binarySearch(\n _callbackList, function(el) {\n return el.runAt - runAt;\n },\n );\n\n _callbackList.splice(idx, 0, data);\n _scheduleRealCallback();\n\n return key;\n}\n\n/**\n * reimplementation of window.clearTimeout, which mirrors setTimeout\n *\n * @param {Number} key result from an earlier setTimeout call\n */\nexport function clearTimeout(key) {\n if (_callbackList.length === 0) {\n return;\n }\n\n // remove the element from the list\n let i;\n for (i = 0; i < _callbackList.length; i++) {\n const cb = _callbackList[i];\n if (cb.key == key) {\n _callbackList.splice(i, 1);\n break;\n }\n }\n\n // iff it was the first one in the list, reschedule our callback.\n if (i === 0) {\n _scheduleRealCallback();\n }\n}\n\n// use the real global.setTimeout to schedule a callback to _runCallbacks.\nfunction _scheduleRealCallback() {\n if (_realCallbackKey) {\n global.clearTimeout(_realCallbackKey);\n }\n\n const first = _callbackList[0];\n\n if (!first) {\n debuglog(\"_scheduleRealCallback: no more callbacks, not rescheduling\");\n return;\n }\n\n const now = _now();\n const delayMs = Math.min(first.runAt - now, TIMER_CHECK_PERIOD_MS);\n\n debuglog(\"_scheduleRealCallback: now:\", now, \"delay:\", delayMs);\n _realCallbackKey = global.setTimeout(_runCallbacks, delayMs);\n}\n\nfunction _runCallbacks() {\n let cb;\n const now = _now();\n debuglog(\"_runCallbacks: now:\", now);\n\n // get the list of things to call\n const callbacksToRun = [];\n while (true) {\n const first = _callbackList[0];\n if (!first || first.runAt > now) {\n break;\n }\n cb = _callbackList.shift();\n debuglog(\"_runCallbacks: popping\", cb.key);\n callbacksToRun.push(cb);\n }\n\n // reschedule the real callback before running our functions, to\n // keep the codepaths the same whether or not our functions\n // register their own setTimeouts.\n _scheduleRealCallback();\n\n for (let i = 0; i < callbacksToRun.length; i++) {\n cb = callbacksToRun[i];\n try {\n cb.func.apply(global, cb.params);\n } catch (e) {\n logger.error(\"Uncaught exception in callback function\",\n e.stack || e);\n }\n }\n}\n\n/* search in a sorted array.\n *\n * returns the index of the last element for which func returns\n * greater than zero, or array.length if no such element exists.\n */\nfunction binarySearch(array, func) {\n // min is inclusive, max exclusive.\n let min = 0;\n let max = array.length;\n\n while (min < max) {\n const mid = (min + max) >> 1;\n const res = func(array[mid]);\n if (res > 0) {\n // the element at 'mid' is too big; set it as the new max.\n max = mid;\n } else {\n // the element at 'mid' is too small. 'min' is inclusive, so +1.\n min = mid + 1;\n }\n }\n // presumably, min==max now.\n return min;\n}\n", - "/*\nCopyright 2015, 2016 OpenMarket Ltd\nCopyright 2019 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n/**\n * This is an internal module which manages queuing, scheduling and retrying\n * of requests.\n * @module scheduler\n */\nimport * as utils from \"./utils\";\nimport { logger } from './logger';\n\nconst DEBUG = false; // set true to enable console logging.\n\n/**\n * Construct a scheduler for Matrix. Requires\n * {@link module:scheduler~MatrixScheduler#setProcessFunction} to be provided\n * with a way of processing events.\n * @constructor\n * @param {module:scheduler~retryAlgorithm} retryAlgorithm Optional. The retry\n * algorithm to apply when determining when to try to send an event again.\n * Defaults to {@link module:scheduler~MatrixScheduler.RETRY_BACKOFF_RATELIMIT}.\n * @param {module:scheduler~queueAlgorithm} queueAlgorithm Optional. The queuing\n * algorithm to apply when determining which events should be sent before the\n * given event. Defaults to {@link module:scheduler~MatrixScheduler.QUEUE_MESSAGES}.\n */\nexport function MatrixScheduler(retryAlgorithm, queueAlgorithm) {\n this.retryAlgorithm = retryAlgorithm || MatrixScheduler.RETRY_BACKOFF_RATELIMIT;\n this.queueAlgorithm = queueAlgorithm || MatrixScheduler.QUEUE_MESSAGES;\n this._queues = {\n // queueName: [{\n // event: MatrixEvent, // event to send\n // defer: Deferred, // defer to resolve/reject at the END of the retries\n // attempts: Number // number of times we've called processFn\n // }, ...]\n };\n this._activeQueues = [];\n this._procFn = null;\n}\n\n/**\n * Retrieve a queue based on an event. The event provided does not need to be in\n * the queue.\n * @param {MatrixEvent} event An event to get the queue for.\n * @return {?Array} A shallow copy of events in the queue or null.\n * Modifying this array will not modify the list itself. Modifying events in\n * this array will modify the underlying event in the queue.\n * @see MatrixScheduler.removeEventFromQueue To remove an event from the queue.\n */\nMatrixScheduler.prototype.getQueueForEvent = function(event) {\n const name = this.queueAlgorithm(event);\n if (!name || !this._queues[name]) {\n return null;\n }\n return this._queues[name].map(function(obj) {\n return obj.event;\n });\n};\n\n/**\n * Remove this event from the queue. The event is equal to another event if they\n * have the same ID returned from event.getId().\n * @param {MatrixEvent} event The event to remove.\n * @return {boolean} True if this event was removed.\n */\nMatrixScheduler.prototype.removeEventFromQueue = function(event) {\n const name = this.queueAlgorithm(event);\n if (!name || !this._queues[name]) {\n return false;\n }\n let removed = false;\n utils.removeElement(this._queues[name], function(element) {\n if (element.event.getId() === event.getId()) {\n // XXX we should probably reject the promise?\n // https://github.com/matrix-org/matrix-js-sdk/issues/496\n removed = true;\n return true;\n }\n });\n return removed;\n};\n\n/**\n * Set the process function. Required for events in the queue to be processed.\n * If set after events have been added to the queue, this will immediately start\n * processing them.\n * @param {module:scheduler~processFn} fn The function that can process events\n * in the queue.\n */\nMatrixScheduler.prototype.setProcessFunction = function(fn) {\n this._procFn = fn;\n _startProcessingQueues(this);\n};\n\n/**\n * Queue an event if it is required and start processing queues.\n * @param {MatrixEvent} event The event that may be queued.\n * @return {?Promise} A promise if the event was queued, which will be\n * resolved or rejected in due time, else null.\n */\nMatrixScheduler.prototype.queueEvent = function(event) {\n const queueName = this.queueAlgorithm(event);\n if (!queueName) {\n return null;\n }\n // add the event to the queue and make a deferred for it.\n if (!this._queues[queueName]) {\n this._queues[queueName] = [];\n }\n const defer = utils.defer();\n this._queues[queueName].push({\n event: event,\n defer: defer,\n attempts: 0,\n });\n debuglog(\n \"Queue algorithm dumped event %s into queue '%s'\",\n event.getId(), queueName,\n );\n _startProcessingQueues(this);\n return defer.promise;\n};\n\n/**\n * Retries events up to 4 times using exponential backoff. This produces wait\n * times of 2, 4, 8, and 16 seconds (30s total) after which we give up. If the\n * failure was due to a rate limited request, the time specified in the error is\n * waited before being retried.\n * @param {MatrixEvent} event\n * @param {Number} attempts\n * @param {MatrixError} err\n * @return {Number}\n * @see module:scheduler~retryAlgorithm\n */\nMatrixScheduler.RETRY_BACKOFF_RATELIMIT = function(event, attempts, err) {\n if (err.httpStatus === 400 || err.httpStatus === 403 || err.httpStatus === 401) {\n // client error; no amount of retrying with save you now.\n return -1;\n }\n // we ship with browser-request which returns { cors: rejected } when trying\n // with no connection, so if we match that, give up since they have no conn.\n if (err.cors === \"rejected\") {\n return -1;\n }\n\n // if event that we are trying to send is too large in any way then retrying won't help\n if (err.name === \"M_TOO_LARGE\") {\n return -1;\n }\n\n if (err.name === \"M_LIMIT_EXCEEDED\") {\n const waitTime = err.data.retry_after_ms;\n if (waitTime > 0) {\n return waitTime;\n }\n }\n if (attempts > 4) {\n return -1; // give up\n }\n return (1000 * Math.pow(2, attempts));\n};\n\n/**\n * Queues m.room.message events and lets other events continue\n * concurrently.\n * @param {MatrixEvent} event\n * @return {string}\n * @see module:scheduler~queueAlgorithm\n */\nMatrixScheduler.QUEUE_MESSAGES = function(event) {\n // enqueue messages or events that associate with another event (redactions and relations)\n if (event.getType() === \"m.room.message\" || event.hasAssocation()) {\n // put these events in the 'message' queue.\n return \"message\";\n }\n // allow all other events continue concurrently.\n return null;\n};\n\nfunction _startProcessingQueues(scheduler) {\n if (!scheduler._procFn) {\n return;\n }\n // for each inactive queue with events in them\n Object.keys(scheduler._queues)\n .filter(function(queueName) {\n return scheduler._activeQueues.indexOf(queueName) === -1 &&\n scheduler._queues[queueName].length > 0;\n })\n .forEach(function(queueName) {\n // mark the queue as active\n scheduler._activeQueues.push(queueName);\n // begin processing the head of the queue\n debuglog(\"Spinning up queue: '%s'\", queueName);\n _processQueue(scheduler, queueName);\n });\n}\n\nfunction _processQueue(scheduler, queueName) {\n // get head of queue\n const obj = _peekNextEvent(scheduler, queueName);\n if (!obj) {\n // queue is empty. Mark as inactive and stop recursing.\n const index = scheduler._activeQueues.indexOf(queueName);\n if (index >= 0) {\n scheduler._activeQueues.splice(index, 1);\n }\n debuglog(\"Stopping queue '%s' as it is now empty\", queueName);\n return;\n }\n debuglog(\n \"Queue '%s' has %s pending events\",\n queueName, scheduler._queues[queueName].length,\n );\n // fire the process function and if it resolves, resolve the deferred. Else\n // invoke the retry algorithm.\n\n // First wait for a resolved promise, so the resolve handlers for\n // the deferred of the previously sent event can run.\n // This way enqueued relations/redactions to enqueued events can receive\n // the remove id of their target before being sent.\n Promise.resolve().then(() => {\n return scheduler._procFn(obj.event);\n }).then(function(res) {\n // remove this from the queue\n _removeNextEvent(scheduler, queueName);\n debuglog(\"Queue '%s' sent event %s\", queueName, obj.event.getId());\n obj.defer.resolve(res);\n // keep processing\n _processQueue(scheduler, queueName);\n }, function(err) {\n obj.attempts += 1;\n // ask the retry algorithm when/if we should try again\n const waitTimeMs = scheduler.retryAlgorithm(obj.event, obj.attempts, err);\n debuglog(\n \"retry(%s) err=%s event_id=%s waitTime=%s\",\n obj.attempts, err, obj.event.getId(), waitTimeMs,\n );\n if (waitTimeMs === -1) { // give up (you quitter!)\n debuglog(\n \"Queue '%s' giving up on event %s\", queueName, obj.event.getId(),\n );\n // remove this from the queue\n _removeNextEvent(scheduler, queueName);\n obj.defer.reject(err);\n // process next event\n _processQueue(scheduler, queueName);\n } else {\n setTimeout(function() {\n _processQueue(scheduler, queueName);\n }, waitTimeMs);\n }\n });\n}\n\nfunction _peekNextEvent(scheduler, queueName) {\n const queue = scheduler._queues[queueName];\n if (!Array.isArray(queue)) {\n return null;\n }\n return queue[0];\n}\n\nfunction _removeNextEvent(scheduler, queueName) {\n const queue = scheduler._queues[queueName];\n if (!Array.isArray(queue)) {\n return null;\n }\n return queue.shift();\n}\n\nfunction debuglog() {\n if (DEBUG) {\n logger.log(...arguments);\n }\n}\n\n/**\n * The retry algorithm to apply when retrying events. To stop retrying, return\n * -1. If this event was part of a queue, it will be removed from\n * the queue.\n * @callback retryAlgorithm\n * @param {MatrixEvent} event The event being retried.\n * @param {Number} attempts The number of failed attempts. This will always be\n * >= 1.\n * @param {MatrixError} err The most recent error message received when trying\n * to send this event.\n * @return {Number} The number of milliseconds to wait before trying again. If\n * this is 0, the request will be immediately retried. If this is\n * -1, the event will be marked as\n * {@link module:models/event.EventStatus.NOT_SENT} and will not be retried.\n */\n\n/**\n * The queuing algorithm to apply to events. This function must be idempotent as\n * it may be called multiple times with the same event. All queues created are\n * serviced in a FIFO manner. To send the event ASAP, return null\n * which will not put this event in a queue. Events that fail to send that form\n * part of a queue will be removed from the queue and the next event in the\n * queue will be sent.\n * @callback queueAlgorithm\n * @param {MatrixEvent} event The event to be sent.\n * @return {string} The name of the queue to put the event into. If a queue with\n * this name does not exist, it will be created. If this is null,\n * the event is not put into a queue and will be sent concurrently.\n */\n\n /**\n * The function to invoke to process (send) events in the queue.\n * @callback processFn\n * @param {MatrixEvent} event The event to send.\n * @return {Promise} Resolved/rejected depending on the outcome of the request.\n */\n\n", + "/*\nCopyright 2015 - 2021 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n/**\n * This is an internal module which manages queuing, scheduling and retrying\n * of requests.\n * @module scheduler\n */\nimport * as utils from \"./utils\";\nimport { logger } from './logger';\nimport { MatrixEvent } from \"./models/event\";\nimport { EventType } from \"./@types/event\";\nimport { IDeferred } from \"./utils\";\nimport { MatrixError } from \"./http-api\";\nimport { ISendEventResponse } from \"./@types/requests\";\n\nconst DEBUG = false; // set true to enable console logging.\n\ninterface IQueueEntry {\n event: MatrixEvent;\n defer: IDeferred;\n attempts: number;\n}\n\ntype ProcessFunction = (event: MatrixEvent) => Promise;\n\n/**\n * Construct a scheduler for Matrix. Requires\n * {@link module:scheduler~MatrixScheduler#setProcessFunction} to be provided\n * with a way of processing events.\n * @constructor\n * @param {module:scheduler~retryAlgorithm} retryAlgorithm Optional. The retry\n * algorithm to apply when determining when to try to send an event again.\n * Defaults to {@link module:scheduler~MatrixScheduler.RETRY_BACKOFF_RATELIMIT}.\n * @param {module:scheduler~queueAlgorithm} queueAlgorithm Optional. The queuing\n * algorithm to apply when determining which events should be sent before the\n * given event. Defaults to {@link module:scheduler~MatrixScheduler.QUEUE_MESSAGES}.\n */\n// eslint-disable-next-line camelcase\nexport class MatrixScheduler {\n /**\n * Retries events up to 4 times using exponential backoff. This produces wait\n * times of 2, 4, 8, and 16 seconds (30s total) after which we give up. If the\n * failure was due to a rate limited request, the time specified in the error is\n * waited before being retried.\n * @param {MatrixEvent} event\n * @param {Number} attempts\n * @param {MatrixError} err\n * @return {Number}\n * @see module:scheduler~retryAlgorithm\n */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n public static RETRY_BACKOFF_RATELIMIT(event: MatrixEvent, attempts: number, err: MatrixError): number {\n if (err.httpStatus === 400 || err.httpStatus === 403 || err.httpStatus === 401) {\n // client error; no amount of retrying with save you now.\n return -1;\n }\n // we ship with browser-request which returns { cors: rejected } when trying\n // with no connection, so if we match that, give up since they have no conn.\n if (err.cors === \"rejected\") {\n return -1;\n }\n\n // if event that we are trying to send is too large in any way then retrying won't help\n if (err.name === \"M_TOO_LARGE\") {\n return -1;\n }\n\n if (err.name === \"M_LIMIT_EXCEEDED\") {\n const waitTime = err.data.retry_after_ms;\n if (waitTime > 0) {\n return waitTime;\n }\n }\n if (attempts > 4) {\n return -1; // give up\n }\n return (1000 * Math.pow(2, attempts));\n }\n\n /**\n * Queues m.room.message events and lets other events continue\n * concurrently.\n * @param {MatrixEvent} event\n * @return {string}\n * @see module:scheduler~queueAlgorithm\n */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n public static QUEUE_MESSAGES(event: MatrixEvent) {\n // enqueue messages or events that associate with another event (redactions and relations)\n if (event.getType() === EventType.RoomMessage || event.hasAssocation()) {\n // put these events in the 'message' queue.\n return \"message\";\n }\n // allow all other events continue concurrently.\n return null;\n }\n\n // queueName: [{\n // event: MatrixEvent, // event to send\n // defer: Deferred, // defer to resolve/reject at the END of the retries\n // attempts: Number // number of times we've called processFn\n // }, ...]\n private readonly queues: Record[]> = {};\n private activeQueues: string[] = [];\n private procFn: ProcessFunction = null;\n\n constructor(\n public readonly retryAlgorithm = MatrixScheduler.RETRY_BACKOFF_RATELIMIT,\n public readonly queueAlgorithm = MatrixScheduler.QUEUE_MESSAGES,\n ) {}\n\n /**\n * Retrieve a queue based on an event. The event provided does not need to be in\n * the queue.\n * @param {MatrixEvent} event An event to get the queue for.\n * @return {?Array} A shallow copy of events in the queue or null.\n * Modifying this array will not modify the list itself. Modifying events in\n * this array will modify the underlying event in the queue.\n * @see MatrixScheduler.removeEventFromQueue To remove an event from the queue.\n */\n public getQueueForEvent(event: MatrixEvent): MatrixEvent[] {\n const name = this.queueAlgorithm(event);\n if (!name || !this.queues[name]) {\n return null;\n }\n return this.queues[name].map(function(obj) {\n return obj.event;\n });\n }\n\n /**\n * Remove this event from the queue. The event is equal to another event if they\n * have the same ID returned from event.getId().\n * @param {MatrixEvent} event The event to remove.\n * @return {boolean} True if this event was removed.\n */\n public removeEventFromQueue(event: MatrixEvent): boolean {\n const name = this.queueAlgorithm(event);\n if (!name || !this.queues[name]) {\n return false;\n }\n let removed = false;\n utils.removeElement(this.queues[name], (element) => {\n if (element.event.getId() === event.getId()) {\n // XXX we should probably reject the promise?\n // https://github.com/matrix-org/matrix-js-sdk/issues/496\n removed = true;\n return true;\n }\n });\n return removed;\n }\n\n /**\n * Set the process function. Required for events in the queue to be processed.\n * If set after events have been added to the queue, this will immediately start\n * processing them.\n * @param {module:scheduler~processFn} fn The function that can process events\n * in the queue.\n */\n public setProcessFunction(fn: ProcessFunction): void {\n this.procFn = fn;\n this.startProcessingQueues();\n }\n\n /**\n * Queue an event if it is required and start processing queues.\n * @param {MatrixEvent} event The event that may be queued.\n * @return {?Promise} A promise if the event was queued, which will be\n * resolved or rejected in due time, else null.\n */\n public queueEvent(event: MatrixEvent): Promise | null {\n const queueName = this.queueAlgorithm(event);\n if (!queueName) {\n return null;\n }\n // add the event to the queue and make a deferred for it.\n if (!this.queues[queueName]) {\n this.queues[queueName] = [];\n }\n const defer = utils.defer();\n this.queues[queueName].push({\n event: event,\n defer: defer,\n attempts: 0,\n });\n debuglog(\"Queue algorithm dumped event %s into queue '%s'\", event.getId(), queueName);\n this.startProcessingQueues();\n return defer.promise;\n }\n\n private startProcessingQueues(): void {\n if (!this.procFn) return;\n // for each inactive queue with events in them\n Object.keys(this.queues)\n .filter((queueName) => {\n return this.activeQueues.indexOf(queueName) === -1 &&\n this.queues[queueName].length > 0;\n })\n .forEach((queueName) => {\n // mark the queue as active\n this.activeQueues.push(queueName);\n // begin processing the head of the queue\n debuglog(\"Spinning up queue: '%s'\", queueName);\n this.processQueue(queueName);\n });\n }\n\n private processQueue = (queueName: string): void => {\n // get head of queue\n const obj = this.peekNextEvent(queueName);\n if (!obj) {\n // queue is empty. Mark as inactive and stop recursing.\n const index = this.activeQueues.indexOf(queueName);\n if (index >= 0) {\n this.activeQueues.splice(index, 1);\n }\n debuglog(\"Stopping queue '%s' as it is now empty\", queueName);\n return;\n }\n debuglog(\"Queue '%s' has %s pending events\", queueName, this.queues[queueName].length);\n // fire the process function and if it resolves, resolve the deferred. Else\n // invoke the retry algorithm.\n\n // First wait for a resolved promise, so the resolve handlers for\n // the deferred of the previously sent event can run.\n // This way enqueued relations/redactions to enqueued events can receive\n // the remove id of their target before being sent.\n Promise.resolve().then(() => {\n return this.procFn(obj.event);\n }).then((res) => {\n // remove this from the queue\n this.removeNextEvent(queueName);\n debuglog(\"Queue '%s' sent event %s\", queueName, obj.event.getId());\n obj.defer.resolve(res);\n // keep processing\n this.processQueue(queueName);\n }, (err) => {\n obj.attempts += 1;\n // ask the retry algorithm when/if we should try again\n const waitTimeMs = this.retryAlgorithm(obj.event, obj.attempts, err);\n debuglog(\"retry(%s) err=%s event_id=%s waitTime=%s\", obj.attempts, err, obj.event.getId(), waitTimeMs);\n if (waitTimeMs === -1) { // give up (you quitter!)\n debuglog(\"Queue '%s' giving up on event %s\", queueName, obj.event.getId());\n // remove this from the queue\n this.removeNextEvent(queueName);\n obj.defer.reject(err);\n // process next event\n this.processQueue(queueName);\n } else {\n setTimeout(this.processQueue, waitTimeMs, queueName);\n }\n });\n };\n\n private peekNextEvent(queueName: string): IQueueEntry {\n const queue = this.queues[queueName];\n if (!Array.isArray(queue)) {\n return null;\n }\n return queue[0];\n }\n\n private removeNextEvent(queueName: string): IQueueEntry {\n const queue = this.queues[queueName];\n if (!Array.isArray(queue)) {\n return null;\n }\n return queue.shift();\n }\n}\n\nfunction debuglog(...args) {\n if (DEBUG) {\n logger.log(...args);\n }\n}\n\n/**\n * The retry algorithm to apply when retrying events. To stop retrying, return\n * -1. If this event was part of a queue, it will be removed from\n * the queue.\n * @callback retryAlgorithm\n * @param {MatrixEvent} event The event being retried.\n * @param {Number} attempts The number of failed attempts. This will always be\n * >= 1.\n * @param {MatrixError} err The most recent error message received when trying\n * to send this event.\n * @return {Number} The number of milliseconds to wait before trying again. If\n * this is 0, the request will be immediately retried. If this is\n * -1, the event will be marked as\n * {@link module:models/event.EventStatus.NOT_SENT} and will not be retried.\n */\n\n/**\n * The queuing algorithm to apply to events. This function must be idempotent as\n * it may be called multiple times with the same event. All queues created are\n * serviced in a FIFO manner. To send the event ASAP, return null\n * which will not put this event in a queue. Events that fail to send that form\n * part of a queue will be removed from the queue and the next event in the\n * queue will be sent.\n * @callback queueAlgorithm\n * @param {MatrixEvent} event The event to be sent.\n * @return {string} The name of the queue to put the event into. If a queue with\n * this name does not exist, it will be created. If this is null,\n * the event is not put into a queue and will be sent concurrently.\n */\n\n/**\n * The function to invoke to process (send) events in the queue.\n * @callback processFn\n * @param {MatrixEvent} event The event to send.\n * @return {Promise} Resolved/rejected depending on the outcome of the request.\n */\n\n", "/*\nCopyright 2019 - 2021 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\nexport enum SERVICE_TYPES {\n IS = 'SERVICE_TYPE_IS', // An identity server\n IM = 'SERVICE_TYPE_IM', // An integration manager\n}\n", "/*\nCopyright 2017 - 2021 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\nimport { IMinimalEvent, ISyncData, ISyncResponse, SyncAccumulator } from \"../sync-accumulator\";\nimport * as utils from \"../utils\";\nimport * as IndexedDBHelpers from \"../indexeddb-helpers\";\nimport { logger } from '../logger';\nimport { IEvent, IStartClientOpts } from \"..\";\nimport { ISavedSync } from \"./index\";\nimport { IIndexedDBBackend, UserTuple } from \"./indexeddb-backend\";\n\nconst VERSION = 3;\n\nfunction createDatabase(db: IDBDatabase): void {\n // Make user store, clobber based on user ID. (userId property of User objects)\n db.createObjectStore(\"users\", { keyPath: [\"userId\"] });\n\n // Make account data store, clobber based on event type.\n // (event.type property of MatrixEvent objects)\n db.createObjectStore(\"accountData\", { keyPath: [\"type\"] });\n\n // Make /sync store (sync tokens, room data, etc), always clobber (const key).\n db.createObjectStore(\"sync\", { keyPath: [\"clobber\"] });\n}\n\nfunction upgradeSchemaV2(db: IDBDatabase): void {\n const oobMembersStore = db.createObjectStore(\n \"oob_membership_events\", {\n keyPath: [\"room_id\", \"state_key\"],\n });\n oobMembersStore.createIndex(\"room\", \"room_id\");\n}\n\nfunction upgradeSchemaV3(db: IDBDatabase): void {\n db.createObjectStore(\"client_options\",\n { keyPath: [\"clobber\"] });\n}\n\n/**\n * Helper method to collect results from a Cursor and promiseify it.\n * @param {ObjectStore|Index} store The store to perform openCursor on.\n * @param {IDBKeyRange=} keyRange Optional key range to apply on the cursor.\n * @param {Function} resultMapper A function which is repeatedly called with a\n * Cursor.\n * Return the data you want to keep.\n * @return {Promise} Resolves to an array of whatever you returned from\n * resultMapper.\n */\nfunction selectQuery(\n store: IDBObjectStore,\n keyRange: IDBKeyRange | IDBValidKey | undefined,\n resultMapper: (cursor: IDBCursorWithValue) => T,\n): Promise {\n const query = store.openCursor(keyRange);\n return new Promise((resolve, reject) => {\n const results = [];\n query.onerror = () => {\n reject(new Error(\"Query failed: \" + query.error));\n };\n // collect results\n query.onsuccess = () => {\n const cursor = query.result;\n if (!cursor) {\n resolve(results);\n return; // end of results\n }\n results.push(resultMapper(cursor));\n cursor.continue();\n };\n });\n}\n\nfunction txnAsPromise(txn: IDBTransaction): Promise {\n return new Promise((resolve, reject) => {\n txn.oncomplete = function(event) {\n resolve(event);\n };\n txn.onerror = function() {\n reject(txn.error);\n };\n });\n}\n\nfunction reqAsEventPromise(req: IDBRequest): Promise {\n return new Promise((resolve, reject) => {\n req.onsuccess = function(event) {\n resolve(event);\n };\n req.onerror = function() {\n reject(req.error);\n };\n });\n}\n\nfunction reqAsPromise(req: IDBRequest): Promise {\n return new Promise((resolve, reject) => {\n req.onsuccess = () => resolve(req);\n req.onerror = (err) => reject(err);\n });\n}\n\nfunction reqAsCursorPromise(req: IDBRequest): Promise {\n return reqAsEventPromise(req).then((event) => req.result);\n}\n\nexport class LocalIndexedDBStoreBackend implements IIndexedDBBackend {\n public static exists(indexedDB: IDBFactory, dbName: string): Promise {\n dbName = \"matrix-js-sdk:\" + (dbName || \"default\");\n return IndexedDBHelpers.exists(indexedDB, dbName);\n }\n\n private readonly dbName: string;\n private readonly syncAccumulator: SyncAccumulator;\n private db: IDBDatabase = null;\n private disconnected = true;\n private _isNewlyCreated = false;\n\n /**\n * Does the actual reading from and writing to the indexeddb\n *\n * Construct a new Indexed Database store backend. This requires a call to\n * connect() before this store can be used.\n * @constructor\n * @param {Object} indexedDB The Indexed DB interface e.g\n * window.indexedDB\n * @param {string=} dbName Optional database name. The same name must be used\n * to open the same database.\n */\n constructor(private readonly indexedDB: IDBFactory, dbName: string) {\n this.dbName = \"matrix-js-sdk:\" + (dbName || \"default\");\n this.syncAccumulator = new SyncAccumulator();\n }\n\n /**\n * Attempt to connect to the database. This can fail if the user does not\n * grant permission.\n * @return {Promise} Resolves if successfully connected.\n */\n public connect(): Promise {\n if (!this.disconnected) {\n logger.log(`LocalIndexedDBStoreBackend.connect: already connected or connecting`);\n return Promise.resolve();\n }\n\n this.disconnected = false;\n\n logger.log(`LocalIndexedDBStoreBackend.connect: connecting...`);\n const req = this.indexedDB.open(this.dbName, VERSION);\n req.onupgradeneeded = (ev) => {\n const db = req.result;\n const oldVersion = ev.oldVersion;\n logger.log(\n `LocalIndexedDBStoreBackend.connect: upgrading from ${oldVersion}`,\n );\n if (oldVersion < 1) { // The database did not previously exist.\n this._isNewlyCreated = true;\n createDatabase(db);\n }\n if (oldVersion < 2) {\n upgradeSchemaV2(db);\n }\n if (oldVersion < 3) {\n upgradeSchemaV3(db);\n }\n // Expand as needed.\n };\n\n req.onblocked = () => {\n logger.log(`can't yet open LocalIndexedDBStoreBackend because it is open elsewhere`);\n };\n\n logger.log(`LocalIndexedDBStoreBackend.connect: awaiting connection...`);\n return reqAsEventPromise(req).then(() => {\n logger.log(`LocalIndexedDBStoreBackend.connect: connected`);\n this.db = req.result;\n\n // add a poorly-named listener for when deleteDatabase is called\n // so we can close our db connections.\n this.db.onversionchange = () => {\n this.db.close();\n };\n\n return this.init();\n });\n }\n\n /** @return {boolean} whether or not the database was newly created in this session. */\n public isNewlyCreated(): Promise {\n return Promise.resolve(this._isNewlyCreated);\n }\n\n /**\n * Having connected, load initial data from the database and prepare for use\n * @return {Promise} Resolves on success\n */\n private init() {\n return Promise.all([\n this.loadAccountData(),\n this.loadSyncData(),\n ]).then(([accountData, syncData]) => {\n logger.log(`LocalIndexedDBStoreBackend: loaded initial data`);\n this.syncAccumulator.accumulate({\n next_batch: syncData.nextBatch,\n rooms: syncData.roomsData,\n groups: syncData.groupsData,\n account_data: {\n events: accountData,\n },\n }, true);\n });\n }\n\n /**\n * Returns the out-of-band membership events for this room that\n * were previously loaded.\n * @param {string} roomId\n * @returns {Promise} the events, potentially an empty array if OOB loading didn't yield any new members\n * @returns {null} in case the members for this room haven't been stored yet\n */\n public getOutOfBandMembers(roomId: string): Promise {\n return new Promise((resolve, reject) =>{\n const tx = this.db.transaction([\"oob_membership_events\"], \"readonly\");\n const store = tx.objectStore(\"oob_membership_events\");\n const roomIndex = store.index(\"room\");\n const range = IDBKeyRange.only(roomId);\n const request = roomIndex.openCursor(range);\n\n const membershipEvents = [];\n // did we encounter the oob_written marker object\n // amongst the results? That means OOB member\n // loading already happened for this room\n // but there were no members to persist as they\n // were all known already\n let oobWritten = false;\n\n request.onsuccess = () => {\n const cursor = request.result;\n if (!cursor) {\n // Unknown room\n if (!membershipEvents.length && !oobWritten) {\n return resolve(null);\n }\n return resolve(membershipEvents);\n }\n const record = cursor.value;\n if (record.oob_written) {\n oobWritten = true;\n } else {\n membershipEvents.push(record);\n }\n cursor.continue();\n };\n request.onerror = (err) => {\n reject(err);\n };\n }).then((events) => {\n logger.log(`LL: got ${events && events.length} membershipEvents from storage for room ${roomId} ...`);\n return events;\n });\n }\n\n /**\n * Stores the out-of-band membership events for this room. Note that\n * it still makes sense to store an empty array as the OOB status for the room is\n * marked as fetched, and getOutOfBandMembers will return an empty array instead of null\n * @param {string} roomId\n * @param {event[]} membershipEvents the membership events to store\n */\n public async setOutOfBandMembers(roomId: string, membershipEvents: IEvent[]): Promise {\n logger.log(`LL: backend about to store ${membershipEvents.length}` +\n ` members for ${roomId}`);\n const tx = this.db.transaction([\"oob_membership_events\"], \"readwrite\");\n const store = tx.objectStore(\"oob_membership_events\");\n membershipEvents.forEach((e) => {\n store.put(e);\n });\n // aside from all the events, we also write a marker object to the store\n // to mark the fact that OOB members have been written for this room.\n // It's possible that 0 members need to be written as all where previously know\n // but we still need to know whether to return null or [] from getOutOfBandMembers\n // where null means out of band members haven't been stored yet for this room\n const markerObject = {\n room_id: roomId,\n oob_written: true,\n state_key: 0,\n };\n store.put(markerObject);\n await txnAsPromise(tx);\n logger.log(`LL: backend done storing for ${roomId}!`);\n }\n\n public async clearOutOfBandMembers(roomId: string): Promise {\n // the approach to delete all members for a room\n // is to get the min and max state key from the index\n // for that room, and then delete between those\n // keys in the store.\n // this should be way faster than deleting every member\n // individually for a large room.\n const readTx = this.db.transaction(\n [\"oob_membership_events\"],\n \"readonly\");\n const store = readTx.objectStore(\"oob_membership_events\");\n const roomIndex = store.index(\"room\");\n const roomRange = IDBKeyRange.only(roomId);\n\n const minStateKeyProm = reqAsCursorPromise(\n roomIndex.openKeyCursor(roomRange, \"next\"),\n ).then((cursor) => cursor && cursor.primaryKey[1]);\n const maxStateKeyProm = reqAsCursorPromise(\n roomIndex.openKeyCursor(roomRange, \"prev\"),\n ).then((cursor) => cursor && cursor.primaryKey[1]);\n const [minStateKey, maxStateKey] = await Promise.all(\n [minStateKeyProm, maxStateKeyProm]);\n\n const writeTx = this.db.transaction(\n [\"oob_membership_events\"],\n \"readwrite\");\n const writeStore = writeTx.objectStore(\"oob_membership_events\");\n const membersKeyRange = IDBKeyRange.bound(\n [roomId, minStateKey],\n [roomId, maxStateKey],\n );\n\n logger.log(`LL: Deleting all users + marker in storage for room ${roomId}, with key range:`,\n [roomId, minStateKey], [roomId, maxStateKey]);\n await reqAsPromise(writeStore.delete(membersKeyRange));\n }\n\n /**\n * Clear the entire database. This should be used when logging out of a client\n * to prevent mixing data between accounts.\n * @return {Promise} Resolved when the database is cleared.\n */\n public clearDatabase(): Promise {\n return new Promise((resolve) => {\n logger.log(`Removing indexeddb instance: ${this.dbName}`);\n const req = this.indexedDB.deleteDatabase(this.dbName);\n\n req.onblocked = () => {\n logger.log(`can't yet delete indexeddb ${this.dbName} because it is open elsewhere`);\n };\n\n req.onerror = () => {\n // in firefox, with indexedDB disabled, this fails with a\n // DOMError. We treat this as non-fatal, so that we can still\n // use the app.\n logger.warn(`unable to delete js-sdk store indexeddb: ${req.error}`);\n resolve();\n };\n\n req.onsuccess = () => {\n logger.log(`Removed indexeddb instance: ${this.dbName}`);\n resolve();\n };\n });\n }\n\n /**\n * @param {boolean=} copy If false, the data returned is from internal\n * buffers and must not be mutated. Otherwise, a copy is made before\n * returning such that the data can be safely mutated. Default: true.\n *\n * @return {Promise} Resolves with a sync response to restore the\n * client state to where it was at the last save, or null if there\n * is no saved sync data.\n */\n public getSavedSync(copy = true): Promise {\n const data = this.syncAccumulator.getJSON();\n if (!data.nextBatch) return Promise.resolve(null);\n if (copy) {\n // We must deep copy the stored data so that the /sync processing code doesn't\n // corrupt the internal state of the sync accumulator (it adds non-clonable keys)\n return Promise.resolve(utils.deepCopy(data));\n } else {\n return Promise.resolve(data);\n }\n }\n\n public getNextBatchToken(): Promise {\n return Promise.resolve(this.syncAccumulator.getNextBatchToken());\n }\n\n public setSyncData(syncData: ISyncResponse): Promise {\n return Promise.resolve().then(() => {\n this.syncAccumulator.accumulate(syncData);\n });\n }\n\n public async syncToDatabase(userTuples: UserTuple[]): Promise {\n const syncData = this.syncAccumulator.getJSON(true);\n\n await Promise.all([\n this.persistUserPresenceEvents(userTuples),\n this.persistAccountData(syncData.accountData),\n this.persistSyncData(syncData.nextBatch, syncData.roomsData, syncData.groupsData),\n ]);\n }\n\n /**\n * Persist rooms /sync data along with the next batch token.\n * @param {string} nextBatch The next_batch /sync value.\n * @param {Object} roomsData The 'rooms' /sync data from a SyncAccumulator\n * @param {Object} groupsData The 'groups' /sync data from a SyncAccumulator\n * @return {Promise} Resolves if the data was persisted.\n */\n private persistSyncData(\n nextBatch: string,\n roomsData: ISyncResponse[\"rooms\"],\n groupsData: ISyncResponse[\"groups\"],\n ): Promise {\n logger.log(\"Persisting sync data up to\", nextBatch);\n return utils.promiseTry(() => {\n const txn = this.db.transaction([\"sync\"], \"readwrite\");\n const store = txn.objectStore(\"sync\");\n store.put({\n clobber: \"-\", // constant key so will always clobber\n nextBatch,\n roomsData,\n groupsData,\n }); // put == UPSERT\n return txnAsPromise(txn).then();\n });\n }\n\n /**\n * Persist a list of account data events. Events with the same 'type' will\n * be replaced.\n * @param {Object[]} accountData An array of raw user-scoped account data events\n * @return {Promise} Resolves if the events were persisted.\n */\n private persistAccountData(accountData: IMinimalEvent[]): Promise {\n return utils.promiseTry(() => {\n const txn = this.db.transaction([\"accountData\"], \"readwrite\");\n const store = txn.objectStore(\"accountData\");\n for (let i = 0; i < accountData.length; i++) {\n store.put(accountData[i]); // put == UPSERT\n }\n return txnAsPromise(txn).then();\n });\n }\n\n /**\n * Persist a list of [user id, presence event] they are for.\n * Users with the same 'userId' will be replaced.\n * Presence events should be the event in its raw form (not the Event\n * object)\n * @param {Object[]} tuples An array of [userid, event] tuples\n * @return {Promise} Resolves if the users were persisted.\n */\n private persistUserPresenceEvents(tuples: UserTuple[]): Promise {\n return utils.promiseTry(() => {\n const txn = this.db.transaction([\"users\"], \"readwrite\");\n const store = txn.objectStore(\"users\");\n for (const tuple of tuples) {\n store.put({\n userId: tuple[0],\n event: tuple[1],\n }); // put == UPSERT\n }\n return txnAsPromise(txn).then();\n });\n }\n\n /**\n * Load all user presence events from the database. This is not cached.\n * FIXME: It would probably be more sensible to store the events in the\n * sync.\n * @return {Promise} A list of presence events in their raw form.\n */\n public getUserPresenceEvents(): Promise {\n return utils.promiseTry(() => {\n const txn = this.db.transaction([\"users\"], \"readonly\");\n const store = txn.objectStore(\"users\");\n return selectQuery(store, undefined, (cursor) => {\n return [cursor.value.userId, cursor.value.event];\n });\n });\n }\n\n /**\n * Load all the account data events from the database. This is not cached.\n * @return {Promise} A list of raw global account events.\n */\n private loadAccountData(): Promise {\n logger.log(`LocalIndexedDBStoreBackend: loading account data...`);\n return utils.promiseTry(() => {\n const txn = this.db.transaction([\"accountData\"], \"readonly\");\n const store = txn.objectStore(\"accountData\");\n return selectQuery(store, undefined, (cursor) => {\n return cursor.value;\n }).then((result: IMinimalEvent[]) => {\n logger.log(`LocalIndexedDBStoreBackend: loaded account data`);\n return result;\n });\n });\n }\n\n /**\n * Load the sync data from the database.\n * @return {Promise} An object with \"roomsData\" and \"nextBatch\" keys.\n */\n private loadSyncData(): Promise {\n logger.log(`LocalIndexedDBStoreBackend: loading sync data...`);\n return utils.promiseTry(() => {\n const txn = this.db.transaction([\"sync\"], \"readonly\");\n const store = txn.objectStore(\"sync\");\n return selectQuery(store, undefined, (cursor) => {\n return cursor.value;\n }).then((results: ISyncData[]) => {\n logger.log(`LocalIndexedDBStoreBackend: loaded sync data`);\n if (results.length > 1) {\n logger.warn(\"loadSyncData: More than 1 sync row found.\");\n }\n return results.length > 0 ? results[0] : {} as ISyncData;\n });\n });\n }\n\n public getClientOptions(): Promise {\n return Promise.resolve().then(() => {\n const txn = this.db.transaction([\"client_options\"], \"readonly\");\n const store = txn.objectStore(\"client_options\");\n return selectQuery(store, undefined, (cursor) => {\n if (cursor.value && cursor.value && cursor.value.options) {\n return cursor.value.options;\n }\n }).then((results) => results[0]);\n });\n }\n\n public async storeClientOptions(options: IStartClientOpts): Promise {\n const txn = this.db.transaction([\"client_options\"], \"readwrite\");\n const store = txn.objectStore(\"client_options\");\n store.put({\n clobber: \"-\", // constant key so will always clobber\n options: options,\n }); // put == UPSERT\n await txnAsPromise(txn);\n }\n}\n", "/*\nCopyright 2017 - 2021 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\nimport { logger } from \"../logger\";\nimport { defer, IDeferred } from \"../utils\";\nimport { ISavedSync } from \"./index\";\nimport { IStartClientOpts } from \"../client\";\nimport { IEvent, ISyncResponse } from \"..\";\nimport { IIndexedDBBackend, UserTuple } from \"./indexeddb-backend\";\n\nexport class RemoteIndexedDBStoreBackend implements IIndexedDBBackend {\n private worker: Worker;\n private nextSeq = 0;\n // The currently in-flight requests to the actual backend\n private inFlight: Record> = {}; // seq: promise\n // Once we start connecting, we keep the promise and re-use it\n // if we try to connect again\n private startPromise: Promise = null;\n\n /**\n * An IndexedDB store backend where the actual backend sits in a web\n * worker.\n *\n * Construct a new Indexed Database store backend. This requires a call to\n * connect() before this store can be used.\n * @constructor\n * @param {Function} workerFactory Factory which produces a Worker\n * @param {string=} dbName Optional database name. The same name must be used\n * to open the same database.\n */\n constructor(\n private readonly workerFactory: () => Worker,\n private readonly dbName: string,\n ) {}\n\n /**\n * Attempt to connect to the database. This can fail if the user does not\n * grant permission.\n * @return {Promise} Resolves if successfully connected.\n */\n public connect(): Promise {\n return this.ensureStarted().then(() => this.doCmd('connect'));\n }\n\n /**\n * Clear the entire database. This should be used when logging out of a client\n * to prevent mixing data between accounts.\n * @return {Promise} Resolved when the database is cleared.\n */\n public clearDatabase(): Promise {\n return this.ensureStarted().then(() => this.doCmd('clearDatabase'));\n }\n\n /** @return {Promise} whether or not the database was newly created in this session. */\n public isNewlyCreated(): Promise {\n return this.doCmd('isNewlyCreated');\n }\n\n /**\n * @return {Promise} Resolves with a sync response to restore the\n * client state to where it was at the last save, or null if there\n * is no saved sync data.\n */\n public getSavedSync(): Promise {\n return this.doCmd('getSavedSync');\n }\n\n public getNextBatchToken(): Promise {\n return this.doCmd('getNextBatchToken');\n }\n\n public setSyncData(syncData: ISyncResponse): Promise {\n return this.doCmd('setSyncData', [syncData]);\n }\n\n public syncToDatabase(userTuples: UserTuple[]): Promise {\n return this.doCmd('syncToDatabase', [userTuples]);\n }\n\n /**\n * Returns the out-of-band membership events for this room that\n * were previously loaded.\n * @param {string} roomId\n * @returns {event[]} the events, potentially an empty array if OOB loading didn't yield any new members\n * @returns {null} in case the members for this room haven't been stored yet\n */\n public getOutOfBandMembers(roomId: string): Promise {\n return this.doCmd('getOutOfBandMembers', [roomId]);\n }\n\n /**\n * Stores the out-of-band membership events for this room. Note that\n * it still makes sense to store an empty array as the OOB status for the room is\n * marked as fetched, and getOutOfBandMembers will return an empty array instead of null\n * @param {string} roomId\n * @param {event[]} membershipEvents the membership events to store\n * @returns {Promise} when all members have been stored\n */\n public setOutOfBandMembers(roomId: string, membershipEvents: IEvent[]): Promise {\n return this.doCmd('setOutOfBandMembers', [roomId, membershipEvents]);\n }\n\n public clearOutOfBandMembers(roomId: string): Promise {\n return this.doCmd('clearOutOfBandMembers', [roomId]);\n }\n\n public getClientOptions(): Promise {\n return this.doCmd('getClientOptions');\n }\n\n public storeClientOptions(options: IStartClientOpts): Promise {\n return this.doCmd('storeClientOptions', [options]);\n }\n\n /**\n * Load all user presence events from the database. This is not cached.\n * @return {Promise} A list of presence events in their raw form.\n */\n public getUserPresenceEvents(): Promise {\n return this.doCmd('getUserPresenceEvents');\n }\n\n private ensureStarted(): Promise {\n if (this.startPromise === null) {\n this.worker = this.workerFactory();\n this.worker.onmessage = this.onWorkerMessage;\n\n // tell the worker the db name.\n this.startPromise = this.doCmd('_setupWorker', [this.dbName]).then(() => {\n logger.log(\"IndexedDB worker is ready\");\n });\n }\n return this.startPromise;\n }\n\n private doCmd(command: string, args?: any): Promise {\n // wrap in a q so if the postMessage throws,\n // the promise automatically gets rejected\n return Promise.resolve().then(() => {\n const seq = this.nextSeq++;\n const def = defer();\n\n this.inFlight[seq] = def;\n\n this.worker.postMessage({ command, seq, args });\n\n return def.promise;\n });\n }\n\n private onWorkerMessage = (ev: MessageEvent): void => {\n const msg = ev.data;\n\n if (msg.command == 'cmd_success' || msg.command == 'cmd_fail') {\n if (msg.seq === undefined) {\n logger.error(\"Got reply from worker with no seq\");\n return;\n }\n\n const def = this.inFlight[msg.seq];\n if (def === undefined) {\n logger.error(\"Got reply for unknown seq \" + msg.seq);\n return;\n }\n delete this.inFlight[msg.seq];\n\n if (msg.command == 'cmd_success') {\n def.resolve(msg.result);\n } else {\n const error = new Error(msg.error.message);\n error.name = msg.error.name;\n def.reject(error);\n }\n } else {\n logger.warn(\"Unrecognised message from worker: \", msg);\n }\n };\n}\n\n", "/*\nCopyright 2017 - 2021 Vector Creations Ltd\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n/* eslint-disable @babel/no-invalid-this */\n\nimport { EventEmitter } from 'events';\n\nimport { MemoryStore, IOpts as IBaseOpts } from \"./memory\";\nimport { LocalIndexedDBStoreBackend } from \"./indexeddb-local-backend\";\nimport { RemoteIndexedDBStoreBackend } from \"./indexeddb-remote-backend\";\nimport { User } from \"../models/user\";\nimport { IEvent, MatrixEvent } from \"../models/event\";\nimport { logger } from '../logger';\nimport { ISavedSync } from \"./index\";\nimport { IIndexedDBBackend } from \"./indexeddb-backend\";\nimport { ISyncResponse } from \"../sync-accumulator\";\n\n/**\n * This is an internal module. See {@link IndexedDBStore} for the public class.\n * @module store/indexeddb\n */\n\n// If this value is too small we'll be writing very often which will cause\n// noticeable stop-the-world pauses. If this value is too big we'll be writing\n// so infrequently that the /sync size gets bigger on reload. Writing more\n// often does not affect the length of the pause since the entire /sync\n// response is persisted each time.\nconst WRITE_DELAY_MS = 1000 * 60 * 5; // once every 5 minutes\n\ninterface IOpts extends IBaseOpts {\n indexedDB: IDBFactory;\n dbName?: string;\n workerFactory?: () => Worker;\n}\n\nexport class IndexedDBStore extends MemoryStore {\n static exists(indexedDB: IDBFactory, dbName: string): Promise {\n return LocalIndexedDBStoreBackend.exists(indexedDB, dbName);\n }\n\n public readonly backend: IIndexedDBBackend;\n\n private startedUp = false;\n private syncTs = 0;\n // Records the last-modified-time of each user at the last point we saved\n // the database, such that we can derive the set if users that have been\n // modified since we last saved.\n private userModifiedMap: Record = {}; // user_id : timestamp\n private emitter = new EventEmitter();\n\n /**\n * Construct a new Indexed Database store, which extends MemoryStore.\n *\n * This store functions like a MemoryStore except it periodically persists\n * the contents of the store to an IndexedDB backend.\n *\n * All data is still kept in-memory but can be loaded from disk by calling\n * startup(). This can make startup times quicker as a complete\n * sync from the server is not required. This does not reduce memory usage as all\n * the data is eagerly fetched when startup() is called.\n *
\n     * let opts = { indexedDB: window.indexedDB, localStorage: window.localStorage };\n     * let store = new IndexedDBStore(opts);\n     * await store.startup(); // load from indexed db\n     * let client = sdk.createClient({\n     *     store: store,\n     * });\n     * client.startClient();\n     * client.on(\"sync\", function(state, prevState, data) {\n     *     if (state === \"PREPARED\") {\n     *         console.log(\"Started up, now with go faster stripes!\");\n     *     }\n     * });\n     * 
\n *\n * @constructor\n * @extends MemoryStore\n * @param {Object} opts Options object.\n * @param {Object} opts.indexedDB The Indexed DB interface e.g.\n * window.indexedDB\n * @param {string=} opts.dbName Optional database name. The same name must be used\n * to open the same database.\n * @param {string=} opts.workerScript Optional URL to a script to invoke a web\n * worker with to run IndexedDB queries on the web worker. The IndexedDbStoreWorker\n * class is provided for this purpose and requires the application to provide a\n * trivial wrapper script around it.\n * @param {Object=} opts.workerApi The webWorker API object. If omitted, the global Worker\n * object will be used if it exists.\n * @prop {IndexedDBStoreBackend} backend The backend instance. Call through to\n * this API if you need to perform specific indexeddb actions like deleting the\n * database.\n */\n constructor(opts: IOpts) {\n super(opts);\n\n if (!opts.indexedDB) {\n throw new Error('Missing required option: indexedDB');\n }\n\n if (opts.workerFactory) {\n this.backend = new RemoteIndexedDBStoreBackend(opts.workerFactory, opts.dbName);\n } else {\n this.backend = new LocalIndexedDBStoreBackend(opts.indexedDB, opts.dbName);\n }\n }\n\n public on = this.emitter.on.bind(this.emitter);\n\n /**\n * @return {Promise} Resolved when loaded from indexed db.\n */\n public startup(): Promise {\n if (this.startedUp) {\n logger.log(`IndexedDBStore.startup: already started`);\n return Promise.resolve();\n }\n\n logger.log(`IndexedDBStore.startup: connecting to backend`);\n return this.backend.connect().then(() => {\n logger.log(`IndexedDBStore.startup: loading presence events`);\n return this.backend.getUserPresenceEvents();\n }).then((userPresenceEvents) => {\n logger.log(`IndexedDBStore.startup: processing presence events`);\n userPresenceEvents.forEach(([userId, rawEvent]) => {\n const u = new User(userId);\n if (rawEvent) {\n u.setPresenceEvent(new MatrixEvent(rawEvent));\n }\n this.userModifiedMap[u.userId] = u.getLastModifiedTime();\n this.storeUser(u);\n });\n });\n }\n\n /**\n * @return {Promise} Resolves with a sync response to restore the\n * client state to where it was at the last save, or null if there\n * is no saved sync data.\n */\n public getSavedSync = this.degradable((): Promise => {\n return this.backend.getSavedSync();\n }, \"getSavedSync\");\n\n /** @return {Promise} whether or not the database was newly created in this session. */\n public isNewlyCreated = this.degradable((): Promise => {\n return this.backend.isNewlyCreated();\n }, \"isNewlyCreated\");\n\n /**\n * @return {Promise} If there is a saved sync, the nextBatch token\n * for this sync, otherwise null.\n */\n public getSavedSyncToken = this.degradable((): Promise => {\n return this.backend.getNextBatchToken();\n }, \"getSavedSyncToken\");\n\n /**\n * Delete all data from this store.\n * @return {Promise} Resolves if the data was deleted from the database.\n */\n public deleteAllData = this.degradable((): Promise => {\n super.deleteAllData();\n return this.backend.clearDatabase().then(() => {\n logger.log(\"Deleted indexeddb data.\");\n }, (err) => {\n logger.error(`Failed to delete indexeddb data: ${err}`);\n throw err;\n });\n });\n\n /**\n * Whether this store would like to save its data\n * Note that obviously whether the store wants to save or\n * not could change between calling this function and calling\n * save().\n *\n * @return {boolean} True if calling save() will actually save\n * (at the time this function is called).\n */\n public wantsSave(): boolean {\n const now = Date.now();\n return now - this.syncTs > WRITE_DELAY_MS;\n }\n\n /**\n * Possibly write data to the database.\n *\n * @param {boolean} force True to force a save to happen\n * @return {Promise} Promise resolves after the write completes\n * (or immediately if no write is performed)\n */\n public save(force = false): Promise {\n if (force || this.wantsSave()) {\n return this.reallySave();\n }\n return Promise.resolve();\n }\n\n private reallySave = this.degradable((): Promise => {\n this.syncTs = Date.now(); // set now to guard against multi-writes\n\n // work out changed users (this doesn't handle deletions but you\n // can't 'delete' users as they are just presence events).\n const userTuples: [userId: string, presenceEvent: Partial][] = [];\n for (const u of this.getUsers()) {\n if (this.userModifiedMap[u.userId] === u.getLastModifiedTime()) continue;\n if (!u.events.presence) continue;\n\n userTuples.push([u.userId, u.events.presence.event]);\n\n // note that we've saved this version of the user\n this.userModifiedMap[u.userId] = u.getLastModifiedTime();\n }\n\n return this.backend.syncToDatabase(userTuples);\n });\n\n public setSyncData = this.degradable((syncData: ISyncResponse): Promise => {\n return this.backend.setSyncData(syncData);\n }, \"setSyncData\");\n\n /**\n * Returns the out-of-band membership events for this room that\n * were previously loaded.\n * @param {string} roomId\n * @returns {event[]} the events, potentially an empty array if OOB loading didn't yield any new members\n * @returns {null} in case the members for this room haven't been stored yet\n */\n public getOutOfBandMembers = this.degradable((roomId: string): Promise => {\n return this.backend.getOutOfBandMembers(roomId);\n }, \"getOutOfBandMembers\");\n\n /**\n * Stores the out-of-band membership events for this room. Note that\n * it still makes sense to store an empty array as the OOB status for the room is\n * marked as fetched, and getOutOfBandMembers will return an empty array instead of null\n * @param {string} roomId\n * @param {event[]} membershipEvents the membership events to store\n * @returns {Promise} when all members have been stored\n */\n public setOutOfBandMembers = this.degradable((roomId: string, membershipEvents: IEvent[]): Promise => {\n super.setOutOfBandMembers(roomId, membershipEvents);\n return this.backend.setOutOfBandMembers(roomId, membershipEvents);\n }, \"setOutOfBandMembers\");\n\n public clearOutOfBandMembers = this.degradable((roomId: string) => {\n super.clearOutOfBandMembers(roomId);\n return this.backend.clearOutOfBandMembers(roomId);\n }, \"clearOutOfBandMembers\");\n\n public getClientOptions = this.degradable((): Promise => {\n return this.backend.getClientOptions();\n }, \"getClientOptions\");\n\n public storeClientOptions = this.degradable((options: object): Promise => {\n super.storeClientOptions(options);\n return this.backend.storeClientOptions(options);\n }, \"storeClientOptions\");\n\n /**\n * All member functions of `IndexedDBStore` that access the backend use this wrapper to\n * watch for failures after initial store startup, including `QuotaExceededError` as\n * free disk space changes, etc.\n *\n * When IndexedDB fails via any of these paths, we degrade this back to a `MemoryStore`\n * in place so that the current operation and all future ones are in-memory only.\n *\n * @param {Function} func The degradable work to do.\n * @param {String} fallback The method name for fallback.\n * @returns {Function} A wrapped member function.\n */\n private degradable, R = void>(\n func: DegradableFn,\n fallback?: string,\n ): DegradableFn {\n const fallbackFn = super[fallback];\n\n return async (...args) => {\n try {\n return func.call(this, ...args);\n } catch (e) {\n logger.error(\"IndexedDBStore failure, degrading to MemoryStore\", e);\n this.emitter.emit(\"degraded\", e);\n try {\n // We try to delete IndexedDB after degrading since this store is only a\n // cache (the app will still function correctly without the data).\n // It's possible that deleting repair IndexedDB for the next app load,\n // potentially by making a little more space available.\n logger.log(\"IndexedDBStore trying to delete degraded data\");\n await this.backend.clearDatabase();\n logger.log(\"IndexedDBStore delete after degrading succeeded\");\n } catch (e) {\n logger.warn(\"IndexedDBStore delete after degrading failed\", e);\n }\n // Degrade the store from being an instance of `IndexedDBStore` to instead be\n // an instance of `MemoryStore` so that future API calls use the memory path\n // directly and skip IndexedDB entirely. This should be safe as\n // `IndexedDBStore` already extends from `MemoryStore`, so we are making the\n // store become its parent type in a way. The mutator methods of\n // `IndexedDBStore` also maintain the state that `MemoryStore` uses (many are\n // not overridden at all).\n if (fallbackFn) {\n return fallbackFn(...args);\n }\n }\n };\n }\n}\n\ntype DegradableFn, T> = (...args: A) => Promise;\n", - "/*\nCopyright 2015 - 2021 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n/**\n * This is an internal module. See {@link MemoryStore} for the public class.\n * @module store/memory\n */\n\nimport { EventType } from \"../@types/event\";\nimport { Group } from \"../models/group\";\nimport { Room } from \"../models/room\";\nimport { User } from \"../models/user\";\nimport { IEvent, MatrixEvent } from \"../models/event\";\nimport { RoomState } from \"../models/room-state\";\nimport { RoomMember } from \"../models/room-member\";\nimport { Filter } from \"../filter\";\nimport { ISavedSync, IStore } from \"./index\";\nimport { RoomSummary } from \"../models/room-summary\";\nimport { ISyncResponse } from \"../sync-accumulator\";\n\nfunction isValidFilterId(filterId: string): boolean {\n const isValidStr = typeof filterId === \"string\" &&\n !!filterId &&\n filterId !== \"undefined\" && // exclude these as we've serialized undefined in localStorage before\n filterId !== \"null\";\n\n return isValidStr || typeof filterId === \"number\";\n}\n\nexport interface IOpts {\n localStorage?: Storage;\n}\n\n/**\n * Construct a new in-memory data store for the Matrix Client.\n * @constructor\n * @param {Object=} opts Config options\n * @param {LocalStorage} opts.localStorage The local storage instance to persist\n * some forms of data such as tokens. Rooms will NOT be stored.\n */\nexport class MemoryStore implements IStore {\n private rooms: Record = {}; // roomId: Room\n private groups: Record = {}; // groupId: Group\n private users: Record = {}; // userId: User\n private syncToken: string = null;\n // userId: {\n // filterId: Filter\n // }\n private filters: Record> = {};\n public accountData: Record = {}; // type : content\n private readonly localStorage: Storage;\n private oobMembers: Record = {}; // roomId: [member events]\n private clientOptions = {};\n\n constructor(opts: IOpts = {}) {\n this.localStorage = opts.localStorage;\n }\n\n /**\n * Retrieve the token to stream from.\n * @return {string} The token or null.\n */\n public getSyncToken(): string | null {\n return this.syncToken;\n }\n\n /** @return {Promise} whether or not the database was newly created in this session. */\n public isNewlyCreated(): Promise {\n return Promise.resolve(true);\n }\n\n /**\n * Set the token to stream from.\n * @param {string} token The token to stream from.\n */\n public setSyncToken(token: string) {\n this.syncToken = token;\n }\n\n /**\n * Store the given room.\n * @param {Group} group The group to be stored\n */\n public storeGroup(group: Group) {\n this.groups[group.groupId] = group;\n }\n\n /**\n * Retrieve a group by its group ID.\n * @param {string} groupId The group ID.\n * @return {Group} The group or null.\n */\n public getGroup(groupId: string): Group | null {\n return this.groups[groupId] || null;\n }\n\n /**\n * Retrieve all known groups.\n * @return {Group[]} A list of groups, which may be empty.\n */\n public getGroups(): Group[] {\n return Object.values(this.groups);\n }\n\n /**\n * Store the given room.\n * @param {Room} room The room to be stored. All properties must be stored.\n */\n public storeRoom(room: Room) {\n this.rooms[room.roomId] = room;\n // add listeners for room member changes so we can keep the room member\n // map up-to-date.\n room.currentState.on(\"RoomState.members\", this.onRoomMember);\n // add existing members\n room.currentState.getMembers().forEach((m) => {\n this.onRoomMember(null, room.currentState, m);\n });\n }\n\n /**\n * Called when a room member in a room being tracked by this store has been\n * updated.\n * @param {MatrixEvent} event\n * @param {RoomState} state\n * @param {RoomMember} member\n */\n private onRoomMember = (event: MatrixEvent, state: RoomState, member: RoomMember) => {\n if (member.membership === \"invite\") {\n // We do NOT add invited members because people love to typo user IDs\n // which would then show up in these lists (!)\n return;\n }\n\n const user = this.users[member.userId] || new User(member.userId);\n if (member.name) {\n user.setDisplayName(member.name);\n if (member.events.member) {\n user.setRawDisplayName(\n member.events.member.getDirectionalContent().displayname,\n );\n }\n }\n if (member.events.member && member.events.member.getContent().avatar_url) {\n user.setAvatarUrl(member.events.member.getContent().avatar_url);\n }\n this.users[user.userId] = user;\n };\n\n /**\n * Retrieve a room by its' room ID.\n * @param {string} roomId The room ID.\n * @return {Room} The room or null.\n */\n public getRoom(roomId: string): Room | null {\n return this.rooms[roomId] || null;\n }\n\n /**\n * Retrieve all known rooms.\n * @return {Room[]} A list of rooms, which may be empty.\n */\n public getRooms(): Room[] {\n return Object.values(this.rooms);\n }\n\n /**\n * Permanently delete a room.\n * @param {string} roomId\n */\n public removeRoom(roomId: string): void {\n if (this.rooms[roomId]) {\n this.rooms[roomId].removeListener(\"RoomState.members\", this.onRoomMember);\n }\n delete this.rooms[roomId];\n }\n\n /**\n * Retrieve a summary of all the rooms.\n * @return {RoomSummary[]} A summary of each room.\n */\n public getRoomSummaries(): RoomSummary[] {\n return Object.values(this.rooms).map(function(room) {\n return room.summary;\n });\n }\n\n /**\n * Store a User.\n * @param {User} user The user to store.\n */\n public storeUser(user: User): void {\n this.users[user.userId] = user;\n }\n\n /**\n * Retrieve a User by its' user ID.\n * @param {string} userId The user ID.\n * @return {User} The user or null.\n */\n public getUser(userId: string): User | null {\n return this.users[userId] || null;\n }\n\n /**\n * Retrieve all known users.\n * @return {User[]} A list of users, which may be empty.\n */\n public getUsers(): User[] {\n return Object.values(this.users);\n }\n\n /**\n * Retrieve scrollback for this room.\n * @param {Room} room The matrix room\n * @param {integer} limit The max number of old events to retrieve.\n * @return {Array} An array of objects which will be at most 'limit'\n * length and at least 0. The objects are the raw event JSON.\n */\n public scrollback(room: Room, limit: number): MatrixEvent[] {\n return [];\n }\n\n /**\n * Store events for a room. The events have already been added to the timeline\n * @param {Room} room The room to store events for.\n * @param {Array} events The events to store.\n * @param {string} token The token associated with these events.\n * @param {boolean} toStart True if these are paginated results.\n */\n public storeEvents(room: Room, events: MatrixEvent[], token: string, toStart: boolean) {\n // no-op because they've already been added to the room instance.\n }\n\n /**\n * Store a filter.\n * @param {Filter} filter\n */\n public storeFilter(filter: Filter): void {\n if (!filter) {\n return;\n }\n if (!this.filters[filter.userId]) {\n this.filters[filter.userId] = {};\n }\n this.filters[filter.userId][filter.filterId] = filter;\n }\n\n /**\n * Retrieve a filter.\n * @param {string} userId\n * @param {string} filterId\n * @return {?Filter} A filter or null.\n */\n public getFilter(userId: string, filterId: string): Filter | null {\n if (!this.filters[userId] || !this.filters[userId][filterId]) {\n return null;\n }\n return this.filters[userId][filterId];\n }\n\n /**\n * Retrieve a filter ID with the given name.\n * @param {string} filterName The filter name.\n * @return {?string} The filter ID or null.\n */\n public getFilterIdByName(filterName: string): string | null {\n if (!this.localStorage) {\n return null;\n }\n const key = \"mxjssdk_memory_filter_\" + filterName;\n // XXX Storage.getItem doesn't throw ...\n // or are we using something different\n // than window.localStorage in some cases\n // that does throw?\n // that would be very naughty\n try {\n const value = this.localStorage.getItem(key);\n if (isValidFilterId(value)) {\n return value;\n }\n } catch (e) {}\n return null;\n }\n\n /**\n * Set a filter name to ID mapping.\n * @param {string} filterName\n * @param {string} filterId\n */\n public setFilterIdByName(filterName: string, filterId: string) {\n if (!this.localStorage) {\n return;\n }\n const key = \"mxjssdk_memory_filter_\" + filterName;\n try {\n if (isValidFilterId(filterId)) {\n this.localStorage.setItem(key, filterId);\n } else {\n this.localStorage.removeItem(key);\n }\n } catch (e) {}\n }\n\n /**\n * Store user-scoped account data events.\n * N.B. that account data only allows a single event per type, so multiple\n * events with the same type will replace each other.\n * @param {Array} events The events to store.\n */\n public storeAccountDataEvents(events: MatrixEvent[]): void {\n events.forEach((event) => {\n this.accountData[event.getType()] = event;\n });\n }\n\n /**\n * Get account data event by event type\n * @param {string} eventType The event type being queried\n * @return {?MatrixEvent} the user account_data event of given type, if any\n */\n public getAccountData(eventType: EventType | string): MatrixEvent | undefined {\n return this.accountData[eventType];\n }\n\n /**\n * setSyncData does nothing as there is no backing data store.\n *\n * @param {Object} syncData The sync data\n * @return {Promise} An immediately resolved promise.\n */\n public setSyncData(syncData: ISyncResponse): Promise {\n return Promise.resolve();\n }\n\n /**\n * We never want to save becase we have nothing to save to.\n *\n * @return {boolean} If the store wants to save\n */\n public wantsSave(): boolean {\n return false;\n }\n\n /**\n * Save does nothing as there is no backing data store.\n * @param {bool} force True to force a save (but the memory\n * store still can't save anything)\n */\n public save(force: boolean): void {}\n\n /**\n * Startup does nothing as this store doesn't require starting up.\n * @return {Promise} An immediately resolved promise.\n */\n public startup(): Promise {\n return Promise.resolve();\n }\n\n /**\n * @return {Promise} Resolves with a sync response to restore the\n * client state to where it was at the last save, or null if there\n * is no saved sync data.\n */\n public getSavedSync(): Promise {\n return Promise.resolve(null);\n }\n\n /**\n * @return {Promise} If there is a saved sync, the nextBatch token\n * for this sync, otherwise null.\n */\n public getSavedSyncToken(): Promise {\n return Promise.resolve(null);\n }\n\n /**\n * Delete all data from this store.\n * @return {Promise} An immediately resolved promise.\n */\n public deleteAllData(): Promise {\n this.rooms = {\n // roomId: Room\n };\n this.users = {\n // userId: User\n };\n this.syncToken = null;\n this.filters = {\n // userId: {\n // filterId: Filter\n // }\n };\n this.accountData = {\n // type : content\n };\n return Promise.resolve();\n }\n\n /**\n * Returns the out-of-band membership events for this room that\n * were previously loaded.\n * @param {string} roomId\n * @returns {event[]} the events, potentially an empty array if OOB loading didn't yield any new members\n * @returns {null} in case the members for this room haven't been stored yet\n */\n public getOutOfBandMembers(roomId: string): Promise {\n return Promise.resolve(this.oobMembers[roomId] || null);\n }\n\n /**\n * Stores the out-of-band membership events for this room. Note that\n * it still makes sense to store an empty array as the OOB status for the room is\n * marked as fetched, and getOutOfBandMembers will return an empty array instead of null\n * @param {string} roomId\n * @param {event[]} membershipEvents the membership events to store\n * @returns {Promise} when all members have been stored\n */\n public setOutOfBandMembers(roomId: string, membershipEvents: IEvent[]): Promise {\n this.oobMembers[roomId] = membershipEvents;\n return Promise.resolve();\n }\n\n public clearOutOfBandMembers(roomId: string): Promise {\n this.oobMembers = {};\n return Promise.resolve();\n }\n\n public getClientOptions(): Promise {\n return Promise.resolve(this.clientOptions);\n }\n\n public storeClientOptions(options: object): Promise {\n this.clientOptions = Object.assign({}, options);\n return Promise.resolve();\n }\n}\n", + "/*\nCopyright 2015 - 2021 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n/**\n * This is an internal module. See {@link MemoryStore} for the public class.\n * @module store/memory\n */\n\nimport { EventType } from \"../@types/event\";\nimport { Group } from \"../models/group\";\nimport { Room } from \"../models/room\";\nimport { User } from \"../models/user\";\nimport { IEvent, MatrixEvent } from \"../models/event\";\nimport { RoomState } from \"../models/room-state\";\nimport { RoomMember } from \"../models/room-member\";\nimport { Filter } from \"../filter\";\nimport { ISavedSync, IStore } from \"./index\";\nimport { RoomSummary } from \"../models/room-summary\";\nimport { ISyncResponse } from \"../sync-accumulator\";\n\nfunction isValidFilterId(filterId: string): boolean {\n const isValidStr = typeof filterId === \"string\" &&\n !!filterId &&\n filterId !== \"undefined\" && // exclude these as we've serialized undefined in localStorage before\n filterId !== \"null\";\n\n return isValidStr || typeof filterId === \"number\";\n}\n\nexport interface IOpts {\n localStorage?: Storage;\n}\n\n/**\n * Construct a new in-memory data store for the Matrix Client.\n * @constructor\n * @param {Object=} opts Config options\n * @param {LocalStorage} opts.localStorage The local storage instance to persist\n * some forms of data such as tokens. Rooms will NOT be stored.\n */\nexport class MemoryStore implements IStore {\n private rooms: Record = {}; // roomId: Room\n private groups: Record = {}; // groupId: Group\n private users: Record = {}; // userId: User\n private syncToken: string = null;\n // userId: {\n // filterId: Filter\n // }\n private filters: Record> = {};\n public accountData: Record = {}; // type : content\n private readonly localStorage: Storage;\n private oobMembers: Record = {}; // roomId: [member events]\n private clientOptions = {};\n\n constructor(opts: IOpts = {}) {\n this.localStorage = opts.localStorage;\n }\n\n /**\n * Retrieve the token to stream from.\n * @return {string} The token or null.\n */\n public getSyncToken(): string | null {\n return this.syncToken;\n }\n\n /** @return {Promise} whether or not the database was newly created in this session. */\n public isNewlyCreated(): Promise {\n return Promise.resolve(true);\n }\n\n /**\n * Set the token to stream from.\n * @param {string} token The token to stream from.\n */\n public setSyncToken(token: string) {\n this.syncToken = token;\n }\n\n /**\n * Store the given room.\n * @param {Group} group The group to be stored\n * @deprecated groups/communities never made it to the spec and support for them is being discontinued.\n */\n public storeGroup(group: Group) {\n this.groups[group.groupId] = group;\n }\n\n /**\n * Retrieve a group by its group ID.\n * @param {string} groupId The group ID.\n * @return {Group} The group or null.\n * @deprecated groups/communities never made it to the spec and support for them is being discontinued.\n */\n public getGroup(groupId: string): Group | null {\n return this.groups[groupId] || null;\n }\n\n /**\n * Retrieve all known groups.\n * @return {Group[]} A list of groups, which may be empty.\n * @deprecated groups/communities never made it to the spec and support for them is being discontinued.\n */\n public getGroups(): Group[] {\n return Object.values(this.groups);\n }\n\n /**\n * Store the given room.\n * @param {Room} room The room to be stored. All properties must be stored.\n */\n public storeRoom(room: Room) {\n this.rooms[room.roomId] = room;\n // add listeners for room member changes so we can keep the room member\n // map up-to-date.\n room.currentState.on(\"RoomState.members\", this.onRoomMember);\n // add existing members\n room.currentState.getMembers().forEach((m) => {\n this.onRoomMember(null, room.currentState, m);\n });\n }\n\n /**\n * Called when a room member in a room being tracked by this store has been\n * updated.\n * @param {MatrixEvent} event\n * @param {RoomState} state\n * @param {RoomMember} member\n */\n private onRoomMember = (event: MatrixEvent, state: RoomState, member: RoomMember) => {\n if (member.membership === \"invite\") {\n // We do NOT add invited members because people love to typo user IDs\n // which would then show up in these lists (!)\n return;\n }\n\n const user = this.users[member.userId] || new User(member.userId);\n if (member.name) {\n user.setDisplayName(member.name);\n if (member.events.member) {\n user.setRawDisplayName(\n member.events.member.getDirectionalContent().displayname,\n );\n }\n }\n if (member.events.member && member.events.member.getContent().avatar_url) {\n user.setAvatarUrl(member.events.member.getContent().avatar_url);\n }\n this.users[user.userId] = user;\n };\n\n /**\n * Retrieve a room by its' room ID.\n * @param {string} roomId The room ID.\n * @return {Room} The room or null.\n */\n public getRoom(roomId: string): Room | null {\n return this.rooms[roomId] || null;\n }\n\n /**\n * Retrieve all known rooms.\n * @return {Room[]} A list of rooms, which may be empty.\n */\n public getRooms(): Room[] {\n return Object.values(this.rooms);\n }\n\n /**\n * Permanently delete a room.\n * @param {string} roomId\n */\n public removeRoom(roomId: string): void {\n if (this.rooms[roomId]) {\n this.rooms[roomId].removeListener(\"RoomState.members\", this.onRoomMember);\n }\n delete this.rooms[roomId];\n }\n\n /**\n * Retrieve a summary of all the rooms.\n * @return {RoomSummary[]} A summary of each room.\n */\n public getRoomSummaries(): RoomSummary[] {\n return Object.values(this.rooms).map(function(room) {\n return room.summary;\n });\n }\n\n /**\n * Store a User.\n * @param {User} user The user to store.\n */\n public storeUser(user: User): void {\n this.users[user.userId] = user;\n }\n\n /**\n * Retrieve a User by its' user ID.\n * @param {string} userId The user ID.\n * @return {User} The user or null.\n */\n public getUser(userId: string): User | null {\n return this.users[userId] || null;\n }\n\n /**\n * Retrieve all known users.\n * @return {User[]} A list of users, which may be empty.\n */\n public getUsers(): User[] {\n return Object.values(this.users);\n }\n\n /**\n * Retrieve scrollback for this room.\n * @param {Room} room The matrix room\n * @param {integer} limit The max number of old events to retrieve.\n * @return {Array} An array of objects which will be at most 'limit'\n * length and at least 0. The objects are the raw event JSON.\n */\n public scrollback(room: Room, limit: number): MatrixEvent[] {\n return [];\n }\n\n /**\n * Store events for a room. The events have already been added to the timeline\n * @param {Room} room The room to store events for.\n * @param {Array} events The events to store.\n * @param {string} token The token associated with these events.\n * @param {boolean} toStart True if these are paginated results.\n */\n public storeEvents(room: Room, events: MatrixEvent[], token: string, toStart: boolean) {\n // no-op because they've already been added to the room instance.\n }\n\n /**\n * Store a filter.\n * @param {Filter} filter\n */\n public storeFilter(filter: Filter): void {\n if (!filter) {\n return;\n }\n if (!this.filters[filter.userId]) {\n this.filters[filter.userId] = {};\n }\n this.filters[filter.userId][filter.filterId] = filter;\n }\n\n /**\n * Retrieve a filter.\n * @param {string} userId\n * @param {string} filterId\n * @return {?Filter} A filter or null.\n */\n public getFilter(userId: string, filterId: string): Filter | null {\n if (!this.filters[userId] || !this.filters[userId][filterId]) {\n return null;\n }\n return this.filters[userId][filterId];\n }\n\n /**\n * Retrieve a filter ID with the given name.\n * @param {string} filterName The filter name.\n * @return {?string} The filter ID or null.\n */\n public getFilterIdByName(filterName: string): string | null {\n if (!this.localStorage) {\n return null;\n }\n const key = \"mxjssdk_memory_filter_\" + filterName;\n // XXX Storage.getItem doesn't throw ...\n // or are we using something different\n // than window.localStorage in some cases\n // that does throw?\n // that would be very naughty\n try {\n const value = this.localStorage.getItem(key);\n if (isValidFilterId(value)) {\n return value;\n }\n } catch (e) {}\n return null;\n }\n\n /**\n * Set a filter name to ID mapping.\n * @param {string} filterName\n * @param {string} filterId\n */\n public setFilterIdByName(filterName: string, filterId: string) {\n if (!this.localStorage) {\n return;\n }\n const key = \"mxjssdk_memory_filter_\" + filterName;\n try {\n if (isValidFilterId(filterId)) {\n this.localStorage.setItem(key, filterId);\n } else {\n this.localStorage.removeItem(key);\n }\n } catch (e) {}\n }\n\n /**\n * Store user-scoped account data events.\n * N.B. that account data only allows a single event per type, so multiple\n * events with the same type will replace each other.\n * @param {Array} events The events to store.\n */\n public storeAccountDataEvents(events: MatrixEvent[]): void {\n events.forEach((event) => {\n this.accountData[event.getType()] = event;\n });\n }\n\n /**\n * Get account data event by event type\n * @param {string} eventType The event type being queried\n * @return {?MatrixEvent} the user account_data event of given type, if any\n */\n public getAccountData(eventType: EventType | string): MatrixEvent | undefined {\n return this.accountData[eventType];\n }\n\n /**\n * setSyncData does nothing as there is no backing data store.\n *\n * @param {Object} syncData The sync data\n * @return {Promise} An immediately resolved promise.\n */\n public setSyncData(syncData: ISyncResponse): Promise {\n return Promise.resolve();\n }\n\n /**\n * We never want to save becase we have nothing to save to.\n *\n * @return {boolean} If the store wants to save\n */\n public wantsSave(): boolean {\n return false;\n }\n\n /**\n * Save does nothing as there is no backing data store.\n * @param {bool} force True to force a save (but the memory\n * store still can't save anything)\n */\n public save(force: boolean): void {}\n\n /**\n * Startup does nothing as this store doesn't require starting up.\n * @return {Promise} An immediately resolved promise.\n */\n public startup(): Promise {\n return Promise.resolve();\n }\n\n /**\n * @return {Promise} Resolves with a sync response to restore the\n * client state to where it was at the last save, or null if there\n * is no saved sync data.\n */\n public getSavedSync(): Promise {\n return Promise.resolve(null);\n }\n\n /**\n * @return {Promise} If there is a saved sync, the nextBatch token\n * for this sync, otherwise null.\n */\n public getSavedSyncToken(): Promise {\n return Promise.resolve(null);\n }\n\n /**\n * Delete all data from this store.\n * @return {Promise} An immediately resolved promise.\n */\n public deleteAllData(): Promise {\n this.rooms = {\n // roomId: Room\n };\n this.users = {\n // userId: User\n };\n this.syncToken = null;\n this.filters = {\n // userId: {\n // filterId: Filter\n // }\n };\n this.accountData = {\n // type : content\n };\n return Promise.resolve();\n }\n\n /**\n * Returns the out-of-band membership events for this room that\n * were previously loaded.\n * @param {string} roomId\n * @returns {event[]} the events, potentially an empty array if OOB loading didn't yield any new members\n * @returns {null} in case the members for this room haven't been stored yet\n */\n public getOutOfBandMembers(roomId: string): Promise {\n return Promise.resolve(this.oobMembers[roomId] || null);\n }\n\n /**\n * Stores the out-of-band membership events for this room. Note that\n * it still makes sense to store an empty array as the OOB status for the room is\n * marked as fetched, and getOutOfBandMembers will return an empty array instead of null\n * @param {string} roomId\n * @param {event[]} membershipEvents the membership events to store\n * @returns {Promise} when all members have been stored\n */\n public setOutOfBandMembers(roomId: string, membershipEvents: IEvent[]): Promise {\n this.oobMembers[roomId] = membershipEvents;\n return Promise.resolve();\n }\n\n public clearOutOfBandMembers(roomId: string): Promise {\n this.oobMembers = {};\n return Promise.resolve();\n }\n\n public getClientOptions(): Promise {\n return Promise.resolve(this.clientOptions);\n }\n\n public storeClientOptions(options: object): Promise {\n this.clientOptions = Object.assign({}, options);\n return Promise.resolve();\n }\n}\n", "/*\nCopyright 2015, 2016 OpenMarket Ltd\nCopyright 2017 New Vector Ltd\nCopyright 2018 New Vector Ltd\nCopyright 2019 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n/**\n * @module store/session/webstorage\n */\n\nimport * as utils from \"../../utils\";\nimport { logger } from '../../logger';\n\nconst DEBUG = false; // set true to enable console logging.\nconst E2E_PREFIX = \"session.e2e.\";\n\n/**\n * Construct a web storage session store, capable of storing account keys,\n * session keys and access tokens.\n * @constructor\n * @param {WebStorage} webStore A web storage implementation, e.g.\n * 'window.localStorage' or 'window.sessionStorage' or a custom implementation.\n * @throws if the supplied 'store' does not meet the Storage interface of the\n * WebStorage API.\n */\nexport function WebStorageSessionStore(webStore) {\n this.store = webStore;\n if (!utils.isFunction(webStore.getItem) ||\n !utils.isFunction(webStore.setItem) ||\n !utils.isFunction(webStore.removeItem) ||\n !utils.isFunction(webStore.key) ||\n typeof(webStore.length) !== 'number'\n ) {\n throw new Error(\n \"Supplied webStore does not meet the WebStorage API interface\",\n );\n }\n}\n\nWebStorageSessionStore.prototype = {\n /**\n * Remove the stored end to end account for the logged-in user.\n */\n removeEndToEndAccount: function() {\n this.store.removeItem(KEY_END_TO_END_ACCOUNT);\n },\n\n /**\n * Load the end to end account for the logged-in user.\n * Note that the end-to-end account is now stored in the\n * crypto store rather than here: this remains here so\n * old sessions can be migrated out of the session store.\n * @return {?string} Base64 encoded account.\n */\n getEndToEndAccount: function() {\n return this.store.getItem(KEY_END_TO_END_ACCOUNT);\n },\n\n /**\n * Retrieves the known devices for all users.\n * @return {object} A map from user ID to map of device ID to keys for the device.\n */\n getAllEndToEndDevices: function() {\n const prefix = keyEndToEndDevicesForUser('');\n const devices = {};\n for (let i = 0; i < this.store.length; ++i) {\n const key = this.store.key(i);\n const userId = key.substr(prefix.length);\n if (key.startsWith(prefix)) devices[userId] = getJsonItem(this.store, key);\n }\n return devices;\n },\n\n getEndToEndDeviceTrackingStatus: function() {\n return getJsonItem(this.store, KEY_END_TO_END_DEVICE_LIST_TRACKING_STATUS);\n },\n\n /**\n * Get the sync token corresponding to the device list.\n *\n * @return {String?} token\n */\n getEndToEndDeviceSyncToken: function() {\n return getJsonItem(this.store, KEY_END_TO_END_DEVICE_SYNC_TOKEN);\n },\n\n /**\n * Removes all end to end device data from the store\n */\n removeEndToEndDeviceData: function() {\n removeByPrefix(this.store, keyEndToEndDevicesForUser(''));\n removeByPrefix(this.store, KEY_END_TO_END_DEVICE_LIST_TRACKING_STATUS);\n removeByPrefix(this.store, KEY_END_TO_END_DEVICE_SYNC_TOKEN);\n },\n\n /**\n * Retrieve the end-to-end sessions between the logged-in user and another\n * device.\n * @param {string} deviceKey The public key of the other device.\n * @return {object} A map from sessionId to Base64 end-to-end session.\n */\n getEndToEndSessions: function(deviceKey) {\n return getJsonItem(this.store, keyEndToEndSessions(deviceKey));\n },\n\n /**\n * Retrieve all end-to-end sessions between the logged-in user and other\n * devices.\n * @return {object} A map of {deviceKey -> {sessionId -> session pickle}}\n */\n getAllEndToEndSessions: function() {\n const deviceKeys = getKeysWithPrefix(this.store, keyEndToEndSessions(''));\n const results = {};\n for (const k of deviceKeys) {\n const unprefixedKey = k.substr(keyEndToEndSessions('').length);\n results[unprefixedKey] = getJsonItem(this.store, k);\n }\n return results;\n },\n\n /**\n * Remove all end-to-end sessions from the store\n * This is used after migrating sessions awat from the sessions store.\n */\n removeAllEndToEndSessions: function() {\n removeByPrefix(this.store, keyEndToEndSessions(''));\n },\n\n /**\n * Retrieve a list of all known inbound group sessions\n *\n * @return {{senderKey: string, sessionId: string}}\n */\n getAllEndToEndInboundGroupSessionKeys: function() {\n const prefix = E2E_PREFIX + 'inboundgroupsessions/';\n const result = [];\n for (let i = 0; i < this.store.length; i++) {\n const key = this.store.key(i);\n if (!key.startsWith(prefix)) {\n continue;\n }\n // we can't use split, as the components we are trying to split out\n // might themselves contain '/' characters. We rely on the\n // senderKey being a (32-byte) curve25519 key, base64-encoded\n // (hence 43 characters long).\n\n result.push({\n senderKey: key.substr(prefix.length, 43),\n sessionId: key.substr(prefix.length + 44),\n });\n }\n return result;\n },\n\n getEndToEndInboundGroupSession: function(senderKey, sessionId) {\n const key = keyEndToEndInboundGroupSession(senderKey, sessionId);\n return this.store.getItem(key);\n },\n\n removeAllEndToEndInboundGroupSessions: function() {\n removeByPrefix(this.store, E2E_PREFIX + 'inboundgroupsessions/');\n },\n\n /**\n * Get the end-to-end state for all rooms\n * @return {object} roomId -> object with the end-to-end info for the room.\n */\n getAllEndToEndRooms: function() {\n const roomKeys = getKeysWithPrefix(this.store, keyEndToEndRoom(''));\n const results = {};\n for (const k of roomKeys) {\n const unprefixedKey = k.substr(keyEndToEndRoom('').length);\n results[unprefixedKey] = getJsonItem(this.store, k);\n }\n return results;\n },\n\n removeAllEndToEndRooms: function() {\n removeByPrefix(this.store, keyEndToEndRoom(''));\n },\n\n setLocalTrustedBackupPubKey: function(pubkey) {\n this.store.setItem(KEY_END_TO_END_TRUSTED_BACKUP_PUBKEY, pubkey);\n },\n\n // XXX: This store is deprecated really, but added this as a temporary\n // thing until cross-signing lands.\n getLocalTrustedBackupPubKey: function() {\n return this.store.getItem(KEY_END_TO_END_TRUSTED_BACKUP_PUBKEY);\n },\n};\n\nconst KEY_END_TO_END_ACCOUNT = E2E_PREFIX + \"account\";\nconst KEY_END_TO_END_DEVICE_SYNC_TOKEN = E2E_PREFIX + \"device_sync_token\";\nconst KEY_END_TO_END_DEVICE_LIST_TRACKING_STATUS = E2E_PREFIX + \"device_tracking\";\nconst KEY_END_TO_END_TRUSTED_BACKUP_PUBKEY = E2E_PREFIX + \"trusted_backup_pubkey\";\n\nfunction keyEndToEndDevicesForUser(userId) {\n return E2E_PREFIX + \"devices/\" + userId;\n}\n\nfunction keyEndToEndSessions(deviceKey) {\n return E2E_PREFIX + \"sessions/\" + deviceKey;\n}\n\nfunction keyEndToEndInboundGroupSession(senderKey, sessionId) {\n return E2E_PREFIX + \"inboundgroupsessions/\" + senderKey + \"/\" + sessionId;\n}\n\nfunction keyEndToEndRoom(roomId) {\n return E2E_PREFIX + \"rooms/\" + roomId;\n}\n\nfunction getJsonItem(store, key) {\n try {\n // if the key is absent, store.getItem() returns null, and\n // JSON.parse(null) === null, so this returns null.\n return JSON.parse(store.getItem(key));\n } catch (e) {\n debuglog(\"Failed to get key %s: %s\", key, e);\n debuglog(e.stack);\n }\n return null;\n}\n\nfunction getKeysWithPrefix(store, prefix) {\n const results = [];\n for (let i = 0; i < store.length; ++i) {\n const key = store.key(i);\n if (key.startsWith(prefix)) results.push(key);\n }\n return results;\n}\n\nfunction removeByPrefix(store, prefix) {\n const toRemove = [];\n for (let i = 0; i < store.length; ++i) {\n const key = store.key(i);\n if (key.startsWith(prefix)) toRemove.push(key);\n }\n for (const key of toRemove) {\n store.removeItem(key);\n }\n}\n\nfunction debuglog() {\n if (DEBUG) {\n logger.log(...arguments);\n }\n}\n", - "/*\nCopyright 2015 - 2021 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n/**\n * This is an internal module.\n * @module store/stub\n */\n\nimport { EventType } from \"../@types/event\";\nimport { Group } from \"../models/group\";\nimport { Room } from \"../models/room\";\nimport { User } from \"../models/user\";\nimport { IEvent, MatrixEvent } from \"../models/event\";\nimport { Filter } from \"../filter\";\nimport { ISavedSync, IStore } from \"./index\";\nimport { RoomSummary } from \"../models/room-summary\";\nimport { ISyncResponse } from \"../sync-accumulator\";\n\n/**\n * Construct a stub store. This does no-ops on most store methods.\n * @constructor\n */\nexport class StubStore implements IStore {\n public readonly accountData = {}; // stub\n private fromToken: string = null;\n\n /** @return {Promise} whether or not the database was newly created in this session. */\n public isNewlyCreated(): Promise {\n return Promise.resolve(true);\n }\n\n /**\n * Get the sync token.\n * @return {string}\n */\n public getSyncToken(): string | null {\n return this.fromToken;\n }\n\n /**\n * Set the sync token.\n * @param {string} token\n */\n public setSyncToken(token: string) {\n this.fromToken = token;\n }\n\n /**\n * No-op.\n * @param {Group} group\n */\n public storeGroup(group: Group) {}\n\n /**\n * No-op.\n * @param {string} groupId\n * @return {null}\n */\n public getGroup(groupId: string): Group | null {\n return null;\n }\n\n /**\n * No-op.\n * @return {Array} An empty array.\n */\n public getGroups(): Group[] {\n return [];\n }\n\n /**\n * No-op.\n * @param {Room} room\n */\n public storeRoom(room: Room) {}\n\n /**\n * No-op.\n * @param {string} roomId\n * @return {null}\n */\n public getRoom(roomId: string): Room | null {\n return null;\n }\n\n /**\n * No-op.\n * @return {Array} An empty array.\n */\n public getRooms(): Room[] {\n return [];\n }\n\n /**\n * Permanently delete a room.\n * @param {string} roomId\n */\n public removeRoom(roomId: string) {\n return;\n }\n\n /**\n * No-op.\n * @return {Array} An empty array.\n */\n public getRoomSummaries(): RoomSummary[] {\n return [];\n }\n\n /**\n * No-op.\n * @param {User} user\n */\n public storeUser(user: User) {}\n\n /**\n * No-op.\n * @param {string} userId\n * @return {null}\n */\n public getUser(userId: string): User | null {\n return null;\n }\n\n /**\n * No-op.\n * @return {User[]}\n */\n public getUsers(): User[] {\n return [];\n }\n\n /**\n * No-op.\n * @param {Room} room\n * @param {integer} limit\n * @return {Array}\n */\n public scrollback(room: Room, limit: number): MatrixEvent[] {\n return [];\n }\n\n /**\n * Store events for a room.\n * @param {Room} room The room to store events for.\n * @param {Array} events The events to store.\n * @param {string} token The token associated with these events.\n * @param {boolean} toStart True if these are paginated results.\n */\n public storeEvents(room: Room, events: MatrixEvent[], token: string, toStart: boolean) {}\n\n /**\n * Store a filter.\n * @param {Filter} filter\n */\n public storeFilter(filter: Filter) {}\n\n /**\n * Retrieve a filter.\n * @param {string} userId\n * @param {string} filterId\n * @return {?Filter} A filter or null.\n */\n public getFilter(userId: string, filterId: string): Filter | null {\n return null;\n }\n\n /**\n * Retrieve a filter ID with the given name.\n * @param {string} filterName The filter name.\n * @return {?string} The filter ID or null.\n */\n public getFilterIdByName(filterName: string): string | null {\n return null;\n }\n\n /**\n * Set a filter name to ID mapping.\n * @param {string} filterName\n * @param {string} filterId\n */\n public setFilterIdByName(filterName: string, filterId: string) {}\n\n /**\n * Store user-scoped account data events\n * @param {Array} events The events to store.\n */\n public storeAccountDataEvents(events: MatrixEvent[]) {}\n\n /**\n * Get account data event by event type\n * @param {string} eventType The event type being queried\n */\n public getAccountData(eventType: EventType | string): MatrixEvent | undefined {\n return undefined;\n }\n\n /**\n * setSyncData does nothing as there is no backing data store.\n *\n * @param {Object} syncData The sync data\n * @return {Promise} An immediately resolved promise.\n */\n public setSyncData(syncData: ISyncResponse): Promise {\n return Promise.resolve();\n }\n\n /**\n * We never want to save because we have nothing to save to.\n *\n * @return {boolean} If the store wants to save\n */\n public wantsSave(): boolean {\n return false;\n }\n\n /**\n * Save does nothing as there is no backing data store.\n */\n public save() {}\n\n /**\n * Startup does nothing.\n * @return {Promise} An immediately resolved promise.\n */\n public startup(): Promise {\n return Promise.resolve();\n }\n\n /**\n * @return {Promise} Resolves with a sync response to restore the\n * client state to where it was at the last save, or null if there\n * is no saved sync data.\n */\n public getSavedSync(): Promise {\n return Promise.resolve(null);\n }\n\n /**\n * @return {Promise} If there is a saved sync, the nextBatch token\n * for this sync, otherwise null.\n */\n public getSavedSyncToken(): Promise {\n return Promise.resolve(null);\n }\n\n /**\n * Delete all data from this store. Does nothing since this store\n * doesn't store anything.\n * @return {Promise} An immediately resolved promise.\n */\n public deleteAllData(): Promise {\n return Promise.resolve();\n }\n\n public getOutOfBandMembers(): Promise {\n return Promise.resolve(null);\n }\n\n public setOutOfBandMembers(roomId: string, membershipEvents: IEvent[]): Promise {\n return Promise.resolve();\n }\n\n public clearOutOfBandMembers(): Promise {\n return Promise.resolve();\n }\n\n public getClientOptions(): Promise {\n return Promise.resolve({});\n }\n\n public storeClientOptions(options: object): Promise {\n return Promise.resolve();\n }\n}\n", + "/*\nCopyright 2015 - 2021 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n/**\n * This is an internal module.\n * @module store/stub\n */\n\nimport { EventType } from \"../@types/event\";\nimport { Group } from \"../models/group\";\nimport { Room } from \"../models/room\";\nimport { User } from \"../models/user\";\nimport { IEvent, MatrixEvent } from \"../models/event\";\nimport { Filter } from \"../filter\";\nimport { ISavedSync, IStore } from \"./index\";\nimport { RoomSummary } from \"../models/room-summary\";\nimport { ISyncResponse } from \"../sync-accumulator\";\n\n/**\n * Construct a stub store. This does no-ops on most store methods.\n * @constructor\n */\nexport class StubStore implements IStore {\n public readonly accountData = {}; // stub\n private fromToken: string = null;\n\n /** @return {Promise} whether or not the database was newly created in this session. */\n public isNewlyCreated(): Promise {\n return Promise.resolve(true);\n }\n\n /**\n * Get the sync token.\n * @return {string}\n */\n public getSyncToken(): string | null {\n return this.fromToken;\n }\n\n /**\n * Set the sync token.\n * @param {string} token\n */\n public setSyncToken(token: string) {\n this.fromToken = token;\n }\n\n /**\n * No-op.\n * @param {Group} group\n * @deprecated groups/communities never made it to the spec and support for them is being discontinued.\n */\n public storeGroup(group: Group) {}\n\n /**\n * No-op.\n * @param {string} groupId\n * @return {null}\n * @deprecated groups/communities never made it to the spec and support for them is being discontinued.\n */\n public getGroup(groupId: string): Group | null {\n return null;\n }\n\n /**\n * No-op.\n * @return {Array} An empty array.\n * @deprecated groups/communities never made it to the spec and support for them is being discontinued.\n */\n public getGroups(): Group[] {\n return [];\n }\n\n /**\n * No-op.\n * @param {Room} room\n */\n public storeRoom(room: Room) {}\n\n /**\n * No-op.\n * @param {string} roomId\n * @return {null}\n */\n public getRoom(roomId: string): Room | null {\n return null;\n }\n\n /**\n * No-op.\n * @return {Array} An empty array.\n */\n public getRooms(): Room[] {\n return [];\n }\n\n /**\n * Permanently delete a room.\n * @param {string} roomId\n */\n public removeRoom(roomId: string) {\n return;\n }\n\n /**\n * No-op.\n * @return {Array} An empty array.\n */\n public getRoomSummaries(): RoomSummary[] {\n return [];\n }\n\n /**\n * No-op.\n * @param {User} user\n */\n public storeUser(user: User) {}\n\n /**\n * No-op.\n * @param {string} userId\n * @return {null}\n */\n public getUser(userId: string): User | null {\n return null;\n }\n\n /**\n * No-op.\n * @return {User[]}\n */\n public getUsers(): User[] {\n return [];\n }\n\n /**\n * No-op.\n * @param {Room} room\n * @param {integer} limit\n * @return {Array}\n */\n public scrollback(room: Room, limit: number): MatrixEvent[] {\n return [];\n }\n\n /**\n * Store events for a room.\n * @param {Room} room The room to store events for.\n * @param {Array} events The events to store.\n * @param {string} token The token associated with these events.\n * @param {boolean} toStart True if these are paginated results.\n */\n public storeEvents(room: Room, events: MatrixEvent[], token: string, toStart: boolean) {}\n\n /**\n * Store a filter.\n * @param {Filter} filter\n */\n public storeFilter(filter: Filter) {}\n\n /**\n * Retrieve a filter.\n * @param {string} userId\n * @param {string} filterId\n * @return {?Filter} A filter or null.\n */\n public getFilter(userId: string, filterId: string): Filter | null {\n return null;\n }\n\n /**\n * Retrieve a filter ID with the given name.\n * @param {string} filterName The filter name.\n * @return {?string} The filter ID or null.\n */\n public getFilterIdByName(filterName: string): string | null {\n return null;\n }\n\n /**\n * Set a filter name to ID mapping.\n * @param {string} filterName\n * @param {string} filterId\n */\n public setFilterIdByName(filterName: string, filterId: string) {}\n\n /**\n * Store user-scoped account data events\n * @param {Array} events The events to store.\n */\n public storeAccountDataEvents(events: MatrixEvent[]) {}\n\n /**\n * Get account data event by event type\n * @param {string} eventType The event type being queried\n */\n public getAccountData(eventType: EventType | string): MatrixEvent | undefined {\n return undefined;\n }\n\n /**\n * setSyncData does nothing as there is no backing data store.\n *\n * @param {Object} syncData The sync data\n * @return {Promise} An immediately resolved promise.\n */\n public setSyncData(syncData: ISyncResponse): Promise {\n return Promise.resolve();\n }\n\n /**\n * We never want to save because we have nothing to save to.\n *\n * @return {boolean} If the store wants to save\n */\n public wantsSave(): boolean {\n return false;\n }\n\n /**\n * Save does nothing as there is no backing data store.\n */\n public save() {}\n\n /**\n * Startup does nothing.\n * @return {Promise} An immediately resolved promise.\n */\n public startup(): Promise {\n return Promise.resolve();\n }\n\n /**\n * @return {Promise} Resolves with a sync response to restore the\n * client state to where it was at the last save, or null if there\n * is no saved sync data.\n */\n public getSavedSync(): Promise {\n return Promise.resolve(null);\n }\n\n /**\n * @return {Promise} If there is a saved sync, the nextBatch token\n * for this sync, otherwise null.\n */\n public getSavedSyncToken(): Promise {\n return Promise.resolve(null);\n }\n\n /**\n * Delete all data from this store. Does nothing since this store\n * doesn't store anything.\n * @return {Promise} An immediately resolved promise.\n */\n public deleteAllData(): Promise {\n return Promise.resolve();\n }\n\n public getOutOfBandMembers(): Promise {\n return Promise.resolve(null);\n }\n\n public setOutOfBandMembers(roomId: string, membershipEvents: IEvent[]): Promise {\n return Promise.resolve();\n }\n\n public clearOutOfBandMembers(): Promise {\n return Promise.resolve();\n }\n\n public getClientOptions(): Promise {\n return Promise.resolve({});\n }\n\n public storeClientOptions(options: object): Promise {\n return Promise.resolve();\n }\n}\n", "/*\nCopyright 2017 - 2021 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n/**\n * This is an internal module. See {@link SyncAccumulator} for the public class.\n * @module sync-accumulator\n */\n\nimport { logger } from './logger';\nimport { deepCopy } from \"./utils\";\nimport { IContent, IUnsigned } from \"./models/event\";\nimport { IRoomSummary } from \"./models/room-summary\";\nimport { EventType } from \"./@types/event\";\n\ninterface IOpts {\n maxTimelineEntries?: number;\n}\n\nexport interface IMinimalEvent {\n content: IContent;\n type: EventType | string;\n}\n\nexport interface IEphemeral {\n events: IMinimalEvent[];\n}\n\n/* eslint-disable camelcase */\ninterface IUnreadNotificationCounts {\n highlight_count?: number;\n notification_count?: number;\n}\n\nexport interface IRoomEvent extends IMinimalEvent {\n event_id: string;\n sender: string;\n origin_server_ts: number;\n unsigned?: IUnsigned;\n /** @deprecated - legacy field */\n age?: number;\n}\n\nexport interface IStateEvent extends IRoomEvent {\n prev_content?: IContent;\n state_key: string;\n}\n\ninterface IState {\n events: IStateEvent[];\n}\n\nexport interface ITimeline {\n events: Array;\n limited?: boolean;\n prev_batch: string;\n}\n\nexport interface IJoinedRoom {\n summary: IRoomSummary;\n state: IState;\n timeline: ITimeline;\n ephemeral: IEphemeral;\n account_data: IAccountData;\n unread_notifications: IUnreadNotificationCounts;\n}\n\nexport interface IStrippedState {\n content: IContent;\n state_key: string;\n type: EventType | string;\n sender: string;\n}\n\nexport interface IInviteState {\n events: IStrippedState[];\n}\n\nexport interface IInvitedRoom {\n invite_state: IInviteState;\n}\n\nexport interface ILeftRoom {\n state: IState;\n timeline: ITimeline;\n account_data: IAccountData;\n}\n\nexport interface IRooms {\n [Category.Join]: Record;\n [Category.Invite]: Record;\n [Category.Leave]: Record;\n}\n\ninterface IPresence {\n events: IMinimalEvent[];\n}\n\ninterface IAccountData {\n events: IMinimalEvent[];\n}\n\ninterface IToDeviceEvent {\n content: IContent;\n sender: string;\n type: string;\n}\n\ninterface IToDevice {\n events: IToDeviceEvent[];\n}\n\ninterface IDeviceLists {\n changed: string[];\n left: string[];\n}\n\nexport interface IGroups {\n [Category.Join]: object;\n [Category.Invite]: object;\n [Category.Leave]: object;\n}\n\nexport interface ISyncResponse {\n next_batch: string;\n rooms: IRooms;\n presence?: IPresence;\n account_data: IAccountData;\n to_device?: IToDevice;\n device_lists?: IDeviceLists;\n device_one_time_keys_count?: Record;\n\n groups: IGroups; // unspecced\n}\n/* eslint-enable camelcase */\n\nexport enum Category {\n Invite = \"invite\",\n Leave = \"leave\",\n Join = \"join\",\n}\n\ninterface IRoom {\n _currentState: { [eventType: string]: { [stateKey: string]: IStateEvent } };\n _timeline: {\n event: IRoomEvent | IStateEvent;\n token: string | null;\n }[];\n _summary: Partial;\n _accountData: { [eventType: string]: IMinimalEvent };\n _unreadNotifications: Partial;\n _readReceipts: {\n [userId: string]: {\n data: IMinimalEvent;\n eventId: string;\n };\n };\n}\n\nexport interface ISyncData {\n nextBatch: string;\n accountData: IMinimalEvent[];\n roomsData: IRooms;\n groupsData: IGroups;\n}\n\n/**\n * The purpose of this class is to accumulate /sync responses such that a\n * complete \"initial\" JSON response can be returned which accurately represents\n * the sum total of the /sync responses accumulated to date. It only handles\n * room data: that is, everything under the \"rooms\" top-level key.\n *\n * This class is used when persisting room data so a complete /sync response can\n * be loaded from disk and incremental syncs can be performed on the server,\n * rather than asking the server to do an initial sync on startup.\n */\nexport class SyncAccumulator {\n private accountData: Record = {}; // $event_type: Object\n private inviteRooms: Record = {}; // $roomId: { ... sync 'invite' json data ... }\n private joinRooms: { [roomId: string]: IRoom } = {};\n // the /sync token which corresponds to the last time rooms were\n // accumulated. We remember this so that any caller can obtain a\n // coherent /sync response and know at what point they should be\n // streaming from without losing events.\n private nextBatch: string = null;\n\n // { ('invite'|'join'|'leave'): $groupId: { ... sync 'group' data } }\n private groups: Record = {\n invite: {},\n join: {},\n leave: {},\n };\n\n /**\n * @param {Object} opts\n * @param {Number=} opts.maxTimelineEntries The ideal maximum number of\n * timeline entries to keep in the sync response. This is best-effort, as\n * clients do not always have a back-pagination token for each event, so\n * it's possible there may be slightly *less* than this value. There will\n * never be more. This cannot be 0 or else it makes it impossible to scroll\n * back in a room. Default: 50.\n */\n constructor(private readonly opts: IOpts = {}) {\n this.opts.maxTimelineEntries = this.opts.maxTimelineEntries || 50;\n }\n\n public accumulate(syncResponse: ISyncResponse, fromDatabase = false): void {\n this.accumulateRooms(syncResponse, fromDatabase);\n this.accumulateGroups(syncResponse);\n this.accumulateAccountData(syncResponse);\n this.nextBatch = syncResponse.next_batch;\n }\n\n private accumulateAccountData(syncResponse: ISyncResponse): void {\n if (!syncResponse.account_data || !syncResponse.account_data.events) {\n return;\n }\n // Clobbers based on event type.\n syncResponse.account_data.events.forEach((e) => {\n this.accountData[e.type] = e;\n });\n }\n\n /**\n * Accumulate incremental /sync room data.\n * @param {Object} syncResponse the complete /sync JSON\n * @param {boolean} fromDatabase True if the sync response is one saved to the database\n */\n private accumulateRooms(syncResponse: ISyncResponse, fromDatabase = false): void {\n if (!syncResponse.rooms) {\n return;\n }\n if (syncResponse.rooms.invite) {\n Object.keys(syncResponse.rooms.invite).forEach((roomId) => {\n this.accumulateRoom(roomId, Category.Invite, syncResponse.rooms.invite[roomId], fromDatabase);\n });\n }\n if (syncResponse.rooms.join) {\n Object.keys(syncResponse.rooms.join).forEach((roomId) => {\n this.accumulateRoom(roomId, Category.Join, syncResponse.rooms.join[roomId], fromDatabase);\n });\n }\n if (syncResponse.rooms.leave) {\n Object.keys(syncResponse.rooms.leave).forEach((roomId) => {\n this.accumulateRoom(roomId, Category.Leave, syncResponse.rooms.leave[roomId], fromDatabase);\n });\n }\n }\n\n private accumulateRoom(roomId: string, category: Category.Invite, data: IInvitedRoom, fromDatabase: boolean): void;\n private accumulateRoom(roomId: string, category: Category.Join, data: IJoinedRoom, fromDatabase: boolean): void;\n private accumulateRoom(roomId: string, category: Category.Leave, data: ILeftRoom, fromDatabase: boolean): void;\n private accumulateRoom(roomId: string, category: Category, data: any, fromDatabase = false): void {\n // Valid /sync state transitions\n // +--------+ <======+ 1: Accept an invite\n // +== | INVITE | | (5) 2: Leave a room\n // | +--------+ =====+ | 3: Join a public room previously\n // |(1) (4) | | left (handle as if new room)\n // V (2) V | 4: Reject an invite\n // +------+ ========> +--------+ 5: Invite to a room previously\n // | JOIN | (3) | LEAVE* | left (handle as if new room)\n // +------+ <======== +--------+\n //\n // * equivalent to \"no state\"\n switch (category) {\n case Category.Invite: // (5)\n this.accumulateInviteState(roomId, data as IInvitedRoom);\n break;\n\n case Category.Join:\n if (this.inviteRooms[roomId]) { // (1)\n // was previously invite, now join. We expect /sync to give\n // the entire state and timeline on 'join', so delete previous\n // invite state\n delete this.inviteRooms[roomId];\n }\n // (3)\n this.accumulateJoinState(roomId, data as IJoinedRoom, fromDatabase);\n break;\n\n case Category.Leave:\n if (this.inviteRooms[roomId]) { // (4)\n delete this.inviteRooms[roomId];\n } else { // (2)\n delete this.joinRooms[roomId];\n }\n break;\n\n default:\n logger.error(\"Unknown cateogory: \", category);\n }\n }\n\n private accumulateInviteState(roomId: string, data: IInvitedRoom): void {\n if (!data.invite_state || !data.invite_state.events) { // no new data\n return;\n }\n if (!this.inviteRooms[roomId]) {\n this.inviteRooms[roomId] = {\n invite_state: data.invite_state,\n };\n return;\n }\n // accumulate extra keys for invite->invite transitions\n // clobber based on event type / state key\n // We expect invite_state to be small, so just loop over the events\n const currentData = this.inviteRooms[roomId];\n data.invite_state.events.forEach((e) => {\n let hasAdded = false;\n for (let i = 0; i < currentData.invite_state.events.length; i++) {\n const current = currentData.invite_state.events[i];\n if (current.type === e.type && current.state_key == e.state_key) {\n currentData.invite_state.events[i] = e; // update\n hasAdded = true;\n }\n }\n if (!hasAdded) {\n currentData.invite_state.events.push(e);\n }\n });\n }\n\n // Accumulate timeline and state events in a room.\n private accumulateJoinState(roomId: string, data: IJoinedRoom, fromDatabase = false): void {\n // We expect this function to be called a lot (every /sync) so we want\n // this to be fast. /sync stores events in an array but we often want\n // to clobber based on type/state_key. Rather than convert arrays to\n // maps all the time, just keep private maps which contain\n // the actual current accumulated sync state, and array-ify it when\n // getJSON() is called.\n\n // State resolution:\n // The 'state' key is the delta from the previous sync (or start of time\n // if no token was supplied), to the START of the timeline. To obtain\n // the current state, we need to \"roll forward\" state by reading the\n // timeline. We want to store the current state so we can drop events\n // out the end of the timeline based on opts.maxTimelineEntries.\n //\n // 'state' 'timeline' current state\n // |-------x<======================>x\n // T I M E\n //\n // When getJSON() is called, we 'roll back' the current state by the\n // number of entries in the timeline to work out what 'state' should be.\n\n // Back-pagination:\n // On an initial /sync, the server provides a back-pagination token for\n // the start of the timeline. When /sync deltas come down, they also\n // include back-pagination tokens for the start of the timeline. This\n // means not all events in the timeline have back-pagination tokens, as\n // it is only the ones at the START of the timeline which have them.\n // In order for us to have a valid timeline (and back-pagination token\n // to match), we need to make sure that when we remove old timeline\n // events, that we roll forward to an event which has a back-pagination\n // token. This means we can't keep a strict sliding-window based on\n // opts.maxTimelineEntries, and we may have a few less. We should never\n // have more though, provided that the /sync limit is less than or equal\n // to opts.maxTimelineEntries.\n\n if (!this.joinRooms[roomId]) {\n // Create truly empty objects so event types of 'hasOwnProperty' and co\n // don't cause this code to break.\n this.joinRooms[roomId] = {\n _currentState: Object.create(null),\n _timeline: [],\n _accountData: Object.create(null),\n _unreadNotifications: {},\n _summary: {},\n _readReceipts: {},\n };\n }\n const currentData = this.joinRooms[roomId];\n\n if (data.account_data && data.account_data.events) {\n // clobber based on type\n data.account_data.events.forEach((e) => {\n currentData._accountData[e.type] = e;\n });\n }\n\n // these probably clobber, spec is unclear.\n if (data.unread_notifications) {\n currentData._unreadNotifications = data.unread_notifications;\n }\n if (data.summary) {\n const HEROES_KEY = \"m.heroes\";\n const INVITED_COUNT_KEY = \"m.invited_member_count\";\n const JOINED_COUNT_KEY = \"m.joined_member_count\";\n\n const acc = currentData._summary;\n const sum = data.summary;\n acc[HEROES_KEY] = sum[HEROES_KEY] || acc[HEROES_KEY];\n acc[JOINED_COUNT_KEY] = sum[JOINED_COUNT_KEY] || acc[JOINED_COUNT_KEY];\n acc[INVITED_COUNT_KEY] = sum[INVITED_COUNT_KEY] || acc[INVITED_COUNT_KEY];\n }\n\n if (data.ephemeral && data.ephemeral.events) {\n data.ephemeral.events.forEach((e) => {\n // We purposefully do not persist m.typing events.\n // Technically you could refresh a browser before the timer on a\n // typing event is up, so it'll look like you aren't typing when\n // you really still are. However, the alternative is worse. If\n // we do persist typing events, it will look like people are\n // typing forever until someone really does start typing (which\n // will prompt Synapse to send down an actual m.typing event to\n // clobber the one we persisted).\n if (e.type !== \"m.receipt\" || !e.content) {\n // This means we'll drop unknown ephemeral events but that\n // seems okay.\n return;\n }\n // Handle m.receipt events. They clobber based on:\n // (user_id, receipt_type)\n // but they are keyed in the event as:\n // content:{ $event_id: { $receipt_type: { $user_id: {json} }}}\n // so store them in the former so we can accumulate receipt deltas\n // quickly and efficiently (we expect a lot of them). Fold the\n // receipt type into the key name since we only have 1 at the\n // moment (m.read) and nested JSON objects are slower and more\n // of a hassle to work with. We'll inflate this back out when\n // getJSON() is called.\n Object.keys(e.content).forEach((eventId) => {\n if (!e.content[eventId][\"m.read\"]) {\n return;\n }\n Object.keys(e.content[eventId][\"m.read\"]).forEach((userId) => {\n // clobber on user ID\n currentData._readReceipts[userId] = {\n data: e.content[eventId][\"m.read\"][userId],\n eventId: eventId,\n };\n });\n });\n });\n }\n\n // if we got a limited sync, we need to remove all timeline entries or else\n // we will have gaps in the timeline.\n if (data.timeline && data.timeline.limited) {\n currentData._timeline = [];\n }\n\n // Work out the current state. The deltas need to be applied in the order:\n // - existing state which didn't come down /sync.\n // - State events under the 'state' key.\n // - State events in the 'timeline'.\n if (data.state && data.state.events) {\n data.state.events.forEach((e) => {\n setState(currentData._currentState, e);\n });\n }\n if (data.timeline && data.timeline.events) {\n data.timeline.events.forEach((e, index) => {\n // this nops if 'e' isn't a state event\n setState(currentData._currentState, e);\n // append the event to the timeline. The back-pagination token\n // corresponds to the first event in the timeline\n let transformedEvent: IRoomEvent & { _localTs?: number };\n if (!fromDatabase) {\n transformedEvent = Object.assign({}, e);\n if (transformedEvent.unsigned !== undefined) {\n transformedEvent.unsigned = Object.assign({}, transformedEvent.unsigned);\n }\n const age = e.unsigned ? e.unsigned.age : e.age;\n if (age !== undefined) transformedEvent._localTs = Date.now() - age;\n } else {\n transformedEvent = e;\n }\n\n currentData._timeline.push({\n event: transformedEvent,\n token: index === 0 ? data.timeline.prev_batch : null,\n });\n });\n }\n\n // attempt to prune the timeline by jumping between events which have\n // pagination tokens.\n if (currentData._timeline.length > this.opts.maxTimelineEntries) {\n const startIndex = (\n currentData._timeline.length - this.opts.maxTimelineEntries\n );\n for (let i = startIndex; i < currentData._timeline.length; i++) {\n if (currentData._timeline[i].token) {\n // keep all events after this, including this one\n currentData._timeline = currentData._timeline.slice(\n i, currentData._timeline.length,\n );\n break;\n }\n }\n }\n }\n\n /**\n * Accumulate incremental /sync group data.\n * @param {Object} syncResponse the complete /sync JSON\n */\n private accumulateGroups(syncResponse: ISyncResponse): void {\n if (!syncResponse.groups) {\n return;\n }\n if (syncResponse.groups.invite) {\n Object.keys(syncResponse.groups.invite).forEach((groupId) => {\n this.accumulateGroup(groupId, Category.Invite, syncResponse.groups.invite[groupId]);\n });\n }\n if (syncResponse.groups.join) {\n Object.keys(syncResponse.groups.join).forEach((groupId) => {\n this.accumulateGroup(groupId, Category.Join, syncResponse.groups.join[groupId]);\n });\n }\n if (syncResponse.groups.leave) {\n Object.keys(syncResponse.groups.leave).forEach((groupId) => {\n this.accumulateGroup(groupId, Category.Leave, syncResponse.groups.leave[groupId]);\n });\n }\n }\n\n private accumulateGroup(groupId: string, category: Category, data: object): void {\n for (const cat of [Category.Invite, Category.Leave, Category.Join]) {\n delete this.groups[cat][groupId];\n }\n this.groups[category][groupId] = data;\n }\n\n /**\n * Return everything under the 'rooms' key from a /sync response which\n * represents all room data that should be stored. This should be paired\n * with the sync token which represents the most recent /sync response\n * provided to accumulate().\n * @param {boolean} forDatabase True to generate a sync to be saved to storage\n * @return {Object} An object with a \"nextBatch\", \"roomsData\" and \"accountData\"\n * keys.\n * The \"nextBatch\" key is a string which represents at what point in the\n * /sync stream the accumulator reached. This token should be used when\n * restarting a /sync stream at startup. Failure to do so can lead to missing\n * events. The \"roomsData\" key is an Object which represents the entire\n * /sync response from the 'rooms' key onwards. The \"accountData\" key is\n * a list of raw events which represent global account data.\n */\n public getJSON(forDatabase = false): ISyncData {\n const data: IRooms = {\n join: {},\n invite: {},\n // always empty. This is set by /sync when a room was previously\n // in 'invite' or 'join'. On fresh startup, the client won't know\n // about any previous room being in 'invite' or 'join' so we can\n // just omit mentioning it at all, even if it has previously come\n // down /sync.\n // The notable exception is when a client is kicked or banned:\n // we may want to hold onto that room so the client can clearly see\n // why their room has disappeared. We don't persist it though because\n // it is unclear *when* we can safely remove the room from the DB.\n // Instead, we assume that if you're loading from the DB, you've\n // refreshed the page, which means you've seen the kick/ban already.\n leave: {},\n };\n Object.keys(this.inviteRooms).forEach((roomId) => {\n data.invite[roomId] = this.inviteRooms[roomId];\n });\n Object.keys(this.joinRooms).forEach((roomId) => {\n const roomData = this.joinRooms[roomId];\n const roomJson = {\n ephemeral: { events: [] },\n account_data: { events: [] },\n state: { events: [] },\n timeline: {\n events: [],\n prev_batch: null,\n },\n unread_notifications: roomData._unreadNotifications,\n summary: roomData._summary as IRoomSummary,\n };\n // Add account data\n Object.keys(roomData._accountData).forEach((evType) => {\n roomJson.account_data.events.push(roomData._accountData[evType]);\n });\n\n // Add receipt data\n const receiptEvent = {\n type: \"m.receipt\",\n room_id: roomId,\n content: {\n // $event_id: { \"m.read\": { $user_id: $json } }\n },\n };\n Object.keys(roomData._readReceipts).forEach((userId) => {\n const receiptData = roomData._readReceipts[userId];\n if (!receiptEvent.content[receiptData.eventId]) {\n receiptEvent.content[receiptData.eventId] = {\n \"m.read\": {},\n };\n }\n receiptEvent.content[receiptData.eventId][\"m.read\"][userId] = (\n receiptData.data\n );\n });\n // add only if we have some receipt data\n if (Object.keys(receiptEvent.content).length > 0) {\n roomJson.ephemeral.events.push(receiptEvent);\n }\n\n // Add timeline data\n roomData._timeline.forEach((msgData) => {\n if (!roomJson.timeline.prev_batch) {\n // the first event we add to the timeline MUST match up to\n // the prev_batch token.\n if (!msgData.token) {\n return; // this shouldn't happen as we prune constantly.\n }\n roomJson.timeline.prev_batch = msgData.token;\n }\n\n let transformedEvent: (IRoomEvent | IStateEvent) & { _localTs?: number };\n if (!forDatabase && msgData.event[\"_localTs\"]) {\n // This means we have to copy each event so we can fix it up to\n // set a correct 'age' parameter whilst keeping the local timestamp\n // on our stored event. If this turns out to be a bottleneck, it could\n // be optimised either by doing this in the main process after the data\n // has been structured-cloned to go between the worker & main process,\n // or special-casing data from saved syncs to read the local timestamp\n // directly rather than turning it into age to then immediately be\n // transformed back again into a local timestamp.\n transformedEvent = Object.assign({}, msgData.event);\n if (transformedEvent.unsigned !== undefined) {\n transformedEvent.unsigned = Object.assign({}, transformedEvent.unsigned);\n }\n delete transformedEvent._localTs;\n transformedEvent.unsigned = transformedEvent.unsigned || {};\n transformedEvent.unsigned.age = Date.now() - msgData.event[\"_localTs\"];\n } else {\n transformedEvent = msgData.event;\n }\n roomJson.timeline.events.push(transformedEvent);\n });\n\n // Add state data: roll back current state to the start of timeline,\n // by \"reverse clobbering\" from the end of the timeline to the start.\n // Convert maps back into arrays.\n const rollBackState = Object.create(null);\n for (let i = roomJson.timeline.events.length - 1; i >=0; i--) {\n const timelineEvent = roomJson.timeline.events[i];\n if (timelineEvent.state_key === null ||\n timelineEvent.state_key === undefined) {\n continue; // not a state event\n }\n // since we're going back in time, we need to use the previous\n // state value else we'll break causality. We don't have the\n // complete previous state event, so we need to create one.\n const prevStateEvent = deepCopy(timelineEvent);\n if (prevStateEvent.unsigned) {\n if (prevStateEvent.unsigned.prev_content) {\n prevStateEvent.content = prevStateEvent.unsigned.prev_content;\n }\n if (prevStateEvent.unsigned.prev_sender) {\n prevStateEvent.sender = prevStateEvent.unsigned.prev_sender;\n }\n }\n setState(rollBackState, prevStateEvent);\n }\n Object.keys(roomData._currentState).forEach((evType) => {\n Object.keys(roomData._currentState[evType]).forEach((stateKey) => {\n let ev = roomData._currentState[evType][stateKey];\n if (rollBackState[evType] && rollBackState[evType][stateKey]) {\n // use the reverse clobbered event instead.\n ev = rollBackState[evType][stateKey];\n }\n roomJson.state.events.push(ev);\n });\n });\n data.join[roomId] = roomJson;\n });\n\n // Add account data\n const accData: IMinimalEvent[] = [];\n Object.keys(this.accountData).forEach((evType) => {\n accData.push(this.accountData[evType]);\n });\n\n return {\n nextBatch: this.nextBatch,\n roomsData: data,\n groupsData: this.groups,\n accountData: accData,\n };\n }\n\n public getNextBatchToken(): string {\n return this.nextBatch;\n }\n}\n\nfunction setState(eventMap: Record>, event: IRoomEvent | IStateEvent): void {\n if ((event as IStateEvent).state_key === null || (event as IStateEvent).state_key === undefined || !event.type) {\n return;\n }\n if (!eventMap[event.type]) {\n eventMap[event.type] = Object.create(null);\n }\n eventMap[event.type][(event as IStateEvent).state_key] = event as IStateEvent;\n}\n", "/*\nCopyright 2021 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n// TODO: Merge this with sync.js once converted\n\nexport enum SyncState {\n Error = \"ERROR\",\n Prepared = \"PREPARED\",\n Stopped = \"STOPPED\",\n Syncing = \"SYNCING\",\n Catchup = \"CATCHUP\",\n Reconnecting = \"RECONNECTING\",\n}\n", - "/*\nCopyright 2015 - 2021 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n/*\n * TODO:\n * This class mainly serves to take all the syncing logic out of client.js and\n * into a separate file. It's all very fluid, and this class gut wrenches a lot\n * of MatrixClient props (e.g. http). Given we want to support WebSockets as\n * an alternative syncing API, we may want to have a proper syncing interface\n * for HTTP and WS at some point.\n */\n\nimport { User } from \"./models/user\";\nimport { NotificationCountType, Room } from \"./models/room\";\nimport { Group } from \"./models/group\";\nimport * as utils from \"./utils\";\nimport { IDeferred } from \"./utils\";\nimport { Filter } from \"./filter\";\nimport { EventTimeline } from \"./models/event-timeline\";\nimport { PushProcessor } from \"./pushprocessor\";\nimport { logger } from './logger';\nimport { InvalidStoreError } from './errors';\nimport { IStoredClientOpts, MatrixClient, PendingEventOrdering } from \"./client\";\nimport { SyncState } from \"./sync.api\";\nimport {\n Category,\n IInvitedRoom,\n IInviteState,\n IJoinedRoom,\n ILeftRoom,\n IStateEvent,\n IRoomEvent,\n IStrippedState,\n ISyncResponse,\n ITimeline,\n IEphemeral,\n IMinimalEvent,\n} from \"./sync-accumulator\";\nimport { MatrixEvent } from \"./models/event\";\nimport { MatrixError } from \"./http-api\";\nimport { ISavedSync } from \"./store\";\n\nconst DEBUG = true;\n\n// /sync requests allow you to set a timeout= but the request may continue\n// beyond that and wedge forever, so we need to track how long we are willing\n// to keep open the connection. This constant is *ADDED* to the timeout= value\n// to determine the max time we're willing to wait.\nconst BUFFER_PERIOD_MS = 80 * 1000;\n\n// Number of consecutive failed syncs that will lead to a syncState of ERROR as opposed\n// to RECONNECTING. This is needed to inform the client of server issues when the\n// keepAlive is successful but the server /sync fails.\nconst FAILED_SYNC_ERROR_THRESHOLD = 3;\n\nfunction getFilterName(userId: string, suffix?: string): string {\n // scope this on the user ID because people may login on many accounts\n // and they all need to be stored!\n return \"FILTER_SYNC_\" + userId + (suffix ? \"_\" + suffix : \"\");\n}\n\nfunction debuglog(...params) {\n if (!DEBUG) {\n return;\n }\n logger.log(...params);\n}\n\ninterface ISyncOptions {\n filterId?: string;\n hasSyncedBefore?: boolean;\n}\n\nexport interface ISyncStateData {\n error?: Error;\n oldSyncToken?: string;\n nextSyncToken?: string;\n catchingUp?: boolean;\n fromCache?: boolean;\n}\n\ninterface ISyncParams {\n filter?: string;\n timeout: number;\n since?: string;\n // eslint-disable-next-line camelcase\n full_state?: boolean;\n // eslint-disable-next-line camelcase\n set_presence?: \"offline\" | \"online\" | \"unavailable\";\n _cacheBuster?: string | number; // not part of the API itself\n}\n\n// http-api mangles an abort method onto its promises\ninterface IRequestPromise extends Promise {\n abort(): void;\n}\n\ntype WrappedRoom = T & {\n room: Room;\n isBrandNewRoom: boolean;\n};\n\n/**\n * Internal class - unstable.\n * Construct an entity which is able to sync with a homeserver.\n * @constructor\n * @param {MatrixClient} client The matrix client instance to use.\n * @param {Object} opts Config options\n * @param {module:crypto=} opts.crypto Crypto manager\n * @param {Function=} opts.canResetEntireTimeline A function which is called\n * with a room ID and returns a boolean. It should return 'true' if the SDK can\n * SAFELY remove events from this room. It may not be safe to remove events if\n * there are other references to the timelines for this room.\n * Default: returns false.\n * @param {Boolean=} opts.disablePresence True to perform syncing without automatically\n * updating presence.\n */\nexport class SyncApi {\n private _peekRoom: Room = null;\n private currentSyncRequest: IRequestPromise = null;\n private syncState: SyncState = null;\n private syncStateData: ISyncStateData = null; // additional data (eg. error object for failed sync)\n private catchingUp = false;\n private running = false;\n private keepAliveTimer: number = null;\n private connectionReturnedDefer: IDeferred = null;\n private notifEvents: MatrixEvent[] = []; // accumulator of sync events in the current sync response\n private failedSyncCount = 0; // Number of consecutive failed /sync requests\n private storeIsInvalid = false; // flag set if the store needs to be cleared before we can start\n\n constructor(private readonly client: MatrixClient, private readonly opts: Partial = {}) {\n this.opts.initialSyncLimit = this.opts.initialSyncLimit ?? 8;\n this.opts.resolveInvitesToProfiles = this.opts.resolveInvitesToProfiles || false;\n this.opts.pollTimeout = this.opts.pollTimeout || (30 * 1000);\n this.opts.pendingEventOrdering = this.opts.pendingEventOrdering || PendingEventOrdering.Chronological;\n\n if (!opts.canResetEntireTimeline) {\n opts.canResetEntireTimeline = (roomId: string) => {\n return false;\n };\n }\n\n if (client.getNotifTimelineSet()) {\n client.reEmitter.reEmit(client.getNotifTimelineSet(),\n [\"Room.timeline\", \"Room.timelineReset\"]);\n }\n }\n\n /**\n * @param {string} roomId\n * @return {Room}\n */\n public createRoom(roomId: string): Room {\n const client = this.client;\n const {\n timelineSupport,\n unstableClientRelationAggregation,\n } = client;\n const room = new Room(roomId, client, client.getUserId(), {\n lazyLoadMembers: this.opts.lazyLoadMembers,\n pendingEventOrdering: this.opts.pendingEventOrdering,\n timelineSupport,\n unstableClientRelationAggregation,\n });\n client.reEmitter.reEmit(room, [\"Room.name\", \"Room.timeline\",\n \"Room.redaction\",\n \"Room.redactionCancelled\",\n \"Room.receipt\", \"Room.tags\",\n \"Room.timelineReset\",\n \"Room.localEchoUpdated\",\n \"Room.accountData\",\n \"Room.myMembership\",\n \"Room.replaceEvent\",\n ]);\n this.registerStateListeners(room);\n return room;\n }\n\n /**\n * @param {string} groupId\n * @return {Group}\n */\n public createGroup(groupId: string): Group {\n const client = this.client;\n const group = new Group(groupId);\n client.reEmitter.reEmit(group, [\"Group.profile\", \"Group.myMembership\"]);\n client.store.storeGroup(group);\n return group;\n }\n\n /**\n * @param {Room} room\n * @private\n */\n private registerStateListeners(room: Room): void {\n const client = this.client;\n // we need to also re-emit room state and room member events, so hook it up\n // to the client now. We need to add a listener for RoomState.members in\n // order to hook them correctly. (TODO: find a better way?)\n client.reEmitter.reEmit(room.currentState, [\n \"RoomState.events\", \"RoomState.members\", \"RoomState.newMember\",\n ]);\n room.currentState.on(\"RoomState.newMember\", function(event, state, member) {\n member.user = client.getUser(member.userId);\n client.reEmitter.reEmit(\n member,\n [\n \"RoomMember.name\", \"RoomMember.typing\", \"RoomMember.powerLevel\",\n \"RoomMember.membership\",\n ],\n );\n });\n }\n\n /**\n * @param {Room} room\n * @private\n */\n private deregisterStateListeners(room: Room): void {\n // could do with a better way of achieving this.\n room.currentState.removeAllListeners(\"RoomState.events\");\n room.currentState.removeAllListeners(\"RoomState.members\");\n room.currentState.removeAllListeners(\"RoomState.newMember\");\n }\n\n /**\n * Sync rooms the user has left.\n * @return {Promise} Resolved when they've been added to the store.\n */\n public syncLeftRooms() {\n const client = this.client;\n\n // grab a filter with limit=1 and include_leave=true\n const filter = new Filter(this.client.credentials.userId);\n filter.setTimelineLimit(1);\n filter.setIncludeLeaveRooms(true);\n\n const localTimeoutMs = this.opts.pollTimeout + BUFFER_PERIOD_MS;\n const qps: ISyncParams = {\n timeout: 0, // don't want to block since this is a single isolated req\n };\n\n return client.getOrCreateFilter(\n getFilterName(client.credentials.userId, \"LEFT_ROOMS\"), filter,\n ).then(function(filterId) {\n qps.filter = filterId;\n return client.http.authedRequest(\n undefined, \"GET\", \"/sync\", qps, undefined, localTimeoutMs,\n );\n }).then((data) => {\n let leaveRooms = [];\n if (data.rooms && data.rooms.leave) {\n leaveRooms = this.mapSyncResponseToRoomArray(data.rooms.leave);\n }\n const rooms = [];\n leaveRooms.forEach((leaveObj) => {\n const room = leaveObj.room;\n rooms.push(room);\n if (!leaveObj.isBrandNewRoom) {\n // the intention behind syncLeftRooms is to add in rooms which were\n // *omitted* from the initial /sync. Rooms the user were joined to\n // but then left whilst the app is running will appear in this list\n // and we do not want to bother with them since they will have the\n // current state already (and may get dupe messages if we add\n // yet more timeline events!), so skip them.\n // NB: When we persist rooms to localStorage this will be more\n // complicated...\n return;\n }\n leaveObj.timeline = leaveObj.timeline || {};\n const timelineEvents =\n this.mapSyncEventsFormat(leaveObj.timeline, room);\n const stateEvents = this.mapSyncEventsFormat(leaveObj.state, room);\n\n // set the back-pagination token. Do this *before* adding any\n // events so that clients can start back-paginating.\n room.getLiveTimeline().setPaginationToken(leaveObj.timeline.prev_batch,\n EventTimeline.BACKWARDS);\n\n this.processRoomEvents(room, stateEvents, timelineEvents);\n\n room.recalculate();\n client.store.storeRoom(room);\n client.emit(\"Room\", room);\n\n this.processEventsForNotifs(room, timelineEvents);\n });\n return rooms;\n });\n }\n\n /**\n * Peek into a room. This will result in the room in question being synced so it\n * is accessible via getRooms(). Live updates for the room will be provided.\n * @param {string} roomId The room ID to peek into.\n * @return {Promise} A promise which resolves once the room has been added to the\n * store.\n */\n public peek(roomId: string): Promise {\n if (this._peekRoom && this._peekRoom.roomId === roomId) {\n return Promise.resolve(this._peekRoom);\n }\n\n const client = this.client;\n this._peekRoom = this.createRoom(roomId);\n return this.client.roomInitialSync(roomId, 20).then((response) => {\n // make sure things are init'd\n response.messages = response.messages || { chunk: [] };\n response.messages.chunk = response.messages.chunk || [];\n response.state = response.state || [];\n\n // FIXME: Mostly duplicated from processRoomEvents but not entirely\n // because \"state\" in this API is at the BEGINNING of the chunk\n const oldStateEvents = utils.deepCopy(response.state)\n .map(client.getEventMapper());\n const stateEvents = response.state.map(client.getEventMapper());\n const messages = response.messages.chunk.map(client.getEventMapper());\n\n // XXX: copypasted from /sync until we kill off this minging v1 API stuff)\n // handle presence events (User objects)\n if (response.presence && Array.isArray(response.presence)) {\n response.presence.map(client.getEventMapper()).forEach(\n function(presenceEvent) {\n let user = client.store.getUser(presenceEvent.getContent().user_id);\n if (user) {\n user.setPresenceEvent(presenceEvent);\n } else {\n user = createNewUser(client, presenceEvent.getContent().user_id);\n user.setPresenceEvent(presenceEvent);\n client.store.storeUser(user);\n }\n client.emit(\"event\", presenceEvent);\n });\n }\n\n // set the pagination token before adding the events in case people\n // fire off pagination requests in response to the Room.timeline\n // events.\n if (response.messages.start) {\n this._peekRoom.oldState.paginationToken = response.messages.start;\n }\n\n // set the state of the room to as it was after the timeline executes\n this._peekRoom.oldState.setStateEvents(oldStateEvents);\n this._peekRoom.currentState.setStateEvents(stateEvents);\n\n this.resolveInvites(this._peekRoom);\n this._peekRoom.recalculate();\n\n // roll backwards to diverge old state. addEventsToTimeline\n // will overwrite the pagination token, so make sure it overwrites\n // it with the right thing.\n this._peekRoom.addEventsToTimeline(messages.reverse(), true,\n this._peekRoom.getLiveTimeline(),\n response.messages.start);\n\n client.store.storeRoom(this._peekRoom);\n client.emit(\"Room\", this._peekRoom);\n\n this.peekPoll(this._peekRoom);\n return this._peekRoom;\n });\n }\n\n /**\n * Stop polling for updates in the peeked room. NOPs if there is no room being\n * peeked.\n */\n public stopPeeking(): void {\n this._peekRoom = null;\n }\n\n /**\n * Do a peek room poll.\n * @param {Room} peekRoom\n * @param {string?} token from= token\n */\n private peekPoll(peekRoom: Room, token?: string): void {\n if (this._peekRoom !== peekRoom) {\n debuglog(\"Stopped peeking in room %s\", peekRoom.roomId);\n return;\n }\n\n // FIXME: gut wrenching; hard-coded timeout values\n this.client.http.authedRequest(undefined, \"GET\", \"/events\", {\n room_id: peekRoom.roomId,\n timeout: 30 * 1000,\n from: token,\n }, undefined, 50 * 1000).then((res) => {\n if (this._peekRoom !== peekRoom) {\n debuglog(\"Stopped peeking in room %s\", peekRoom.roomId);\n return;\n }\n // We have a problem that we get presence both from /events and /sync\n // however, /sync only returns presence for users in rooms\n // you're actually joined to.\n // in order to be sure to get presence for all of the users in the\n // peeked room, we handle presence explicitly here. This may result\n // in duplicate presence events firing for some users, which is a\n // performance drain, but such is life.\n // XXX: copypasted from /sync until we can kill this minging v1 stuff.\n\n res.chunk.filter(function(e) {\n return e.type === \"m.presence\";\n }).map(this.client.getEventMapper()).forEach((presenceEvent) => {\n let user = this.client.store.getUser(presenceEvent.getContent().user_id);\n if (user) {\n user.setPresenceEvent(presenceEvent);\n } else {\n user = createNewUser(this.client, presenceEvent.getContent().user_id);\n user.setPresenceEvent(presenceEvent);\n this.client.store.storeUser(user);\n }\n this.client.emit(\"event\", presenceEvent);\n });\n\n // strip out events which aren't for the given room_id (e.g presence)\n // and also ephemeral events (which we're assuming is anything without\n // and event ID because the /events API doesn't separate them).\n const events = res.chunk.filter(function(e) {\n return e.room_id === peekRoom.roomId && e.event_id;\n }).map(this.client.getEventMapper());\n\n peekRoom.addLiveEvents(events);\n this.peekPoll(peekRoom, res.end);\n }, (err) => {\n logger.error(\"[%s] Peek poll failed: %s\", peekRoom.roomId, err);\n setTimeout(() => {\n this.peekPoll(peekRoom, token);\n }, 30 * 1000);\n });\n }\n\n /**\n * Returns the current state of this sync object\n * @see module:client~MatrixClient#event:\"sync\"\n * @return {?String}\n */\n public getSyncState(): SyncState {\n return this.syncState;\n }\n\n /**\n * Returns the additional data object associated with\n * the current sync state, or null if there is no\n * such data.\n * Sync errors, if available, are put in the 'error' key of\n * this object.\n * @return {?Object}\n */\n public getSyncStateData(): ISyncStateData {\n return this.syncStateData;\n }\n\n public async recoverFromSyncStartupError(savedSyncPromise: Promise, err: Error): Promise {\n // Wait for the saved sync to complete - we send the pushrules and filter requests\n // before the saved sync has finished so they can run in parallel, but only process\n // the results after the saved sync is done. Equivalently, we wait for it to finish\n // before reporting failures from these functions.\n await savedSyncPromise;\n const keepaliveProm = this.startKeepAlives();\n this.updateSyncState(SyncState.Error, { error: err });\n await keepaliveProm;\n }\n\n /**\n * Is the lazy loading option different than in previous session?\n * @param {boolean} lazyLoadMembers current options for lazy loading\n * @return {boolean} whether or not the option has changed compared to the previous session */\n private async wasLazyLoadingToggled(lazyLoadMembers = false): Promise {\n // assume it was turned off before\n // if we don't know any better\n let lazyLoadMembersBefore = false;\n const isStoreNewlyCreated = await this.client.store.isNewlyCreated();\n if (!isStoreNewlyCreated) {\n const prevClientOptions = await this.client.store.getClientOptions();\n if (prevClientOptions) {\n lazyLoadMembersBefore = !!prevClientOptions.lazyLoadMembers;\n }\n return lazyLoadMembersBefore !== lazyLoadMembers;\n }\n return false;\n }\n\n private shouldAbortSync(error: MatrixError): boolean {\n if (error.errcode === \"M_UNKNOWN_TOKEN\") {\n // The logout already happened, we just need to stop.\n logger.warn(\"Token no longer valid - assuming logout\");\n this.stop();\n return true;\n }\n return false;\n }\n\n /**\n * Main entry point\n */\n public sync(): void {\n const client = this.client;\n\n this.running = true;\n\n if (global.window && global.window.addEventListener) {\n global.window.addEventListener(\"online\", this.onOnline, false);\n }\n\n let savedSyncPromise = Promise.resolve();\n let savedSyncToken = null;\n\n // We need to do one-off checks before we can begin the /sync loop.\n // These are:\n // 1) We need to get push rules so we can check if events should bing as we get\n // them from /sync.\n // 2) We need to get/create a filter which we can use for /sync.\n // 3) We need to check the lazy loading option matches what was used in the\n // stored sync. If it doesn't, we can't use the stored sync.\n\n const getPushRules = async () => {\n try {\n debuglog(\"Getting push rules...\");\n const result = await client.getPushRules();\n debuglog(\"Got push rules\");\n\n client.pushRules = result;\n } catch (err) {\n logger.error(\"Getting push rules failed\", err);\n if (this.shouldAbortSync(err)) return;\n // wait for saved sync to complete before doing anything else,\n // otherwise the sync state will end up being incorrect\n debuglog(\"Waiting for saved sync before retrying push rules...\");\n await this.recoverFromSyncStartupError(savedSyncPromise, err);\n getPushRules();\n return;\n }\n checkLazyLoadStatus(); // advance to the next stage\n };\n\n const buildDefaultFilter = () => {\n const filter = new Filter(client.credentials.userId);\n filter.setTimelineLimit(this.opts.initialSyncLimit);\n return filter;\n };\n\n const checkLazyLoadStatus = async () => {\n debuglog(\"Checking lazy load status...\");\n if (this.opts.lazyLoadMembers && client.isGuest()) {\n this.opts.lazyLoadMembers = false;\n }\n if (this.opts.lazyLoadMembers) {\n debuglog(\"Checking server lazy load support...\");\n const supported = await client.doesServerSupportLazyLoading();\n if (supported) {\n debuglog(\"Enabling lazy load on sync filter...\");\n if (!this.opts.filter) {\n this.opts.filter = buildDefaultFilter();\n }\n this.opts.filter.setLazyLoadMembers(true);\n } else {\n debuglog(\"LL: lazy loading requested but not supported \" +\n \"by server, so disabling\");\n this.opts.lazyLoadMembers = false;\n }\n }\n // need to vape the store when enabling LL and wasn't enabled before\n debuglog(\"Checking whether lazy loading has changed in store...\");\n const shouldClear = await this.wasLazyLoadingToggled(this.opts.lazyLoadMembers);\n if (shouldClear) {\n this.storeIsInvalid = true;\n const reason = InvalidStoreError.TOGGLED_LAZY_LOADING;\n const error = new InvalidStoreError(reason, !!this.opts.lazyLoadMembers);\n this.updateSyncState(SyncState.Error, { error });\n // bail out of the sync loop now: the app needs to respond to this error.\n // we leave the state as 'ERROR' which isn't great since this normally means\n // we're retrying. The client must be stopped before clearing the stores anyway\n // so the app should stop the client, clear the store and start it again.\n logger.warn(\"InvalidStoreError: store is not usable: stopping sync.\");\n return;\n }\n if (this.opts.lazyLoadMembers && this.opts.crypto) {\n this.opts.crypto.enableLazyLoading();\n }\n try {\n debuglog(\"Storing client options...\");\n await this.client.storeClientOptions();\n debuglog(\"Stored client options\");\n } catch (err) {\n logger.error(\"Storing client options failed\", err);\n throw err;\n }\n\n getFilter(); // Now get the filter and start syncing\n };\n\n const getFilter = async () => {\n debuglog(\"Getting filter...\");\n let filter;\n if (this.opts.filter) {\n filter = this.opts.filter;\n } else {\n filter = buildDefaultFilter();\n }\n\n let filterId;\n try {\n filterId = await client.getOrCreateFilter(getFilterName(client.credentials.userId), filter);\n } catch (err) {\n logger.error(\"Getting filter failed\", err);\n if (this.shouldAbortSync(err)) return;\n // wait for saved sync to complete before doing anything else,\n // otherwise the sync state will end up being incorrect\n debuglog(\"Waiting for saved sync before retrying filter...\");\n await this.recoverFromSyncStartupError(savedSyncPromise, err);\n getFilter();\n return;\n }\n // reset the notifications timeline to prepare it to paginate from\n // the current point in time.\n // The right solution would be to tie /sync pagination tokens into\n // /notifications API somehow.\n client.resetNotifTimelineSet();\n\n if (this.currentSyncRequest === null) {\n // Send this first sync request here so we can then wait for the saved\n // sync data to finish processing before we process the results of this one.\n debuglog(\"Sending first sync request...\");\n this.currentSyncRequest = this.doSyncRequest({ filterId }, savedSyncToken);\n }\n\n // Now wait for the saved sync to finish...\n debuglog(\"Waiting for saved sync before starting sync processing...\");\n await savedSyncPromise;\n this.doSync({ filterId });\n };\n\n if (client.isGuest()) {\n // no push rules for guests, no access to POST filter for guests.\n this.doSync({});\n } else {\n // Pull the saved sync token out first, before the worker starts sending\n // all the sync data which could take a while. This will let us send our\n // first incremental sync request before we've processed our saved data.\n debuglog(\"Getting saved sync token...\");\n savedSyncPromise = client.store.getSavedSyncToken().then((tok) => {\n debuglog(\"Got saved sync token\");\n savedSyncToken = tok;\n debuglog(\"Getting saved sync...\");\n return client.store.getSavedSync();\n }).then((savedSync) => {\n debuglog(`Got reply from saved sync, exists? ${!!savedSync}`);\n if (savedSync) {\n return this.syncFromCache(savedSync);\n }\n }).catch(err => {\n logger.error(\"Getting saved sync failed\", err);\n });\n // Now start the first incremental sync request: this can also\n // take a while so if we set it going now, we can wait for it\n // to finish while we process our saved sync data.\n getPushRules();\n }\n }\n\n /**\n * Stops the sync object from syncing.\n */\n public stop(): void {\n debuglog(\"SyncApi.stop\");\n if (global.window) {\n global.window.removeEventListener(\"online\", this.onOnline, false);\n }\n this.running = false;\n if (this.currentSyncRequest) {\n this.currentSyncRequest.abort();\n }\n if (this.keepAliveTimer) {\n clearTimeout(this.keepAliveTimer);\n this.keepAliveTimer = null;\n }\n }\n\n /**\n * Retry a backed off syncing request immediately. This should only be used when\n * the user explicitly attempts to retry their lost connection.\n * @return {boolean} True if this resulted in a request being retried.\n */\n public retryImmediately(): boolean {\n if (!this.connectionReturnedDefer) {\n return false;\n }\n this.startKeepAlives(0);\n return true;\n }\n /**\n * Process a single set of cached sync data.\n * @param {Object} savedSync a saved sync that was persisted by a store. This\n * should have been acquired via client.store.getSavedSync().\n */\n private async syncFromCache(savedSync: ISavedSync): Promise {\n debuglog(\"sync(): not doing HTTP hit, instead returning stored /sync data\");\n\n const nextSyncToken = savedSync.nextBatch;\n\n // Set sync token for future incremental syncing\n this.client.store.setSyncToken(nextSyncToken);\n\n // No previous sync, set old token to null\n const syncEventData = {\n oldSyncToken: null,\n nextSyncToken,\n catchingUp: false,\n fromCache: true,\n };\n\n const data: ISyncResponse = {\n next_batch: nextSyncToken,\n rooms: savedSync.roomsData,\n groups: savedSync.groupsData,\n account_data: {\n events: savedSync.accountData,\n },\n };\n\n try {\n await this.processSyncResponse(syncEventData, data);\n } catch (e) {\n logger.error(\"Error processing cached sync\", e.stack || e);\n }\n\n // Don't emit a prepared if we've bailed because the store is invalid:\n // in this case the client will not be usable until stopped & restarted\n // so this would be useless and misleading.\n if (!this.storeIsInvalid) {\n this.updateSyncState(SyncState.Prepared, syncEventData);\n }\n }\n\n /**\n * Invoke me to do /sync calls\n * @param {Object} syncOptions\n * @param {string} syncOptions.filterId\n * @param {boolean} syncOptions.hasSyncedBefore\n */\n private async doSync(syncOptions: ISyncOptions): Promise {\n const client = this.client;\n\n if (!this.running) {\n debuglog(\"Sync no longer running: exiting.\");\n if (this.connectionReturnedDefer) {\n this.connectionReturnedDefer.reject();\n this.connectionReturnedDefer = null;\n }\n this.updateSyncState(SyncState.Stopped);\n return;\n }\n\n const syncToken = client.store.getSyncToken();\n\n let data;\n try {\n //debuglog('Starting sync since=' + syncToken);\n if (this.currentSyncRequest === null) {\n this.currentSyncRequest = this.doSyncRequest(syncOptions, syncToken);\n }\n data = await this.currentSyncRequest;\n } catch (e) {\n this.onSyncError(e, syncOptions);\n return;\n } finally {\n this.currentSyncRequest = null;\n }\n\n //debuglog('Completed sync, next_batch=' + data.next_batch);\n\n // set the sync token NOW *before* processing the events. We do this so\n // if something barfs on an event we can skip it rather than constantly\n // polling with the same token.\n client.store.setSyncToken(data.next_batch);\n\n // Reset after a successful sync\n this.failedSyncCount = 0;\n\n await client.store.setSyncData(data);\n\n const syncEventData = {\n oldSyncToken: syncToken,\n nextSyncToken: data.next_batch,\n catchingUp: this.catchingUp,\n };\n\n if (this.opts.crypto) {\n // tell the crypto module we're about to process a sync\n // response\n await this.opts.crypto.onSyncWillProcess(syncEventData);\n }\n\n try {\n await this.processSyncResponse(syncEventData, data);\n } catch (e) {\n // log the exception with stack if we have it, else fall back\n // to the plain description\n logger.error(\"Caught /sync error\", e.stack || e);\n\n // Emit the exception for client handling\n this.client.emit(\"sync.unexpectedError\", e);\n }\n\n // update this as it may have changed\n syncEventData.catchingUp = this.catchingUp;\n\n // emit synced events\n if (!syncOptions.hasSyncedBefore) {\n this.updateSyncState(SyncState.Prepared, syncEventData);\n syncOptions.hasSyncedBefore = true;\n }\n\n // tell the crypto module to do its processing. It may block (to do a\n // /keys/changes request).\n if (this.opts.crypto) {\n await this.opts.crypto.onSyncCompleted(syncEventData);\n }\n\n // keep emitting SYNCING -> SYNCING for clients who want to do bulk updates\n this.updateSyncState(SyncState.Syncing, syncEventData);\n\n if (client.store.wantsSave()) {\n // We always save the device list (if it's dirty) before saving the sync data:\n // this means we know the saved device list data is at least as fresh as the\n // stored sync data which means we don't have to worry that we may have missed\n // device changes. We can also skip the delay since we're not calling this very\n // frequently (and we don't really want to delay the sync for it).\n if (this.opts.crypto) {\n await this.opts.crypto.saveDeviceList(0);\n }\n\n // tell databases that everything is now in a consistent state and can be saved.\n client.store.save();\n }\n\n // Begin next sync\n this.doSync(syncOptions);\n }\n\n private doSyncRequest(syncOptions: ISyncOptions, syncToken: string): IRequestPromise {\n const qps = this.getSyncParams(syncOptions, syncToken);\n return this.client.http.authedRequest(\n undefined, \"GET\", \"/sync\", qps, undefined,\n qps.timeout + BUFFER_PERIOD_MS,\n );\n }\n\n private getSyncParams(syncOptions: ISyncOptions, syncToken: string): ISyncParams {\n let pollTimeout = this.opts.pollTimeout;\n\n if (this.getSyncState() !== 'SYNCING' || this.catchingUp) {\n // unless we are happily syncing already, we want the server to return\n // as quickly as possible, even if there are no events queued. This\n // serves two purposes:\n //\n // * When the connection dies, we want to know asap when it comes back,\n // so that we can hide the error from the user. (We don't want to\n // have to wait for an event or a timeout).\n //\n // * We want to know if the server has any to_device messages queued up\n // for us. We do that by calling it with a zero timeout until it\n // doesn't give us any more to_device messages.\n this.catchingUp = true;\n pollTimeout = 0;\n }\n\n let filterId = syncOptions.filterId;\n if (this.client.isGuest() && !filterId) {\n filterId = this.getGuestFilter();\n }\n\n const qps: ISyncParams = {\n filter: filterId,\n timeout: pollTimeout,\n };\n\n if (this.opts.disablePresence) {\n qps.set_presence = \"offline\";\n }\n\n if (syncToken) {\n qps.since = syncToken;\n } else {\n // use a cachebuster for initialsyncs, to make sure that\n // we don't get a stale sync\n // (https://github.com/vector-im/vector-web/issues/1354)\n qps._cacheBuster = Date.now();\n }\n\n if (this.getSyncState() == 'ERROR' || this.getSyncState() == 'RECONNECTING') {\n // we think the connection is dead. If it comes back up, we won't know\n // about it till /sync returns. If the timeout= is high, this could\n // be a long time. Set it to 0 when doing retries so we don't have to wait\n // for an event or a timeout before emiting the SYNCING event.\n qps.timeout = 0;\n }\n\n return qps;\n }\n\n private onSyncError(err: Error, syncOptions: ISyncOptions): void {\n if (!this.running) {\n debuglog(\"Sync no longer running: exiting\");\n if (this.connectionReturnedDefer) {\n this.connectionReturnedDefer.reject();\n this.connectionReturnedDefer = null;\n }\n this.updateSyncState(SyncState.Stopped);\n return;\n }\n\n logger.error(\"/sync error %s\", err);\n logger.error(err);\n\n if (this.shouldAbortSync(err)) {\n return;\n }\n\n this.failedSyncCount++;\n logger.log('Number of consecutive failed sync requests:', this.failedSyncCount);\n\n debuglog(\"Starting keep-alive\");\n // Note that we do *not* mark the sync connection as\n // lost yet: we only do this if a keepalive poke\n // fails, since long lived HTTP connections will\n // go away sometimes and we shouldn't treat this as\n // erroneous. We set the state to 'reconnecting'\n // instead, so that clients can observe this state\n // if they wish.\n this.startKeepAlives().then((connDidFail) => {\n // Only emit CATCHUP if we detected a connectivity error: if we didn't,\n // it's quite likely the sync will fail again for the same reason and we\n // want to stay in ERROR rather than keep flip-flopping between ERROR\n // and CATCHUP.\n if (connDidFail && this.getSyncState() === SyncState.Error) {\n this.updateSyncState(SyncState.Catchup, {\n oldSyncToken: null,\n nextSyncToken: null,\n catchingUp: true,\n });\n }\n this.doSync(syncOptions);\n });\n\n this.currentSyncRequest = null;\n // Transition from RECONNECTING to ERROR after a given number of failed syncs\n this.updateSyncState(\n this.failedSyncCount >= FAILED_SYNC_ERROR_THRESHOLD ?\n SyncState.Error : SyncState.Reconnecting,\n { error: err },\n );\n }\n\n /**\n * Process data returned from a sync response and propagate it\n * into the model objects\n *\n * @param {Object} syncEventData Object containing sync tokens associated with this sync\n * @param {Object} data The response from /sync\n */\n private async processSyncResponse(syncEventData: ISyncStateData, data: ISyncResponse): Promise {\n const client = this.client;\n\n // data looks like:\n // {\n // next_batch: $token,\n // presence: { events: [] },\n // account_data: { events: [] },\n // device_lists: { changed: [\"@user:server\", ... ]},\n // to_device: { events: [] },\n // device_one_time_keys_count: { signed_curve25519: 42 },\n // rooms: {\n // invite: {\n // $roomid: {\n // invite_state: { events: [] }\n // }\n // },\n // join: {\n // $roomid: {\n // state: { events: [] },\n // timeline: { events: [], prev_batch: $token, limited: true },\n // ephemeral: { events: [] },\n // summary: {\n // m.heroes: [ $user_id ],\n // m.joined_member_count: $count,\n // m.invited_member_count: $count\n // },\n // account_data: { events: [] },\n // unread_notifications: {\n // highlight_count: 0,\n // notification_count: 0,\n // }\n // }\n // },\n // leave: {\n // $roomid: {\n // state: { events: [] },\n // timeline: { events: [], prev_batch: $token }\n // }\n // }\n // },\n // groups: {\n // invite: {\n // $groupId: {\n // inviter: $inviter,\n // profile: {\n // avatar_url: $avatarUrl,\n // name: $groupName,\n // },\n // },\n // },\n // join: {},\n // leave: {},\n // },\n // }\n\n // TODO-arch:\n // - Each event we pass through needs to be emitted via 'event', can we\n // do this in one place?\n // - The isBrandNewRoom boilerplate is boilerplatey.\n\n // handle presence events (User objects)\n if (data.presence && Array.isArray(data.presence.events)) {\n data.presence.events.map(client.getEventMapper()).forEach(\n function(presenceEvent) {\n let user = client.store.getUser(presenceEvent.getSender());\n if (user) {\n user.setPresenceEvent(presenceEvent);\n } else {\n user = createNewUser(client, presenceEvent.getSender());\n user.setPresenceEvent(presenceEvent);\n client.store.storeUser(user);\n }\n client.emit(\"event\", presenceEvent);\n });\n }\n\n // handle non-room account_data\n if (data.account_data && Array.isArray(data.account_data.events)) {\n const events = data.account_data.events.map(client.getEventMapper());\n const prevEventsMap = events.reduce((m, c) => {\n m[c.getId()] = client.store.getAccountData(c.getType());\n return m;\n }, {});\n client.store.storeAccountDataEvents(events);\n events.forEach(\n function(accountDataEvent) {\n // Honour push rules that come down the sync stream but also\n // honour push rules that were previously cached. Base rules\n // will be updated when we receive push rules via getPushRules\n // (see sync) before syncing over the network.\n if (accountDataEvent.getType() === 'm.push_rules') {\n const rules = accountDataEvent.getContent();\n client.pushRules = PushProcessor.rewriteDefaultRules(rules);\n }\n const prevEvent = prevEventsMap[accountDataEvent.getId()];\n client.emit(\"accountData\", accountDataEvent, prevEvent);\n return accountDataEvent;\n },\n );\n }\n\n // handle to-device events\n if (data.to_device && Array.isArray(data.to_device.events) &&\n data.to_device.events.length > 0\n ) {\n const cancelledKeyVerificationTxns = [];\n data.to_device.events\n .map(client.getEventMapper())\n .map((toDeviceEvent) => { // map is a cheap inline forEach\n // We want to flag m.key.verification.start events as cancelled\n // if there's an accompanying m.key.verification.cancel event, so\n // we pull out the transaction IDs from the cancellation events\n // so we can flag the verification events as cancelled in the loop\n // below.\n if (toDeviceEvent.getType() === \"m.key.verification.cancel\") {\n const txnId = toDeviceEvent.getContent()['transaction_id'];\n if (txnId) {\n cancelledKeyVerificationTxns.push(txnId);\n }\n }\n\n // as mentioned above, .map is a cheap inline forEach, so return\n // the unmodified event.\n return toDeviceEvent;\n })\n .forEach(\n function(toDeviceEvent) {\n const content = toDeviceEvent.getContent();\n if (\n toDeviceEvent.getType() == \"m.room.message\" &&\n content.msgtype == \"m.bad.encrypted\"\n ) {\n // the mapper already logged a warning.\n logger.log(\n 'Ignoring undecryptable to-device event from ' +\n toDeviceEvent.getSender(),\n );\n return;\n }\n\n if (toDeviceEvent.getType() === \"m.key.verification.start\"\n || toDeviceEvent.getType() === \"m.key.verification.request\") {\n const txnId = content['transaction_id'];\n if (cancelledKeyVerificationTxns.includes(txnId)) {\n toDeviceEvent.flagCancelled();\n }\n }\n\n client.emit(\"toDeviceEvent\", toDeviceEvent);\n },\n );\n } else {\n // no more to-device events: we can stop polling with a short timeout.\n this.catchingUp = false;\n }\n\n if (data.groups) {\n if (data.groups.invite) {\n this.processGroupSyncEntry(data.groups.invite, Category.Invite);\n }\n\n if (data.groups.join) {\n this.processGroupSyncEntry(data.groups.join, Category.Join);\n }\n\n if (data.groups.leave) {\n this.processGroupSyncEntry(data.groups.leave, Category.Leave);\n }\n }\n\n // the returned json structure is a bit crap, so make it into a\n // nicer form (array) after applying sanity to make sure we don't fail\n // on missing keys (on the off chance)\n let inviteRooms: WrappedRoom[] = [];\n let joinRooms: WrappedRoom[] = [];\n let leaveRooms: WrappedRoom[] = [];\n\n if (data.rooms) {\n if (data.rooms.invite) {\n inviteRooms = this.mapSyncResponseToRoomArray(data.rooms.invite);\n }\n if (data.rooms.join) {\n joinRooms = this.mapSyncResponseToRoomArray(data.rooms.join);\n }\n if (data.rooms.leave) {\n leaveRooms = this.mapSyncResponseToRoomArray(data.rooms.leave);\n }\n }\n\n this.notifEvents = [];\n\n // Handle invites\n inviteRooms.forEach((inviteObj) => {\n const room = inviteObj.room;\n const stateEvents = this.mapSyncEventsFormat(inviteObj.invite_state, room);\n\n this.processRoomEvents(room, stateEvents);\n if (inviteObj.isBrandNewRoom) {\n room.recalculate();\n client.store.storeRoom(room);\n client.emit(\"Room\", room);\n }\n stateEvents.forEach(function(e) {\n client.emit(\"event\", e);\n });\n room.updateMyMembership(\"invite\");\n });\n\n // Handle joins\n await utils.promiseMapSeries(joinRooms, async (joinObj) => {\n const room = joinObj.room;\n const stateEvents = this.mapSyncEventsFormat(joinObj.state, room);\n // Prevent events from being decrypted ahead of time\n // this helps large account to speed up faster\n // room::decryptCriticalEvent is in charge of decrypting all the events\n // required for a client to function properly\n const timelineEvents = this.mapSyncEventsFormat(joinObj.timeline, room, false);\n const ephemeralEvents = this.mapSyncEventsFormat(joinObj.ephemeral);\n const accountDataEvents = this.mapSyncEventsFormat(joinObj.account_data);\n\n const encrypted = client.isRoomEncrypted(room.roomId);\n // we do this first so it's correct when any of the events fire\n if (joinObj.unread_notifications) {\n room.setUnreadNotificationCount(\n NotificationCountType.Total,\n joinObj.unread_notifications.notification_count,\n );\n\n // We track unread notifications ourselves in encrypted rooms, so don't\n // bother setting it here. We trust our calculations better than the\n // server's for this case, and therefore will assume that our non-zero\n // count is accurate.\n if (!encrypted\n || (encrypted && room.getUnreadNotificationCount(NotificationCountType.Highlight) <= 0)) {\n room.setUnreadNotificationCount(\n NotificationCountType.Highlight,\n joinObj.unread_notifications.highlight_count,\n );\n }\n }\n\n joinObj.timeline = joinObj.timeline || {} as ITimeline;\n\n if (joinObj.isBrandNewRoom) {\n // set the back-pagination token. Do this *before* adding any\n // events so that clients can start back-paginating.\n room.getLiveTimeline().setPaginationToken(\n joinObj.timeline.prev_batch, EventTimeline.BACKWARDS);\n } else if (joinObj.timeline.limited) {\n let limited = true;\n\n // we've got a limited sync, so we *probably* have a gap in the\n // timeline, so should reset. But we might have been peeking or\n // paginating and already have some of the events, in which\n // case we just want to append any subsequent events to the end\n // of the existing timeline.\n //\n // This is particularly important in the case that we already have\n // *all* of the events in the timeline - in that case, if we reset\n // the timeline, we'll end up with an entirely empty timeline,\n // which we'll try to paginate but not get any new events (which\n // will stop us linking the empty timeline into the chain).\n //\n for (let i = timelineEvents.length - 1; i >= 0; i--) {\n const eventId = timelineEvents[i].getId();\n if (room.getTimelineForEvent(eventId)) {\n debuglog(\"Already have event \" + eventId + \" in limited \" +\n \"sync - not resetting\");\n limited = false;\n\n // we might still be missing some of the events before i;\n // we don't want to be adding them to the end of the\n // timeline because that would put them out of order.\n timelineEvents.splice(0, i);\n\n // XXX: there's a problem here if the skipped part of the\n // timeline modifies the state set in stateEvents, because\n // we'll end up using the state from stateEvents rather\n // than the later state from timelineEvents. We probably\n // need to wind stateEvents forward over the events we're\n // skipping.\n\n break;\n }\n }\n\n if (limited) {\n this.deregisterStateListeners(room);\n room.resetLiveTimeline(\n joinObj.timeline.prev_batch,\n this.opts.canResetEntireTimeline(room.roomId) ?\n null : syncEventData.oldSyncToken,\n );\n\n // We have to assume any gap in any timeline is\n // reason to stop incrementally tracking notifications and\n // reset the timeline.\n client.resetNotifTimelineSet();\n\n this.registerStateListeners(room);\n }\n }\n\n this.processRoomEvents(room, stateEvents, timelineEvents, syncEventData.fromCache);\n\n // set summary after processing events,\n // because it will trigger a name calculation\n // which needs the room state to be up to date\n if (joinObj.summary) {\n room.setSummary(joinObj.summary);\n }\n\n // we deliberately don't add ephemeral events to the timeline\n room.addEphemeralEvents(ephemeralEvents);\n\n // we deliberately don't add accountData to the timeline\n room.addAccountData(accountDataEvents);\n\n room.recalculate();\n if (joinObj.isBrandNewRoom) {\n client.store.storeRoom(room);\n client.emit(\"Room\", room);\n }\n\n this.processEventsForNotifs(room, timelineEvents);\n\n const processRoomEvent = async (e) => {\n client.emit(\"event\", e);\n if (e.isState() && e.getType() == \"m.room.encryption\" && this.opts.crypto) {\n await this.opts.crypto.onCryptoEvent(e);\n }\n if (e.isState() && e.getType() === \"im.vector.user_status\") {\n let user = client.store.getUser(e.getStateKey());\n if (user) {\n user.unstable_updateStatusMessage(e);\n } else {\n user = createNewUser(client, e.getStateKey());\n user.unstable_updateStatusMessage(e);\n client.store.storeUser(user);\n }\n }\n };\n\n await utils.promiseMapSeries(stateEvents, processRoomEvent);\n await utils.promiseMapSeries(timelineEvents, processRoomEvent);\n ephemeralEvents.forEach(function(e) {\n client.emit(\"event\", e);\n });\n accountDataEvents.forEach(function(e) {\n client.emit(\"event\", e);\n });\n\n room.updateMyMembership(\"join\");\n\n // Decrypt only the last message in all rooms to make sure we can generate a preview\n // And decrypt all events after the recorded read receipt to ensure an accurate\n // notification count\n room.decryptCriticalEvents();\n });\n\n // Handle leaves (e.g. kicked rooms)\n leaveRooms.forEach((leaveObj) => {\n const room = leaveObj.room;\n const stateEvents = this.mapSyncEventsFormat(leaveObj.state, room);\n const timelineEvents = this.mapSyncEventsFormat(leaveObj.timeline, room);\n const accountDataEvents = this.mapSyncEventsFormat(leaveObj.account_data);\n\n this.processRoomEvents(room, stateEvents, timelineEvents);\n room.addAccountData(accountDataEvents);\n\n room.recalculate();\n if (leaveObj.isBrandNewRoom) {\n client.store.storeRoom(room);\n client.emit(\"Room\", room);\n }\n\n this.processEventsForNotifs(room, timelineEvents);\n\n stateEvents.forEach(function(e) {\n client.emit(\"event\", e);\n });\n timelineEvents.forEach(function(e) {\n client.emit(\"event\", e);\n });\n accountDataEvents.forEach(function(e) {\n client.emit(\"event\", e);\n });\n\n room.updateMyMembership(\"leave\");\n });\n\n // update the notification timeline, if appropriate.\n // we only do this for live events, as otherwise we can't order them sanely\n // in the timeline relative to ones paginated in by /notifications.\n // XXX: we could fix this by making EventTimeline support chronological\n // ordering... but it doesn't, right now.\n if (syncEventData.oldSyncToken && this.notifEvents.length) {\n this.notifEvents.sort(function(a, b) {\n return a.getTs() - b.getTs();\n });\n this.notifEvents.forEach(function(event) {\n client.getNotifTimelineSet().addLiveEvent(event);\n });\n }\n\n // Handle device list updates\n if (data.device_lists) {\n if (this.opts.crypto) {\n await this.opts.crypto.handleDeviceListChanges(syncEventData, data.device_lists);\n } else {\n // FIXME if we *don't* have a crypto module, we still need to\n // invalidate the device lists. But that would require a\n // substantial bit of rework :/.\n }\n }\n\n // Handle one_time_keys_count\n if (this.opts.crypto && data.device_one_time_keys_count) {\n const currentCount = data.device_one_time_keys_count.signed_curve25519 || 0;\n this.opts.crypto.updateOneTimeKeyCount(currentCount);\n }\n if (this.opts.crypto && data[\"org.matrix.msc2732.device_unused_fallback_key_types\"]) {\n // The presence of device_unused_fallback_key_types indicates that the\n // server supports fallback keys. If there's no unused\n // signed_curve25519 fallback key we need a new one.\n const unusedFallbackKeys = data[\"org.matrix.msc2732.device_unused_fallback_key_types\"];\n this.opts.crypto.setNeedsNewFallback(\n unusedFallbackKeys instanceof Array &&\n !unusedFallbackKeys.includes(\"signed_curve25519\"),\n );\n }\n }\n\n /**\n * Starts polling the connectivity check endpoint\n * @param {number} delay How long to delay until the first poll.\n * defaults to a short, randomised interval (to prevent\n * tightlooping if /versions succeeds but /sync etc. fail).\n * @return {promise} which resolves once the connection returns\n */\n private startKeepAlives(delay?: number): Promise {\n if (delay === undefined) {\n delay = 2000 + Math.floor(Math.random() * 5000);\n }\n\n if (this.keepAliveTimer !== null) {\n clearTimeout(this.keepAliveTimer);\n }\n if (delay > 0) {\n this.keepAliveTimer = setTimeout(this.pokeKeepAlive.bind(this), delay);\n } else {\n this.pokeKeepAlive();\n }\n if (!this.connectionReturnedDefer) {\n this.connectionReturnedDefer = utils.defer();\n }\n return this.connectionReturnedDefer.promise;\n }\n\n /**\n * Make a dummy call to /_matrix/client/versions, to see if the HS is\n * reachable.\n *\n * On failure, schedules a call back to itself. On success, resolves\n * this.connectionReturnedDefer.\n *\n * @param {boolean} connDidFail True if a connectivity failure has been detected. Optional.\n */\n private pokeKeepAlive(connDidFail = false): void {\n const success = () => {\n clearTimeout(this.keepAliveTimer);\n if (this.connectionReturnedDefer) {\n this.connectionReturnedDefer.resolve(connDidFail);\n this.connectionReturnedDefer = null;\n }\n };\n\n this.client.http.request(\n undefined, // callback\n \"GET\", \"/_matrix/client/versions\",\n undefined, // queryParams\n undefined, // data\n {\n prefix: '',\n localTimeoutMs: 15 * 1000,\n },\n ).then(() => {\n success();\n }, (err) => {\n if (err.httpStatus == 400 || err.httpStatus == 404) {\n // treat this as a success because the server probably just doesn't\n // support /versions: point is, we're getting a response.\n // We wait a short time though, just in case somehow the server\n // is in a mode where it 400s /versions responses and sync etc.\n // responses fail, this will mean we don't hammer in a loop.\n this.keepAliveTimer = setTimeout(success, 2000);\n } else {\n connDidFail = true;\n this.keepAliveTimer = setTimeout(\n this.pokeKeepAlive.bind(this, connDidFail),\n 5000 + Math.floor(Math.random() * 5000),\n );\n // A keepalive has failed, so we emit the\n // error state (whether or not this is the\n // first failure).\n // Note we do this after setting the timer:\n // this lets the unit tests advance the mock\n // clock when they get the error.\n this.updateSyncState(SyncState.Error, { error: err });\n }\n });\n }\n\n /**\n * @param {Object} groupsSection Groups section object, eg. response.groups.invite\n * @param {string} sectionName Which section this is ('invite', 'join' or 'leave')\n */\n private processGroupSyncEntry(groupsSection: object, sectionName: Category) {\n // Processes entries from 'groups' section of the sync stream\n for (const groupId of Object.keys(groupsSection)) {\n const groupInfo = groupsSection[groupId];\n let group = this.client.store.getGroup(groupId);\n const isBrandNew = group === null;\n if (group === null) {\n group = this.createGroup(groupId);\n }\n if (groupInfo.profile) {\n group.setProfile(\n groupInfo.profile.name, groupInfo.profile.avatar_url,\n );\n }\n if (groupInfo.inviter) {\n group.setInviter({ userId: groupInfo.inviter });\n }\n group.setMyMembership(sectionName);\n if (isBrandNew) {\n // Now we've filled in all the fields, emit the Group event\n this.client.emit(\"Group\", group);\n }\n }\n }\n\n /**\n * @param {Object} obj\n * @return {Object[]}\n */\n private mapSyncResponseToRoomArray(\n obj: Record,\n ): Array> {\n // Maps { roomid: {stuff}, roomid: {stuff} }\n // to\n // [{stuff+Room+isBrandNewRoom}, {stuff+Room+isBrandNewRoom}]\n const client = this.client;\n return Object.keys(obj).map((roomId) => {\n const arrObj = obj[roomId] as T & { room: Room, isBrandNewRoom: boolean };\n let room = client.store.getRoom(roomId);\n let isBrandNewRoom = false;\n if (!room) {\n room = this.createRoom(roomId);\n isBrandNewRoom = true;\n }\n arrObj.room = room;\n arrObj.isBrandNewRoom = isBrandNewRoom;\n return arrObj;\n });\n }\n\n /**\n * @param {Object} obj\n * @param {Room} room\n * @param {boolean} decrypt\n * @return {MatrixEvent[]}\n */\n private mapSyncEventsFormat(\n obj: IInviteState | ITimeline | IEphemeral,\n room?: Room,\n decrypt = true,\n ): MatrixEvent[] {\n if (!obj || !Array.isArray(obj.events)) {\n return [];\n }\n const mapper = this.client.getEventMapper({ decrypt });\n return (obj.events as Array).map(function(e) {\n if (room) {\n e[\"room_id\"] = room.roomId;\n }\n return mapper(e);\n });\n }\n\n /**\n * @param {Room} room\n */\n private resolveInvites(room: Room): void {\n if (!room || !this.opts.resolveInvitesToProfiles) {\n return;\n }\n const client = this.client;\n // For each invited room member we want to give them a displayname/avatar url\n // if they have one (the m.room.member invites don't contain this).\n room.getMembersWithMembership(\"invite\").forEach(function(member) {\n if (member._requestedProfileInfo) return;\n member._requestedProfileInfo = true;\n // try to get a cached copy first.\n const user = client.getUser(member.userId);\n let promise;\n if (user) {\n promise = Promise.resolve({\n avatar_url: user.avatarUrl,\n displayname: user.displayName,\n });\n } else {\n promise = client.getProfileInfo(member.userId);\n }\n promise.then(function(info) {\n // slightly naughty by doctoring the invite event but this means all\n // the code paths remain the same between invite/join display name stuff\n // which is a worthy trade-off for some minor pollution.\n const inviteEvent = member.events.member;\n if (inviteEvent.getContent().membership !== \"invite\") {\n // between resolving and now they have since joined, so don't clobber\n return;\n }\n inviteEvent.getContent().avatar_url = info.avatar_url;\n inviteEvent.getContent().displayname = info.displayname;\n // fire listeners\n member.setMembershipEvent(inviteEvent, room.currentState);\n }, function(err) {\n // OH WELL.\n });\n });\n }\n\n /**\n * @param {Room} room\n * @param {MatrixEvent[]} stateEventList A list of state events. This is the state\n * at the *START* of the timeline list if it is supplied.\n * @param {MatrixEvent[]} [timelineEventList] A list of timeline events. Lower index\n * @param {boolean} fromCache whether the sync response came from cache\n * is earlier in time. Higher index is later.\n */\n private processRoomEvents(\n room: Room,\n stateEventList: MatrixEvent[],\n timelineEventList?: MatrixEvent[],\n fromCache = false,\n ): void {\n // If there are no events in the timeline yet, initialise it with\n // the given state events\n const liveTimeline = room.getLiveTimeline();\n const timelineWasEmpty = liveTimeline.getEvents().length == 0;\n if (timelineWasEmpty) {\n // Passing these events into initialiseState will freeze them, so we need\n // to compute and cache the push actions for them now, otherwise sync dies\n // with an attempt to assign to read only property.\n // XXX: This is pretty horrible and is assuming all sorts of behaviour from\n // these functions that it shouldn't be. We should probably either store the\n // push actions cache elsewhere so we can freeze MatrixEvents, or otherwise\n // find some solution where MatrixEvents are immutable but allow for a cache\n // field.\n for (const ev of stateEventList) {\n this.client.getPushActionsForEvent(ev);\n }\n liveTimeline.initialiseState(stateEventList);\n }\n\n this.resolveInvites(room);\n\n // recalculate the room name at this point as adding events to the timeline\n // may make notifications appear which should have the right name.\n // XXX: This looks suspect: we'll end up recalculating the room once here\n // and then again after adding events (processSyncResponse calls it after\n // calling us) even if no state events were added. It also means that if\n // one of the room events in timelineEventList is something that needs\n // a recalculation (like m.room.name) we won't recalculate until we've\n // finished adding all the events, which will cause the notification to have\n // the old room name rather than the new one.\n room.recalculate();\n\n // If the timeline wasn't empty, we process the state events here: they're\n // defined as updates to the state before the start of the timeline, so this\n // starts to roll the state forward.\n // XXX: That's what we *should* do, but this can happen if we were previously\n // peeking in a room, in which case we obviously do *not* want to add the\n // state events here onto the end of the timeline. Historically, the js-sdk\n // has just set these new state events on the old and new state. This seems\n // very wrong because there could be events in the timeline that diverge the\n // state, in which case this is going to leave things out of sync. However,\n // for now I think it;s best to behave the same as the code has done previously.\n if (!timelineWasEmpty) {\n // XXX: As above, don't do this...\n //room.addLiveEvents(stateEventList || []);\n // Do this instead...\n room.oldState.setStateEvents(stateEventList || []);\n room.currentState.setStateEvents(stateEventList || []);\n }\n // execute the timeline events. This will continue to diverge the current state\n // if the timeline has any state events in it.\n // This also needs to be done before running push rules on the events as they need\n // to be decorated with sender etc.\n room.addLiveEvents(timelineEventList || [], null, fromCache);\n }\n\n /**\n * Takes a list of timelineEvents and adds and adds to notifEvents\n * as appropriate.\n * This must be called after the room the events belong to has been stored.\n *\n * @param {Room} room\n * @param {MatrixEvent[]} [timelineEventList] A list of timeline events. Lower index\n * is earlier in time. Higher index is later.\n */\n private processEventsForNotifs(room: Room, timelineEventList: MatrixEvent[]): void {\n // gather our notifications into this.notifEvents\n if (this.client.getNotifTimelineSet()) {\n for (let i = 0; i < timelineEventList.length; i++) {\n const pushActions = this.client.getPushActionsForEvent(timelineEventList[i]);\n if (pushActions && pushActions.notify &&\n pushActions.tweaks && pushActions.tweaks.highlight) {\n this.notifEvents.push(timelineEventList[i]);\n }\n }\n }\n }\n\n /**\n * @return {string}\n */\n private getGuestFilter(): string {\n // Dev note: This used to be conditional to return a filter of 20 events maximum, but\n // the condition never went to the other branch. This is now hardcoded.\n return \"{}\";\n }\n\n /**\n * Sets the sync state and emits an event to say so\n * @param {String} newState The new state string\n * @param {Object} data Object of additional data to emit in the event\n */\n private updateSyncState(newState: SyncState, data?: ISyncStateData): void {\n const old = this.syncState;\n this.syncState = newState;\n this.syncStateData = data;\n this.client.emit(\"sync\", this.syncState, old, data);\n }\n\n /**\n * Event handler for the 'online' event\n * This event is generally unreliable and precise behaviour\n * varies between browsers, so we poll for connectivity too,\n * but this might help us reconnect a little faster.\n */\n private onOnline = (): void => {\n debuglog(\"Browser thinks we are back online\");\n this.startKeepAlives(0);\n };\n}\n\nfunction createNewUser(client: MatrixClient, userId: string): User {\n const user = new User(userId);\n client.reEmitter.reEmit(user, [\n \"User.avatarUrl\", \"User.displayName\", \"User.presence\",\n \"User.currentlyActive\", \"User.lastPresenceTs\",\n ]);\n return user;\n}\n\n", + "/*\nCopyright 2015 - 2021 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n/*\n * TODO:\n * This class mainly serves to take all the syncing logic out of client.js and\n * into a separate file. It's all very fluid, and this class gut wrenches a lot\n * of MatrixClient props (e.g. http). Given we want to support WebSockets as\n * an alternative syncing API, we may want to have a proper syncing interface\n * for HTTP and WS at some point.\n */\n\nimport { User } from \"./models/user\";\nimport { NotificationCountType, Room } from \"./models/room\";\nimport { Group } from \"./models/group\";\nimport * as utils from \"./utils\";\nimport { IDeferred } from \"./utils\";\nimport { Filter } from \"./filter\";\nimport { EventTimeline } from \"./models/event-timeline\";\nimport { PushProcessor } from \"./pushprocessor\";\nimport { logger } from './logger';\nimport { InvalidStoreError } from './errors';\nimport { IStoredClientOpts, MatrixClient, PendingEventOrdering } from \"./client\";\nimport { SyncState } from \"./sync.api\";\nimport {\n Category,\n IInvitedRoom,\n IInviteState,\n IJoinedRoom,\n ILeftRoom,\n IStateEvent,\n IRoomEvent,\n IStrippedState,\n ISyncResponse,\n ITimeline,\n IEphemeral,\n IMinimalEvent,\n} from \"./sync-accumulator\";\nimport { MatrixEvent } from \"./models/event\";\nimport { MatrixError } from \"./http-api\";\nimport { ISavedSync } from \"./store\";\nimport { EventType } from \"./@types/event\";\nimport { IPushRules } from \"./@types/PushRules\";\n\nconst DEBUG = true;\n\n// /sync requests allow you to set a timeout= but the request may continue\n// beyond that and wedge forever, so we need to track how long we are willing\n// to keep open the connection. This constant is *ADDED* to the timeout= value\n// to determine the max time we're willing to wait.\nconst BUFFER_PERIOD_MS = 80 * 1000;\n\n// Number of consecutive failed syncs that will lead to a syncState of ERROR as opposed\n// to RECONNECTING. This is needed to inform the client of server issues when the\n// keepAlive is successful but the server /sync fails.\nconst FAILED_SYNC_ERROR_THRESHOLD = 3;\n\nfunction getFilterName(userId: string, suffix?: string): string {\n // scope this on the user ID because people may login on many accounts\n // and they all need to be stored!\n return \"FILTER_SYNC_\" + userId + (suffix ? \"_\" + suffix : \"\");\n}\n\nfunction debuglog(...params) {\n if (!DEBUG) {\n return;\n }\n logger.log(...params);\n}\n\ninterface ISyncOptions {\n filterId?: string;\n hasSyncedBefore?: boolean;\n}\n\nexport interface ISyncStateData {\n error?: Error;\n oldSyncToken?: string;\n nextSyncToken?: string;\n catchingUp?: boolean;\n fromCache?: boolean;\n}\n\ninterface ISyncParams {\n filter?: string;\n timeout: number;\n since?: string;\n // eslint-disable-next-line camelcase\n full_state?: boolean;\n // eslint-disable-next-line camelcase\n set_presence?: \"offline\" | \"online\" | \"unavailable\";\n _cacheBuster?: string | number; // not part of the API itself\n}\n\n// http-api mangles an abort method onto its promises\ninterface IRequestPromise extends Promise {\n abort(): void;\n}\n\ntype WrappedRoom = T & {\n room: Room;\n isBrandNewRoom: boolean;\n};\n\n/**\n * Internal class - unstable.\n * Construct an entity which is able to sync with a homeserver.\n * @constructor\n * @param {MatrixClient} client The matrix client instance to use.\n * @param {Object} opts Config options\n * @param {module:crypto=} opts.crypto Crypto manager\n * @param {Function=} opts.canResetEntireTimeline A function which is called\n * with a room ID and returns a boolean. It should return 'true' if the SDK can\n * SAFELY remove events from this room. It may not be safe to remove events if\n * there are other references to the timelines for this room.\n * Default: returns false.\n * @param {Boolean=} opts.disablePresence True to perform syncing without automatically\n * updating presence.\n */\nexport class SyncApi {\n private _peekRoom: Room = null;\n private currentSyncRequest: IRequestPromise = null;\n private syncState: SyncState = null;\n private syncStateData: ISyncStateData = null; // additional data (eg. error object for failed sync)\n private catchingUp = false;\n private running = false;\n private keepAliveTimer: number = null;\n private connectionReturnedDefer: IDeferred = null;\n private notifEvents: MatrixEvent[] = []; // accumulator of sync events in the current sync response\n private failedSyncCount = 0; // Number of consecutive failed /sync requests\n private storeIsInvalid = false; // flag set if the store needs to be cleared before we can start\n\n constructor(private readonly client: MatrixClient, private readonly opts: Partial = {}) {\n this.opts.initialSyncLimit = this.opts.initialSyncLimit ?? 8;\n this.opts.resolveInvitesToProfiles = this.opts.resolveInvitesToProfiles || false;\n this.opts.pollTimeout = this.opts.pollTimeout || (30 * 1000);\n this.opts.pendingEventOrdering = this.opts.pendingEventOrdering || PendingEventOrdering.Chronological;\n this.opts.experimentalThreadSupport = this.opts.experimentalThreadSupport === true;\n\n if (!opts.canResetEntireTimeline) {\n opts.canResetEntireTimeline = (roomId: string) => {\n return false;\n };\n }\n\n if (client.getNotifTimelineSet()) {\n client.reEmitter.reEmit(client.getNotifTimelineSet(),\n [\"Room.timeline\", \"Room.timelineReset\"]);\n }\n }\n\n /**\n * @param {string} roomId\n * @return {Room}\n */\n public createRoom(roomId: string): Room {\n const client = this.client;\n const {\n timelineSupport,\n unstableClientRelationAggregation,\n } = client;\n const room = new Room(roomId, client, client.getUserId(), {\n lazyLoadMembers: this.opts.lazyLoadMembers,\n pendingEventOrdering: this.opts.pendingEventOrdering,\n timelineSupport,\n unstableClientRelationAggregation,\n });\n client.reEmitter.reEmit(room, [\"Room.name\", \"Room.timeline\",\n \"Room.redaction\",\n \"Room.redactionCancelled\",\n \"Room.receipt\", \"Room.tags\",\n \"Room.timelineReset\",\n \"Room.localEchoUpdated\",\n \"Room.accountData\",\n \"Room.myMembership\",\n \"Room.replaceEvent\",\n ]);\n this.registerStateListeners(room);\n return room;\n }\n\n /**\n * @param {string} groupId\n * @return {Group}\n */\n public createGroup(groupId: string): Group {\n const client = this.client;\n const group = new Group(groupId);\n client.reEmitter.reEmit(group, [\"Group.profile\", \"Group.myMembership\"]);\n client.store.storeGroup(group);\n return group;\n }\n\n /**\n * @param {Room} room\n * @private\n */\n private registerStateListeners(room: Room): void {\n const client = this.client;\n // we need to also re-emit room state and room member events, so hook it up\n // to the client now. We need to add a listener for RoomState.members in\n // order to hook them correctly. (TODO: find a better way?)\n client.reEmitter.reEmit(room.currentState, [\n \"RoomState.events\", \"RoomState.members\", \"RoomState.newMember\",\n ]);\n room.currentState.on(\"RoomState.newMember\", function(event, state, member) {\n member.user = client.getUser(member.userId);\n client.reEmitter.reEmit(\n member,\n [\n \"RoomMember.name\", \"RoomMember.typing\", \"RoomMember.powerLevel\",\n \"RoomMember.membership\",\n ],\n );\n });\n }\n\n /**\n * @param {Room} room\n * @private\n */\n private deregisterStateListeners(room: Room): void {\n // could do with a better way of achieving this.\n room.currentState.removeAllListeners(\"RoomState.events\");\n room.currentState.removeAllListeners(\"RoomState.members\");\n room.currentState.removeAllListeners(\"RoomState.newMember\");\n }\n\n /**\n * Sync rooms the user has left.\n * @return {Promise} Resolved when they've been added to the store.\n */\n public syncLeftRooms() {\n const client = this.client;\n\n // grab a filter with limit=1 and include_leave=true\n const filter = new Filter(this.client.credentials.userId);\n filter.setTimelineLimit(1);\n filter.setIncludeLeaveRooms(true);\n\n const localTimeoutMs = this.opts.pollTimeout + BUFFER_PERIOD_MS;\n const qps: ISyncParams = {\n timeout: 0, // don't want to block since this is a single isolated req\n };\n\n return client.getOrCreateFilter(\n getFilterName(client.credentials.userId, \"LEFT_ROOMS\"), filter,\n ).then(function(filterId) {\n qps.filter = filterId;\n return client.http.authedRequest(\n undefined, \"GET\", \"/sync\", qps, undefined, localTimeoutMs,\n );\n }).then((data) => {\n let leaveRooms = [];\n if (data.rooms && data.rooms.leave) {\n leaveRooms = this.mapSyncResponseToRoomArray(data.rooms.leave);\n }\n const rooms = [];\n leaveRooms.forEach((leaveObj) => {\n const room = leaveObj.room;\n rooms.push(room);\n if (!leaveObj.isBrandNewRoom) {\n // the intention behind syncLeftRooms is to add in rooms which were\n // *omitted* from the initial /sync. Rooms the user were joined to\n // but then left whilst the app is running will appear in this list\n // and we do not want to bother with them since they will have the\n // current state already (and may get dupe messages if we add\n // yet more timeline events!), so skip them.\n // NB: When we persist rooms to localStorage this will be more\n // complicated...\n return;\n }\n leaveObj.timeline = leaveObj.timeline || {};\n const events = this.mapSyncEventsFormat(leaveObj.timeline, room);\n const [timelineEvents, threadedEvents] = this.partitionThreadedEvents(events);\n\n const stateEvents = this.mapSyncEventsFormat(leaveObj.state, room);\n\n // set the back-pagination token. Do this *before* adding any\n // events so that clients can start back-paginating.\n room.getLiveTimeline().setPaginationToken(leaveObj.timeline.prev_batch,\n EventTimeline.BACKWARDS);\n\n this.processRoomEvents(room, stateEvents, timelineEvents);\n this.processThreadEvents(room, threadedEvents);\n\n room.recalculate();\n client.store.storeRoom(room);\n client.emit(\"Room\", room);\n\n this.processEventsForNotifs(room, events);\n });\n return rooms;\n });\n }\n\n /**\n * Split events between the ones that will end up in the main\n * room timeline versus the one that need to be processed in a thread\n * @experimental\n */\n public partitionThreadedEvents(events: MatrixEvent[]): [MatrixEvent[], MatrixEvent[]] {\n if (this.opts.experimentalThreadSupport) {\n return events.reduce((memo, event: MatrixEvent) => {\n memo[event.replyEventId ? 1 : 0].push(event);\n return memo;\n }, [[], []]);\n } else {\n // When `experimentalThreadSupport` is disabled\n // treat all events as timelineEvents\n return [\n events,\n [],\n ];\n }\n }\n\n /**\n * Peek into a room. This will result in the room in question being synced so it\n * is accessible via getRooms(). Live updates for the room will be provided.\n * @param {string} roomId The room ID to peek into.\n * @return {Promise} A promise which resolves once the room has been added to the\n * store.\n */\n public peek(roomId: string): Promise {\n if (this._peekRoom && this._peekRoom.roomId === roomId) {\n return Promise.resolve(this._peekRoom);\n }\n\n const client = this.client;\n this._peekRoom = this.createRoom(roomId);\n return this.client.roomInitialSync(roomId, 20).then((response) => {\n // make sure things are init'd\n response.messages = response.messages || { chunk: [] };\n response.messages.chunk = response.messages.chunk || [];\n response.state = response.state || [];\n\n // FIXME: Mostly duplicated from processRoomEvents but not entirely\n // because \"state\" in this API is at the BEGINNING of the chunk\n const oldStateEvents = utils.deepCopy(response.state)\n .map(client.getEventMapper());\n const stateEvents = response.state.map(client.getEventMapper());\n const messages = response.messages.chunk.map(client.getEventMapper());\n\n // XXX: copypasted from /sync until we kill off this minging v1 API stuff)\n // handle presence events (User objects)\n if (response.presence && Array.isArray(response.presence)) {\n response.presence.map(client.getEventMapper()).forEach(\n function(presenceEvent) {\n let user = client.store.getUser(presenceEvent.getContent().user_id);\n if (user) {\n user.setPresenceEvent(presenceEvent);\n } else {\n user = createNewUser(client, presenceEvent.getContent().user_id);\n user.setPresenceEvent(presenceEvent);\n client.store.storeUser(user);\n }\n client.emit(\"event\", presenceEvent);\n });\n }\n\n // set the pagination token before adding the events in case people\n // fire off pagination requests in response to the Room.timeline\n // events.\n if (response.messages.start) {\n this._peekRoom.oldState.paginationToken = response.messages.start;\n }\n\n // set the state of the room to as it was after the timeline executes\n this._peekRoom.oldState.setStateEvents(oldStateEvents);\n this._peekRoom.currentState.setStateEvents(stateEvents);\n\n this.resolveInvites(this._peekRoom);\n this._peekRoom.recalculate();\n\n // roll backwards to diverge old state. addEventsToTimeline\n // will overwrite the pagination token, so make sure it overwrites\n // it with the right thing.\n this._peekRoom.addEventsToTimeline(messages.reverse(), true,\n this._peekRoom.getLiveTimeline(),\n response.messages.start);\n\n client.store.storeRoom(this._peekRoom);\n client.emit(\"Room\", this._peekRoom);\n\n this.peekPoll(this._peekRoom);\n return this._peekRoom;\n });\n }\n\n /**\n * Stop polling for updates in the peeked room. NOPs if there is no room being\n * peeked.\n */\n public stopPeeking(): void {\n this._peekRoom = null;\n }\n\n /**\n * Do a peek room poll.\n * @param {Room} peekRoom\n * @param {string?} token from= token\n */\n private peekPoll(peekRoom: Room, token?: string): void {\n if (this._peekRoom !== peekRoom) {\n debuglog(\"Stopped peeking in room %s\", peekRoom.roomId);\n return;\n }\n\n // FIXME: gut wrenching; hard-coded timeout values\n this.client.http.authedRequest(undefined, \"GET\", \"/events\", {\n room_id: peekRoom.roomId,\n timeout: 30 * 1000,\n from: token,\n }, undefined, 50 * 1000).then((res) => {\n if (this._peekRoom !== peekRoom) {\n debuglog(\"Stopped peeking in room %s\", peekRoom.roomId);\n return;\n }\n // We have a problem that we get presence both from /events and /sync\n // however, /sync only returns presence for users in rooms\n // you're actually joined to.\n // in order to be sure to get presence for all of the users in the\n // peeked room, we handle presence explicitly here. This may result\n // in duplicate presence events firing for some users, which is a\n // performance drain, but such is life.\n // XXX: copypasted from /sync until we can kill this minging v1 stuff.\n\n res.chunk.filter(function(e) {\n return e.type === \"m.presence\";\n }).map(this.client.getEventMapper()).forEach((presenceEvent) => {\n let user = this.client.store.getUser(presenceEvent.getContent().user_id);\n if (user) {\n user.setPresenceEvent(presenceEvent);\n } else {\n user = createNewUser(this.client, presenceEvent.getContent().user_id);\n user.setPresenceEvent(presenceEvent);\n this.client.store.storeUser(user);\n }\n this.client.emit(\"event\", presenceEvent);\n });\n\n // strip out events which aren't for the given room_id (e.g presence)\n // and also ephemeral events (which we're assuming is anything without\n // and event ID because the /events API doesn't separate them).\n const events = res.chunk.filter(function(e) {\n return e.room_id === peekRoom.roomId && e.event_id;\n }).map(this.client.getEventMapper());\n\n peekRoom.addLiveEvents(events);\n this.peekPoll(peekRoom, res.end);\n }, (err) => {\n logger.error(\"[%s] Peek poll failed: %s\", peekRoom.roomId, err);\n setTimeout(() => {\n this.peekPoll(peekRoom, token);\n }, 30 * 1000);\n });\n }\n\n /**\n * Returns the current state of this sync object\n * @see module:client~MatrixClient#event:\"sync\"\n * @return {?String}\n */\n public getSyncState(): SyncState {\n return this.syncState;\n }\n\n /**\n * Returns the additional data object associated with\n * the current sync state, or null if there is no\n * such data.\n * Sync errors, if available, are put in the 'error' key of\n * this object.\n * @return {?Object}\n */\n public getSyncStateData(): ISyncStateData {\n return this.syncStateData;\n }\n\n public async recoverFromSyncStartupError(savedSyncPromise: Promise, err: Error): Promise {\n // Wait for the saved sync to complete - we send the pushrules and filter requests\n // before the saved sync has finished so they can run in parallel, but only process\n // the results after the saved sync is done. Equivalently, we wait for it to finish\n // before reporting failures from these functions.\n await savedSyncPromise;\n const keepaliveProm = this.startKeepAlives();\n this.updateSyncState(SyncState.Error, { error: err });\n await keepaliveProm;\n }\n\n /**\n * Is the lazy loading option different than in previous session?\n * @param {boolean} lazyLoadMembers current options for lazy loading\n * @return {boolean} whether or not the option has changed compared to the previous session */\n private async wasLazyLoadingToggled(lazyLoadMembers = false): Promise {\n // assume it was turned off before\n // if we don't know any better\n let lazyLoadMembersBefore = false;\n const isStoreNewlyCreated = await this.client.store.isNewlyCreated();\n if (!isStoreNewlyCreated) {\n const prevClientOptions = await this.client.store.getClientOptions();\n if (prevClientOptions) {\n lazyLoadMembersBefore = !!prevClientOptions.lazyLoadMembers;\n }\n return lazyLoadMembersBefore !== lazyLoadMembers;\n }\n return false;\n }\n\n private shouldAbortSync(error: MatrixError): boolean {\n if (error.errcode === \"M_UNKNOWN_TOKEN\") {\n // The logout already happened, we just need to stop.\n logger.warn(\"Token no longer valid - assuming logout\");\n this.stop();\n return true;\n }\n return false;\n }\n\n /**\n * Main entry point\n */\n public sync(): void {\n const client = this.client;\n\n this.running = true;\n\n if (global.window && global.window.addEventListener) {\n global.window.addEventListener(\"online\", this.onOnline, false);\n }\n\n let savedSyncPromise = Promise.resolve();\n let savedSyncToken = null;\n\n // We need to do one-off checks before we can begin the /sync loop.\n // These are:\n // 1) We need to get push rules so we can check if events should bing as we get\n // them from /sync.\n // 2) We need to get/create a filter which we can use for /sync.\n // 3) We need to check the lazy loading option matches what was used in the\n // stored sync. If it doesn't, we can't use the stored sync.\n\n const getPushRules = async () => {\n try {\n debuglog(\"Getting push rules...\");\n const result = await client.getPushRules();\n debuglog(\"Got push rules\");\n\n client.pushRules = result;\n } catch (err) {\n logger.error(\"Getting push rules failed\", err);\n if (this.shouldAbortSync(err)) return;\n // wait for saved sync to complete before doing anything else,\n // otherwise the sync state will end up being incorrect\n debuglog(\"Waiting for saved sync before retrying push rules...\");\n await this.recoverFromSyncStartupError(savedSyncPromise, err);\n getPushRules();\n return;\n }\n checkLazyLoadStatus(); // advance to the next stage\n };\n\n const buildDefaultFilter = () => {\n const filter = new Filter(client.credentials.userId);\n filter.setTimelineLimit(this.opts.initialSyncLimit);\n return filter;\n };\n\n const checkLazyLoadStatus = async () => {\n debuglog(\"Checking lazy load status...\");\n if (this.opts.lazyLoadMembers && client.isGuest()) {\n this.opts.lazyLoadMembers = false;\n }\n if (this.opts.lazyLoadMembers) {\n debuglog(\"Checking server lazy load support...\");\n const supported = await client.doesServerSupportLazyLoading();\n if (supported) {\n debuglog(\"Enabling lazy load on sync filter...\");\n if (!this.opts.filter) {\n this.opts.filter = buildDefaultFilter();\n }\n this.opts.filter.setLazyLoadMembers(true);\n } else {\n debuglog(\"LL: lazy loading requested but not supported \" +\n \"by server, so disabling\");\n this.opts.lazyLoadMembers = false;\n }\n }\n // need to vape the store when enabling LL and wasn't enabled before\n debuglog(\"Checking whether lazy loading has changed in store...\");\n const shouldClear = await this.wasLazyLoadingToggled(this.opts.lazyLoadMembers);\n if (shouldClear) {\n this.storeIsInvalid = true;\n const reason = InvalidStoreError.TOGGLED_LAZY_LOADING;\n const error = new InvalidStoreError(reason, !!this.opts.lazyLoadMembers);\n this.updateSyncState(SyncState.Error, { error });\n // bail out of the sync loop now: the app needs to respond to this error.\n // we leave the state as 'ERROR' which isn't great since this normally means\n // we're retrying. The client must be stopped before clearing the stores anyway\n // so the app should stop the client, clear the store and start it again.\n logger.warn(\"InvalidStoreError: store is not usable: stopping sync.\");\n return;\n }\n if (this.opts.lazyLoadMembers && this.opts.crypto) {\n this.opts.crypto.enableLazyLoading();\n }\n try {\n debuglog(\"Storing client options...\");\n await this.client.storeClientOptions();\n debuglog(\"Stored client options\");\n } catch (err) {\n logger.error(\"Storing client options failed\", err);\n throw err;\n }\n\n getFilter(); // Now get the filter and start syncing\n };\n\n const getFilter = async () => {\n debuglog(\"Getting filter...\");\n let filter;\n if (this.opts.filter) {\n filter = this.opts.filter;\n } else {\n filter = buildDefaultFilter();\n }\n\n let filterId;\n try {\n filterId = await client.getOrCreateFilter(getFilterName(client.credentials.userId), filter);\n } catch (err) {\n logger.error(\"Getting filter failed\", err);\n if (this.shouldAbortSync(err)) return;\n // wait for saved sync to complete before doing anything else,\n // otherwise the sync state will end up being incorrect\n debuglog(\"Waiting for saved sync before retrying filter...\");\n await this.recoverFromSyncStartupError(savedSyncPromise, err);\n getFilter();\n return;\n }\n // reset the notifications timeline to prepare it to paginate from\n // the current point in time.\n // The right solution would be to tie /sync pagination tokens into\n // /notifications API somehow.\n client.resetNotifTimelineSet();\n\n if (this.currentSyncRequest === null) {\n // Send this first sync request here so we can then wait for the saved\n // sync data to finish processing before we process the results of this one.\n debuglog(\"Sending first sync request...\");\n this.currentSyncRequest = this.doSyncRequest({ filterId }, savedSyncToken);\n }\n\n // Now wait for the saved sync to finish...\n debuglog(\"Waiting for saved sync before starting sync processing...\");\n await savedSyncPromise;\n this.doSync({ filterId });\n };\n\n if (client.isGuest()) {\n // no push rules for guests, no access to POST filter for guests.\n this.doSync({});\n } else {\n // Pull the saved sync token out first, before the worker starts sending\n // all the sync data which could take a while. This will let us send our\n // first incremental sync request before we've processed our saved data.\n debuglog(\"Getting saved sync token...\");\n savedSyncPromise = client.store.getSavedSyncToken().then((tok) => {\n debuglog(\"Got saved sync token\");\n savedSyncToken = tok;\n debuglog(\"Getting saved sync...\");\n return client.store.getSavedSync();\n }).then((savedSync) => {\n debuglog(`Got reply from saved sync, exists? ${!!savedSync}`);\n if (savedSync) {\n return this.syncFromCache(savedSync);\n }\n }).catch(err => {\n logger.error(\"Getting saved sync failed\", err);\n });\n // Now start the first incremental sync request: this can also\n // take a while so if we set it going now, we can wait for it\n // to finish while we process our saved sync data.\n getPushRules();\n }\n }\n\n /**\n * Stops the sync object from syncing.\n */\n public stop(): void {\n debuglog(\"SyncApi.stop\");\n if (global.window) {\n global.window.removeEventListener(\"online\", this.onOnline, false);\n }\n this.running = false;\n if (this.currentSyncRequest) {\n this.currentSyncRequest.abort();\n }\n if (this.keepAliveTimer) {\n clearTimeout(this.keepAliveTimer);\n this.keepAliveTimer = null;\n }\n }\n\n /**\n * Retry a backed off syncing request immediately. This should only be used when\n * the user explicitly attempts to retry their lost connection.\n * @return {boolean} True if this resulted in a request being retried.\n */\n public retryImmediately(): boolean {\n if (!this.connectionReturnedDefer) {\n return false;\n }\n this.startKeepAlives(0);\n return true;\n }\n /**\n * Process a single set of cached sync data.\n * @param {Object} savedSync a saved sync that was persisted by a store. This\n * should have been acquired via client.store.getSavedSync().\n */\n private async syncFromCache(savedSync: ISavedSync): Promise {\n debuglog(\"sync(): not doing HTTP hit, instead returning stored /sync data\");\n\n const nextSyncToken = savedSync.nextBatch;\n\n // Set sync token for future incremental syncing\n this.client.store.setSyncToken(nextSyncToken);\n\n // No previous sync, set old token to null\n const syncEventData = {\n oldSyncToken: null,\n nextSyncToken,\n catchingUp: false,\n fromCache: true,\n };\n\n const data: ISyncResponse = {\n next_batch: nextSyncToken,\n rooms: savedSync.roomsData,\n groups: savedSync.groupsData,\n account_data: {\n events: savedSync.accountData,\n },\n };\n\n try {\n await this.processSyncResponse(syncEventData, data);\n } catch (e) {\n logger.error(\"Error processing cached sync\", e.stack || e);\n }\n\n // Don't emit a prepared if we've bailed because the store is invalid:\n // in this case the client will not be usable until stopped & restarted\n // so this would be useless and misleading.\n if (!this.storeIsInvalid) {\n this.updateSyncState(SyncState.Prepared, syncEventData);\n }\n }\n\n /**\n * Invoke me to do /sync calls\n * @param {Object} syncOptions\n * @param {string} syncOptions.filterId\n * @param {boolean} syncOptions.hasSyncedBefore\n */\n private async doSync(syncOptions: ISyncOptions): Promise {\n const client = this.client;\n\n if (!this.running) {\n debuglog(\"Sync no longer running: exiting.\");\n if (this.connectionReturnedDefer) {\n this.connectionReturnedDefer.reject();\n this.connectionReturnedDefer = null;\n }\n this.updateSyncState(SyncState.Stopped);\n return;\n }\n\n const syncToken = client.store.getSyncToken();\n\n let data;\n try {\n //debuglog('Starting sync since=' + syncToken);\n if (this.currentSyncRequest === null) {\n this.currentSyncRequest = this.doSyncRequest(syncOptions, syncToken);\n }\n data = await this.currentSyncRequest;\n } catch (e) {\n this.onSyncError(e, syncOptions);\n return;\n } finally {\n this.currentSyncRequest = null;\n }\n\n //debuglog('Completed sync, next_batch=' + data.next_batch);\n\n // set the sync token NOW *before* processing the events. We do this so\n // if something barfs on an event we can skip it rather than constantly\n // polling with the same token.\n client.store.setSyncToken(data.next_batch);\n\n // Reset after a successful sync\n this.failedSyncCount = 0;\n\n await client.store.setSyncData(data);\n\n const syncEventData = {\n oldSyncToken: syncToken,\n nextSyncToken: data.next_batch,\n catchingUp: this.catchingUp,\n };\n\n if (this.opts.crypto) {\n // tell the crypto module we're about to process a sync\n // response\n await this.opts.crypto.onSyncWillProcess(syncEventData);\n }\n\n try {\n await this.processSyncResponse(syncEventData, data);\n } catch (e) {\n // log the exception with stack if we have it, else fall back\n // to the plain description\n logger.error(\"Caught /sync error\", e.stack || e);\n\n // Emit the exception for client handling\n this.client.emit(\"sync.unexpectedError\", e);\n }\n\n // update this as it may have changed\n syncEventData.catchingUp = this.catchingUp;\n\n // emit synced events\n if (!syncOptions.hasSyncedBefore) {\n this.updateSyncState(SyncState.Prepared, syncEventData);\n syncOptions.hasSyncedBefore = true;\n }\n\n // tell the crypto module to do its processing. It may block (to do a\n // /keys/changes request).\n if (this.opts.crypto) {\n await this.opts.crypto.onSyncCompleted(syncEventData);\n }\n\n // keep emitting SYNCING -> SYNCING for clients who want to do bulk updates\n this.updateSyncState(SyncState.Syncing, syncEventData);\n\n if (client.store.wantsSave()) {\n // We always save the device list (if it's dirty) before saving the sync data:\n // this means we know the saved device list data is at least as fresh as the\n // stored sync data which means we don't have to worry that we may have missed\n // device changes. We can also skip the delay since we're not calling this very\n // frequently (and we don't really want to delay the sync for it).\n if (this.opts.crypto) {\n await this.opts.crypto.saveDeviceList(0);\n }\n\n // tell databases that everything is now in a consistent state and can be saved.\n client.store.save();\n }\n\n // Begin next sync\n this.doSync(syncOptions);\n }\n\n private doSyncRequest(syncOptions: ISyncOptions, syncToken: string): IRequestPromise {\n const qps = this.getSyncParams(syncOptions, syncToken);\n return this.client.http.authedRequest(\n undefined, \"GET\", \"/sync\", qps, undefined,\n qps.timeout + BUFFER_PERIOD_MS,\n );\n }\n\n private getSyncParams(syncOptions: ISyncOptions, syncToken: string): ISyncParams {\n let pollTimeout = this.opts.pollTimeout;\n\n if (this.getSyncState() !== 'SYNCING' || this.catchingUp) {\n // unless we are happily syncing already, we want the server to return\n // as quickly as possible, even if there are no events queued. This\n // serves two purposes:\n //\n // * When the connection dies, we want to know asap when it comes back,\n // so that we can hide the error from the user. (We don't want to\n // have to wait for an event or a timeout).\n //\n // * We want to know if the server has any to_device messages queued up\n // for us. We do that by calling it with a zero timeout until it\n // doesn't give us any more to_device messages.\n this.catchingUp = true;\n pollTimeout = 0;\n }\n\n let filterId = syncOptions.filterId;\n if (this.client.isGuest() && !filterId) {\n filterId = this.getGuestFilter();\n }\n\n const qps: ISyncParams = {\n filter: filterId,\n timeout: pollTimeout,\n };\n\n if (this.opts.disablePresence) {\n qps.set_presence = \"offline\";\n }\n\n if (syncToken) {\n qps.since = syncToken;\n } else {\n // use a cachebuster for initialsyncs, to make sure that\n // we don't get a stale sync\n // (https://github.com/vector-im/vector-web/issues/1354)\n qps._cacheBuster = Date.now();\n }\n\n if (this.getSyncState() == 'ERROR' || this.getSyncState() == 'RECONNECTING') {\n // we think the connection is dead. If it comes back up, we won't know\n // about it till /sync returns. If the timeout= is high, this could\n // be a long time. Set it to 0 when doing retries so we don't have to wait\n // for an event or a timeout before emiting the SYNCING event.\n qps.timeout = 0;\n }\n\n return qps;\n }\n\n private onSyncError(err: Error, syncOptions: ISyncOptions): void {\n if (!this.running) {\n debuglog(\"Sync no longer running: exiting\");\n if (this.connectionReturnedDefer) {\n this.connectionReturnedDefer.reject();\n this.connectionReturnedDefer = null;\n }\n this.updateSyncState(SyncState.Stopped);\n return;\n }\n\n logger.error(\"/sync error %s\", err);\n logger.error(err);\n\n if (this.shouldAbortSync(err)) {\n return;\n }\n\n this.failedSyncCount++;\n logger.log('Number of consecutive failed sync requests:', this.failedSyncCount);\n\n debuglog(\"Starting keep-alive\");\n // Note that we do *not* mark the sync connection as\n // lost yet: we only do this if a keepalive poke\n // fails, since long lived HTTP connections will\n // go away sometimes and we shouldn't treat this as\n // erroneous. We set the state to 'reconnecting'\n // instead, so that clients can observe this state\n // if they wish.\n this.startKeepAlives().then((connDidFail) => {\n // Only emit CATCHUP if we detected a connectivity error: if we didn't,\n // it's quite likely the sync will fail again for the same reason and we\n // want to stay in ERROR rather than keep flip-flopping between ERROR\n // and CATCHUP.\n if (connDidFail && this.getSyncState() === SyncState.Error) {\n this.updateSyncState(SyncState.Catchup, {\n oldSyncToken: null,\n nextSyncToken: null,\n catchingUp: true,\n });\n }\n this.doSync(syncOptions);\n });\n\n this.currentSyncRequest = null;\n // Transition from RECONNECTING to ERROR after a given number of failed syncs\n this.updateSyncState(\n this.failedSyncCount >= FAILED_SYNC_ERROR_THRESHOLD ?\n SyncState.Error : SyncState.Reconnecting,\n { error: err },\n );\n }\n\n /**\n * Process data returned from a sync response and propagate it\n * into the model objects\n *\n * @param {Object} syncEventData Object containing sync tokens associated with this sync\n * @param {Object} data The response from /sync\n */\n private async processSyncResponse(syncEventData: ISyncStateData, data: ISyncResponse): Promise {\n const client = this.client;\n\n // data looks like:\n // {\n // next_batch: $token,\n // presence: { events: [] },\n // account_data: { events: [] },\n // device_lists: { changed: [\"@user:server\", ... ]},\n // to_device: { events: [] },\n // device_one_time_keys_count: { signed_curve25519: 42 },\n // rooms: {\n // invite: {\n // $roomid: {\n // invite_state: { events: [] }\n // }\n // },\n // join: {\n // $roomid: {\n // state: { events: [] },\n // timeline: { events: [], prev_batch: $token, limited: true },\n // ephemeral: { events: [] },\n // summary: {\n // m.heroes: [ $user_id ],\n // m.joined_member_count: $count,\n // m.invited_member_count: $count\n // },\n // account_data: { events: [] },\n // unread_notifications: {\n // highlight_count: 0,\n // notification_count: 0,\n // }\n // }\n // },\n // leave: {\n // $roomid: {\n // state: { events: [] },\n // timeline: { events: [], prev_batch: $token }\n // }\n // }\n // },\n // groups: {\n // invite: {\n // $groupId: {\n // inviter: $inviter,\n // profile: {\n // avatar_url: $avatarUrl,\n // name: $groupName,\n // },\n // },\n // },\n // join: {},\n // leave: {},\n // },\n // }\n\n // TODO-arch:\n // - Each event we pass through needs to be emitted via 'event', can we\n // do this in one place?\n // - The isBrandNewRoom boilerplate is boilerplatey.\n\n // handle presence events (User objects)\n if (data.presence && Array.isArray(data.presence.events)) {\n data.presence.events.map(client.getEventMapper()).forEach(\n function(presenceEvent) {\n let user = client.store.getUser(presenceEvent.getSender());\n if (user) {\n user.setPresenceEvent(presenceEvent);\n } else {\n user = createNewUser(client, presenceEvent.getSender());\n user.setPresenceEvent(presenceEvent);\n client.store.storeUser(user);\n }\n client.emit(\"event\", presenceEvent);\n });\n }\n\n // handle non-room account_data\n if (data.account_data && Array.isArray(data.account_data.events)) {\n const events = data.account_data.events.map(client.getEventMapper());\n const prevEventsMap = events.reduce((m, c) => {\n m[c.getId()] = client.store.getAccountData(c.getType());\n return m;\n }, {});\n client.store.storeAccountDataEvents(events);\n events.forEach(\n function(accountDataEvent) {\n // Honour push rules that come down the sync stream but also\n // honour push rules that were previously cached. Base rules\n // will be updated when we receive push rules via getPushRules\n // (see sync) before syncing over the network.\n if (accountDataEvent.getType() === EventType.PushRules) {\n const rules = accountDataEvent.getContent();\n client.pushRules = PushProcessor.rewriteDefaultRules(rules);\n }\n const prevEvent = prevEventsMap[accountDataEvent.getId()];\n client.emit(\"accountData\", accountDataEvent, prevEvent);\n return accountDataEvent;\n },\n );\n }\n\n // handle to-device events\n if (data.to_device && Array.isArray(data.to_device.events) &&\n data.to_device.events.length > 0\n ) {\n const cancelledKeyVerificationTxns = [];\n data.to_device.events\n .map(client.getEventMapper())\n .map((toDeviceEvent) => { // map is a cheap inline forEach\n // We want to flag m.key.verification.start events as cancelled\n // if there's an accompanying m.key.verification.cancel event, so\n // we pull out the transaction IDs from the cancellation events\n // so we can flag the verification events as cancelled in the loop\n // below.\n if (toDeviceEvent.getType() === \"m.key.verification.cancel\") {\n const txnId = toDeviceEvent.getContent()['transaction_id'];\n if (txnId) {\n cancelledKeyVerificationTxns.push(txnId);\n }\n }\n\n // as mentioned above, .map is a cheap inline forEach, so return\n // the unmodified event.\n return toDeviceEvent;\n })\n .forEach(\n function(toDeviceEvent) {\n const content = toDeviceEvent.getContent();\n if (\n toDeviceEvent.getType() == \"m.room.message\" &&\n content.msgtype == \"m.bad.encrypted\"\n ) {\n // the mapper already logged a warning.\n logger.log(\n 'Ignoring undecryptable to-device event from ' +\n toDeviceEvent.getSender(),\n );\n return;\n }\n\n if (toDeviceEvent.getType() === \"m.key.verification.start\"\n || toDeviceEvent.getType() === \"m.key.verification.request\") {\n const txnId = content['transaction_id'];\n if (cancelledKeyVerificationTxns.includes(txnId)) {\n toDeviceEvent.flagCancelled();\n }\n }\n\n client.emit(\"toDeviceEvent\", toDeviceEvent);\n },\n );\n } else {\n // no more to-device events: we can stop polling with a short timeout.\n this.catchingUp = false;\n }\n\n if (data.groups) {\n if (data.groups.invite) {\n this.processGroupSyncEntry(data.groups.invite, Category.Invite);\n }\n\n if (data.groups.join) {\n this.processGroupSyncEntry(data.groups.join, Category.Join);\n }\n\n if (data.groups.leave) {\n this.processGroupSyncEntry(data.groups.leave, Category.Leave);\n }\n }\n\n // the returned json structure is a bit crap, so make it into a\n // nicer form (array) after applying sanity to make sure we don't fail\n // on missing keys (on the off chance)\n let inviteRooms: WrappedRoom[] = [];\n let joinRooms: WrappedRoom[] = [];\n let leaveRooms: WrappedRoom[] = [];\n\n if (data.rooms) {\n if (data.rooms.invite) {\n inviteRooms = this.mapSyncResponseToRoomArray(data.rooms.invite);\n }\n if (data.rooms.join) {\n joinRooms = this.mapSyncResponseToRoomArray(data.rooms.join);\n }\n if (data.rooms.leave) {\n leaveRooms = this.mapSyncResponseToRoomArray(data.rooms.leave);\n }\n }\n\n this.notifEvents = [];\n\n // Handle invites\n inviteRooms.forEach((inviteObj) => {\n const room = inviteObj.room;\n const stateEvents = this.mapSyncEventsFormat(inviteObj.invite_state, room);\n\n this.processRoomEvents(room, stateEvents);\n if (inviteObj.isBrandNewRoom) {\n room.recalculate();\n client.store.storeRoom(room);\n client.emit(\"Room\", room);\n }\n stateEvents.forEach(function(e) {\n client.emit(\"event\", e);\n });\n room.updateMyMembership(\"invite\");\n });\n\n // Handle joins\n await utils.promiseMapSeries(joinRooms, async (joinObj) => {\n const room = joinObj.room;\n const stateEvents = this.mapSyncEventsFormat(joinObj.state, room);\n // Prevent events from being decrypted ahead of time\n // this helps large account to speed up faster\n // room::decryptCriticalEvent is in charge of decrypting all the events\n // required for a client to function properly\n const events = this.mapSyncEventsFormat(joinObj.timeline, room, false);\n const ephemeralEvents = this.mapSyncEventsFormat(joinObj.ephemeral);\n const accountDataEvents = this.mapSyncEventsFormat(joinObj.account_data);\n\n const encrypted = client.isRoomEncrypted(room.roomId);\n // we do this first so it's correct when any of the events fire\n if (joinObj.unread_notifications) {\n room.setUnreadNotificationCount(\n NotificationCountType.Total,\n joinObj.unread_notifications.notification_count,\n );\n\n // We track unread notifications ourselves in encrypted rooms, so don't\n // bother setting it here. We trust our calculations better than the\n // server's for this case, and therefore will assume that our non-zero\n // count is accurate.\n if (!encrypted\n || (encrypted && room.getUnreadNotificationCount(NotificationCountType.Highlight) <= 0)) {\n room.setUnreadNotificationCount(\n NotificationCountType.Highlight,\n joinObj.unread_notifications.highlight_count,\n );\n }\n }\n\n joinObj.timeline = joinObj.timeline || {} as ITimeline;\n\n if (joinObj.isBrandNewRoom) {\n // set the back-pagination token. Do this *before* adding any\n // events so that clients can start back-paginating.\n room.getLiveTimeline().setPaginationToken(\n joinObj.timeline.prev_batch, EventTimeline.BACKWARDS);\n } else if (joinObj.timeline.limited) {\n let limited = true;\n\n // we've got a limited sync, so we *probably* have a gap in the\n // timeline, so should reset. But we might have been peeking or\n // paginating and already have some of the events, in which\n // case we just want to append any subsequent events to the end\n // of the existing timeline.\n //\n // This is particularly important in the case that we already have\n // *all* of the events in the timeline - in that case, if we reset\n // the timeline, we'll end up with an entirely empty timeline,\n // which we'll try to paginate but not get any new events (which\n // will stop us linking the empty timeline into the chain).\n //\n for (let i = events.length - 1; i >= 0; i--) {\n const eventId = events[i].getId();\n if (room.getTimelineForEvent(eventId)) {\n debuglog(\"Already have event \" + eventId + \" in limited \" +\n \"sync - not resetting\");\n limited = false;\n\n // we might still be missing some of the events before i;\n // we don't want to be adding them to the end of the\n // timeline because that would put them out of order.\n events.splice(0, i);\n\n // XXX: there's a problem here if the skipped part of the\n // timeline modifies the state set in stateEvents, because\n // we'll end up using the state from stateEvents rather\n // than the later state from timelineEvents. We probably\n // need to wind stateEvents forward over the events we're\n // skipping.\n\n break;\n }\n }\n\n if (limited) {\n this.deregisterStateListeners(room);\n room.resetLiveTimeline(\n joinObj.timeline.prev_batch,\n this.opts.canResetEntireTimeline(room.roomId) ?\n null : syncEventData.oldSyncToken,\n );\n\n // We have to assume any gap in any timeline is\n // reason to stop incrementally tracking notifications and\n // reset the timeline.\n client.resetNotifTimelineSet();\n\n this.registerStateListeners(room);\n }\n }\n\n const [timelineEvents, threadedEvents] = this.partitionThreadedEvents(events);\n\n this.processRoomEvents(room, stateEvents, timelineEvents, syncEventData.fromCache);\n this.processThreadEvents(room, threadedEvents);\n\n // set summary after processing events,\n // because it will trigger a name calculation\n // which needs the room state to be up to date\n if (joinObj.summary) {\n room.setSummary(joinObj.summary);\n }\n\n // we deliberately don't add ephemeral events to the timeline\n room.addEphemeralEvents(ephemeralEvents);\n\n // we deliberately don't add accountData to the timeline\n room.addAccountData(accountDataEvents);\n\n room.recalculate();\n if (joinObj.isBrandNewRoom) {\n client.store.storeRoom(room);\n client.emit(\"Room\", room);\n }\n\n this.processEventsForNotifs(room, events);\n\n const processRoomEvent = async (e) => {\n client.emit(\"event\", e);\n if (e.isState() && e.getType() == \"m.room.encryption\" && this.opts.crypto) {\n await this.opts.crypto.onCryptoEvent(e);\n }\n if (e.isState() && e.getType() === \"im.vector.user_status\") {\n let user = client.store.getUser(e.getStateKey());\n if (user) {\n user.unstable_updateStatusMessage(e);\n } else {\n user = createNewUser(client, e.getStateKey());\n user.unstable_updateStatusMessage(e);\n client.store.storeUser(user);\n }\n }\n };\n\n await utils.promiseMapSeries(stateEvents, processRoomEvent);\n await utils.promiseMapSeries(timelineEvents, processRoomEvent);\n await utils.promiseMapSeries(threadedEvents, processRoomEvent);\n ephemeralEvents.forEach(function(e) {\n client.emit(\"event\", e);\n });\n accountDataEvents.forEach(function(e) {\n client.emit(\"event\", e);\n });\n\n room.updateMyMembership(\"join\");\n\n // Decrypt only the last message in all rooms to make sure we can generate a preview\n // And decrypt all events after the recorded read receipt to ensure an accurate\n // notification count\n room.decryptCriticalEvents();\n });\n\n // Handle leaves (e.g. kicked rooms)\n leaveRooms.forEach((leaveObj) => {\n const room = leaveObj.room;\n const stateEvents = this.mapSyncEventsFormat(leaveObj.state, room);\n const events = this.mapSyncEventsFormat(leaveObj.timeline, room);\n const accountDataEvents = this.mapSyncEventsFormat(leaveObj.account_data);\n\n const [timelineEvents, threadedEvents] = this.partitionThreadedEvents(events);\n\n this.processRoomEvents(room, stateEvents, timelineEvents);\n this.processThreadEvents(room, threadedEvents);\n room.addAccountData(accountDataEvents);\n\n room.recalculate();\n if (leaveObj.isBrandNewRoom) {\n client.store.storeRoom(room);\n client.emit(\"Room\", room);\n }\n\n this.processEventsForNotifs(room, events);\n\n stateEvents.forEach(function(e) {\n client.emit(\"event\", e);\n });\n timelineEvents.forEach(function(e) {\n client.emit(\"event\", e);\n });\n threadedEvents.forEach(function(e) {\n client.emit(\"event\", e);\n });\n accountDataEvents.forEach(function(e) {\n client.emit(\"event\", e);\n });\n\n room.updateMyMembership(\"leave\");\n });\n\n // update the notification timeline, if appropriate.\n // we only do this for live events, as otherwise we can't order them sanely\n // in the timeline relative to ones paginated in by /notifications.\n // XXX: we could fix this by making EventTimeline support chronological\n // ordering... but it doesn't, right now.\n if (syncEventData.oldSyncToken && this.notifEvents.length) {\n this.notifEvents.sort(function(a, b) {\n return a.getTs() - b.getTs();\n });\n this.notifEvents.forEach(function(event) {\n client.getNotifTimelineSet().addLiveEvent(event);\n });\n }\n\n // Handle device list updates\n if (data.device_lists) {\n if (this.opts.crypto) {\n await this.opts.crypto.handleDeviceListChanges(syncEventData, data.device_lists);\n } else {\n // FIXME if we *don't* have a crypto module, we still need to\n // invalidate the device lists. But that would require a\n // substantial bit of rework :/.\n }\n }\n\n // Handle one_time_keys_count\n if (this.opts.crypto && data.device_one_time_keys_count) {\n const currentCount = data.device_one_time_keys_count.signed_curve25519 || 0;\n this.opts.crypto.updateOneTimeKeyCount(currentCount);\n }\n if (this.opts.crypto && data[\"org.matrix.msc2732.device_unused_fallback_key_types\"]) {\n // The presence of device_unused_fallback_key_types indicates that the\n // server supports fallback keys. If there's no unused\n // signed_curve25519 fallback key we need a new one.\n const unusedFallbackKeys = data[\"org.matrix.msc2732.device_unused_fallback_key_types\"];\n this.opts.crypto.setNeedsNewFallback(\n unusedFallbackKeys instanceof Array &&\n !unusedFallbackKeys.includes(\"signed_curve25519\"),\n );\n }\n }\n\n /**\n * Starts polling the connectivity check endpoint\n * @param {number} delay How long to delay until the first poll.\n * defaults to a short, randomised interval (to prevent\n * tightlooping if /versions succeeds but /sync etc. fail).\n * @return {promise} which resolves once the connection returns\n */\n private startKeepAlives(delay?: number): Promise {\n if (delay === undefined) {\n delay = 2000 + Math.floor(Math.random() * 5000);\n }\n\n if (this.keepAliveTimer !== null) {\n clearTimeout(this.keepAliveTimer);\n }\n if (delay > 0) {\n this.keepAliveTimer = setTimeout(this.pokeKeepAlive.bind(this), delay);\n } else {\n this.pokeKeepAlive();\n }\n if (!this.connectionReturnedDefer) {\n this.connectionReturnedDefer = utils.defer();\n }\n return this.connectionReturnedDefer.promise;\n }\n\n /**\n * Make a dummy call to /_matrix/client/versions, to see if the HS is\n * reachable.\n *\n * On failure, schedules a call back to itself. On success, resolves\n * this.connectionReturnedDefer.\n *\n * @param {boolean} connDidFail True if a connectivity failure has been detected. Optional.\n */\n private pokeKeepAlive(connDidFail = false): void {\n const success = () => {\n clearTimeout(this.keepAliveTimer);\n if (this.connectionReturnedDefer) {\n this.connectionReturnedDefer.resolve(connDidFail);\n this.connectionReturnedDefer = null;\n }\n };\n\n this.client.http.request(\n undefined, // callback\n \"GET\", \"/_matrix/client/versions\",\n undefined, // queryParams\n undefined, // data\n {\n prefix: '',\n localTimeoutMs: 15 * 1000,\n },\n ).then(() => {\n success();\n }, (err) => {\n if (err.httpStatus == 400 || err.httpStatus == 404) {\n // treat this as a success because the server probably just doesn't\n // support /versions: point is, we're getting a response.\n // We wait a short time though, just in case somehow the server\n // is in a mode where it 400s /versions responses and sync etc.\n // responses fail, this will mean we don't hammer in a loop.\n this.keepAliveTimer = setTimeout(success, 2000);\n } else {\n connDidFail = true;\n this.keepAliveTimer = setTimeout(\n this.pokeKeepAlive.bind(this, connDidFail),\n 5000 + Math.floor(Math.random() * 5000),\n );\n // A keepalive has failed, so we emit the\n // error state (whether or not this is the\n // first failure).\n // Note we do this after setting the timer:\n // this lets the unit tests advance the mock\n // clock when they get the error.\n this.updateSyncState(SyncState.Error, { error: err });\n }\n });\n }\n\n /**\n * @param {Object} groupsSection Groups section object, eg. response.groups.invite\n * @param {string} sectionName Which section this is ('invite', 'join' or 'leave')\n */\n private processGroupSyncEntry(groupsSection: object, sectionName: Category) {\n // Processes entries from 'groups' section of the sync stream\n for (const groupId of Object.keys(groupsSection)) {\n const groupInfo = groupsSection[groupId];\n let group = this.client.store.getGroup(groupId);\n const isBrandNew = group === null;\n if (group === null) {\n group = this.createGroup(groupId);\n }\n if (groupInfo.profile) {\n group.setProfile(\n groupInfo.profile.name, groupInfo.profile.avatar_url,\n );\n }\n if (groupInfo.inviter) {\n group.setInviter({ userId: groupInfo.inviter });\n }\n group.setMyMembership(sectionName);\n if (isBrandNew) {\n // Now we've filled in all the fields, emit the Group event\n this.client.emit(\"Group\", group);\n }\n }\n }\n\n /**\n * @param {Object} obj\n * @return {Object[]}\n */\n private mapSyncResponseToRoomArray(\n obj: Record,\n ): Array> {\n // Maps { roomid: {stuff}, roomid: {stuff} }\n // to\n // [{stuff+Room+isBrandNewRoom}, {stuff+Room+isBrandNewRoom}]\n const client = this.client;\n return Object.keys(obj).map((roomId) => {\n const arrObj = obj[roomId] as T & { room: Room, isBrandNewRoom: boolean };\n let room = client.store.getRoom(roomId);\n let isBrandNewRoom = false;\n if (!room) {\n room = this.createRoom(roomId);\n isBrandNewRoom = true;\n }\n arrObj.room = room;\n arrObj.isBrandNewRoom = isBrandNewRoom;\n return arrObj;\n });\n }\n\n /**\n * @param {Object} obj\n * @param {Room} room\n * @param {boolean} decrypt\n * @return {MatrixEvent[]}\n */\n private mapSyncEventsFormat(\n obj: IInviteState | ITimeline | IEphemeral,\n room?: Room,\n decrypt = true,\n ): MatrixEvent[] {\n if (!obj || !Array.isArray(obj.events)) {\n return [];\n }\n const mapper = this.client.getEventMapper({ decrypt });\n return (obj.events as Array).map(function(e) {\n if (room) {\n e[\"room_id\"] = room.roomId;\n }\n return mapper(e);\n });\n }\n\n /**\n * @param {Room} room\n */\n private resolveInvites(room: Room): void {\n if (!room || !this.opts.resolveInvitesToProfiles) {\n return;\n }\n const client = this.client;\n // For each invited room member we want to give them a displayname/avatar url\n // if they have one (the m.room.member invites don't contain this).\n room.getMembersWithMembership(\"invite\").forEach(function(member) {\n if (member._requestedProfileInfo) return;\n member._requestedProfileInfo = true;\n // try to get a cached copy first.\n const user = client.getUser(member.userId);\n let promise;\n if (user) {\n promise = Promise.resolve({\n avatar_url: user.avatarUrl,\n displayname: user.displayName,\n });\n } else {\n promise = client.getProfileInfo(member.userId);\n }\n promise.then(function(info) {\n // slightly naughty by doctoring the invite event but this means all\n // the code paths remain the same between invite/join display name stuff\n // which is a worthy trade-off for some minor pollution.\n const inviteEvent = member.events.member;\n if (inviteEvent.getContent().membership !== \"invite\") {\n // between resolving and now they have since joined, so don't clobber\n return;\n }\n inviteEvent.getContent().avatar_url = info.avatar_url;\n inviteEvent.getContent().displayname = info.displayname;\n // fire listeners\n member.setMembershipEvent(inviteEvent, room.currentState);\n }, function(err) {\n // OH WELL.\n });\n });\n }\n\n /**\n * @param {Room} room\n * @param {MatrixEvent[]} stateEventList A list of state events. This is the state\n * at the *START* of the timeline list if it is supplied.\n * @param {MatrixEvent[]} [timelineEventList] A list of timeline events. Lower index\n * @param {boolean} fromCache whether the sync response came from cache\n * is earlier in time. Higher index is later.\n */\n private processRoomEvents(\n room: Room,\n stateEventList: MatrixEvent[],\n timelineEventList?: MatrixEvent[],\n fromCache = false,\n ): void {\n // If there are no events in the timeline yet, initialise it with\n // the given state events\n const liveTimeline = room.getLiveTimeline();\n const timelineWasEmpty = liveTimeline.getEvents().length == 0;\n if (timelineWasEmpty) {\n // Passing these events into initialiseState will freeze them, so we need\n // to compute and cache the push actions for them now, otherwise sync dies\n // with an attempt to assign to read only property.\n // XXX: This is pretty horrible and is assuming all sorts of behaviour from\n // these functions that it shouldn't be. We should probably either store the\n // push actions cache elsewhere so we can freeze MatrixEvents, or otherwise\n // find some solution where MatrixEvents are immutable but allow for a cache\n // field.\n for (const ev of stateEventList) {\n this.client.getPushActionsForEvent(ev);\n }\n liveTimeline.initialiseState(stateEventList);\n }\n\n this.resolveInvites(room);\n\n // recalculate the room name at this point as adding events to the timeline\n // may make notifications appear which should have the right name.\n // XXX: This looks suspect: we'll end up recalculating the room once here\n // and then again after adding events (processSyncResponse calls it after\n // calling us) even if no state events were added. It also means that if\n // one of the room events in timelineEventList is something that needs\n // a recalculation (like m.room.name) we won't recalculate until we've\n // finished adding all the events, which will cause the notification to have\n // the old room name rather than the new one.\n room.recalculate();\n\n // If the timeline wasn't empty, we process the state events here: they're\n // defined as updates to the state before the start of the timeline, so this\n // starts to roll the state forward.\n // XXX: That's what we *should* do, but this can happen if we were previously\n // peeking in a room, in which case we obviously do *not* want to add the\n // state events here onto the end of the timeline. Historically, the js-sdk\n // has just set these new state events on the old and new state. This seems\n // very wrong because there could be events in the timeline that diverge the\n // state, in which case this is going to leave things out of sync. However,\n // for now I think it;s best to behave the same as the code has done previously.\n if (!timelineWasEmpty) {\n // XXX: As above, don't do this...\n //room.addLiveEvents(stateEventList || []);\n // Do this instead...\n room.oldState.setStateEvents(stateEventList || []);\n room.currentState.setStateEvents(stateEventList || []);\n }\n // execute the timeline events. This will continue to diverge the current state\n // if the timeline has any state events in it.\n // This also needs to be done before running push rules on the events as they need\n // to be decorated with sender etc.\n room.addLiveEvents(timelineEventList || [], null, fromCache);\n }\n\n /**\n * @experimental\n */\n private processThreadEvents(room: Room, threadedEvents: MatrixEvent[]): void {\n threadedEvents.forEach(event => {\n room.addThreadedEvent(event);\n });\n }\n\n /**\n * Takes a list of timelineEvents and adds and adds to notifEvents\n * as appropriate.\n * This must be called after the room the events belong to has been stored.\n *\n * @param {Room} room\n * @param {MatrixEvent[]} [timelineEventList] A list of timeline events. Lower index\n * is earlier in time. Higher index is later.\n */\n private processEventsForNotifs(room: Room, timelineEventList: MatrixEvent[]): void {\n // gather our notifications into this.notifEvents\n if (this.client.getNotifTimelineSet()) {\n for (let i = 0; i < timelineEventList.length; i++) {\n const pushActions = this.client.getPushActionsForEvent(timelineEventList[i]);\n if (pushActions && pushActions.notify &&\n pushActions.tweaks && pushActions.tweaks.highlight) {\n this.notifEvents.push(timelineEventList[i]);\n }\n }\n }\n }\n\n /**\n * @return {string}\n */\n private getGuestFilter(): string {\n // Dev note: This used to be conditional to return a filter of 20 events maximum, but\n // the condition never went to the other branch. This is now hardcoded.\n return \"{}\";\n }\n\n /**\n * Sets the sync state and emits an event to say so\n * @param {String} newState The new state string\n * @param {Object} data Object of additional data to emit in the event\n */\n private updateSyncState(newState: SyncState, data?: ISyncStateData): void {\n const old = this.syncState;\n this.syncState = newState;\n this.syncStateData = data;\n this.client.emit(\"sync\", this.syncState, old, data);\n }\n\n /**\n * Event handler for the 'online' event\n * This event is generally unreliable and precise behaviour\n * varies between browsers, so we poll for connectivity too,\n * but this might help us reconnect a little faster.\n */\n private onOnline = (): void => {\n debuglog(\"Browser thinks we are back online\");\n this.startKeepAlives(0);\n };\n}\n\nfunction createNewUser(client: MatrixClient, userId: string): User {\n const user = new User(userId);\n client.reEmitter.reEmit(user, [\n \"User.avatarUrl\", \"User.displayName\", \"User.presence\",\n \"User.currentlyActive\", \"User.lastPresenceTs\",\n ]);\n return user;\n}\n\n", "/*\nCopyright 2016 - 2021 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n/** @module timeline-window */\n\nimport { Direction, EventTimeline } from './models/event-timeline';\nimport { logger } from './logger';\nimport { MatrixClient } from \"./client\";\nimport { EventTimelineSet } from \"./models/event-timeline-set\";\nimport { MatrixEvent } from \"./models/event\";\n\n/**\n * @private\n */\nconst DEBUG = false;\n\n/**\n * @private\n */\nconst debuglog = DEBUG ? logger.log.bind(logger) : function() {};\n\n/**\n * the number of times we ask the server for more events before giving up\n *\n * @private\n */\nconst DEFAULT_PAGINATE_LOOP_LIMIT = 5;\n\ninterface IOpts {\n windowLimit?: number;\n}\n\nexport class TimelineWindow {\n private readonly windowLimit: number;\n // these will be TimelineIndex objects; they delineate the 'start' and\n // 'end' of the window.\n //\n // start.index is inclusive; end.index is exclusive.\n private start?: TimelineIndex = null;\n private end?: TimelineIndex = null;\n private eventCount = 0;\n\n /**\n * Construct a TimelineWindow.\n *\n *

This abstracts the separate timelines in a Matrix {@link\n * module:models/room|Room} into a single iterable thing. It keeps track of\n * the start and endpoints of the window, which can be advanced with the help\n * of pagination requests.\n *\n *

Before the window is useful, it must be initialised by calling {@link\n * module:timeline-window~TimelineWindow#load|load}.\n *\n *

Note that the window will not automatically extend itself when new events\n * are received from /sync; you should arrange to call {@link\n * module:timeline-window~TimelineWindow#paginate|paginate} on {@link\n * module:client~MatrixClient.event:\"Room.timeline\"|Room.timeline} events.\n *\n * @param {MatrixClient} client MatrixClient to be used for context/pagination\n * requests.\n *\n * @param {EventTimelineSet} timelineSet The timelineSet to track\n *\n * @param {Object} [opts] Configuration options for this window\n *\n * @param {number} [opts.windowLimit = 1000] maximum number of events to keep\n * in the window. If more events are retrieved via pagination requests,\n * excess events will be dropped from the other end of the window.\n *\n * @constructor\n */\n constructor(\n private readonly client: MatrixClient,\n private readonly timelineSet: EventTimelineSet,\n opts: IOpts = {},\n ) {\n this.windowLimit = opts.windowLimit || 1000;\n }\n\n /**\n * Initialise the window to point at a given event, or the live timeline\n *\n * @param {string} [initialEventId] If given, the window will contain the\n * given event\n * @param {number} [initialWindowSize = 20] Size of the initial window\n *\n * @return {Promise}\n */\n public load(initialEventId: string, initialWindowSize = 20): Promise {\n // given an EventTimeline, find the event we were looking for, and initialise our\n // fields so that the event in question is in the middle of the window.\n const initFields = (timeline: EventTimeline) => {\n let eventIndex;\n\n const events = timeline.getEvents();\n\n if (!initialEventId) {\n // we were looking for the live timeline: initialise to the end\n eventIndex = events.length;\n } else {\n for (let i = 0; i < events.length; i++) {\n if (events[i].getId() == initialEventId) {\n eventIndex = i;\n break;\n }\n }\n\n if (eventIndex === undefined) {\n throw new Error(\"getEventTimeline result didn't include requested event\");\n }\n }\n\n const endIndex = Math.min(events.length,\n eventIndex + Math.ceil(initialWindowSize / 2));\n const startIndex = Math.max(0, endIndex - initialWindowSize);\n this.start = new TimelineIndex(timeline, startIndex - timeline.getBaseIndex());\n this.end = new TimelineIndex(timeline, endIndex - timeline.getBaseIndex());\n this.eventCount = endIndex - startIndex;\n };\n\n // We avoid delaying the resolution of the promise by a reactor tick if\n // we already have the data we need, which is important to keep room-switching\n // feeling snappy.\n //\n if (initialEventId) {\n const timeline = this.timelineSet.getTimelineForEvent(initialEventId);\n if (timeline) {\n // hot-path optimization to save a reactor tick by replicating the sync check getTimelineForEvent does.\n initFields(timeline);\n return Promise.resolve(timeline);\n }\n\n const prom = this.client.getEventTimeline(this.timelineSet, initialEventId);\n return prom.then(initFields);\n } else {\n const tl = this.timelineSet.getLiveTimeline();\n initFields(tl);\n return Promise.resolve();\n }\n }\n\n /**\n * Get the TimelineIndex of the window in the given direction.\n *\n * @param {string} direction EventTimeline.BACKWARDS to get the TimelineIndex\n * at the start of the window; EventTimeline.FORWARDS to get the TimelineIndex at\n * the end.\n *\n * @return {TimelineIndex} The requested timeline index if one exists, null\n * otherwise.\n */\n public getTimelineIndex(direction: Direction): TimelineIndex {\n if (direction == EventTimeline.BACKWARDS) {\n return this.start;\n } else if (direction == EventTimeline.FORWARDS) {\n return this.end;\n } else {\n throw new Error(\"Invalid direction '\" + direction + \"'\");\n }\n }\n\n /**\n * Try to extend the window using events that are already in the underlying\n * TimelineIndex.\n *\n * @param {string} direction EventTimeline.BACKWARDS to try extending it\n * backwards; EventTimeline.FORWARDS to try extending it forwards.\n * @param {number} size number of events to try to extend by.\n *\n * @return {boolean} true if the window was extended, false otherwise.\n */\n public extend(direction: Direction, size: number): boolean {\n const tl = this.getTimelineIndex(direction);\n\n if (!tl) {\n debuglog(\"TimelineWindow: no timeline yet\");\n return false;\n }\n\n const count = (direction == EventTimeline.BACKWARDS) ?\n tl.retreat(size) : tl.advance(size);\n\n if (count) {\n this.eventCount += count;\n debuglog(\"TimelineWindow: increased cap by \" + count +\n \" (now \" + this.eventCount + \")\");\n // remove some events from the other end, if necessary\n const excess = this.eventCount - this.windowLimit;\n if (excess > 0) {\n this.unpaginate(excess, direction != EventTimeline.BACKWARDS);\n }\n return true;\n }\n\n return false;\n }\n\n /**\n * Check if this window can be extended\n *\n *

This returns true if we either have more events, or if we have a\n * pagination token which means we can paginate in that direction. It does not\n * necessarily mean that there are more events available in that direction at\n * this time.\n *\n * @param {string} direction EventTimeline.BACKWARDS to check if we can\n * paginate backwards; EventTimeline.FORWARDS to check if we can go forwards\n *\n * @return {boolean} true if we can paginate in the given direction\n */\n public canPaginate(direction: Direction): boolean {\n const tl = this.getTimelineIndex(direction);\n\n if (!tl) {\n debuglog(\"TimelineWindow: no timeline yet\");\n return false;\n }\n\n if (direction == EventTimeline.BACKWARDS) {\n if (tl.index > tl.minIndex()) {\n return true;\n }\n } else {\n if (tl.index < tl.maxIndex()) {\n return true;\n }\n }\n\n return Boolean(tl.timeline.getNeighbouringTimeline(direction) ||\n tl.timeline.getPaginationToken(direction));\n }\n\n /**\n * Attempt to extend the window\n *\n * @param {string} direction EventTimeline.BACKWARDS to extend the window\n * backwards (towards older events); EventTimeline.FORWARDS to go forwards.\n *\n * @param {number} size number of events to try to extend by. If fewer than this\n * number are immediately available, then we return immediately rather than\n * making an API call.\n *\n * @param {boolean} [makeRequest = true] whether we should make API calls to\n * fetch further events if we don't have any at all. (This has no effect if\n * the room already knows about additional events in the relevant direction,\n * even if there are fewer than 'size' of them, as we will just return those\n * we already know about.)\n *\n * @param {number} [requestLimit = 5] limit for the number of API requests we\n * should make.\n *\n * @return {Promise} Resolves to a boolean which is true if more events\n * were successfully retrieved.\n */\n public paginate(\n direction: Direction,\n size: number,\n makeRequest = true,\n requestLimit = DEFAULT_PAGINATE_LOOP_LIMIT,\n ): Promise {\n // Either wind back the message cap (if there are enough events in the\n // timeline to do so), or fire off a pagination request.\n const tl = this.getTimelineIndex(direction);\n\n if (!tl) {\n debuglog(\"TimelineWindow: no timeline yet\");\n return Promise.resolve(false);\n }\n\n if (tl.pendingPaginate) {\n return tl.pendingPaginate;\n }\n\n // try moving the cap\n if (this.extend(direction, size)) {\n return Promise.resolve(true);\n }\n\n if (!makeRequest || requestLimit === 0) {\n // todo: should we return something different to indicate that there\n // might be more events out there, but we haven't found them yet?\n return Promise.resolve(false);\n }\n\n // try making a pagination request\n const token = tl.timeline.getPaginationToken(direction);\n if (!token) {\n debuglog(\"TimelineWindow: no token\");\n return Promise.resolve(false);\n }\n\n debuglog(\"TimelineWindow: starting request\");\n\n const prom = this.client.paginateEventTimeline(tl.timeline, {\n backwards: direction == EventTimeline.BACKWARDS,\n limit: size,\n }).finally(function() {\n tl.pendingPaginate = null;\n }).then((r) => {\n debuglog(\"TimelineWindow: request completed with result \" + r);\n if (!r) {\n // end of timeline\n return false;\n }\n\n // recurse to advance the index into the results.\n //\n // If we don't get any new events, we want to make sure we keep asking\n // the server for events for as long as we have a valid pagination\n // token. In particular, we want to know if we've actually hit the\n // start of the timeline, or if we just happened to know about all of\n // the events thanks to https://matrix.org/jira/browse/SYN-645.\n //\n // On the other hand, we necessarily want to wait forever for the\n // server to make its mind up about whether there are other events,\n // because it gives a bad user experience\n // (https://github.com/vector-im/vector-web/issues/1204).\n return this.paginate(direction, size, true, requestLimit - 1);\n });\n tl.pendingPaginate = prom;\n return prom;\n }\n\n /**\n * Remove `delta` events from the start or end of the timeline.\n *\n * @param {number} delta number of events to remove from the timeline\n * @param {boolean} startOfTimeline if events should be removed from the start\n * of the timeline.\n */\n public unpaginate(delta: number, startOfTimeline: boolean): void {\n const tl = startOfTimeline ? this.start : this.end;\n\n // sanity-check the delta\n if (delta > this.eventCount || delta < 0) {\n throw new Error(\"Attemting to unpaginate \" + delta + \" events, but \" +\n \"only have \" + this.eventCount + \" in the timeline\");\n }\n\n while (delta > 0) {\n const count = startOfTimeline ? tl.advance(delta) : tl.retreat(delta);\n if (count <= 0) {\n // sadness. This shouldn't be possible.\n throw new Error(\n \"Unable to unpaginate any further, but still have \" +\n this.eventCount + \" events\");\n }\n\n delta -= count;\n this.eventCount -= count;\n debuglog(\"TimelineWindow.unpaginate: dropped \" + count +\n \" (now \" + this.eventCount + \")\");\n }\n }\n\n /**\n * Get a list of the events currently in the window\n *\n * @return {MatrixEvent[]} the events in the window\n */\n public getEvents(): MatrixEvent[] {\n if (!this.start) {\n // not yet loaded\n return [];\n }\n\n const result = [];\n\n // iterate through each timeline between this.start and this.end\n // (inclusive).\n let timeline = this.start.timeline;\n // eslint-disable-next-line no-constant-condition\n while (true) {\n const events = timeline.getEvents();\n\n // For the first timeline in the chain, we want to start at\n // this.start.index. For the last timeline in the chain, we want to\n // stop before this.end.index. Otherwise, we want to copy all of the\n // events in the timeline.\n //\n // (Note that both this.start.index and this.end.index are relative\n // to their respective timelines' BaseIndex).\n //\n let startIndex = 0;\n let endIndex = events.length;\n if (timeline === this.start.timeline) {\n startIndex = this.start.index + timeline.getBaseIndex();\n }\n if (timeline === this.end.timeline) {\n endIndex = this.end.index + timeline.getBaseIndex();\n }\n\n for (let i = startIndex; i < endIndex; i++) {\n result.push(events[i]);\n }\n\n // if we're not done, iterate to the next timeline.\n if (timeline === this.end.timeline) {\n break;\n } else {\n timeline = timeline.getNeighbouringTimeline(EventTimeline.FORWARDS);\n }\n }\n\n return result;\n }\n}\n\n/**\n * a thing which contains a timeline reference, and an index into it.\n *\n * @constructor\n * @param {EventTimeline} timeline\n * @param {number} index\n * @private\n */\nexport class TimelineIndex {\n public pendingPaginate?: Promise;\n\n // index: the indexes are relative to BaseIndex, so could well be negative.\n constructor(public timeline: EventTimeline, public index: number) {}\n\n /**\n * @return {number} the minimum possible value for the index in the current\n * timeline\n */\n public minIndex(): number {\n return this.timeline.getBaseIndex() * -1;\n }\n\n /**\n * @return {number} the maximum possible value for the index in the current\n * timeline (exclusive - ie, it actually returns one more than the index\n * of the last element).\n */\n public maxIndex(): number {\n return this.timeline.getEvents().length - this.timeline.getBaseIndex();\n }\n\n /**\n * Try move the index forward, or into the neighbouring timeline\n *\n * @param {number} delta number of events to advance by\n * @return {number} number of events successfully advanced by\n */\n public advance(delta: number): number {\n if (!delta) {\n return 0;\n }\n\n // first try moving the index in the current timeline. See if there is room\n // to do so.\n let cappedDelta;\n if (delta < 0) {\n // we want to wind the index backwards.\n //\n // (this.minIndex() - this.index) is a negative number whose magnitude\n // is the amount of room we have to wind back the index in the current\n // timeline. We cap delta to this quantity.\n cappedDelta = Math.max(delta, this.minIndex() - this.index);\n if (cappedDelta < 0) {\n this.index += cappedDelta;\n return cappedDelta;\n }\n } else {\n // we want to wind the index forwards.\n //\n // (this.maxIndex() - this.index) is a (positive) number whose magnitude\n // is the amount of room we have to wind forward the index in the current\n // timeline. We cap delta to this quantity.\n cappedDelta = Math.min(delta, this.maxIndex() - this.index);\n if (cappedDelta > 0) {\n this.index += cappedDelta;\n return cappedDelta;\n }\n }\n\n // the index is already at the start/end of the current timeline.\n //\n // next see if there is a neighbouring timeline to switch to.\n const neighbour = this.timeline.getNeighbouringTimeline(\n delta < 0 ? EventTimeline.BACKWARDS : EventTimeline.FORWARDS);\n if (neighbour) {\n this.timeline = neighbour;\n if (delta < 0) {\n this.index = this.maxIndex();\n } else {\n this.index = this.minIndex();\n }\n\n debuglog(\"paginate: switched to new neighbour\");\n\n // recurse, using the next timeline\n return this.advance(delta);\n }\n\n return 0;\n }\n\n /**\n * Try move the index backwards, or into the neighbouring timeline\n *\n * @param {number} delta number of events to retreat by\n * @return {number} number of events successfully retreated by\n */\n public retreat(delta: number): number {\n return this.advance(delta * -1) * -1;\n }\n}\n", - "/*\nCopyright 2015, 2016 OpenMarket Ltd\nCopyright 2019 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n/**\n * This is an internal module.\n * @module utils\n */\n\nimport unhomoglyph from \"unhomoglyph\";\nimport promiseRetry from \"p-retry\";\nimport type NodeCrypto from \"crypto\";\n\n/**\n * Encode a dictionary of query parameters.\n * @param {Object} params A dict of key/values to encode e.g.\n * {\"foo\": \"bar\", \"baz\": \"taz\"}\n * @return {string} The encoded string e.g. foo=bar&baz=taz\n */\nexport function encodeParams(params: Record): string {\n return new URLSearchParams(params).toString();\n}\n\nexport type QueryDict = Record;\n\n/**\n * Decode a query string in `application/x-www-form-urlencoded` format.\n * @param {string} query A query string to decode e.g.\n * foo=bar&via=server1&server2\n * @return {Object} The decoded object, if any keys occurred multiple times\n * then the value will be an array of strings, else it will be an array.\n * This behaviour matches Node's qs.parse but is built on URLSearchParams\n * for native web compatibility\n */\nexport function decodeParams(query: string): QueryDict {\n const o: QueryDict = {};\n const params = new URLSearchParams(query);\n for (const key of params.keys()) {\n const val = params.getAll(key);\n o[key] = val.length === 1 ? val[0] : val;\n }\n return o;\n}\n\n/**\n * Encodes a URI according to a set of template variables. Variables will be\n * passed through encodeURIComponent.\n * @param {string} pathTemplate The path with template variables e.g. '/foo/$bar'.\n * @param {Object} variables The key/value pairs to replace the template\n * variables with. E.g. { \"$bar\": \"baz\" }.\n * @return {string} The result of replacing all template variables e.g. '/foo/baz'.\n */\nexport function encodeUri(pathTemplate: string,\n variables: Record): string {\n for (const key in variables) {\n if (!variables.hasOwnProperty(key)) {\n continue;\n }\n pathTemplate = pathTemplate.replace(\n key, encodeURIComponent(variables[key]),\n );\n }\n return pathTemplate;\n}\n\n/**\n * The removeElement() method removes the first element in the array that\n * satisfies (returns true) the provided testing function.\n * @param {Array} array The array.\n * @param {Function} fn Function to execute on each value in the array, with the\n * function signature fn(element, index, array). Return true to\n * remove this element and break.\n * @param {boolean} reverse True to search in reverse order.\n * @return {boolean} True if an element was removed.\n */\nexport function removeElement(\n array: T[],\n fn: (t: T, i?: number, a?: T[]) => boolean,\n reverse?: boolean,\n) {\n let i;\n let removed;\n if (reverse) {\n for (i = array.length - 1; i >= 0; i--) {\n if (fn(array[i], i, array)) {\n removed = array[i];\n array.splice(i, 1);\n return removed;\n }\n }\n } else {\n for (i = 0; i < array.length; i++) {\n if (fn(array[i], i, array)) {\n removed = array[i];\n array.splice(i, 1);\n return removed;\n }\n }\n }\n return false;\n}\n\n/**\n * Checks if the given thing is a function.\n * @param {*} value The thing to check.\n * @return {boolean} True if it is a function.\n */\nexport function isFunction(value: any) {\n return Object.prototype.toString.call(value) === \"[object Function]\";\n}\n\n/**\n * Checks that the given object has the specified keys.\n * @param {Object} obj The object to check.\n * @param {string[]} keys The list of keys that 'obj' must have.\n * @throws If the object is missing keys.\n */\n// note using 'keys' here would shadow the 'keys' function defined above\nexport function checkObjectHasKeys(obj: object, keys: string[]) {\n for (let i = 0; i < keys.length; i++) {\n if (!obj.hasOwnProperty(keys[i])) {\n throw new Error(\"Missing required key: \" + keys[i]);\n }\n }\n}\n\n/**\n * Checks that the given object has no extra keys other than the specified ones.\n * @param {Object} obj The object to check.\n * @param {string[]} allowedKeys The list of allowed key names.\n * @throws If there are extra keys.\n */\nexport function checkObjectHasNoAdditionalKeys(obj: object, allowedKeys: string[]): void {\n for (const key in obj) {\n if (!obj.hasOwnProperty(key)) {\n continue;\n }\n if (allowedKeys.indexOf(key) === -1) {\n throw new Error(\"Unknown key: \" + key);\n }\n }\n}\n\n/**\n * Deep copy the given object. The object MUST NOT have circular references and\n * MUST NOT have functions.\n * @param {Object} obj The object to deep copy.\n * @return {Object} A copy of the object without any references to the original.\n */\nexport function deepCopy(obj: T): T {\n return JSON.parse(JSON.stringify(obj));\n}\n\n/**\n * Compare two objects for equality. The objects MUST NOT have circular references.\n *\n * @param {Object} x The first object to compare.\n * @param {Object} y The second object to compare.\n *\n * @return {boolean} true if the two objects are equal\n */\nexport function deepCompare(x: any, y: any): boolean {\n // Inspired by\n // http://stackoverflow.com/questions/1068834/object-comparison-in-javascript#1144249\n\n // Compare primitives and functions.\n // Also check if both arguments link to the same object.\n if (x === y) {\n return true;\n }\n\n if (typeof x !== typeof y) {\n return false;\n }\n\n // special-case NaN (since NaN !== NaN)\n if (typeof x === 'number' && isNaN(x) && isNaN(y)) {\n return true;\n }\n\n // special-case null (since typeof null == 'object', but null.constructor\n // throws)\n if (x === null || y === null) {\n return x === y;\n }\n\n // everything else is either an unequal primitive, or an object\n if (!(x instanceof Object)) {\n return false;\n }\n\n // check they are the same type of object\n if (x.constructor !== y.constructor || x.prototype !== y.prototype) {\n return false;\n }\n\n // special-casing for some special types of object\n if (x instanceof RegExp || x instanceof Date) {\n return x.toString() === y.toString();\n }\n\n // the object algorithm works for Array, but it's sub-optimal.\n if (x instanceof Array) {\n if (x.length !== y.length) {\n return false;\n }\n\n for (let i = 0; i < x.length; i++) {\n if (!deepCompare(x[i], y[i])) {\n return false;\n }\n }\n } else {\n // disable jshint \"The body of a for in should be wrapped in an if\n // statement\"\n /* jshint -W089 */\n\n // check that all of y's direct keys are in x\n let p;\n for (p in y) {\n if (y.hasOwnProperty(p) !== x.hasOwnProperty(p)) {\n return false;\n }\n }\n\n // finally, compare each of x's keys with y\n for (p in y) { // eslint-disable-line guard-for-in\n if (y.hasOwnProperty(p) !== x.hasOwnProperty(p)) {\n return false;\n }\n if (!deepCompare(x[p], y[p])) {\n return false;\n }\n }\n }\n /* jshint +W089 */\n return true;\n}\n\n// Dev note: This returns a tuple, but jsdoc doesn't like that. https://github.com/jsdoc/jsdoc/issues/1703\n/**\n * Creates an array of object properties/values (entries) then\n * sorts the result by key, recursively. The input object must\n * ensure it does not have loops. If the input is not an object\n * then it will be returned as-is.\n * @param {*} obj The object to get entries of\n * @returns {Array} The entries, sorted by key.\n */\nexport function deepSortedObjectEntries(obj: any): [string, any][] {\n if (typeof(obj) !== \"object\") return obj;\n\n // Apparently these are object types...\n if (obj === null || obj === undefined || Array.isArray(obj)) return obj;\n\n const pairs: [string, any][] = [];\n for (const [k, v] of Object.entries(obj)) {\n pairs.push([k, deepSortedObjectEntries(v)]);\n }\n\n // lexicographicCompare is faster than localeCompare, so let's use that.\n pairs.sort((a, b) => lexicographicCompare(a[0], b[0]));\n\n return pairs;\n}\n\n/**\n * Copy properties from one object to another.\n *\n * All enumerable properties, included inherited ones, are copied.\n *\n * This is approximately equivalent to ES6's Object.assign, except\n * that the latter doesn't copy inherited properties.\n *\n * @param {Object} target The object that will receive new properties\n * @param {...Object} source Objects from which to copy properties\n *\n * @return {Object} target\n */\nexport function extend(...restParams) {\n const target = restParams[0] || {};\n for (let i = 1; i < restParams.length; i++) {\n const source = restParams[i];\n if (!source) continue;\n for (const propName in source) { // eslint-disable-line guard-for-in\n target[propName] = source[propName];\n }\n }\n return target;\n}\n\n/**\n * Inherit the prototype methods from one constructor into another. This is a\n * port of the Node.js implementation with an Object.create polyfill.\n *\n * @param {function} ctor Constructor function which needs to inherit the\n * prototype.\n * @param {function} superCtor Constructor function to inherit prototype from.\n */\nexport function inherits(ctor: Function, superCtor: Function) {\n // Add util.inherits from Node.js\n // Source:\n // https://github.com/joyent/node/blob/master/lib/util.js\n // Copyright Joyent, Inc. and other Node contributors.\n //\n // Permission is hereby granted, free of charge, to any person obtaining a\n // copy of this software and associated documentation files (the\n // \"Software\"), to deal in the Software without restriction, including\n // without limitation the rights to use, copy, modify, merge, publish,\n // distribute, sublicense, and/or sell copies of the Software, and to permit\n // persons to whom the Software is furnished to do so, subject to the\n // following conditions:\n //\n // The above copyright notice and this permission notice shall be included\n // in all copies or substantial portions of the Software.\n //\n // THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n // USE OR OTHER DEALINGS IN THE SOFTWARE.\n (ctor as any).super_ = superCtor;\n ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: false,\n writable: true,\n configurable: true,\n },\n });\n}\n\n/**\n * Polyfills inheritance for prototypes by allowing different kinds of\n * super types. Typically prototypes would use `SuperType.call(this, params)`\n * though this doesn't always work in some environments - this function\n * falls back to using `Object.assign()` to clone a constructed copy\n * of the super type onto `thisArg`.\n * @param {any} thisArg The child instance. Modified in place.\n * @param {any} SuperType The type to act as a super instance\n * @param {any} params Arguments to supply to the super type's constructor\n */\nexport function polyfillSuper(thisArg: any, SuperType: any, ...params: any[]) {\n try {\n SuperType.call(thisArg, ...params);\n } catch (e) {\n // fall back to Object.assign to just clone the thing\n const fakeSuper = new SuperType(...params);\n Object.assign(thisArg, fakeSuper);\n }\n}\n\n/**\n * Returns whether the given value is a finite number without type-coercion\n *\n * @param {*} value the value to test\n * @return {boolean} whether or not value is a finite number without type-coercion\n */\nexport function isNumber(value: any): boolean {\n return typeof value === 'number' && isFinite(value);\n}\n\n/**\n * Removes zero width chars, diacritics and whitespace from the string\n * Also applies an unhomoglyph on the string, to prevent similar looking chars\n * @param {string} str the string to remove hidden characters from\n * @return {string} a string with the hidden characters removed\n */\nexport function removeHiddenChars(str: string): string {\n if (typeof str === \"string\") {\n return unhomoglyph(str.normalize('NFD').replace(removeHiddenCharsRegex, ''));\n }\n return \"\";\n}\n\nexport function normalize(str: string): string {\n // Note: we have to match the filter with the removeHiddenChars() because the\n // function strips spaces and other characters (M becomes RN for example, in lowercase).\n return removeHiddenChars(str.toLowerCase())\n // Strip all punctuation\n .replace(/[\\\\'!\"#$%&()*+,\\-./:;<=>?@[\\]^_`{|}~\\u2000-\\u206f\\u2e00-\\u2e7f]/g, \"\")\n // We also doubly convert to lowercase to work around oddities of the library.\n .toLowerCase();\n}\n\n// Regex matching bunch of unicode control characters and otherwise misleading/invisible characters.\n// Includes:\n// various width spaces U+2000 - U+200D\n// LTR and RTL marks U+200E and U+200F\n// LTR/RTL and other directional formatting marks U+202A - U+202F\n// Arabic Letter RTL mark U+061C\n// Combining characters U+0300 - U+036F\n// Zero width no-break space (BOM) U+FEFF\n// eslint-disable-next-line no-misleading-character-class\nconst removeHiddenCharsRegex = /[\\u2000-\\u200F\\u202A-\\u202F\\u0300-\\u036F\\uFEFF\\u061C\\s]/g;\n\nexport function escapeRegExp(string: string): string {\n return string.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n}\n\nexport function globToRegexp(glob: string, extended: any): string {\n extended = typeof(extended) === 'boolean' ? extended : true;\n // From\n // https://github.com/matrix-org/synapse/blob/abbee6b29be80a77e05730707602f3bbfc3f38cb/synapse/push/__init__.py#L132\n // Because micromatch is about 130KB with dependencies,\n // and minimatch is not much better.\n let pat = escapeRegExp(glob);\n pat = pat.replace(/\\\\\\*/g, '.*');\n pat = pat.replace(/\\?/g, '.');\n if (extended) {\n pat = pat.replace(/\\\\\\[(!|)(.*)\\\\]/g, function(match, p1, p2, offset, string) {\n const first = p1 && '^' || '';\n const second = p2.replace(/\\\\-/, '-');\n return '[' + first + second + ']';\n });\n }\n return pat;\n}\n\nexport function ensureNoTrailingSlash(url: string): string {\n if (url && url.endsWith(\"/\")) {\n return url.substr(0, url.length - 1);\n } else {\n return url;\n }\n}\n\n// Returns a promise which resolves with a given value after the given number of ms\nexport function sleep(ms: number, value?: T): Promise {\n return new Promise((resolve => {\n setTimeout(resolve, ms, value);\n }));\n}\n\nexport function isNullOrUndefined(val: any): boolean {\n return val === null || val === undefined;\n}\n\nexport interface IDeferred {\n resolve: (value: T) => void;\n reject: (reason?: any) => void;\n promise: Promise;\n}\n\n// Returns a Deferred\nexport function defer(): IDeferred {\n let resolve;\n let reject;\n\n const promise = new Promise((_resolve, _reject) => {\n resolve = _resolve;\n reject = _reject;\n });\n\n return { resolve, reject, promise };\n}\n\nexport async function promiseMapSeries(\n promises: T[],\n fn: (t: T) => void,\n): Promise {\n for (const o of promises) {\n await fn(await o);\n }\n}\n\nexport function promiseTry(fn: () => T | Promise): Promise {\n return new Promise((resolve) => resolve(fn()));\n}\n\n// Creates and awaits all promises, running no more than `chunkSize` at the same time\nexport async function chunkPromises(fns: (() => Promise)[], chunkSize: number): Promise {\n const results: T[] = [];\n for (let i = 0; i < fns.length; i += chunkSize) {\n results.push(...(await Promise.all(fns.slice(i, i + chunkSize).map(fn => fn()))));\n }\n return results;\n}\n\n/**\n * Retries the function until it succeeds or is interrupted. The given function must return\n * a promise which throws/rejects on error, otherwise the retry will assume the request\n * succeeded. The promise chain returned will contain the successful promise. The given function\n * should always return a new promise.\n * @param {Function} promiseFn The function to call to get a fresh promise instance. Takes an\n * attempt count as an argument, for logging/debugging purposes.\n * @returns {Promise} The promise for the retried operation.\n */\nexport function simpleRetryOperation(promiseFn: (attempt: number) => Promise): Promise {\n return promiseRetry((attempt: number) => {\n return promiseFn(attempt);\n }, {\n forever: true,\n factor: 2,\n minTimeout: 3000, // ms\n maxTimeout: 15000, // ms\n });\n}\n\n// We need to be able to access the Node.js crypto library from within the\n// Matrix SDK without needing to `require(\"crypto\")`, which will fail in\n// browsers. So `index.ts` will call `setCrypto` to store it, and when we need\n// it, we can call `getCrypto`.\nlet crypto: typeof NodeCrypto;\n\nexport function setCrypto(c: typeof NodeCrypto) {\n crypto = c;\n}\n\nexport function getCrypto(): typeof NodeCrypto {\n return crypto;\n}\n\n// String averaging inspired by https://stackoverflow.com/a/2510816\n// Dev note: We make the alphabet a string because it's easier to write syntactically\n// than arrays. Thankfully, strings implement the useful parts of the Array interface\n// anyhow.\n\n/**\n * The default alphabet used by string averaging in this SDK. This matches\n * all usefully printable ASCII characters (0x20-0x7E, inclusive).\n */\nexport const DEFAULT_ALPHABET = (() => {\n let str = \"\";\n for (let c = 0x20; c <= 0x7E; c++) {\n str += String.fromCharCode(c);\n }\n return str;\n})();\n\n/**\n * Pads a string using the given alphabet as a base. The returned string will be\n * padded at the end with the first character in the alphabet.\n *\n * This is intended for use with string averaging.\n * @param {string} s The string to pad.\n * @param {number} n The length to pad to.\n * @param {string} alphabet The alphabet to use as a single string.\n * @returns {string} The padded string.\n */\nexport function alphabetPad(s: string, n: number, alphabet = DEFAULT_ALPHABET): string {\n return s.padEnd(n, alphabet[0]);\n}\n\n/**\n * Converts a baseN number to a string, where N is the alphabet's length.\n *\n * This is intended for use with string averaging.\n * @param {bigint} n The baseN number.\n * @param {string} alphabet The alphabet to use as a single string.\n * @returns {string} The baseN number encoded as a string from the alphabet.\n */\nexport function baseToString(n: bigint, alphabet = DEFAULT_ALPHABET): string {\n // Developer note: the stringToBase() function offsets the character set by 1 so that repeated\n // characters (ie: \"aaaaaa\" in a..z) don't come out as zero. We have to reverse this here as\n // otherwise we'll be wrong in our conversion. Undoing a +1 before an exponent isn't very fun\n // though, so we rely on a lengthy amount of `x - 1` and integer division rules to reach a\n // sane state. This also means we have to do rollover detection: see below.\n\n const len = BigInt(alphabet.length);\n if (n <= len) {\n return alphabet[Number(n) - 1] ?? \"\";\n }\n\n let d = n / len;\n let r = Number(n % len) - 1;\n\n // Rollover detection: if the remainder is negative, it means that the string needs\n // to roll over by 1 character downwards (ie: in a..z, the previous to \"aaa\" would be\n // \"zz\").\n if (r < 0) {\n d -= BigInt(Math.abs(r)); // abs() is just to be clear what we're doing. Could also `+= r`.\n r = Number(len) - 1;\n }\n\n return baseToString(d, alphabet) + alphabet[r];\n}\n\n/**\n * Converts a string to a baseN number, where N is the alphabet's length.\n *\n * This is intended for use with string averaging.\n * @param {string} s The string to convert to a number.\n * @param {string} alphabet The alphabet to use as a single string.\n * @returns {bigint} The baseN number.\n */\nexport function stringToBase(s: string, alphabet = DEFAULT_ALPHABET): bigint {\n const len = BigInt(alphabet.length);\n\n // In our conversion to baseN we do a couple performance optimizations to avoid using\n // excess CPU and such. To create baseN numbers, the input string needs to be reversed\n // so the exponents stack up appropriately, as the last character in the unreversed\n // string has less impact than the first character (in \"abc\" the A is a lot more important\n // for lexicographic sorts). We also do a trick with the character codes to optimize the\n // alphabet lookup, avoiding an index scan of `alphabet.indexOf(reversedStr[i])` - we know\n // that the alphabet and (theoretically) the input string are constrained on character sets\n // and thus can do simple subtraction to end up with the same result.\n\n // Developer caution: we carefully cast to BigInt here to avoid losing precision. We cannot\n // rely on Math.pow() (for example) to be capable of handling our insane numbers.\n\n let result = BigInt(0);\n for (let i = s.length - 1, j = BigInt(0); i >= 0; i--, j++) {\n const charIndex = s.charCodeAt(i) - alphabet.charCodeAt(0);\n\n // We add 1 to the char index to offset the whole numbering scheme. We unpack this in\n // the baseToString() function.\n result += BigInt(1 + charIndex) * (len ** j);\n }\n return result;\n}\n\n/**\n * Averages two strings, returning the midpoint between them. This is accomplished by\n * converting both to baseN numbers (where N is the alphabet's length) then averaging\n * those before re-encoding as a string.\n * @param {string} a The first string.\n * @param {string} b The second string.\n * @param {string} alphabet The alphabet to use as a single string.\n * @returns {string} The midpoint between the strings, as a string.\n */\nexport function averageBetweenStrings(a: string, b: string, alphabet = DEFAULT_ALPHABET): string {\n const padN = Math.max(a.length, b.length);\n const baseA = stringToBase(alphabetPad(a, padN, alphabet), alphabet);\n const baseB = stringToBase(alphabetPad(b, padN, alphabet), alphabet);\n const avg = (baseA + baseB) / BigInt(2);\n\n // Detect integer division conflicts. This happens when two numbers are divided too close so\n // we lose a .5 precision. We need to add a padding character in these cases.\n if (avg === baseA || avg == baseB) {\n return baseToString(avg, alphabet) + alphabet[0];\n }\n\n return baseToString(avg, alphabet);\n}\n\n/**\n * Finds the next string using the alphabet provided. This is done by converting the\n * string to a baseN number, where N is the alphabet's length, then adding 1 before\n * converting back to a string.\n * @param {string} s The string to start at.\n * @param {string} alphabet The alphabet to use as a single string.\n * @returns {string} The string which follows the input string.\n */\nexport function nextString(s: string, alphabet = DEFAULT_ALPHABET): string {\n return baseToString(stringToBase(s, alphabet) + BigInt(1), alphabet);\n}\n\n/**\n * Finds the previous string using the alphabet provided. This is done by converting the\n * string to a baseN number, where N is the alphabet's length, then subtracting 1 before\n * converting back to a string.\n * @param {string} s The string to start at.\n * @param {string} alphabet The alphabet to use as a single string.\n * @returns {string} The string which precedes the input string.\n */\nexport function prevString(s: string, alphabet = DEFAULT_ALPHABET): string {\n return baseToString(stringToBase(s, alphabet) - BigInt(1), alphabet);\n}\n\n/**\n * Compares strings lexicographically as a sort-safe function.\n * @param {string} a The first (reference) string.\n * @param {string} b The second (compare) string.\n * @returns {number} Negative if the reference string is before the compare string;\n * positive if the reference string is after; and zero if equal.\n */\nexport function lexicographicCompare(a: string, b: string): number {\n // Dev note: this exists because I'm sad that you can use math operators on strings, so I've\n // hidden the operation in this function.\n return (a < b) ? -1 : ((a === b) ? 0 : 1);\n}\n\nconst collator = new Intl.Collator();\n/**\n * Performant language-sensitive string comparison\n * @param a the first string to compare\n * @param b the second string to compare\n */\nexport function compare(a: string, b: string): number {\n return collator.compare(a, b);\n}\n\n/**\n * This function is similar to Object.assign() but it assigns recursively and\n * allows you to ignore nullish values from the source\n *\n * @param {Object} target\n * @param {Object} source\n * @returns the target object\n */\nexport function recursivelyAssign(target: Object, source: Object, ignoreNullish = false): any {\n for (const [sourceKey, sourceValue] of Object.entries(source)) {\n if (target[sourceKey] instanceof Object && sourceValue) {\n recursivelyAssign(target[sourceKey], sourceValue);\n continue;\n }\n if ((sourceValue !== null && sourceValue !== undefined) || !ignoreNullish) {\n target[sourceKey] = sourceValue;\n continue;\n }\n }\n return target;\n}\n", - "/*\nCopyright 2015, 2016 OpenMarket Ltd\nCopyright 2017 New Vector Ltd\nCopyright 2019, 2020 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n/**\n * This is an internal module. See {@link createNewMatrixCall} for the public API.\n * @module webrtc/call\n */\n\nimport { logger } from '../logger';\nimport { EventEmitter } from 'events';\nimport * as utils from '../utils';\nimport { MatrixEvent } from '../models/event';\nimport { EventType } from '../@types/event';\nimport { RoomMember } from '../models/room-member';\nimport { randomString } from '../randomstring';\nimport {\n MCallReplacesEvent,\n MCallAnswer,\n MCallOfferNegotiate,\n CallCapabilities,\n SDPStreamMetadataPurpose,\n SDPStreamMetadata,\n SDPStreamMetadataKey,\n MCallSDPStreamMetadataChanged,\n} from './callEventTypes';\nimport { CallFeed } from './callFeed';\n\n// events: hangup, error(err), replaced(call), state(state, oldState)\n\n/**\n * Fires whenever an error occurs when call.js encounters an issue with setting up the call.\n *

\n * The error given will have a code equal to either `MatrixCall.ERR_LOCAL_OFFER_FAILED` or\n * `MatrixCall.ERR_NO_USER_MEDIA`. `ERR_LOCAL_OFFER_FAILED` is emitted when the local client\n * fails to create an offer. `ERR_NO_USER_MEDIA` is emitted when the user has denied access\n * to their audio/video hardware.\n *\n * @event module:webrtc/call~MatrixCall#\"error\"\n * @param {Error} err The error raised by MatrixCall.\n * @example\n * matrixCall.on(\"error\", function(err){\n * console.error(err.code, err);\n * });\n */\n\ninterface CallOpts {\n roomId?: string;\n invitee?: string;\n client?: any; // Fix when client is TSified\n forceTURN?: boolean;\n turnServers?: Array;\n}\n\ninterface TurnServer {\n urls: Array;\n username?: string;\n password?: string;\n ttl?: number;\n}\n\ninterface AssertedIdentity {\n id: string;\n displayName: string;\n}\n\nexport enum CallState {\n Fledgling = 'fledgling',\n InviteSent = 'invite_sent',\n WaitLocalMedia = 'wait_local_media',\n CreateOffer = 'create_offer',\n CreateAnswer = 'create_answer',\n Connecting = 'connecting',\n Connected = 'connected',\n Ringing = 'ringing',\n Ended = 'ended',\n}\n\nexport enum CallType {\n Voice = 'voice',\n Video = 'video',\n}\n\nexport enum CallDirection {\n Inbound = 'inbound',\n Outbound = 'outbound',\n}\n\nexport enum CallParty {\n Local = 'local',\n Remote = 'remote',\n}\n\nexport enum CallEvent {\n Hangup = 'hangup',\n State = 'state',\n Error = 'error',\n Replaced = 'replaced',\n\n // The value of isLocalOnHold() has changed\n LocalHoldUnhold = 'local_hold_unhold',\n // The value of isRemoteOnHold() has changed\n RemoteHoldUnhold = 'remote_hold_unhold',\n // backwards compat alias for LocalHoldUnhold: remove in a major version bump\n HoldUnhold = 'hold_unhold',\n // Feeds have changed\n FeedsChanged = 'feeds_changed',\n\n AssertedIdentityChanged = 'asserted_identity_changed',\n}\n\nexport enum CallErrorCode {\n /** The user chose to end the call */\n UserHangup = 'user_hangup',\n\n /** An error code when the local client failed to create an offer. */\n LocalOfferFailed = 'local_offer_failed',\n /**\n * An error code when there is no local mic/camera to use. This may be because\n * the hardware isn't plugged in, or the user has explicitly denied access.\n */\n NoUserMedia = 'no_user_media',\n\n /**\n * Error code used when a call event failed to send\n * because unknown devices were present in the room\n */\n UnknownDevices = 'unknown_devices',\n\n /**\n * Error code used when we fail to send the invite\n * for some reason other than there being unknown devices\n */\n SendInvite = 'send_invite',\n\n /**\n * An answer could not be created\n */\n CreateAnswer = 'create_answer',\n\n /**\n * Error code used when we fail to send the answer\n * for some reason other than there being unknown devices\n */\n SendAnswer = 'send_answer',\n\n /**\n * The session description from the other side could not be set\n */\n SetRemoteDescription = 'set_remote_description',\n\n /**\n * The session description from this side could not be set\n */\n SetLocalDescription = 'set_local_description',\n\n /**\n * A different device answered the call\n */\n AnsweredElsewhere = 'answered_elsewhere',\n\n /**\n * No media connection could be established to the other party\n */\n IceFailed = 'ice_failed',\n\n /**\n * The invite timed out whilst waiting for an answer\n */\n InviteTimeout = 'invite_timeout',\n\n /**\n * The call was replaced by another call\n */\n Replaced = 'replaced',\n\n /**\n * Signalling for the call could not be sent (other than the initial invite)\n */\n SignallingFailed = 'signalling_timeout',\n\n /**\n * The remote party is busy\n */\n UserBusy = 'user_busy',\n\n /**\n * We transferred the call off to somewhere else\n */\n Transfered = 'transferred',\n}\n\nexport enum ConstraintsType {\n Audio = \"audio\",\n Video = \"video\",\n}\n\n/**\n * The version field that we set in m.call.* events\n */\nconst VOIP_PROTO_VERSION = 1;\n\n/** The fallback ICE server to use for STUN or TURN protocols. */\nconst FALLBACK_ICE_SERVER = 'stun:turn.matrix.org';\n\n/** The length of time a call can be ringing for. */\nconst CALL_TIMEOUT_MS = 60000;\n\n/** Retrieves sources from desktopCapturer */\nexport function getDesktopCapturerSources(): Promise> {\n const options: GetSourcesOptions = {\n thumbnailSize: {\n height: 176,\n width: 312,\n },\n types: [\n \"screen\",\n \"window\",\n ],\n };\n return window.electron.getDesktopCapturerSources(options);\n}\n\nexport class CallError extends Error {\n code: string;\n\n constructor(code: CallErrorCode, msg: string, err: Error) {\n // Still don't think there's any way to have proper nested errors\n super(msg + \": \" + err);\n\n this.code = code;\n }\n}\n\nfunction genCallID(): string {\n return Date.now().toString() + randomString(16);\n}\n\n/**\n * Construct a new Matrix Call.\n * @constructor\n * @param {Object} opts Config options.\n * @param {string} opts.roomId The room ID for this call.\n * @param {Object} opts.webRtc The WebRTC globals from the browser.\n * @param {boolean} opts.forceTURN whether relay through TURN should be forced.\n * @param {Object} opts.URL The URL global.\n * @param {Array} opts.turnServers Optional. A list of TURN servers.\n * @param {MatrixClient} opts.client The Matrix Client instance to send events to.\n */\nexport class MatrixCall extends EventEmitter {\n roomId: string;\n invitee?: string;\n type: CallType;\n callId: string;\n state: CallState;\n hangupParty: CallParty;\n hangupReason: string;\n direction: CallDirection;\n ourPartyId: string;\n\n private client: any; // Fix when client is TSified\n private forceTURN: boolean;\n private turnServers: Array;\n private candidateSendQueue: Array;\n private candidateSendTries: number;\n private sentEndOfCandidates: boolean;\n private peerConn: RTCPeerConnection;\n private feeds: Array;\n private usermediaSenders: Array;\n private screensharingSenders: Array;\n private inviteOrAnswerSent: boolean;\n private waitForLocalAVStream: boolean;\n private successor: MatrixCall;\n private opponentMember: RoomMember;\n private opponentVersion: number;\n // The party ID of the other side: undefined if we haven't chosen a partner\n // yet, null if we have but they didn't send a party ID.\n private opponentPartyId: string;\n private opponentCaps: CallCapabilities;\n private inviteTimeout: number;\n private iceDisconnectedTimeout: number;\n\n // The logic of when & if a call is on hold is nontrivial and explained in is*OnHold\n // This flag represents whether we want the other party to be on hold\n private remoteOnHold;\n\n // the stats for the call at the point it ended. We can't get these after we\n // tear the call down, so we just grab a snapshot before we stop the call.\n // The typescript definitions have this type as 'any' :(\n private callStatsAtEnd: any[];\n\n // Perfect negotiation state: https://www.w3.org/TR/webrtc/#perfect-negotiation-example\n private makingOffer: boolean;\n private ignoreOffer: boolean;\n\n // If candidates arrive before we've picked an opponent (which, in particular,\n // will happen if the opponent sends candidates eagerly before the user answers\n // the call) we buffer them up here so we can then add the ones from the party we pick\n private remoteCandidateBuffer = new Map();\n\n private remoteAssertedIdentity: AssertedIdentity;\n\n private remoteSDPStreamMetadata: SDPStreamMetadata;\n\n constructor(opts: CallOpts) {\n super();\n this.roomId = opts.roomId;\n this.invitee = opts.invitee;\n this.client = opts.client;\n this.type = null;\n this.forceTURN = opts.forceTURN;\n this.ourPartyId = this.client.deviceId;\n // Array of Objects with urls, username, credential keys\n this.turnServers = opts.turnServers || [];\n if (this.turnServers.length === 0 && this.client.isFallbackICEServerAllowed()) {\n this.turnServers.push({\n urls: [FALLBACK_ICE_SERVER],\n });\n }\n for (const server of this.turnServers) {\n utils.checkObjectHasKeys(server, [\"urls\"]);\n }\n\n this.callId = genCallID();\n this.state = CallState.Fledgling;\n\n // A queue for candidates waiting to go out.\n // We try to amalgamate candidates into a single candidate message where\n // possible\n this.candidateSendQueue = [];\n this.candidateSendTries = 0;\n\n this.sentEndOfCandidates = false;\n this.inviteOrAnswerSent = false;\n this.makingOffer = false;\n\n this.remoteOnHold = false;\n\n this.feeds = [];\n\n this.usermediaSenders = [];\n this.screensharingSenders = [];\n }\n\n /**\n * Place a voice call to this room.\n * @throws If you have not specified a listener for 'error' events.\n */\n async placeVoiceCall() {\n logger.debug(\"placeVoiceCall\");\n this.checkForErrorListener();\n this.type = CallType.Voice;\n await this.placeCall(ConstraintsType.Audio);\n }\n\n /**\n * Place a video call to this room.\n * @throws If you have not specified a listener for 'error' events.\n */\n async placeVideoCall() {\n logger.debug(\"placeVideoCall\");\n this.checkForErrorListener();\n this.type = CallType.Video;\n await this.placeCall(ConstraintsType.Video);\n }\n\n public getOpponentMember() {\n return this.opponentMember;\n }\n\n public opponentCanBeTransferred() {\n return Boolean(this.opponentCaps && this.opponentCaps[\"m.call.transferee\"]);\n }\n\n public opponentSupportsDTMF(): boolean {\n return Boolean(this.opponentCaps && this.opponentCaps[\"m.call.dtmf\"]);\n }\n\n public getRemoteAssertedIdentity(): AssertedIdentity {\n return this.remoteAssertedIdentity;\n }\n\n public get localUsermediaFeed(): CallFeed {\n return this.getLocalFeeds().find((feed) => feed.purpose === SDPStreamMetadataPurpose.Usermedia);\n }\n\n public get localScreensharingFeed(): CallFeed {\n return this.getLocalFeeds().find((feed) => feed.purpose === SDPStreamMetadataPurpose.Screenshare);\n }\n\n public get localUsermediaStream(): MediaStream {\n return this.localUsermediaFeed?.stream;\n }\n\n private get localScreensharingStream(): MediaStream {\n return this.localScreensharingFeed?.stream;\n }\n\n private getFeedByStreamId(streamId: string): CallFeed {\n return this.getFeeds().find((feed) => feed.stream.id === streamId);\n }\n\n /**\n * Returns an array of all CallFeeds\n * @returns {Array} CallFeeds\n */\n public getFeeds(): Array {\n return this.feeds;\n }\n\n /**\n * Returns an array of all local CallFeeds\n * @returns {Array} local CallFeeds\n */\n public getLocalFeeds(): Array {\n return this.feeds.filter((feed) => feed.isLocal());\n }\n\n /**\n * Returns an array of all remote CallFeeds\n * @returns {Array} remote CallFeeds\n */\n public getRemoteFeeds(): Array {\n return this.feeds.filter((feed) => !feed.isLocal());\n }\n\n /**\n * Generates and returns localSDPStreamMetadata\n * @returns {SDPStreamMetadata} localSDPStreamMetadata\n */\n private getLocalSDPStreamMetadata(): SDPStreamMetadata {\n const metadata: SDPStreamMetadata = {};\n for (const localFeed of this.getLocalFeeds()) {\n metadata[localFeed.stream.id] = {\n purpose: localFeed.purpose,\n audio_muted: localFeed.isAudioMuted(),\n video_muted: localFeed.isVideoMuted(),\n };\n }\n logger.debug(\"Got local SDPStreamMetadata\", metadata);\n return metadata;\n }\n\n /**\n * Returns true if there are no incoming feeds,\n * otherwise returns false\n * @returns {boolean} no incoming feeds\n */\n public noIncomingFeeds(): boolean {\n return !this.feeds.some((feed) => !feed.isLocal());\n }\n\n private pushRemoteFeed(stream: MediaStream) {\n // Fallback to old behavior if the other side doesn't support SDPStreamMetadata\n if (!this.opponentSupportsSDPStreamMetadata()) {\n this.pushRemoteFeedWithoutMetadata(stream);\n return;\n }\n\n const userId = this.getOpponentMember().userId;\n const purpose = this.remoteSDPStreamMetadata[stream.id].purpose;\n const audioMuted = this.remoteSDPStreamMetadata[stream.id].audio_muted;\n const videoMuted = this.remoteSDPStreamMetadata[stream.id].video_muted;\n\n if (!purpose) {\n logger.warn(`Ignoring stream with id ${stream.id} because we didn't get any metadata about it`);\n return;\n }\n\n // Try to find a feed with the same purpose as the new stream,\n // if we find it replace the old stream with the new one\n const existingFeed = this.getRemoteFeeds().find((feed) => feed.purpose === purpose);\n if (existingFeed) {\n existingFeed.setNewStream(stream);\n } else {\n this.feeds.push(new CallFeed(stream, userId, purpose, this.client, this.roomId, audioMuted, videoMuted));\n this.emit(CallEvent.FeedsChanged, this.feeds);\n }\n\n logger.info(`Pushed remote stream (id=\"${stream.id}\", active=\"${stream.active}\", purpose=${purpose})`);\n }\n\n /**\n * This method is used ONLY if the other client doesn't support sending SDPStreamMetadata\n */\n private pushRemoteFeedWithoutMetadata(stream: MediaStream) {\n const userId = this.getOpponentMember().userId;\n // We can guess the purpose here since the other client can only send one stream\n const purpose = SDPStreamMetadataPurpose.Usermedia;\n const oldRemoteStream = this.feeds.find((feed) => !feed.isLocal())?.stream;\n\n // Note that we check by ID and always set the remote stream: Chrome appears\n // to make new stream objects when transceiver directionality is changed and the 'active'\n // status of streams change - Dave\n // If we already have a stream, check this stream has the same id\n if (oldRemoteStream && stream.id !== oldRemoteStream.id) {\n logger.warn(`Ignoring new stream ID ${stream.id}: we already have stream ID ${oldRemoteStream.id}`);\n return;\n }\n\n // Try to find a feed with the same stream id as the new stream,\n // if we find it replace the old stream with the new one\n const feed = this.getFeedByStreamId(stream.id);\n if (feed) {\n feed.setNewStream(stream);\n } else {\n this.feeds.push(new CallFeed(stream, userId, purpose, this.client, this.roomId, false, false));\n this.emit(CallEvent.FeedsChanged, this.feeds);\n }\n\n logger.info(`Pushed remote stream (id=\"${stream.id}\", active=\"${stream.active}\")`);\n }\n\n private pushLocalFeed(stream: MediaStream, purpose: SDPStreamMetadataPurpose, addToPeerConnection = true) {\n const userId = this.client.getUserId();\n\n // We try to replace an existing feed if there already is one with the same purpose\n const existingFeed = this.getLocalFeeds().find((feed) => feed.purpose === purpose);\n if (existingFeed) {\n existingFeed.setNewStream(stream);\n } else {\n this.feeds.push(new CallFeed(stream, userId, purpose, this.client, this.roomId, false, false));\n this.emit(CallEvent.FeedsChanged, this.feeds);\n }\n\n // TODO: Find out what is going on here\n // why do we enable audio (and only audio) tracks here? -- matthew\n setTracksEnabled(stream.getAudioTracks(), true);\n\n if (addToPeerConnection) {\n const senderArray = purpose === SDPStreamMetadataPurpose.Usermedia ?\n this.usermediaSenders : this.screensharingSenders;\n // Empty the array\n senderArray.splice(0, senderArray.length);\n\n this.emit(CallEvent.FeedsChanged, this.feeds);\n for (const track of stream.getTracks()) {\n logger.info(\n `Adding track (` +\n `id=\"${track.id}\", ` +\n `kind=\"${track.kind}\", ` +\n `streamId=\"${stream.id}\", ` +\n `streamPurpose=\"${purpose}\"` +\n `) to peer connection`,\n );\n senderArray.push(this.peerConn.addTrack(track, stream));\n }\n }\n\n logger.info(`Pushed local stream (id=\"${stream.id}\", active=\"${stream.active}\", purpose=\"${purpose}\")`);\n }\n\n private deleteAllFeeds() {\n this.feeds = [];\n this.emit(CallEvent.FeedsChanged, this.feeds);\n }\n\n private deleteFeedByStream(stream: MediaStream) {\n logger.debug(`Removing feed with stream id ${stream.id}`);\n\n const feed = this.getFeedByStreamId(stream.id);\n if (!feed) {\n logger.warn(`Didn't find the feed with stream id ${stream.id} to delete`);\n return;\n }\n\n this.feeds.splice(this.feeds.indexOf(feed), 1);\n this.emit(CallEvent.FeedsChanged, this.feeds);\n }\n\n // The typescript definitions have this type as 'any' :(\n public async getCurrentCallStats(): Promise {\n if (this.callHasEnded()) {\n return this.callStatsAtEnd;\n }\n\n return this.collectCallStats();\n }\n\n private async collectCallStats(): Promise {\n // This happens when the call fails before it starts.\n // For example when we fail to get capture sources\n if (!this.peerConn) return;\n\n const statsReport = await this.peerConn.getStats();\n const stats = [];\n for (const item of statsReport) {\n stats.push(item[1]);\n }\n\n return stats;\n }\n\n /**\n * Configure this call from an invite event. Used by MatrixClient.\n * @param {MatrixEvent} event The m.call.invite event\n */\n async initWithInvite(event: MatrixEvent) {\n const invite = event.getContent();\n this.direction = CallDirection.Inbound;\n\n // make sure we have valid turn creds. Unless something's gone wrong, it should\n // poll and keep the credentials valid so this should be instant.\n const haveTurnCreds = await this.client.checkTurnServers();\n if (!haveTurnCreds) {\n logger.warn(\"Failed to get TURN credentials! Proceeding with call anyway...\");\n }\n\n const sdpStreamMetadata = invite[SDPStreamMetadataKey];\n if (sdpStreamMetadata) {\n this.updateRemoteSDPStreamMetadata(sdpStreamMetadata);\n } else {\n logger.debug(\"Did not get any SDPStreamMetadata! Can not send/receive multiple streams\");\n }\n\n this.peerConn = this.createPeerConnection();\n // we must set the party ID before await-ing on anything: the call event\n // handler will start giving us more call events (eg. candidates) so if\n // we haven't set the party ID, we'll ignore them.\n this.chooseOpponent(event);\n try {\n await this.peerConn.setRemoteDescription(invite.offer);\n await this.addBufferedIceCandidates();\n } catch (e) {\n logger.debug(\"Failed to set remote description\", e);\n this.terminate(CallParty.Local, CallErrorCode.SetRemoteDescription, false);\n return;\n }\n\n const remoteStream = this.feeds.find((feed) => !feed.isLocal())?.stream;\n\n // According to previous comments in this file, firefox at some point did not\n // add streams until media started arriving on them. Testing latest firefox\n // (81 at time of writing), this is no longer a problem, so let's do it the correct way.\n if (!remoteStream || remoteStream.getTracks().length === 0) {\n logger.error(\"No remote stream or no tracks after setting remote description!\");\n this.terminate(CallParty.Local, CallErrorCode.SetRemoteDescription, false);\n return;\n }\n\n this.type = remoteStream.getTracks().some(t => t.kind === 'video') ? CallType.Video : CallType.Voice;\n\n this.setState(CallState.Ringing);\n\n if (event.getLocalAge()) {\n setTimeout(() => {\n if (this.state == CallState.Ringing) {\n logger.debug(\"Call invite has expired. Hanging up.\");\n this.hangupParty = CallParty.Remote; // effectively\n this.setState(CallState.Ended);\n this.stopAllMedia();\n if (this.peerConn.signalingState != 'closed') {\n this.peerConn.close();\n }\n this.emit(CallEvent.Hangup);\n }\n }, invite.lifetime - event.getLocalAge());\n }\n }\n\n /**\n * Configure this call from a hangup or reject event. Used by MatrixClient.\n * @param {MatrixEvent} event The m.call.hangup event\n */\n initWithHangup(event: MatrixEvent) {\n // perverse as it may seem, sometimes we want to instantiate a call with a\n // hangup message (because when getting the state of the room on load, events\n // come in reverse order and we want to remember that a call has been hung up)\n this.setState(CallState.Ended);\n }\n\n /**\n * Answer a call.\n */\n async answer() {\n if (this.inviteOrAnswerSent) {\n return;\n }\n\n logger.debug(`Answering call ${this.callId} of type ${this.type}`);\n\n if (!this.localUsermediaStream && !this.waitForLocalAVStream) {\n const constraints = getUserMediaContraints(\n this.type == CallType.Video ?\n ConstraintsType.Video:\n ConstraintsType.Audio,\n );\n logger.log(\"Getting user media with constraints\", constraints);\n this.setState(CallState.WaitLocalMedia);\n this.waitForLocalAVStream = true;\n\n try {\n let mediaStream: MediaStream;\n\n if (this.type === CallType.Voice) {\n mediaStream = await this.client.getLocalAudioStream();\n } else {\n mediaStream = await this.client.getLocalVideoStream();\n }\n\n this.waitForLocalAVStream = false;\n this.gotUserMediaForAnswer(mediaStream);\n } catch (e) {\n this.getUserMediaFailed(e);\n return;\n }\n } else if (this.waitForLocalAVStream) {\n this.setState(CallState.WaitLocalMedia);\n }\n }\n\n /**\n * Replace this call with a new call, e.g. for glare resolution. Used by\n * MatrixClient.\n * @param {MatrixCall} newCall The new call.\n */\n replacedBy(newCall: MatrixCall) {\n if (this.state === CallState.WaitLocalMedia) {\n logger.debug(\"Telling new call to wait for local media\");\n newCall.waitForLocalAVStream = true;\n } else if ([CallState.CreateOffer, CallState.InviteSent].includes(this.state)) {\n logger.debug(\"Handing local stream to new call\");\n newCall.gotUserMediaForAnswer(this.localUsermediaStream);\n }\n this.successor = newCall;\n this.emit(CallEvent.Replaced, newCall);\n this.hangup(CallErrorCode.Replaced, true);\n }\n\n /**\n * Hangup a call.\n * @param {string} reason The reason why the call is being hung up.\n * @param {boolean} suppressEvent True to suppress emitting an event.\n */\n hangup(reason: CallErrorCode, suppressEvent: boolean) {\n if (this.callHasEnded()) return;\n\n logger.debug(\"Ending call \" + this.callId);\n this.terminate(CallParty.Local, reason, !suppressEvent);\n // We don't want to send hangup here if we didn't even get to sending an invite\n if (this.state === CallState.WaitLocalMedia) return;\n const content = {};\n // Don't send UserHangup reason to older clients\n if ((this.opponentVersion && this.opponentVersion >= 1) || reason !== CallErrorCode.UserHangup) {\n content[\"reason\"] = reason;\n }\n this.sendVoipEvent(EventType.CallHangup, content);\n }\n\n /**\n * Reject a call\n * This used to be done by calling hangup, but is a separate method and protocol\n * event as of MSC2746.\n */\n reject() {\n if (this.state !== CallState.Ringing) {\n throw Error(\"Call must be in 'ringing' state to reject!\");\n }\n\n if (this.opponentVersion < 1) {\n logger.info(\n `Opponent version is less than 1 (${this.opponentVersion}): sending hangup instead of reject`,\n );\n this.hangup(CallErrorCode.UserHangup, true);\n return;\n }\n\n logger.debug(\"Rejecting call: \" + this.callId);\n this.terminate(CallParty.Local, CallErrorCode.UserHangup, true);\n this.sendVoipEvent(EventType.CallReject, {});\n }\n\n /**\n * Returns true if this.remoteSDPStreamMetadata is defined, otherwise returns false\n * @returns {boolean} can screenshare\n */\n public opponentSupportsSDPStreamMetadata(): boolean {\n return Boolean(this.remoteSDPStreamMetadata);\n }\n\n /**\n * If there is a screensharing stream returns true, otherwise returns false\n * @returns {boolean} is screensharing\n */\n public isScreensharing(): boolean {\n return Boolean(this.localScreensharingStream);\n }\n\n /**\n * Starts/stops screensharing\n * @param enabled the desired screensharing state\n * @param selectDesktopCapturerSource callBack to select a screensharing stream on desktop\n * @returns {boolean} new screensharing state\n */\n public async setScreensharingEnabled(\n enabled: boolean,\n selectDesktopCapturerSource?: () => Promise,\n ) {\n // Skip if there is nothing to do\n if (enabled && this.isScreensharing()) {\n logger.warn(`There is already a screensharing stream - there is nothing to do!`);\n return true;\n } else if (!enabled && !this.isScreensharing()) {\n logger.warn(`There already isn't a screensharing stream - there is nothing to do!`);\n return false;\n }\n\n // Fallback to replaceTrack()\n if (!this.opponentSupportsSDPStreamMetadata()) {\n return await this.setScreensharingEnabledWithoutMetadataSupport(enabled, selectDesktopCapturerSource);\n }\n\n logger.debug(`Set screensharing enabled? ${enabled}`);\n if (enabled) {\n try {\n const stream = await getScreensharingStream(selectDesktopCapturerSource);\n if (!stream) return false;\n this.pushLocalFeed(stream, SDPStreamMetadataPurpose.Screenshare);\n return true;\n } catch (err) {\n this.emit(CallEvent.Error,\n new CallError(CallErrorCode.NoUserMedia, \"Failed to get screen-sharing stream: \", err),\n );\n return false;\n }\n } else {\n for (const sender of this.screensharingSenders) {\n this.peerConn.removeTrack(sender);\n }\n for (const track of this.localScreensharingStream.getTracks()) {\n track.stop();\n }\n this.deleteFeedByStream(this.localScreensharingStream);\n return false;\n }\n }\n\n /**\n * Starts/stops screensharing\n * Should be used ONLY if the opponent doesn't support SDPStreamMetadata\n * @param enabled the desired screensharing state\n * @param selectDesktopCapturerSource callBack to select a screensharing stream on desktop\n * @returns {boolean} new screensharing state\n */\n private async setScreensharingEnabledWithoutMetadataSupport(\n enabled: boolean,\n selectDesktopCapturerSource?: () => Promise,\n ) {\n logger.debug(`Set screensharing enabled? ${enabled} using replaceTrack()`);\n if (enabled) {\n try {\n const stream = await getScreensharingStream(selectDesktopCapturerSource);\n if (!stream) return false;\n\n const track = stream.getTracks().find((track) => {\n return track.kind === \"video\";\n });\n const sender = this.usermediaSenders.find((sender) => {\n return sender.track?.kind === \"video\";\n });\n sender.replaceTrack(track);\n\n this.pushLocalFeed(stream, SDPStreamMetadataPurpose.Screenshare, false);\n\n return true;\n } catch (err) {\n this.emit(CallEvent.Error,\n new CallError(CallErrorCode.NoUserMedia, \"Failed to get screen-sharing stream: \", err),\n );\n return false;\n }\n } else {\n const track = this.localUsermediaStream.getTracks().find((track) => {\n return track.kind === \"video\";\n });\n const sender = this.usermediaSenders.find((sender) => {\n return sender.track?.kind === \"video\";\n });\n sender.replaceTrack(track);\n\n for (const track of this.localScreensharingStream.getTracks()) {\n track.stop();\n }\n this.deleteFeedByStream(this.localScreensharingStream);\n\n return false;\n }\n }\n\n /**\n * Set whether our outbound video should be muted or not.\n * @param {boolean} muted True to mute the outbound video.\n */\n setLocalVideoMuted(muted: boolean) {\n this.localUsermediaFeed?.setVideoMuted(muted);\n this.updateMuteStatus();\n }\n\n /**\n * Check if local video is muted.\n *\n * If there are multiple video tracks, all of the tracks need to be muted\n * for this to return true. This means if there are no video tracks, this will\n * return true.\n * @return {Boolean} True if the local preview video is muted, else false\n * (including if the call is not set up yet).\n */\n isLocalVideoMuted(): boolean {\n return this.localUsermediaFeed?.isVideoMuted();\n }\n\n /**\n * Set whether the microphone should be muted or not.\n * @param {boolean} muted True to mute the mic.\n */\n setMicrophoneMuted(muted: boolean) {\n this.localUsermediaFeed?.setAudioMuted(muted);\n this.updateMuteStatus();\n }\n\n /**\n * Check if the microphone is muted.\n *\n * If there are multiple audio tracks, all of the tracks need to be muted\n * for this to return true. This means if there are no audio tracks, this will\n * return true.\n * @return {Boolean} True if the mic is muted, else false (including if the call\n * is not set up yet).\n */\n isMicrophoneMuted(): boolean {\n return this.localUsermediaFeed?.isAudioMuted();\n }\n\n /**\n * @returns true if we have put the party on the other side of the call on hold\n * (that is, we are signalling to them that we are not listening)\n */\n isRemoteOnHold(): boolean {\n return this.remoteOnHold;\n }\n\n setRemoteOnHold(onHold: boolean) {\n if (this.isRemoteOnHold() === onHold) return;\n this.remoteOnHold = onHold;\n\n for (const transceiver of this.peerConn.getTransceivers()) {\n // We don't send hold music or anything so we're not actually\n // sending anything, but sendrecv is fairly standard for hold and\n // it makes it a lot easier to figure out who's put who on hold.\n transceiver.direction = onHold ? 'sendonly' : 'sendrecv';\n }\n this.updateMuteStatus();\n\n this.emit(CallEvent.RemoteHoldUnhold, this.remoteOnHold);\n }\n\n /**\n * Indicates whether we are 'on hold' to the remote party (ie. if true,\n * they cannot hear us).\n * @returns true if the other party has put us on hold\n */\n isLocalOnHold(): boolean {\n if (this.state !== CallState.Connected) return false;\n\n let callOnHold = true;\n\n // We consider a call to be on hold only if *all* the tracks are on hold\n // (is this the right thing to do?)\n for (const transceiver of this.peerConn.getTransceivers()) {\n const trackOnHold = ['inactive', 'recvonly'].includes(transceiver.currentDirection);\n\n if (!trackOnHold) callOnHold = false;\n }\n\n return callOnHold;\n }\n\n /**\n * Sends a DTMF digit to the other party\n * @param digit The digit (nb. string - '#' and '*' are dtmf too)\n */\n sendDtmfDigit(digit: string) {\n for (const sender of this.peerConn.getSenders()) {\n if (sender.track.kind === 'audio' && sender.dtmf) {\n sender.dtmf.insertDTMF(digit);\n return;\n }\n }\n\n throw new Error(\"Unable to find a track to send DTMF on\");\n }\n\n private updateMuteStatus() {\n this.sendVoipEvent(EventType.CallSDPStreamMetadataChangedPrefix, {\n [SDPStreamMetadataKey]: this.getLocalSDPStreamMetadata(),\n });\n\n const micShouldBeMuted = this.localUsermediaFeed?.isAudioMuted() || this.remoteOnHold;\n const vidShouldBeMuted = this.localUsermediaFeed?.isVideoMuted() || this.remoteOnHold;\n\n setTracksEnabled(this.localUsermediaStream.getAudioTracks(), !micShouldBeMuted);\n setTracksEnabled(this.localUsermediaStream.getVideoTracks(), !vidShouldBeMuted);\n }\n\n /**\n * Internal\n * @param {Object} stream\n */\n private gotUserMediaForInvite = async (stream: MediaStream) => {\n if (this.successor) {\n this.successor.gotUserMediaForAnswer(stream);\n return;\n }\n if (this.callHasEnded()) {\n this.stopAllMedia();\n return;\n }\n\n this.pushLocalFeed(stream, SDPStreamMetadataPurpose.Usermedia);\n this.setState(CallState.CreateOffer);\n\n logger.debug(\"gotUserMediaForInvite -> \" + this.type);\n // Now we wait for the negotiationneeded event\n };\n\n private async sendAnswer() {\n const answerContent = {\n answer: {\n sdp: this.peerConn.localDescription.sdp,\n // type is now deprecated as of Matrix VoIP v1, but\n // required to still be sent for backwards compat\n type: this.peerConn.localDescription.type,\n },\n [SDPStreamMetadataKey]: this.getLocalSDPStreamMetadata(),\n } as MCallAnswer;\n\n answerContent.capabilities = {\n 'm.call.transferee': this.client.supportsCallTransfer,\n 'm.call.dtmf': false,\n };\n\n // We have just taken the local description from the peerConn which will\n // contain all the local candidates added so far, so we can discard any candidates\n // we had queued up because they'll be in the answer.\n logger.info(`Discarding ${this.candidateSendQueue.length} candidates that will be sent in answer`);\n this.candidateSendQueue = [];\n\n try {\n await this.sendVoipEvent(EventType.CallAnswer, answerContent);\n // If this isn't the first time we've tried to send the answer,\n // we may have candidates queued up, so send them now.\n this.inviteOrAnswerSent = true;\n } catch (error) {\n // We've failed to answer: back to the ringing state\n this.setState(CallState.Ringing);\n this.client.cancelPendingEvent(error.event);\n\n let code = CallErrorCode.SendAnswer;\n let message = \"Failed to send answer\";\n if (error.name == 'UnknownDeviceError') {\n code = CallErrorCode.UnknownDevices;\n message = \"Unknown devices present in the room\";\n }\n this.emit(CallEvent.Error, new CallError(code, message, error));\n throw error;\n }\n\n // error handler re-throws so this won't happen on error, but\n // we don't want the same error handling on the candidate queue\n this.sendCandidateQueue();\n }\n\n private gotUserMediaForAnswer = async (stream: MediaStream) => {\n if (this.callHasEnded()) {\n return;\n }\n\n this.pushLocalFeed(stream, SDPStreamMetadataPurpose.Usermedia);\n this.setState(CallState.CreateAnswer);\n\n let myAnswer;\n try {\n this.getRidOfRTXCodecs();\n myAnswer = await this.peerConn.createAnswer();\n } catch (err) {\n logger.debug(\"Failed to create answer: \", err);\n this.terminate(CallParty.Local, CallErrorCode.CreateAnswer, true);\n return;\n }\n\n try {\n await this.peerConn.setLocalDescription(myAnswer);\n this.setState(CallState.Connecting);\n\n // Allow a short time for initial candidates to be gathered\n await new Promise(resolve => {\n setTimeout(resolve, 200);\n });\n\n this.sendAnswer();\n } catch (err) {\n logger.debug(\"Error setting local description!\", err);\n this.terminate(CallParty.Local, CallErrorCode.SetLocalDescription, true);\n return;\n }\n };\n\n /**\n * Internal\n * @param {Object} event\n */\n private gotLocalIceCandidate = (event: RTCPeerConnectionIceEvent) => {\n if (event.candidate) {\n logger.debug(\n \"Call \" + this.callId + \" got local ICE \" + event.candidate.sdpMid + \" candidate: \" +\n event.candidate.candidate,\n );\n\n if (this.callHasEnded()) return;\n\n // As with the offer, note we need to make a copy of this object, not\n // pass the original: that broke in Chrome ~m43.\n if (event.candidate.candidate !== '' || !this.sentEndOfCandidates) {\n this.queueCandidate(event.candidate);\n\n if (event.candidate.candidate === '') this.sentEndOfCandidates = true;\n }\n }\n };\n\n private onIceGatheringStateChange = (event: Event) => {\n logger.debug(\"ice gathering state changed to \" + this.peerConn.iceGatheringState);\n if (this.peerConn.iceGatheringState === 'complete' && !this.sentEndOfCandidates) {\n // If we didn't get an empty-string candidate to signal the end of candidates,\n // create one ourselves now gathering has finished.\n // We cast because the interface lists all the properties as required but we\n // only want to send 'candidate'\n // XXX: We probably want to send either sdpMid or sdpMLineIndex, as it's not strictly\n // correct to have a candidate that lacks both of these. We'd have to figure out what\n // previous candidates had been sent with and copy them.\n const c = {\n candidate: '',\n } as RTCIceCandidate;\n this.queueCandidate(c);\n this.sentEndOfCandidates = true;\n }\n };\n\n async onRemoteIceCandidatesReceived(ev: MatrixEvent) {\n if (this.callHasEnded()) {\n //debuglog(\"Ignoring remote ICE candidate because call has ended\");\n return;\n }\n\n const candidates = ev.getContent().candidates;\n if (!candidates) {\n logger.info(\"Ignoring candidates event with no candidates!\");\n return;\n }\n\n const fromPartyId = ev.getContent().version === 0 ? null : ev.getContent().party_id || null;\n\n if (this.opponentPartyId === undefined) {\n // we haven't picked an opponent yet so save the candidates\n logger.info(`Buffering ${candidates.length} candidates until we pick an opponent`);\n const bufferedCandidates = this.remoteCandidateBuffer.get(fromPartyId) || [];\n bufferedCandidates.push(...candidates);\n this.remoteCandidateBuffer.set(fromPartyId, bufferedCandidates);\n return;\n }\n\n if (!this.partyIdMatches(ev.getContent())) {\n logger.info(\n `Ignoring candidates from party ID ${ev.getContent().party_id}: ` +\n `we have chosen party ID ${this.opponentPartyId}`,\n );\n\n return;\n }\n\n await this.addIceCandidates(candidates);\n }\n\n /**\n * Used by MatrixClient.\n * @param {Object} msg\n */\n async onAnswerReceived(event: MatrixEvent) {\n logger.debug(`Got answer for call ID ${this.callId} from party ID ${event.getContent().party_id}`);\n\n if (this.callHasEnded()) {\n logger.debug(`Ignoring answer because call ID ${this.callId} has ended`);\n return;\n }\n\n if (this.opponentPartyId !== undefined) {\n logger.info(\n `Ignoring answer from party ID ${event.getContent().party_id}: ` +\n `we already have an answer/reject from ${this.opponentPartyId}`,\n );\n return;\n }\n\n this.chooseOpponent(event);\n await this.addBufferedIceCandidates();\n\n this.setState(CallState.Connecting);\n\n const sdpStreamMetadata = event.getContent()[SDPStreamMetadataKey];\n if (sdpStreamMetadata) {\n this.updateRemoteSDPStreamMetadata(sdpStreamMetadata);\n } else {\n logger.warn(\"Did not get any SDPStreamMetadata! Can not send/receive multiple streams\");\n }\n\n try {\n await this.peerConn.setRemoteDescription(event.getContent().answer);\n } catch (e) {\n logger.debug(\"Failed to set remote description\", e);\n this.terminate(CallParty.Local, CallErrorCode.SetRemoteDescription, false);\n return;\n }\n\n // If the answer we selected has a party_id, send a select_answer event\n // We do this after setting the remote description since otherwise we'd block\n // call setup on it\n if (this.opponentPartyId !== null) {\n try {\n await this.sendVoipEvent(EventType.CallSelectAnswer, {\n selected_party_id: this.opponentPartyId,\n });\n } catch (err) {\n // This isn't fatal, and will just mean that if another party has raced to answer\n // the call, they won't know they got rejected, so we carry on & don't retry.\n logger.warn(\"Failed to send select_answer event\", err);\n }\n }\n }\n\n async onSelectAnswerReceived(event: MatrixEvent) {\n if (this.direction !== CallDirection.Inbound) {\n logger.warn(\"Got select_answer for an outbound call: ignoring\");\n return;\n }\n\n const selectedPartyId = event.getContent().selected_party_id;\n\n if (selectedPartyId === undefined || selectedPartyId === null) {\n logger.warn(\"Got nonsensical select_answer with null/undefined selected_party_id: ignoring\");\n return;\n }\n\n if (selectedPartyId !== this.ourPartyId) {\n logger.info(`Got select_answer for party ID ${selectedPartyId}: we are party ID ${this.ourPartyId}.`);\n // The other party has picked somebody else's answer\n this.terminate(CallParty.Remote, CallErrorCode.AnsweredElsewhere, true);\n }\n }\n\n async onNegotiateReceived(event: MatrixEvent) {\n const description = event.getContent().description;\n if (!description || !description.sdp || !description.type) {\n logger.info(\"Ignoring invalid m.call.negotiate event\");\n return;\n }\n // Politeness always follows the direction of the call: in a glare situation,\n // we pick either the inbound or outbound call, so one side will always be\n // inbound and one outbound\n const polite = this.direction === CallDirection.Inbound;\n\n // Here we follow the perfect negotiation logic from\n // https://developer.mozilla.org/en-US/docs/Web/API/WebRTC_API/Perfect_negotiation\n const offerCollision = (\n (description.type === 'offer') &&\n (this.makingOffer || this.peerConn.signalingState != 'stable')\n );\n\n this.ignoreOffer = !polite && offerCollision;\n if (this.ignoreOffer) {\n logger.info(\"Ignoring colliding negotiate event because we're impolite\");\n return;\n }\n\n const prevLocalOnHold = this.isLocalOnHold();\n\n const sdpStreamMetadata = event.getContent()[SDPStreamMetadataKey];\n if (sdpStreamMetadata) {\n this.updateRemoteSDPStreamMetadata(sdpStreamMetadata);\n } else {\n logger.warn(\"Received negotiation event without SDPStreamMetadata!\");\n }\n\n try {\n await this.peerConn.setRemoteDescription(description);\n\n if (description.type === 'offer') {\n this.getRidOfRTXCodecs();\n const localDescription = await this.peerConn.createAnswer();\n await this.peerConn.setLocalDescription(localDescription);\n\n this.sendVoipEvent(EventType.CallNegotiate, {\n description: this.peerConn.localDescription,\n [SDPStreamMetadataKey]: this.getLocalSDPStreamMetadata(),\n });\n }\n } catch (err) {\n logger.warn(\"Failed to complete negotiation\", err);\n }\n\n const newLocalOnHold = this.isLocalOnHold();\n if (prevLocalOnHold !== newLocalOnHold) {\n this.emit(CallEvent.LocalHoldUnhold, newLocalOnHold);\n // also this one for backwards compat\n this.emit(CallEvent.HoldUnhold, newLocalOnHold);\n }\n }\n\n private updateRemoteSDPStreamMetadata(metadata: SDPStreamMetadata): void {\n this.remoteSDPStreamMetadata = utils.recursivelyAssign(this.remoteSDPStreamMetadata || {}, metadata, true);\n for (const feed of this.getRemoteFeeds()) {\n const streamId = feed.stream.id;\n feed.setAudioMuted(this.remoteSDPStreamMetadata[streamId]?.audio_muted);\n feed.setVideoMuted(this.remoteSDPStreamMetadata[streamId]?.video_muted);\n feed.purpose = this.remoteSDPStreamMetadata[streamId]?.purpose;\n }\n }\n\n public onSDPStreamMetadataChangedReceived(event: MatrixEvent): void {\n const content = event.getContent();\n const metadata = content[SDPStreamMetadataKey];\n this.updateRemoteSDPStreamMetadata(metadata);\n }\n\n async onAssertedIdentityReceived(event: MatrixEvent) {\n if (!event.getContent().asserted_identity) return;\n\n this.remoteAssertedIdentity = {\n id: event.getContent().asserted_identity.id,\n displayName: event.getContent().asserted_identity.display_name,\n };\n this.emit(CallEvent.AssertedIdentityChanged);\n }\n\n private callHasEnded(): boolean {\n // This exists as workaround to typescript trying to be clever and erroring\n // when putting if (this.state === CallState.Ended) return; twice in the same\n // function, even though that function is async.\n return this.state === CallState.Ended;\n }\n\n private gotLocalOffer = async (description: RTCSessionDescriptionInit) => {\n logger.debug(\"Created offer: \", description);\n\n if (this.callHasEnded()) {\n logger.debug(\"Ignoring newly created offer on call ID \" + this.callId +\n \" because the call has ended\");\n return;\n }\n\n try {\n await this.peerConn.setLocalDescription(description);\n } catch (err) {\n logger.debug(\"Error setting local description!\", err);\n this.terminate(CallParty.Local, CallErrorCode.SetLocalDescription, true);\n return;\n }\n\n if (this.peerConn.iceGatheringState === 'gathering') {\n // Allow a short time for initial candidates to be gathered\n await new Promise(resolve => {\n setTimeout(resolve, 200);\n });\n }\n\n if (this.callHasEnded()) return;\n\n const eventType = this.state === CallState.CreateOffer ? EventType.CallInvite : EventType.CallNegotiate;\n\n const content = {\n lifetime: CALL_TIMEOUT_MS,\n } as MCallOfferNegotiate;\n\n if (eventType === EventType.CallInvite && this.invitee) {\n content.invitee = this.invitee;\n }\n\n // clunky because TypeScript can't follow the types through if we use an expression as the key\n if (this.state === CallState.CreateOffer) {\n content.offer = this.peerConn.localDescription;\n } else {\n content.description = this.peerConn.localDescription;\n }\n\n content.capabilities = {\n 'm.call.transferee': this.client.supportsCallTransfer,\n 'm.call.dtmf': false,\n };\n\n content[SDPStreamMetadataKey] = this.getLocalSDPStreamMetadata();\n\n // Get rid of any candidates waiting to be sent: they'll be included in the local\n // description we just got and will send in the offer.\n logger.info(`Discarding ${this.candidateSendQueue.length} candidates that will be sent in offer`);\n this.candidateSendQueue = [];\n\n try {\n await this.sendVoipEvent(eventType, content);\n } catch (error) {\n logger.error(\"Failed to send invite\", error);\n if (error.event) this.client.cancelPendingEvent(error.event);\n\n let code = CallErrorCode.SignallingFailed;\n let message = \"Signalling failed\";\n if (this.state === CallState.CreateOffer) {\n code = CallErrorCode.SendInvite;\n message = \"Failed to send invite\";\n }\n if (error.name == 'UnknownDeviceError') {\n code = CallErrorCode.UnknownDevices;\n message = \"Unknown devices present in the room\";\n }\n\n this.emit(CallEvent.Error, new CallError(code, message, error));\n this.terminate(CallParty.Local, code, false);\n\n // no need to carry on & send the candidate queue, but we also\n // don't want to rethrow the error\n return;\n }\n\n this.sendCandidateQueue();\n if (this.state === CallState.CreateOffer) {\n this.inviteOrAnswerSent = true;\n this.setState(CallState.InviteSent);\n this.inviteTimeout = setTimeout(() => {\n this.inviteTimeout = null;\n if (this.state === CallState.InviteSent) {\n this.hangup(CallErrorCode.InviteTimeout, false);\n }\n }, CALL_TIMEOUT_MS);\n }\n };\n\n private getLocalOfferFailed = (err: Error) => {\n logger.error(\"Failed to get local offer\", err);\n\n this.emit(\n CallEvent.Error,\n new CallError(\n CallErrorCode.LocalOfferFailed,\n \"Failed to get local offer!\", err,\n ),\n );\n this.terminate(CallParty.Local, CallErrorCode.LocalOfferFailed, false);\n };\n\n private getUserMediaFailed = (err: Error) => {\n if (this.successor) {\n this.successor.getUserMediaFailed(err);\n return;\n }\n\n logger.warn(\"Failed to get user media - ending call\", err);\n\n this.emit(\n CallEvent.Error,\n new CallError(\n CallErrorCode.NoUserMedia,\n \"Couldn't start capturing media! Is your microphone set up and \" +\n \"does this app have permission?\", err,\n ),\n );\n this.terminate(CallParty.Local, CallErrorCode.NoUserMedia, false);\n };\n\n onIceConnectionStateChanged = () => {\n if (this.callHasEnded()) {\n return; // because ICE can still complete as we're ending the call\n }\n logger.debug(\n \"Call ID \" + this.callId + \": ICE connection state changed to: \" + this.peerConn.iceConnectionState,\n );\n // ideally we'd consider the call to be connected when we get media but\n // chrome doesn't implement any of the 'onstarted' events yet\n if (this.peerConn.iceConnectionState == 'connected') {\n clearTimeout(this.iceDisconnectedTimeout);\n this.setState(CallState.Connected);\n } else if (this.peerConn.iceConnectionState == 'failed') {\n this.hangup(CallErrorCode.IceFailed, false);\n } else if (this.peerConn.iceConnectionState == 'disconnected') {\n this.iceDisconnectedTimeout = setTimeout(() => {\n this.hangup(CallErrorCode.IceFailed, false);\n }, 30 * 1000);\n }\n };\n\n private onSignallingStateChanged = () => {\n logger.debug(\n \"call \" + this.callId + \": Signalling state changed to: \" +\n this.peerConn.signalingState,\n );\n };\n\n private onTrack = (ev: RTCTrackEvent) => {\n if (ev.streams.length === 0) {\n logger.warn(`Streamless ${ev.track.kind} found: ignoring.`);\n return;\n }\n\n const stream = ev.streams[0];\n this.pushRemoteFeed(stream);\n stream.addEventListener(\"removetrack\", () => this.deleteFeedByStream(stream));\n };\n\n /**\n * This method removes all video/rtx codecs from screensharing video\n * transceivers. This is necessary since they can cause problems. Without\n * this the following steps should produce an error:\n * Chromium calls Firefox\n * Firefox answers\n * Firefox starts screen-sharing\n * Chromium starts screen-sharing\n * Call crashes for Chromium with:\n * [96685:23:0518/162603.933321:ERROR:webrtc_video_engine.cc(3296)] RTX codec (PT=97) mapped to PT=96 which is not in the codec list.\n * [96685:23:0518/162603.933377:ERROR:webrtc_video_engine.cc(1171)] GetChangedRecvParameters called without any video codecs.\n * [96685:23:0518/162603.933430:ERROR:sdp_offer_answer.cc(4302)] Failed to set local video description recv parameters for m-section with mid='2'. (INVALID_PARAMETER)\n */\n private getRidOfRTXCodecs() {\n // RTCRtpReceiver.getCapabilities and RTCRtpSender.getCapabilities don't seem to be supported on FF\n if (!RTCRtpReceiver.getCapabilities || !RTCRtpSender.getCapabilities) return;\n\n const recvCodecs = RTCRtpReceiver.getCapabilities(\"video\").codecs;\n const sendCodecs = RTCRtpSender.getCapabilities(\"video\").codecs;\n const codecs = [...sendCodecs, ...recvCodecs];\n\n for (const codec of codecs) {\n if (codec.mimeType === \"video/rtx\") {\n const rtxCodecIndex = codecs.indexOf(codec);\n codecs.splice(rtxCodecIndex, 1);\n }\n }\n\n for (const trans of this.peerConn.getTransceivers()) {\n if (\n this.screensharingSenders.includes(trans.sender) &&\n (\n trans.sender.track?.kind === \"video\" ||\n trans.receiver.track?.kind === \"video\"\n )\n ) {\n trans.setCodecPreferences(codecs);\n }\n }\n }\n\n onNegotiationNeeded = async () => {\n logger.info(\"Negotiation is needed!\");\n\n if (this.state !== CallState.CreateOffer && this.opponentVersion === 0) {\n logger.info(\"Opponent does not support renegotiation: ignoring negotiationneeded event\");\n return;\n }\n\n this.makingOffer = true;\n try {\n this.getRidOfRTXCodecs();\n const myOffer = await this.peerConn.createOffer();\n await this.gotLocalOffer(myOffer);\n } catch (e) {\n this.getLocalOfferFailed(e);\n return;\n } finally {\n this.makingOffer = false;\n }\n };\n\n onHangupReceived = (msg) => {\n logger.debug(\"Hangup received for call ID \" + this.callId);\n\n // party ID must match (our chosen partner hanging up the call) or be undefined (we haven't chosen\n // a partner yet but we're treating the hangup as a reject as per VoIP v0)\n if (this.partyIdMatches(msg) || this.state === CallState.Ringing) {\n // default reason is user_hangup\n this.terminate(CallParty.Remote, msg.reason || CallErrorCode.UserHangup, true);\n } else {\n logger.info(`Ignoring message from party ID ${msg.party_id}: our partner is ${this.opponentPartyId}`);\n }\n };\n\n onRejectReceived = (msg) => {\n logger.debug(\"Reject received for call ID \" + this.callId);\n\n // No need to check party_id for reject because if we'd received either\n // an answer or reject, we wouldn't be in state InviteSent\n\n const shouldTerminate = (\n // reject events also end the call if it's ringing: it's another of\n // our devices rejecting the call.\n ([CallState.InviteSent, CallState.Ringing].includes(this.state)) ||\n // also if we're in the init state and it's an inbound call, since\n // this means we just haven't entered the ringing state yet\n this.state === CallState.Fledgling && this.direction === CallDirection.Inbound\n );\n\n if (shouldTerminate) {\n this.terminate(CallParty.Remote, msg.reason || CallErrorCode.UserHangup, true);\n } else {\n logger.debug(`Call is in state: ${this.state}: ignoring reject`);\n }\n };\n\n onAnsweredElsewhere = (msg) => {\n logger.debug(\"Call ID \" + this.callId + \" answered elsewhere\");\n this.terminate(CallParty.Remote, CallErrorCode.AnsweredElsewhere, true);\n };\n\n setState(state: CallState) {\n const oldState = this.state;\n this.state = state;\n this.emit(CallEvent.State, state, oldState);\n }\n\n /**\n * Internal\n * @param {string} eventType\n * @param {Object} content\n * @return {Promise}\n */\n private sendVoipEvent(eventType: string, content: object) {\n return this.client.sendEvent(this.roomId, eventType, Object.assign({}, content, {\n version: VOIP_PROTO_VERSION,\n call_id: this.callId,\n party_id: this.ourPartyId,\n }));\n }\n\n queueCandidate(content: RTCIceCandidate) {\n // We partially de-trickle candidates by waiting for `delay` before sending them\n // amalgamated, in order to avoid sending too many m.call.candidates events and hitting\n // rate limits in Matrix.\n // In practice, it'd be better to remove rate limits for m.call.*\n\n // N.B. this deliberately lets you queue and send blank candidates, which MSC2746\n // currently proposes as the way to indicate that candidate gathering is complete.\n // This will hopefully be changed to an explicit rather than implicit notification\n // shortly.\n this.candidateSendQueue.push(content);\n\n // Don't send the ICE candidates yet if the call is in the ringing state: this\n // means we tried to pick (ie. started generating candidates) and then failed to\n // send the answer and went back to the ringing state. Queue up the candidates\n // to send if we successfully send the answer.\n // Equally don't send if we haven't yet sent the answer because we can send the\n // first batch of candidates along with the answer\n if (this.state === CallState.Ringing || !this.inviteOrAnswerSent) return;\n\n // MSC2746 recommends these values (can be quite long when calling because the\n // callee will need a while to answer the call)\n const delay = this.direction === CallDirection.Inbound ? 500 : 2000;\n\n if (this.candidateSendTries === 0) {\n setTimeout(() => {\n this.sendCandidateQueue();\n }, delay);\n }\n }\n\n /*\n * Transfers this call to another user\n */\n async transfer(targetUserId: string) {\n // Fetch the target user's global profile info: their room avatar / displayname\n // could be different in whatever room we share with them.\n const profileInfo = await this.client.getProfileInfo(targetUserId);\n\n const replacementId = genCallID();\n\n const body = {\n replacement_id: genCallID(),\n target_user: {\n id: targetUserId,\n display_name: profileInfo.display_name,\n avatar_url: profileInfo.avatar_url,\n },\n create_call: replacementId,\n } as MCallReplacesEvent;\n\n await this.sendVoipEvent(EventType.CallReplaces, body);\n\n await this.terminate(CallParty.Local, CallErrorCode.Transfered, true);\n }\n\n /*\n * Transfers this call to the target call, effectively 'joining' the\n * two calls (so the remote parties on each call are connected together).\n */\n async transferToCall(transferTargetCall?: MatrixCall) {\n const targetProfileInfo = await this.client.getProfileInfo(transferTargetCall.getOpponentMember().userId);\n const transfereeProfileInfo = await this.client.getProfileInfo(this.getOpponentMember().userId);\n\n const newCallId = genCallID();\n\n const bodyToTransferTarget = {\n // the replacements on each side have their own ID, and it's distinct from the\n // ID of the new call (but we can use the same function to generate it)\n replacement_id: genCallID(),\n target_user: {\n id: this.getOpponentMember().userId,\n display_name: transfereeProfileInfo.display_name,\n avatar_url: transfereeProfileInfo.avatar_url,\n },\n await_call: newCallId,\n } as MCallReplacesEvent;\n\n await transferTargetCall.sendVoipEvent(EventType.CallReplaces, bodyToTransferTarget);\n\n const bodyToTransferee = {\n replacement_id: genCallID(),\n target_user: {\n id: transferTargetCall.getOpponentMember().userId,\n display_name: targetProfileInfo.display_name,\n avatar_url: targetProfileInfo.avatar_url,\n },\n create_call: newCallId,\n } as MCallReplacesEvent;\n\n await this.sendVoipEvent(EventType.CallReplaces, bodyToTransferee);\n\n await this.terminate(CallParty.Local, CallErrorCode.Replaced, true);\n await transferTargetCall.terminate(CallParty.Local, CallErrorCode.Transfered, true);\n }\n\n private async terminate(hangupParty: CallParty, hangupReason: CallErrorCode, shouldEmit: boolean) {\n if (this.callHasEnded()) return;\n\n this.callStatsAtEnd = await this.collectCallStats();\n\n if (this.inviteTimeout) {\n clearTimeout(this.inviteTimeout);\n this.inviteTimeout = null;\n }\n\n // Order is important here: first we stopAllMedia() and only then we can deleteAllFeeds()\n // We don't stop media if the call was replaced as we want to re-use streams in the successor\n if (hangupReason !== CallErrorCode.Replaced) this.stopAllMedia();\n this.deleteAllFeeds();\n\n this.hangupParty = hangupParty;\n this.hangupReason = hangupReason;\n this.setState(CallState.Ended);\n if (this.peerConn && this.peerConn.signalingState !== 'closed') {\n this.peerConn.close();\n }\n if (shouldEmit) {\n this.emit(CallEvent.Hangup, this);\n }\n }\n\n private stopAllMedia() {\n logger.debug(`stopAllMedia (stream=${this.localUsermediaStream})`);\n\n for (const feed of this.feeds) {\n for (const track of feed.stream.getTracks()) {\n track.stop();\n }\n }\n }\n\n private checkForErrorListener() {\n if (this.listeners(\"error\").length === 0) {\n throw new Error(\n \"You MUST attach an error listener using call.on('error', function() {})\",\n );\n }\n }\n\n private async sendCandidateQueue() {\n if (this.candidateSendQueue.length === 0) {\n return;\n }\n\n const candidates = this.candidateSendQueue;\n this.candidateSendQueue = [];\n ++this.candidateSendTries;\n const content = {\n candidates: candidates,\n };\n logger.debug(\"Attempting to send \" + candidates.length + \" candidates\");\n try {\n await this.sendVoipEvent(EventType.CallCandidates, content);\n // reset our retry count if we have successfully sent our candidates\n // otherwise queueCandidate() will refuse to try to flush the queue\n this.candidateSendTries = 0;\n } catch (error) {\n // don't retry this event: we'll send another one later as we might\n // have more candidates by then.\n if (error.event) this.client.cancelPendingEvent(error.event);\n\n // put all the candidates we failed to send back in the queue\n this.candidateSendQueue.push(...candidates);\n\n if (this.candidateSendTries > 5) {\n logger.debug(\n \"Failed to send candidates on attempt \" + this.candidateSendTries +\n \". Giving up on this call.\", error,\n );\n\n const code = CallErrorCode.SignallingFailed;\n const message = \"Signalling failed\";\n\n this.emit(CallEvent.Error, new CallError(code, message, error));\n this.hangup(code, false);\n\n return;\n }\n\n const delayMs = 500 * Math.pow(2, this.candidateSendTries);\n ++this.candidateSendTries;\n logger.debug(\"Failed to send candidates. Retrying in \" + delayMs + \"ms\", error);\n setTimeout(() => {\n this.sendCandidateQueue();\n }, delayMs);\n }\n }\n\n private async placeCall(constraintsType: ConstraintsType) {\n // XXX Find a better way to do this\n this.client.callEventHandler.calls.set(this.callId, this);\n this.setState(CallState.WaitLocalMedia);\n this.direction = CallDirection.Outbound;\n\n // make sure we have valid turn creds. Unless something's gone wrong, it should\n // poll and keep the credentials valid so this should be instant.\n const haveTurnCreds = await this.client.checkTurnServers();\n if (!haveTurnCreds) {\n logger.warn(\"Failed to get TURN credentials! Proceeding with call anyway...\");\n }\n\n // create the peer connection now so it can be gathering candidates while we get user\n // media (assuming a candidate pool size is configured)\n this.peerConn = this.createPeerConnection();\n\n try {\n let mediaStream: MediaStream;\n\n if (constraintsType === ConstraintsType.Audio) {\n mediaStream = await this.client.getLocalAudioStream();\n } else {\n mediaStream = await this.client.getLocalVideoStream();\n }\n\n this.gotUserMediaForInvite(mediaStream);\n } catch (e) {\n this.getUserMediaFailed(e);\n return;\n }\n }\n\n private createPeerConnection(): RTCPeerConnection {\n const pc = new window.RTCPeerConnection({\n iceTransportPolicy: this.forceTURN ? 'relay' : undefined,\n iceServers: this.turnServers,\n iceCandidatePoolSize: this.client.iceCandidatePoolSize,\n });\n\n // 'connectionstatechange' would be better, but firefox doesn't implement that.\n pc.addEventListener('iceconnectionstatechange', this.onIceConnectionStateChanged);\n pc.addEventListener('signalingstatechange', this.onSignallingStateChanged);\n pc.addEventListener('icecandidate', this.gotLocalIceCandidate);\n pc.addEventListener('icegatheringstatechange', this.onIceGatheringStateChange);\n pc.addEventListener('track', this.onTrack);\n pc.addEventListener('negotiationneeded', this.onNegotiationNeeded);\n\n return pc;\n }\n\n private partyIdMatches(msg): boolean {\n // They must either match or both be absent (in which case opponentPartyId will be null)\n // Also we ignore party IDs on the invite/offer if the version is 0, so we must do the same\n // here and use null if the version is 0 (woe betide any opponent sending messages in the\n // same call with different versions)\n const msgPartyId = msg.version === 0 ? null : msg.party_id || null;\n return msgPartyId === this.opponentPartyId;\n }\n\n // Commits to an opponent for the call\n // ev: An invite or answer event\n private chooseOpponent(ev: MatrixEvent) {\n // I choo-choo-choose you\n const msg = ev.getContent();\n\n logger.debug(`Choosing party ID ${msg.party_id} for call ID ${this.callId}`);\n\n this.opponentVersion = msg.version;\n if (this.opponentVersion === 0) {\n // set to null to indicate that we've chosen an opponent, but because\n // they're v0 they have no party ID (even if they sent one, we're ignoring it)\n this.opponentPartyId = null;\n } else {\n // set to their party ID, or if they're naughty and didn't send one despite\n // not being v0, set it to null to indicate we picked an opponent with no\n // party ID\n this.opponentPartyId = msg.party_id || null;\n }\n this.opponentCaps = msg.capabilities || {};\n this.opponentMember = ev.sender;\n }\n\n private async addBufferedIceCandidates() {\n const bufferedCandidates = this.remoteCandidateBuffer.get(this.opponentPartyId);\n if (bufferedCandidates) {\n logger.info(`Adding ${bufferedCandidates.length} buffered candidates for opponent ${this.opponentPartyId}`);\n await this.addIceCandidates(bufferedCandidates);\n }\n this.remoteCandidateBuffer = null;\n }\n\n private async addIceCandidates(candidates: RTCIceCandidate[]) {\n for (const candidate of candidates) {\n if (\n (candidate.sdpMid === null || candidate.sdpMid === undefined) &&\n (candidate.sdpMLineIndex === null || candidate.sdpMLineIndex === undefined)\n ) {\n logger.debug(\"Ignoring remote ICE candidate with no sdpMid or sdpMLineIndex\");\n continue;\n }\n logger.debug(\n \"Call \" + this.callId + \" got remote ICE \" + candidate.sdpMid + \" candidate: \" + candidate.candidate,\n );\n try {\n await this.peerConn.addIceCandidate(candidate);\n } catch (err) {\n if (!this.ignoreOffer) {\n logger.info(\"Failed to add remote ICE candidate\", err);\n }\n }\n }\n }\n}\n\nasync function getScreensharingStream(\n selectDesktopCapturerSource?: () => Promise,\n): Promise {\n const screenshareConstraints = await getScreenshareContraints(selectDesktopCapturerSource);\n if (!screenshareConstraints) return null;\n\n if (window.electron?.getDesktopCapturerSources) {\n // We are using Electron\n logger.debug(\"Getting screen stream using getUserMedia()...\");\n return await navigator.mediaDevices.getUserMedia(screenshareConstraints);\n } else {\n // We are not using Electron\n logger.debug(\"Getting screen stream using getDisplayMedia()...\");\n return await navigator.mediaDevices.getDisplayMedia(screenshareConstraints);\n }\n}\n\nfunction setTracksEnabled(tracks: Array, enabled: boolean) {\n for (let i = 0; i < tracks.length; i++) {\n tracks[i].enabled = enabled;\n }\n}\n\nexport function getUserMediaContraints(type: ConstraintsType) {\n const isWebkit = !!navigator.webkitGetUserMedia;\n\n switch (type) {\n case ConstraintsType.Audio: {\n return {\n audio: {\n deviceId: audioInput ? { ideal: audioInput } : undefined,\n },\n video: false,\n };\n }\n case ConstraintsType.Video: {\n return {\n audio: {\n deviceId: audioInput ? { ideal: audioInput } : undefined,\n }, video: {\n deviceId: videoInput ? { ideal: videoInput } : undefined,\n /* We want 640x360. Chrome will give it only if we ask exactly,\n FF refuses entirely if we ask exactly, so have to ask for ideal\n instead\n XXX: Is this still true?\n */\n width: isWebkit ? { exact: 640 } : { ideal: 640 },\n height: isWebkit ? { exact: 360 } : { ideal: 360 },\n },\n };\n }\n }\n}\n\nasync function getScreenshareContraints(selectDesktopCapturerSource?: () => Promise) {\n if (window.electron?.getDesktopCapturerSources && selectDesktopCapturerSource) {\n // We have access to getDesktopCapturerSources()\n logger.debug(\"Electron getDesktopCapturerSources() is available...\");\n const selectedSource = await selectDesktopCapturerSource();\n if (!selectedSource) return null;\n return {\n audio: false,\n video: {\n mandatory: {\n chromeMediaSource: \"desktop\",\n chromeMediaSourceId: selectedSource.id,\n },\n },\n };\n } else {\n // We do not have access to the Electron desktop capturer,\n // therefore we can assume we are on the web\n logger.debug(\"Electron desktopCapturer is not available...\");\n return {\n audio: false,\n video: true,\n };\n }\n}\n\nlet audioInput: string;\nlet videoInput: string;\n/**\n * Set an audio input device to use for MatrixCalls\n * @function\n * @param {string=} deviceId the identifier for the device\n * undefined treated as unset\n */\nexport function setAudioInput(deviceId: string) { audioInput = deviceId; }\n/**\n * Set a video input device to use for MatrixCalls\n * @function\n * @param {string=} deviceId the identifier for the device\n * undefined treated as unset\n */\nexport function setVideoInput(deviceId: string) { videoInput = deviceId; }\n\n/**\n * DEPRECATED\n * Use client.createCall()\n *\n * Create a new Matrix call for the browser.\n * @param {MatrixClient} client The client instance to use.\n * @param {string} roomId The room the call is in.\n * @param {Object?} options DEPRECATED optional options map.\n * @param {boolean} options.forceTURN DEPRECATED whether relay through TURN should be\n * forced. This option is deprecated - use opts.forceTURN when creating the matrix client\n * since it's only possible to set this option on outbound calls.\n * @return {MatrixCall} the call or null if the browser doesn't support calling.\n */\nexport function createNewMatrixCall(client: any, roomId: string, options?: CallOpts) {\n // typeof prevents Node from erroring on an undefined reference\n if (typeof(window) === 'undefined' || typeof(document) === 'undefined') {\n // NB. We don't log here as apps try to create a call object as a test for\n // whether calls are supported, so we shouldn't fill the logs up.\n return null;\n }\n\n // Firefox throws on so little as accessing the RTCPeerConnection when operating in\n // a secure mode. There's some information at https://bugzilla.mozilla.org/show_bug.cgi?id=1542616\n // though the concern is that the browser throwing a SecurityError will brick the\n // client creation process.\n try {\n const supported = Boolean(\n window.RTCPeerConnection || window.RTCSessionDescription ||\n window.RTCIceCandidate || navigator.mediaDevices,\n );\n if (!supported) {\n // Adds a lot of noise to test runs, so disable logging there.\n if (process.env.NODE_ENV !== \"test\") {\n logger.error(\"WebRTC is not supported in this browser / environment\");\n }\n return null;\n }\n } catch (e) {\n logger.error(\"Exception thrown when trying to access WebRTC\", e);\n return null;\n }\n\n const optionsForceTURN = options ? options.forceTURN : false;\n\n const opts = {\n client: client,\n roomId: roomId,\n invitee: options && options.invitee,\n turnServers: client.getTurnServers(),\n // call level options\n forceTURN: client.forceTURN || optionsForceTURN,\n };\n const call = new MatrixCall(opts);\n\n client.reEmitter.reEmit(call, Object.values(CallEvent));\n\n return call;\n}\n", - "/*\nCopyright 2020 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\nimport { MatrixEvent } from '../models/event';\nimport { logger } from '../logger';\nimport { createNewMatrixCall, MatrixCall, CallErrorCode, CallState, CallDirection } from './call';\nimport { EventType } from '../@types/event';\nimport { MatrixClient } from '../client';\n\n// Don't ring unless we'd be ringing for at least 3 seconds: the user needs some\n// time to press the 'accept' button\nconst RING_GRACE_PERIOD = 3000;\n\nexport class CallEventHandler {\n client: MatrixClient;\n calls: Map;\n callEventBuffer: MatrixEvent[];\n candidateEventsByCall: Map>;\n\n constructor(client: MatrixClient) {\n this.client = client;\n this.calls = new Map();\n // The sync code always emits one event at a time, so it will patiently\n // wait for us to finish processing a call invite before delivering the\n // next event, even if that next event is a hangup. We therefore accumulate\n // all our call events and then process them on the 'sync' event, ie.\n // each time a sync has completed. This way, we can avoid emitting incoming\n // call events if we get both the invite and answer/hangup in the same sync.\n // This happens quite often, eg. replaying sync from storage, catchup sync\n // after loading and after we've been offline for a bit.\n this.callEventBuffer = [];\n this.candidateEventsByCall = new Map>();\n }\n\n public start() {\n this.client.on(\"sync\", this.evaluateEventBuffer);\n this.client.on(\"Room.timeline\", this.onRoomTimeline);\n }\n\n public stop() {\n this.client.removeListener(\"sync\", this.evaluateEventBuffer);\n this.client.removeListener(\"Room.timeline\", this.onRoomTimeline);\n }\n\n private evaluateEventBuffer = async () => {\n if (this.client.getSyncState() === \"SYNCING\") {\n await Promise.all(this.callEventBuffer.map(event => {\n this.client.decryptEventIfNeeded(event);\n }));\n\n const ignoreCallIds = new Set();\n // inspect the buffer and mark all calls which have been answered\n // or hung up before passing them to the call event handler.\n for (const ev of this.callEventBuffer) {\n if (ev.getType() === EventType.CallAnswer ||\n ev.getType() === EventType.CallHangup) {\n ignoreCallIds.add(ev.getContent().call_id);\n }\n }\n // now loop through the buffer chronologically and inject them\n for (const e of this.callEventBuffer) {\n if (\n e.getType() === EventType.CallInvite &&\n ignoreCallIds.has(e.getContent().call_id)\n ) {\n // This call has previously been answered or hung up: ignore it\n continue;\n }\n try {\n this.handleCallEvent(e);\n } catch (e) {\n logger.error(\"Caught exception handling call event\", e);\n }\n }\n this.callEventBuffer = [];\n }\n };\n\n private onRoomTimeline = (event: MatrixEvent) => {\n this.client.decryptEventIfNeeded(event);\n // any call events or ones that might be once they're decrypted\n if (this.eventIsACall(event) || event.isBeingDecrypted()) {\n // queue up for processing once all events from this sync have been\n // processed (see above).\n this.callEventBuffer.push(event);\n }\n\n if (event.isBeingDecrypted() || event.isDecryptionFailure()) {\n // add an event listener for once the event is decrypted.\n event.once(\"Event.decrypted\", () => {\n if (!this.eventIsACall(event)) return;\n\n if (this.callEventBuffer.includes(event)) {\n // we were waiting for that event to decrypt, so recheck the buffer\n this.evaluateEventBuffer();\n } else {\n // This one wasn't buffered so just run the event handler for it\n // straight away\n try {\n this.handleCallEvent(event);\n } catch (e) {\n logger.error(\"Caught exception handling call event\", e);\n }\n }\n });\n }\n };\n\n private eventIsACall(event: MatrixEvent): boolean {\n const type = event.getType();\n /**\n * Unstable prefixes:\n * - org.matrix.call. : MSC3086 https://github.com/matrix-org/matrix-doc/pull/3086\n */\n return type.startsWith(\"m.call.\") || type.startsWith(\"org.matrix.call.\");\n }\n\n private async handleCallEvent(event: MatrixEvent) {\n const content = event.getContent();\n const type = event.getType() as EventType;\n const weSentTheEvent = event.getSender() === this.client.credentials.userId;\n let call = content.call_id ? this.calls.get(content.call_id) : undefined;\n //console.info(\"RECV %s content=%s\", type, JSON.stringify(content));\n\n if (type === EventType.CallInvite) {\n // ignore invites you send\n if (weSentTheEvent) return;\n // expired call\n if (event.getLocalAge() > content.lifetime - RING_GRACE_PERIOD) return;\n // stale/old invite event\n if (call && call.state === CallState.Ended) return;\n\n if (call) {\n logger.log(\n `WARN: Already have a MatrixCall with id ${content.call_id} but got an ` +\n `invite. Clobbering.`,\n );\n }\n\n if (content.invitee && content.invitee !== this.client.getUserId()) {\n return; // This invite was meant for another user in the room\n }\n\n const timeUntilTurnCresExpire = this.client.getTurnServersExpiry() - Date.now();\n logger.info(\"Current turn creds expire in \" + timeUntilTurnCresExpire + \" ms\");\n call = createNewMatrixCall(\n this.client,\n event.getRoomId(),\n { forceTURN: this.client.forceTURN },\n );\n if (!call) {\n logger.log(\n \"Incoming call ID \" + content.call_id + \" but this client \" +\n \"doesn't support WebRTC\",\n );\n // don't hang up the call: there could be other clients\n // connected that do support WebRTC and declining the\n // the call on their behalf would be really annoying.\n return;\n }\n\n call.callId = content.call_id;\n const initWithInvitePromise = call.initWithInvite(event);\n this.calls.set(call.callId, call);\n\n // if we stashed candidate events for that call ID, play them back now\n if (this.candidateEventsByCall.get(call.callId)) {\n for (const ev of this.candidateEventsByCall.get(call.callId)) {\n call.onRemoteIceCandidatesReceived(ev);\n }\n }\n\n // Were we trying to call that user (room)?\n let existingCall;\n for (const thisCall of this.calls.values()) {\n const isCalling = [CallState.WaitLocalMedia, CallState.CreateOffer, CallState.InviteSent].includes(\n thisCall.state,\n );\n\n if (\n call.roomId === thisCall.roomId &&\n thisCall.direction === CallDirection.Outbound &&\n call.invitee === thisCall.invitee &&\n isCalling\n ) {\n existingCall = thisCall;\n break;\n }\n }\n\n if (existingCall) {\n // If we've only got to wait_local_media or create_offer and\n // we've got an invite, pick the incoming call because we know\n // we haven't sent our invite yet otherwise, pick whichever\n // call has the lowest call ID (by string comparison)\n if (\n existingCall.state === CallState.WaitLocalMedia ||\n existingCall.state === CallState.CreateOffer ||\n existingCall.callId > call.callId\n ) {\n logger.log(\n \"Glare detected: answering incoming call \" + call.callId +\n \" and canceling outgoing call \" + existingCall.callId,\n );\n // Await init with invite as we need a peerConn for the following methods\n await initWithInvitePromise;\n existingCall.replacedBy(call);\n call.answer();\n } else {\n logger.log(\n \"Glare detected: rejecting incoming call \" + call.callId +\n \" and keeping outgoing call \" + existingCall.callId,\n );\n call.hangup(CallErrorCode.Replaced, true);\n }\n } else {\n initWithInvitePromise.then(() => {\n this.client.emit(\"Call.incoming\", call);\n });\n }\n } else if (type === EventType.CallCandidates) {\n if (weSentTheEvent) return;\n\n if (!call) {\n // store the candidates; we may get a call eventually.\n if (!this.candidateEventsByCall.has(content.call_id)) {\n this.candidateEventsByCall.set(content.call_id, []);\n }\n this.candidateEventsByCall.get(content.call_id).push(event);\n } else {\n call.onRemoteIceCandidatesReceived(event);\n }\n } else if ([EventType.CallHangup, EventType.CallReject].includes(type)) {\n // Note that we also observe our own hangups here so we can see\n // if we've already rejected a call that would otherwise be valid\n if (!call) {\n // if not live, store the fact that the call has ended because\n // we're probably getting events backwards so\n // the hangup will come before the invite\n call = createNewMatrixCall(this.client, event.getRoomId());\n if (call) {\n call.callId = content.call_id;\n call.initWithHangup(event);\n this.calls.set(content.call_id, call);\n }\n } else {\n if (call.state !== CallState.Ended) {\n if (type === EventType.CallHangup) {\n call.onHangupReceived(content);\n } else {\n call.onRejectReceived(content);\n }\n this.calls.delete(content.call_id);\n }\n }\n }\n\n // The following events need a call\n if (!call) return;\n // Ignore remote echo\n if (event.getContent().party_id === call.ourPartyId) return;\n\n switch (type) {\n case EventType.CallAnswer:\n if (weSentTheEvent) {\n if (call.state === CallState.Ringing) {\n call.onAnsweredElsewhere(content);\n }\n } else {\n call.onAnswerReceived(event);\n }\n break;\n case EventType.CallSelectAnswer:\n call.onSelectAnswerReceived(event);\n break;\n\n case EventType.CallNegotiate:\n call.onNegotiateReceived(event);\n break;\n\n case EventType.CallAssertedIdentity:\n case EventType.CallAssertedIdentityPrefix:\n call.onAssertedIdentityReceived(event);\n break;\n\n case EventType.CallSDPStreamMetadataChanged:\n case EventType.CallSDPStreamMetadataChangedPrefix:\n call.onSDPStreamMetadataChangedReceived(event);\n break;\n }\n }\n}\n", - "// allow non-camelcase as these are events type that go onto the wire\n/* eslint-disable camelcase */\n\n// TODO: Change to \"sdp_stream_metadata\" when MSC3077 is merged\nexport const SDPStreamMetadataKey = \"org.matrix.msc3077.sdp_stream_metadata\";\n\nexport enum SDPStreamMetadataPurpose {\n Usermedia = \"m.usermedia\",\n Screenshare = \"m.screenshare\",\n}\n\nexport interface SDPStreamMetadataObject {\n purpose: SDPStreamMetadataPurpose;\n audio_muted: boolean;\n video_muted: boolean;\n}\n\nexport interface SDPStreamMetadata {\n [key: string]: SDPStreamMetadataObject;\n}\n\ninterface CallOfferAnswer {\n type: string;\n sdp: string;\n}\n\nexport interface CallCapabilities {\n 'm.call.transferee': boolean;\n 'm.call.dtmf': boolean;\n}\n\nexport interface CallReplacesTarget {\n id: string;\n display_name: string;\n avatar_url: string;\n}\n\nexport interface MCallAnswer {\n answer: CallOfferAnswer;\n capabilities: CallCapabilities;\n [SDPStreamMetadataKey]: SDPStreamMetadata;\n}\n\nexport interface MCallOfferNegotiate {\n offer: CallOfferAnswer;\n description: CallOfferAnswer;\n lifetime: number;\n capabilities: CallCapabilities;\n invitee?: string;\n [SDPStreamMetadataKey]: SDPStreamMetadata;\n}\n\nexport interface MCallSDPStreamMetadataChanged {\n [SDPStreamMetadataKey]: SDPStreamMetadata;\n}\n\nexport interface MCallReplacesEvent {\n replacement_id: string;\n target_user: CallReplacesTarget;\n create_call: string;\n await_call: string;\n target_room: string;\n}\n/* eslint-enable camelcase */\n", - "/*\nCopyright 2021 Šimon Brandner \n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\nimport EventEmitter from \"events\";\nimport { SDPStreamMetadataPurpose } from \"./callEventTypes\";\nimport { MatrixClient } from \"../client\";\nimport { RoomMember } from \"../models/room-member\";\n\nexport enum CallFeedEvent {\n NewStream = \"new_stream\",\n MuteStateChanged = \"mute_state_changed\"\n}\n\nexport class CallFeed extends EventEmitter {\n constructor(\n public stream: MediaStream,\n public userId: string,\n public purpose: SDPStreamMetadataPurpose,\n private client: MatrixClient,\n private roomId: string,\n private audioMuted: boolean,\n private videoMuted: boolean,\n ) {\n super();\n }\n\n /**\n * Returns callRoom member\n * @returns member of the callRoom\n */\n public getMember(): RoomMember {\n const callRoom = this.client.getRoom(this.roomId);\n return callRoom.getMember(this.userId);\n }\n\n /**\n * Returns true if CallFeed is local, otherwise returns false\n * @returns {boolean} is local?\n */\n public isLocal(): boolean {\n return this.userId === this.client.getUserId();\n }\n\n /**\n * Returns true if audio is muted or if there are no audio\n * tracks, otherwise returns false\n * @returns {boolean} is audio muted?\n */\n public isAudioMuted(): boolean {\n return this.stream.getAudioTracks().length === 0 || this.audioMuted;\n }\n\n /**\n * Returns true video is muted or if there are no video\n * tracks, otherwise returns false\n * @returns {boolean} is video muted?\n */\n public isVideoMuted(): boolean {\n // We assume only one video track\n return this.stream.getVideoTracks().length === 0 || this.videoMuted;\n }\n\n /**\n * Replaces the current MediaStream with a new one.\n * This method should be only used by MatrixCall.\n * @param newStream new stream with which to replace the current one\n */\n public setNewStream(newStream: MediaStream) {\n this.stream = newStream;\n this.emit(CallFeedEvent.NewStream, this.stream);\n }\n\n public setAudioMuted(muted: boolean): void {\n this.audioMuted = muted;\n this.emit(CallFeedEvent.MuteStateChanged, this.audioMuted, this.videoMuted);\n }\n\n public setVideoMuted(muted: boolean): void {\n this.videoMuted = muted;\n this.emit(CallFeedEvent.MuteStateChanged, this.audioMuted, this.videoMuted);\n }\n}\n" + "/*\nCopyright 2015, 2016 OpenMarket Ltd\nCopyright 2019 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n/**\n * This is an internal module.\n * @module utils\n */\n\nimport unhomoglyph from \"unhomoglyph\";\nimport promiseRetry from \"p-retry\";\nimport type NodeCrypto from \"crypto\";\n\n/**\n * Encode a dictionary of query parameters.\n * @param {Object} params A dict of key/values to encode e.g.\n * {\"foo\": \"bar\", \"baz\": \"taz\"}\n * @return {string} The encoded string e.g. foo=bar&baz=taz\n */\nexport function encodeParams(params: Record): string {\n return new URLSearchParams(params).toString();\n}\n\nexport type QueryDict = Record;\n\n/**\n * Decode a query string in `application/x-www-form-urlencoded` format.\n * @param {string} query A query string to decode e.g.\n * foo=bar&via=server1&server2\n * @return {Object} The decoded object, if any keys occurred multiple times\n * then the value will be an array of strings, else it will be an array.\n * This behaviour matches Node's qs.parse but is built on URLSearchParams\n * for native web compatibility\n */\nexport function decodeParams(query: string): QueryDict {\n const o: QueryDict = {};\n const params = new URLSearchParams(query);\n for (const key of params.keys()) {\n const val = params.getAll(key);\n o[key] = val.length === 1 ? val[0] : val;\n }\n return o;\n}\n\n/**\n * Encodes a URI according to a set of template variables. Variables will be\n * passed through encodeURIComponent.\n * @param {string} pathTemplate The path with template variables e.g. '/foo/$bar'.\n * @param {Object} variables The key/value pairs to replace the template\n * variables with. E.g. { \"$bar\": \"baz\" }.\n * @return {string} The result of replacing all template variables e.g. '/foo/baz'.\n */\nexport function encodeUri(pathTemplate: string,\n variables: Record): string {\n for (const key in variables) {\n if (!variables.hasOwnProperty(key)) {\n continue;\n }\n pathTemplate = pathTemplate.replace(\n key, encodeURIComponent(variables[key]),\n );\n }\n return pathTemplate;\n}\n\n/**\n * The removeElement() method removes the first element in the array that\n * satisfies (returns true) the provided testing function.\n * @param {Array} array The array.\n * @param {Function} fn Function to execute on each value in the array, with the\n * function signature fn(element, index, array). Return true to\n * remove this element and break.\n * @param {boolean} reverse True to search in reverse order.\n * @return {boolean} True if an element was removed.\n */\nexport function removeElement(\n array: T[],\n fn: (t: T, i?: number, a?: T[]) => boolean,\n reverse?: boolean,\n) {\n let i;\n let removed;\n if (reverse) {\n for (i = array.length - 1; i >= 0; i--) {\n if (fn(array[i], i, array)) {\n removed = array[i];\n array.splice(i, 1);\n return removed;\n }\n }\n } else {\n for (i = 0; i < array.length; i++) {\n if (fn(array[i], i, array)) {\n removed = array[i];\n array.splice(i, 1);\n return removed;\n }\n }\n }\n return false;\n}\n\n/**\n * Checks if the given thing is a function.\n * @param {*} value The thing to check.\n * @return {boolean} True if it is a function.\n */\nexport function isFunction(value: any) {\n return Object.prototype.toString.call(value) === \"[object Function]\";\n}\n\n/**\n * Checks that the given object has the specified keys.\n * @param {Object} obj The object to check.\n * @param {string[]} keys The list of keys that 'obj' must have.\n * @throws If the object is missing keys.\n */\n// note using 'keys' here would shadow the 'keys' function defined above\nexport function checkObjectHasKeys(obj: object, keys: string[]) {\n for (let i = 0; i < keys.length; i++) {\n if (!obj.hasOwnProperty(keys[i])) {\n throw new Error(\"Missing required key: \" + keys[i]);\n }\n }\n}\n\n/**\n * Checks that the given object has no extra keys other than the specified ones.\n * @param {Object} obj The object to check.\n * @param {string[]} allowedKeys The list of allowed key names.\n * @throws If there are extra keys.\n */\nexport function checkObjectHasNoAdditionalKeys(obj: object, allowedKeys: string[]): void {\n for (const key in obj) {\n if (!obj.hasOwnProperty(key)) {\n continue;\n }\n if (allowedKeys.indexOf(key) === -1) {\n throw new Error(\"Unknown key: \" + key);\n }\n }\n}\n\n/**\n * Deep copy the given object. The object MUST NOT have circular references and\n * MUST NOT have functions.\n * @param {Object} obj The object to deep copy.\n * @return {Object} A copy of the object without any references to the original.\n */\nexport function deepCopy(obj: T): T {\n return JSON.parse(JSON.stringify(obj));\n}\n\n/**\n * Compare two objects for equality. The objects MUST NOT have circular references.\n *\n * @param {Object} x The first object to compare.\n * @param {Object} y The second object to compare.\n *\n * @return {boolean} true if the two objects are equal\n */\nexport function deepCompare(x: any, y: any): boolean {\n // Inspired by\n // http://stackoverflow.com/questions/1068834/object-comparison-in-javascript#1144249\n\n // Compare primitives and functions.\n // Also check if both arguments link to the same object.\n if (x === y) {\n return true;\n }\n\n if (typeof x !== typeof y) {\n return false;\n }\n\n // special-case NaN (since NaN !== NaN)\n if (typeof x === 'number' && isNaN(x) && isNaN(y)) {\n return true;\n }\n\n // special-case null (since typeof null == 'object', but null.constructor\n // throws)\n if (x === null || y === null) {\n return x === y;\n }\n\n // everything else is either an unequal primitive, or an object\n if (!(x instanceof Object)) {\n return false;\n }\n\n // check they are the same type of object\n if (x.constructor !== y.constructor || x.prototype !== y.prototype) {\n return false;\n }\n\n // special-casing for some special types of object\n if (x instanceof RegExp || x instanceof Date) {\n return x.toString() === y.toString();\n }\n\n // the object algorithm works for Array, but it's sub-optimal.\n if (x instanceof Array) {\n if (x.length !== y.length) {\n return false;\n }\n\n for (let i = 0; i < x.length; i++) {\n if (!deepCompare(x[i], y[i])) {\n return false;\n }\n }\n } else {\n // disable jshint \"The body of a for in should be wrapped in an if\n // statement\"\n /* jshint -W089 */\n\n // check that all of y's direct keys are in x\n let p;\n for (p in y) {\n if (y.hasOwnProperty(p) !== x.hasOwnProperty(p)) {\n return false;\n }\n }\n\n // finally, compare each of x's keys with y\n for (p in y) { // eslint-disable-line guard-for-in\n if (y.hasOwnProperty(p) !== x.hasOwnProperty(p)) {\n return false;\n }\n if (!deepCompare(x[p], y[p])) {\n return false;\n }\n }\n }\n /* jshint +W089 */\n return true;\n}\n\n// Dev note: This returns a tuple, but jsdoc doesn't like that. https://github.com/jsdoc/jsdoc/issues/1703\n/**\n * Creates an array of object properties/values (entries) then\n * sorts the result by key, recursively. The input object must\n * ensure it does not have loops. If the input is not an object\n * then it will be returned as-is.\n * @param {*} obj The object to get entries of\n * @returns {Array} The entries, sorted by key.\n */\nexport function deepSortedObjectEntries(obj: any): [string, any][] {\n if (typeof(obj) !== \"object\") return obj;\n\n // Apparently these are object types...\n if (obj === null || obj === undefined || Array.isArray(obj)) return obj;\n\n const pairs: [string, any][] = [];\n for (const [k, v] of Object.entries(obj)) {\n pairs.push([k, deepSortedObjectEntries(v)]);\n }\n\n // lexicographicCompare is faster than localeCompare, so let's use that.\n pairs.sort((a, b) => lexicographicCompare(a[0], b[0]));\n\n return pairs;\n}\n\n/**\n * Copy properties from one object to another.\n *\n * All enumerable properties, included inherited ones, are copied.\n *\n * This is approximately equivalent to ES6's Object.assign, except\n * that the latter doesn't copy inherited properties.\n *\n * @param {Object} target The object that will receive new properties\n * @param {...Object} source Objects from which to copy properties\n *\n * @return {Object} target\n */\nexport function extend(...restParams) {\n const target = restParams[0] || {};\n for (let i = 1; i < restParams.length; i++) {\n const source = restParams[i];\n if (!source) continue;\n for (const propName in source) { // eslint-disable-line guard-for-in\n target[propName] = source[propName];\n }\n }\n return target;\n}\n\n/**\n * Inherit the prototype methods from one constructor into another. This is a\n * port of the Node.js implementation with an Object.create polyfill.\n *\n * @param {function} ctor Constructor function which needs to inherit the\n * prototype.\n * @param {function} superCtor Constructor function to inherit prototype from.\n */\nexport function inherits(ctor: Function, superCtor: Function) {\n // Add util.inherits from Node.js\n // Source:\n // https://github.com/joyent/node/blob/master/lib/util.js\n // Copyright Joyent, Inc. and other Node contributors.\n //\n // Permission is hereby granted, free of charge, to any person obtaining a\n // copy of this software and associated documentation files (the\n // \"Software\"), to deal in the Software without restriction, including\n // without limitation the rights to use, copy, modify, merge, publish,\n // distribute, sublicense, and/or sell copies of the Software, and to permit\n // persons to whom the Software is furnished to do so, subject to the\n // following conditions:\n //\n // The above copyright notice and this permission notice shall be included\n // in all copies or substantial portions of the Software.\n //\n // THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n // USE OR OTHER DEALINGS IN THE SOFTWARE.\n (ctor as any).super_ = superCtor;\n ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: false,\n writable: true,\n configurable: true,\n },\n });\n}\n\n/**\n * Polyfills inheritance for prototypes by allowing different kinds of\n * super types. Typically prototypes would use `SuperType.call(this, params)`\n * though this doesn't always work in some environments - this function\n * falls back to using `Object.assign()` to clone a constructed copy\n * of the super type onto `thisArg`.\n * @param {any} thisArg The child instance. Modified in place.\n * @param {any} SuperType The type to act as a super instance\n * @param {any} params Arguments to supply to the super type's constructor\n */\nexport function polyfillSuper(thisArg: any, SuperType: any, ...params: any[]) {\n try {\n SuperType.call(thisArg, ...params);\n } catch (e) {\n // fall back to Object.assign to just clone the thing\n const fakeSuper = new SuperType(...params);\n Object.assign(thisArg, fakeSuper);\n }\n}\n\n/**\n * Returns whether the given value is a finite number without type-coercion\n *\n * @param {*} value the value to test\n * @return {boolean} whether or not value is a finite number without type-coercion\n */\nexport function isNumber(value: any): boolean {\n return typeof value === 'number' && isFinite(value);\n}\n\n/**\n * Removes zero width chars, diacritics and whitespace from the string\n * Also applies an unhomoglyph on the string, to prevent similar looking chars\n * @param {string} str the string to remove hidden characters from\n * @return {string} a string with the hidden characters removed\n */\nexport function removeHiddenChars(str: string): string {\n if (typeof str === \"string\") {\n return unhomoglyph(str.normalize('NFD').replace(removeHiddenCharsRegex, ''));\n }\n return \"\";\n}\n\nexport function normalize(str: string): string {\n // Note: we have to match the filter with the removeHiddenChars() because the\n // function strips spaces and other characters (M becomes RN for example, in lowercase).\n return removeHiddenChars(str.toLowerCase())\n // Strip all punctuation\n .replace(/[\\\\'!\"#$%&()*+,\\-./:;<=>?@[\\]^_`{|}~\\u2000-\\u206f\\u2e00-\\u2e7f]/g, \"\")\n // We also doubly convert to lowercase to work around oddities of the library.\n .toLowerCase();\n}\n\n// Regex matching bunch of unicode control characters and otherwise misleading/invisible characters.\n// Includes:\n// various width spaces U+2000 - U+200D\n// LTR and RTL marks U+200E and U+200F\n// LTR/RTL and other directional formatting marks U+202A - U+202F\n// Arabic Letter RTL mark U+061C\n// Combining characters U+0300 - U+036F\n// Zero width no-break space (BOM) U+FEFF\n// eslint-disable-next-line no-misleading-character-class\nconst removeHiddenCharsRegex = /[\\u2000-\\u200F\\u202A-\\u202F\\u0300-\\u036F\\uFEFF\\u061C\\s]/g;\n\nexport function escapeRegExp(string: string): string {\n return string.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n}\n\nexport function globToRegexp(glob: string, extended?: any): string {\n extended = typeof(extended) === 'boolean' ? extended : true;\n // From\n // https://github.com/matrix-org/synapse/blob/abbee6b29be80a77e05730707602f3bbfc3f38cb/synapse/push/__init__.py#L132\n // Because micromatch is about 130KB with dependencies,\n // and minimatch is not much better.\n let pat = escapeRegExp(glob);\n pat = pat.replace(/\\\\\\*/g, '.*');\n pat = pat.replace(/\\?/g, '.');\n if (extended) {\n pat = pat.replace(/\\\\\\[(!|)(.*)\\\\]/g, function(match, p1, p2, offset, string) {\n const first = p1 && '^' || '';\n const second = p2.replace(/\\\\-/, '-');\n return '[' + first + second + ']';\n });\n }\n return pat;\n}\n\nexport function ensureNoTrailingSlash(url: string): string {\n if (url && url.endsWith(\"/\")) {\n return url.substr(0, url.length - 1);\n } else {\n return url;\n }\n}\n\n// Returns a promise which resolves with a given value after the given number of ms\nexport function sleep(ms: number, value?: T): Promise {\n return new Promise((resolve => {\n setTimeout(resolve, ms, value);\n }));\n}\n\nexport function isNullOrUndefined(val: any): boolean {\n return val === null || val === undefined;\n}\n\nexport interface IDeferred {\n resolve: (value: T) => void;\n reject: (reason?: any) => void;\n promise: Promise;\n}\n\n// Returns a Deferred\nexport function defer(): IDeferred {\n let resolve;\n let reject;\n\n const promise = new Promise((_resolve, _reject) => {\n resolve = _resolve;\n reject = _reject;\n });\n\n return { resolve, reject, promise };\n}\n\nexport async function promiseMapSeries(\n promises: T[],\n fn: (t: T) => void,\n): Promise {\n for (const o of promises) {\n await fn(await o);\n }\n}\n\nexport function promiseTry(fn: () => T | Promise): Promise {\n return new Promise((resolve) => resolve(fn()));\n}\n\n// Creates and awaits all promises, running no more than `chunkSize` at the same time\nexport async function chunkPromises(fns: (() => Promise)[], chunkSize: number): Promise {\n const results: T[] = [];\n for (let i = 0; i < fns.length; i += chunkSize) {\n results.push(...(await Promise.all(fns.slice(i, i + chunkSize).map(fn => fn()))));\n }\n return results;\n}\n\n/**\n * Retries the function until it succeeds or is interrupted. The given function must return\n * a promise which throws/rejects on error, otherwise the retry will assume the request\n * succeeded. The promise chain returned will contain the successful promise. The given function\n * should always return a new promise.\n * @param {Function} promiseFn The function to call to get a fresh promise instance. Takes an\n * attempt count as an argument, for logging/debugging purposes.\n * @returns {Promise} The promise for the retried operation.\n */\nexport function simpleRetryOperation(promiseFn: (attempt: number) => Promise): Promise {\n return promiseRetry((attempt: number) => {\n return promiseFn(attempt);\n }, {\n forever: true,\n factor: 2,\n minTimeout: 3000, // ms\n maxTimeout: 15000, // ms\n });\n}\n\n// We need to be able to access the Node.js crypto library from within the\n// Matrix SDK without needing to `require(\"crypto\")`, which will fail in\n// browsers. So `index.ts` will call `setCrypto` to store it, and when we need\n// it, we can call `getCrypto`.\nlet crypto: typeof NodeCrypto;\n\nexport function setCrypto(c: typeof NodeCrypto) {\n crypto = c;\n}\n\nexport function getCrypto(): typeof NodeCrypto {\n return crypto;\n}\n\n// String averaging inspired by https://stackoverflow.com/a/2510816\n// Dev note: We make the alphabet a string because it's easier to write syntactically\n// than arrays. Thankfully, strings implement the useful parts of the Array interface\n// anyhow.\n\n/**\n * The default alphabet used by string averaging in this SDK. This matches\n * all usefully printable ASCII characters (0x20-0x7E, inclusive).\n */\nexport const DEFAULT_ALPHABET = (() => {\n let str = \"\";\n for (let c = 0x20; c <= 0x7E; c++) {\n str += String.fromCharCode(c);\n }\n return str;\n})();\n\n/**\n * Pads a string using the given alphabet as a base. The returned string will be\n * padded at the end with the first character in the alphabet.\n *\n * This is intended for use with string averaging.\n * @param {string} s The string to pad.\n * @param {number} n The length to pad to.\n * @param {string} alphabet The alphabet to use as a single string.\n * @returns {string} The padded string.\n */\nexport function alphabetPad(s: string, n: number, alphabet = DEFAULT_ALPHABET): string {\n return s.padEnd(n, alphabet[0]);\n}\n\n/**\n * Converts a baseN number to a string, where N is the alphabet's length.\n *\n * This is intended for use with string averaging.\n * @param {bigint} n The baseN number.\n * @param {string} alphabet The alphabet to use as a single string.\n * @returns {string} The baseN number encoded as a string from the alphabet.\n */\nexport function baseToString(n: bigint, alphabet = DEFAULT_ALPHABET): string {\n // Developer note: the stringToBase() function offsets the character set by 1 so that repeated\n // characters (ie: \"aaaaaa\" in a..z) don't come out as zero. We have to reverse this here as\n // otherwise we'll be wrong in our conversion. Undoing a +1 before an exponent isn't very fun\n // though, so we rely on a lengthy amount of `x - 1` and integer division rules to reach a\n // sane state. This also means we have to do rollover detection: see below.\n\n const len = BigInt(alphabet.length);\n if (n <= len) {\n return alphabet[Number(n) - 1] ?? \"\";\n }\n\n let d = n / len;\n let r = Number(n % len) - 1;\n\n // Rollover detection: if the remainder is negative, it means that the string needs\n // to roll over by 1 character downwards (ie: in a..z, the previous to \"aaa\" would be\n // \"zz\").\n if (r < 0) {\n d -= BigInt(Math.abs(r)); // abs() is just to be clear what we're doing. Could also `+= r`.\n r = Number(len) - 1;\n }\n\n return baseToString(d, alphabet) + alphabet[r];\n}\n\n/**\n * Converts a string to a baseN number, where N is the alphabet's length.\n *\n * This is intended for use with string averaging.\n * @param {string} s The string to convert to a number.\n * @param {string} alphabet The alphabet to use as a single string.\n * @returns {bigint} The baseN number.\n */\nexport function stringToBase(s: string, alphabet = DEFAULT_ALPHABET): bigint {\n const len = BigInt(alphabet.length);\n\n // In our conversion to baseN we do a couple performance optimizations to avoid using\n // excess CPU and such. To create baseN numbers, the input string needs to be reversed\n // so the exponents stack up appropriately, as the last character in the unreversed\n // string has less impact than the first character (in \"abc\" the A is a lot more important\n // for lexicographic sorts). We also do a trick with the character codes to optimize the\n // alphabet lookup, avoiding an index scan of `alphabet.indexOf(reversedStr[i])` - we know\n // that the alphabet and (theoretically) the input string are constrained on character sets\n // and thus can do simple subtraction to end up with the same result.\n\n // Developer caution: we carefully cast to BigInt here to avoid losing precision. We cannot\n // rely on Math.pow() (for example) to be capable of handling our insane numbers.\n\n let result = BigInt(0);\n for (let i = s.length - 1, j = BigInt(0); i >= 0; i--, j++) {\n const charIndex = s.charCodeAt(i) - alphabet.charCodeAt(0);\n\n // We add 1 to the char index to offset the whole numbering scheme. We unpack this in\n // the baseToString() function.\n result += BigInt(1 + charIndex) * (len ** j);\n }\n return result;\n}\n\n/**\n * Averages two strings, returning the midpoint between them. This is accomplished by\n * converting both to baseN numbers (where N is the alphabet's length) then averaging\n * those before re-encoding as a string.\n * @param {string} a The first string.\n * @param {string} b The second string.\n * @param {string} alphabet The alphabet to use as a single string.\n * @returns {string} The midpoint between the strings, as a string.\n */\nexport function averageBetweenStrings(a: string, b: string, alphabet = DEFAULT_ALPHABET): string {\n const padN = Math.max(a.length, b.length);\n const baseA = stringToBase(alphabetPad(a, padN, alphabet), alphabet);\n const baseB = stringToBase(alphabetPad(b, padN, alphabet), alphabet);\n const avg = (baseA + baseB) / BigInt(2);\n\n // Detect integer division conflicts. This happens when two numbers are divided too close so\n // we lose a .5 precision. We need to add a padding character in these cases.\n if (avg === baseA || avg == baseB) {\n return baseToString(avg, alphabet) + alphabet[0];\n }\n\n return baseToString(avg, alphabet);\n}\n\n/**\n * Finds the next string using the alphabet provided. This is done by converting the\n * string to a baseN number, where N is the alphabet's length, then adding 1 before\n * converting back to a string.\n * @param {string} s The string to start at.\n * @param {string} alphabet The alphabet to use as a single string.\n * @returns {string} The string which follows the input string.\n */\nexport function nextString(s: string, alphabet = DEFAULT_ALPHABET): string {\n return baseToString(stringToBase(s, alphabet) + BigInt(1), alphabet);\n}\n\n/**\n * Finds the previous string using the alphabet provided. This is done by converting the\n * string to a baseN number, where N is the alphabet's length, then subtracting 1 before\n * converting back to a string.\n * @param {string} s The string to start at.\n * @param {string} alphabet The alphabet to use as a single string.\n * @returns {string} The string which precedes the input string.\n */\nexport function prevString(s: string, alphabet = DEFAULT_ALPHABET): string {\n return baseToString(stringToBase(s, alphabet) - BigInt(1), alphabet);\n}\n\n/**\n * Compares strings lexicographically as a sort-safe function.\n * @param {string} a The first (reference) string.\n * @param {string} b The second (compare) string.\n * @returns {number} Negative if the reference string is before the compare string;\n * positive if the reference string is after; and zero if equal.\n */\nexport function lexicographicCompare(a: string, b: string): number {\n // Dev note: this exists because I'm sad that you can use math operators on strings, so I've\n // hidden the operation in this function.\n return (a < b) ? -1 : ((a === b) ? 0 : 1);\n}\n\nconst collator = new Intl.Collator();\n/**\n * Performant language-sensitive string comparison\n * @param a the first string to compare\n * @param b the second string to compare\n */\nexport function compare(a: string, b: string): number {\n return collator.compare(a, b);\n}\n\n/**\n * This function is similar to Object.assign() but it assigns recursively and\n * allows you to ignore nullish values from the source\n *\n * @param {Object} target\n * @param {Object} source\n * @returns the target object\n */\nexport function recursivelyAssign(target: Object, source: Object, ignoreNullish = false): any {\n for (const [sourceKey, sourceValue] of Object.entries(source)) {\n if (target[sourceKey] instanceof Object && sourceValue) {\n recursivelyAssign(target[sourceKey], sourceValue);\n continue;\n }\n if ((sourceValue !== null && sourceValue !== undefined) || !ignoreNullish) {\n target[sourceKey] = sourceValue;\n continue;\n }\n }\n return target;\n}\n", + "/*\nCopyright 2015, 2016 OpenMarket Ltd\nCopyright 2017 New Vector Ltd\nCopyright 2019, 2020 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n/**\n * This is an internal module. See {@link createNewMatrixCall} for the public API.\n * @module webrtc/call\n */\n\nimport { logger } from '../logger';\nimport { EventEmitter } from 'events';\nimport * as utils from '../utils';\nimport { MatrixEvent } from '../models/event';\nimport { EventType } from '../@types/event';\nimport { RoomMember } from '../models/room-member';\nimport { randomString } from '../randomstring';\nimport {\n MCallReplacesEvent,\n MCallAnswer,\n MCallInviteNegotiate,\n CallCapabilities,\n SDPStreamMetadataPurpose,\n SDPStreamMetadata,\n SDPStreamMetadataKey,\n MCallSDPStreamMetadataChanged,\n MCallSelectAnswer,\n MCAllAssertedIdentity,\n MCallCandidates,\n MCallBase,\n MCallHangupReject,\n} from './callEventTypes';\nimport { CallFeed } from './callFeed';\nimport { MatrixClient } from \"../client\";\nimport { ISendEventResponse } from \"../@types/requests\";\n\n// events: hangup, error(err), replaced(call), state(state, oldState)\n\n/**\n * Fires whenever an error occurs when call.js encounters an issue with setting up the call.\n *

\n * The error given will have a code equal to either `MatrixCall.ERR_LOCAL_OFFER_FAILED` or\n * `MatrixCall.ERR_NO_USER_MEDIA`. `ERR_LOCAL_OFFER_FAILED` is emitted when the local client\n * fails to create an offer. `ERR_NO_USER_MEDIA` is emitted when the user has denied access\n * to their audio/video hardware.\n *\n * @event module:webrtc/call~MatrixCall#\"error\"\n * @param {Error} err The error raised by MatrixCall.\n * @example\n * matrixCall.on(\"error\", function(err){\n * console.error(err.code, err);\n * });\n */\n\ninterface CallOpts {\n roomId?: string;\n invitee?: string;\n client?: any; // Fix when client is TSified\n forceTURN?: boolean;\n turnServers?: Array;\n}\n\ninterface TurnServer {\n urls: Array;\n username?: string;\n password?: string;\n ttl?: number;\n}\n\ninterface AssertedIdentity {\n id: string;\n displayName: string;\n}\n\nexport enum CallState {\n Fledgling = 'fledgling',\n InviteSent = 'invite_sent',\n WaitLocalMedia = 'wait_local_media',\n CreateOffer = 'create_offer',\n CreateAnswer = 'create_answer',\n Connecting = 'connecting',\n Connected = 'connected',\n Ringing = 'ringing',\n Ended = 'ended',\n}\n\nexport enum CallType {\n Voice = 'voice',\n Video = 'video',\n}\n\nexport enum CallDirection {\n Inbound = 'inbound',\n Outbound = 'outbound',\n}\n\nexport enum CallParty {\n Local = 'local',\n Remote = 'remote',\n}\n\nexport enum CallEvent {\n Hangup = 'hangup',\n State = 'state',\n Error = 'error',\n Replaced = 'replaced',\n\n // The value of isLocalOnHold() has changed\n LocalHoldUnhold = 'local_hold_unhold',\n // The value of isRemoteOnHold() has changed\n RemoteHoldUnhold = 'remote_hold_unhold',\n // backwards compat alias for LocalHoldUnhold: remove in a major version bump\n HoldUnhold = 'hold_unhold',\n // Feeds have changed\n FeedsChanged = 'feeds_changed',\n\n AssertedIdentityChanged = 'asserted_identity_changed',\n}\n\nexport enum CallErrorCode {\n /** The user chose to end the call */\n UserHangup = 'user_hangup',\n\n /** An error code when the local client failed to create an offer. */\n LocalOfferFailed = 'local_offer_failed',\n /**\n * An error code when there is no local mic/camera to use. This may be because\n * the hardware isn't plugged in, or the user has explicitly denied access.\n */\n NoUserMedia = 'no_user_media',\n\n /**\n * Error code used when a call event failed to send\n * because unknown devices were present in the room\n */\n UnknownDevices = 'unknown_devices',\n\n /**\n * Error code used when we fail to send the invite\n * for some reason other than there being unknown devices\n */\n SendInvite = 'send_invite',\n\n /**\n * An answer could not be created\n */\n CreateAnswer = 'create_answer',\n\n /**\n * Error code used when we fail to send the answer\n * for some reason other than there being unknown devices\n */\n SendAnswer = 'send_answer',\n\n /**\n * The session description from the other side could not be set\n */\n SetRemoteDescription = 'set_remote_description',\n\n /**\n * The session description from this side could not be set\n */\n SetLocalDescription = 'set_local_description',\n\n /**\n * A different device answered the call\n */\n AnsweredElsewhere = 'answered_elsewhere',\n\n /**\n * No media connection could be established to the other party\n */\n IceFailed = 'ice_failed',\n\n /**\n * The invite timed out whilst waiting for an answer\n */\n InviteTimeout = 'invite_timeout',\n\n /**\n * The call was replaced by another call\n */\n Replaced = 'replaced',\n\n /**\n * Signalling for the call could not be sent (other than the initial invite)\n */\n SignallingFailed = 'signalling_timeout',\n\n /**\n * The remote party is busy\n */\n UserBusy = 'user_busy',\n\n /**\n * We transferred the call off to somewhere else\n */\n Transfered = 'transferred',\n}\n\nexport enum ConstraintsType {\n Audio = \"audio\",\n Video = \"video\",\n}\n\n/**\n * The version field that we set in m.call.* events\n */\nconst VOIP_PROTO_VERSION = 1;\n\n/** The fallback ICE server to use for STUN or TURN protocols. */\nconst FALLBACK_ICE_SERVER = 'stun:turn.matrix.org';\n\n/** The length of time a call can be ringing for. */\nconst CALL_TIMEOUT_MS = 60000;\n\n/** Retrieves sources from desktopCapturer */\nexport function getDesktopCapturerSources(): Promise> {\n const options: GetSourcesOptions = {\n thumbnailSize: {\n height: 176,\n width: 312,\n },\n types: [\n \"screen\",\n \"window\",\n ],\n };\n return window.electron.getDesktopCapturerSources(options);\n}\n\nexport class CallError extends Error {\n code: string;\n\n constructor(code: CallErrorCode, msg: string, err: Error) {\n // Still don't think there's any way to have proper nested errors\n super(msg + \": \" + err);\n\n this.code = code;\n }\n}\n\nfunction genCallID(): string {\n return Date.now().toString() + randomString(16);\n}\n\n/**\n * Construct a new Matrix Call.\n * @constructor\n * @param {Object} opts Config options.\n * @param {string} opts.roomId The room ID for this call.\n * @param {Object} opts.webRtc The WebRTC globals from the browser.\n * @param {boolean} opts.forceTURN whether relay through TURN should be forced.\n * @param {Object} opts.URL The URL global.\n * @param {Array} opts.turnServers Optional. A list of TURN servers.\n * @param {MatrixClient} opts.client The Matrix Client instance to send events to.\n */\nexport class MatrixCall extends EventEmitter {\n public roomId: string;\n public type: CallType = null;\n public callId: string;\n public invitee?: string;\n public state = CallState.Fledgling;\n public hangupParty: CallParty;\n public hangupReason: string;\n public direction: CallDirection;\n public ourPartyId: string;\n\n private client: MatrixClient;\n private forceTURN: boolean;\n private turnServers: Array;\n // A queue for candidates waiting to go out.\n // We try to amalgamate candidates into a single candidate message where\n // possible\n private candidateSendQueue: Array = [];\n private candidateSendTries = 0;\n private sentEndOfCandidates = false;\n private peerConn: RTCPeerConnection;\n private feeds: Array = [];\n private usermediaSenders: Array = [];\n private screensharingSenders: Array = [];\n private inviteOrAnswerSent = false;\n private waitForLocalAVStream: boolean;\n private successor: MatrixCall;\n private opponentMember: RoomMember;\n private opponentVersion: number | string;\n // The party ID of the other side: undefined if we haven't chosen a partner\n // yet, null if we have but they didn't send a party ID.\n private opponentPartyId: string;\n private opponentCaps: CallCapabilities;\n private inviteTimeout: number;\n private iceDisconnectedTimeout: number;\n\n // The logic of when & if a call is on hold is nontrivial and explained in is*OnHold\n // This flag represents whether we want the other party to be on hold\n private remoteOnHold = false;\n\n // the stats for the call at the point it ended. We can't get these after we\n // tear the call down, so we just grab a snapshot before we stop the call.\n // The typescript definitions have this type as 'any' :(\n private callStatsAtEnd: any[];\n\n // Perfect negotiation state: https://www.w3.org/TR/webrtc/#perfect-negotiation-example\n private makingOffer = false;\n private ignoreOffer: boolean;\n\n // If candidates arrive before we've picked an opponent (which, in particular,\n // will happen if the opponent sends candidates eagerly before the user answers\n // the call) we buffer them up here so we can then add the ones from the party we pick\n private remoteCandidateBuffer = new Map();\n\n private remoteAssertedIdentity: AssertedIdentity;\n\n private remoteSDPStreamMetadata: SDPStreamMetadata;\n\n constructor(opts: CallOpts) {\n super();\n this.roomId = opts.roomId;\n this.invitee = opts.invitee;\n this.client = opts.client;\n this.forceTURN = opts.forceTURN;\n this.ourPartyId = this.client.deviceId;\n // Array of Objects with urls, username, credential keys\n this.turnServers = opts.turnServers || [];\n if (this.turnServers.length === 0 && this.client.isFallbackICEServerAllowed()) {\n this.turnServers.push({\n urls: [FALLBACK_ICE_SERVER],\n });\n }\n for (const server of this.turnServers) {\n utils.checkObjectHasKeys(server, [\"urls\"]);\n }\n this.callId = genCallID();\n }\n\n /**\n * Place a voice call to this room.\n * @throws If you have not specified a listener for 'error' events.\n */\n public async placeVoiceCall(): Promise {\n logger.debug(\"placeVoiceCall\");\n this.checkForErrorListener();\n this.type = CallType.Voice;\n await this.placeCallWithConstraints(ConstraintsType.Audio);\n }\n\n /**\n * Place a video call to this room.\n * @throws If you have not specified a listener for 'error' events.\n */\n public async placeVideoCall(): Promise {\n logger.debug(\"placeVideoCall\");\n this.checkForErrorListener();\n this.type = CallType.Video;\n await this.placeCallWithConstraints(ConstraintsType.Video);\n }\n\n public getOpponentMember(): RoomMember {\n return this.opponentMember;\n }\n\n public opponentCanBeTransferred(): boolean {\n return Boolean(this.opponentCaps && this.opponentCaps[\"m.call.transferee\"]);\n }\n\n public opponentSupportsDTMF(): boolean {\n return Boolean(this.opponentCaps && this.opponentCaps[\"m.call.dtmf\"]);\n }\n\n public getRemoteAssertedIdentity(): AssertedIdentity {\n return this.remoteAssertedIdentity;\n }\n\n public get localUsermediaFeed(): CallFeed {\n return this.getLocalFeeds().find((feed) => feed.purpose === SDPStreamMetadataPurpose.Usermedia);\n }\n\n public get localScreensharingFeed(): CallFeed {\n return this.getLocalFeeds().find((feed) => feed.purpose === SDPStreamMetadataPurpose.Screenshare);\n }\n\n public get localUsermediaStream(): MediaStream {\n return this.localUsermediaFeed?.stream;\n }\n\n private get localScreensharingStream(): MediaStream {\n return this.localScreensharingFeed?.stream;\n }\n\n private getFeedByStreamId(streamId: string): CallFeed {\n return this.getFeeds().find((feed) => feed.stream.id === streamId);\n }\n\n /**\n * Returns an array of all CallFeeds\n * @returns {Array} CallFeeds\n */\n public getFeeds(): Array {\n return this.feeds;\n }\n\n /**\n * Returns an array of all local CallFeeds\n * @returns {Array} local CallFeeds\n */\n public getLocalFeeds(): Array {\n return this.feeds.filter((feed) => feed.isLocal());\n }\n\n /**\n * Returns an array of all remote CallFeeds\n * @returns {Array} remote CallFeeds\n */\n public getRemoteFeeds(): Array {\n return this.feeds.filter((feed) => !feed.isLocal());\n }\n\n /**\n * Generates and returns localSDPStreamMetadata\n * @returns {SDPStreamMetadata} localSDPStreamMetadata\n */\n private getLocalSDPStreamMetadata(): SDPStreamMetadata {\n const metadata: SDPStreamMetadata = {};\n for (const localFeed of this.getLocalFeeds()) {\n metadata[localFeed.stream.id] = {\n purpose: localFeed.purpose,\n audio_muted: localFeed.isAudioMuted(),\n video_muted: localFeed.isVideoMuted(),\n };\n }\n logger.debug(\"Got local SDPStreamMetadata\", metadata);\n return metadata;\n }\n\n /**\n * Returns true if there are no incoming feeds,\n * otherwise returns false\n * @returns {boolean} no incoming feeds\n */\n public noIncomingFeeds(): boolean {\n return !this.feeds.some((feed) => !feed.isLocal());\n }\n\n private pushRemoteFeed(stream: MediaStream): void {\n // Fallback to old behavior if the other side doesn't support SDPStreamMetadata\n if (!this.opponentSupportsSDPStreamMetadata()) {\n this.pushRemoteFeedWithoutMetadata(stream);\n return;\n }\n\n const userId = this.getOpponentMember().userId;\n const purpose = this.remoteSDPStreamMetadata[stream.id].purpose;\n const audioMuted = this.remoteSDPStreamMetadata[stream.id].audio_muted;\n const videoMuted = this.remoteSDPStreamMetadata[stream.id].video_muted;\n\n if (!purpose) {\n logger.warn(`Ignoring stream with id ${stream.id} because we didn't get any metadata about it`);\n return;\n }\n\n // Try to find a feed with the same purpose as the new stream,\n // if we find it replace the old stream with the new one\n const existingFeed = this.getRemoteFeeds().find((feed) => feed.purpose === purpose);\n if (existingFeed) {\n existingFeed.setNewStream(stream);\n } else {\n this.feeds.push(new CallFeed(stream, userId, purpose, this.client, this.roomId, audioMuted, videoMuted));\n this.emit(CallEvent.FeedsChanged, this.feeds);\n }\n\n logger.info(`Pushed remote stream (id=\"${stream.id}\", active=\"${stream.active}\", purpose=${purpose})`);\n }\n\n /**\n * This method is used ONLY if the other client doesn't support sending SDPStreamMetadata\n */\n private pushRemoteFeedWithoutMetadata(stream: MediaStream): void {\n const userId = this.getOpponentMember().userId;\n // We can guess the purpose here since the other client can only send one stream\n const purpose = SDPStreamMetadataPurpose.Usermedia;\n const oldRemoteStream = this.feeds.find((feed) => !feed.isLocal())?.stream;\n\n // Note that we check by ID and always set the remote stream: Chrome appears\n // to make new stream objects when transceiver directionality is changed and the 'active'\n // status of streams change - Dave\n // If we already have a stream, check this stream has the same id\n if (oldRemoteStream && stream.id !== oldRemoteStream.id) {\n logger.warn(`Ignoring new stream ID ${stream.id}: we already have stream ID ${oldRemoteStream.id}`);\n return;\n }\n\n // Try to find a feed with the same stream id as the new stream,\n // if we find it replace the old stream with the new one\n const feed = this.getFeedByStreamId(stream.id);\n if (feed) {\n feed.setNewStream(stream);\n } else {\n this.feeds.push(new CallFeed(stream, userId, purpose, this.client, this.roomId, false, false));\n this.emit(CallEvent.FeedsChanged, this.feeds);\n }\n\n logger.info(`Pushed remote stream (id=\"${stream.id}\", active=\"${stream.active}\")`);\n }\n\n private pushLocalFeed(stream: MediaStream, purpose: SDPStreamMetadataPurpose, addToPeerConnection = true): void {\n const userId = this.client.getUserId();\n\n // We try to replace an existing feed if there already is one with the same purpose\n const existingFeed = this.getLocalFeeds().find((feed) => feed.purpose === purpose);\n if (existingFeed) {\n existingFeed.setNewStream(stream);\n } else {\n this.feeds.push(new CallFeed(stream, userId, purpose, this.client, this.roomId, false, false));\n this.emit(CallEvent.FeedsChanged, this.feeds);\n }\n\n // TODO: Find out what is going on here\n // why do we enable audio (and only audio) tracks here? -- matthew\n setTracksEnabled(stream.getAudioTracks(), true);\n\n if (addToPeerConnection) {\n const senderArray = purpose === SDPStreamMetadataPurpose.Usermedia ?\n this.usermediaSenders : this.screensharingSenders;\n // Empty the array\n senderArray.splice(0, senderArray.length);\n\n this.emit(CallEvent.FeedsChanged, this.feeds);\n for (const track of stream.getTracks()) {\n logger.info(\n `Adding track (` +\n `id=\"${track.id}\", ` +\n `kind=\"${track.kind}\", ` +\n `streamId=\"${stream.id}\", ` +\n `streamPurpose=\"${purpose}\"` +\n `) to peer connection`,\n );\n senderArray.push(this.peerConn.addTrack(track, stream));\n }\n }\n\n logger.info(`Pushed local stream (id=\"${stream.id}\", active=\"${stream.active}\", purpose=\"${purpose}\")`);\n }\n\n private deleteAllFeeds(): void {\n this.feeds = [];\n this.emit(CallEvent.FeedsChanged, this.feeds);\n }\n\n private deleteFeedByStream(stream: MediaStream): void {\n logger.debug(`Removing feed with stream id ${stream.id}`);\n\n const feed = this.getFeedByStreamId(stream.id);\n if (!feed) {\n logger.warn(`Didn't find the feed with stream id ${stream.id} to delete`);\n return;\n }\n\n this.feeds.splice(this.feeds.indexOf(feed), 1);\n this.emit(CallEvent.FeedsChanged, this.feeds);\n }\n\n // The typescript definitions have this type as 'any' :(\n public async getCurrentCallStats(): Promise {\n if (this.callHasEnded()) {\n return this.callStatsAtEnd;\n }\n\n return this.collectCallStats();\n }\n\n private async collectCallStats(): Promise {\n // This happens when the call fails before it starts.\n // For example when we fail to get capture sources\n if (!this.peerConn) return;\n\n const statsReport = await this.peerConn.getStats();\n const stats = [];\n for (const item of statsReport) {\n stats.push(item[1]);\n }\n\n return stats;\n }\n\n /**\n * Configure this call from an invite event. Used by MatrixClient.\n * @param {MatrixEvent} event The m.call.invite event\n */\n public async initWithInvite(event: MatrixEvent): Promise {\n const invite = event.getContent();\n this.direction = CallDirection.Inbound;\n\n // make sure we have valid turn creds. Unless something's gone wrong, it should\n // poll and keep the credentials valid so this should be instant.\n const haveTurnCreds = await this.client.checkTurnServers();\n if (!haveTurnCreds) {\n logger.warn(\"Failed to get TURN credentials! Proceeding with call anyway...\");\n }\n\n const sdpStreamMetadata = invite[SDPStreamMetadataKey];\n if (sdpStreamMetadata) {\n this.updateRemoteSDPStreamMetadata(sdpStreamMetadata);\n } else {\n logger.debug(\"Did not get any SDPStreamMetadata! Can not send/receive multiple streams\");\n }\n\n this.peerConn = this.createPeerConnection();\n // we must set the party ID before await-ing on anything: the call event\n // handler will start giving us more call events (eg. candidates) so if\n // we haven't set the party ID, we'll ignore them.\n this.chooseOpponent(event);\n try {\n await this.peerConn.setRemoteDescription(invite.offer);\n await this.addBufferedIceCandidates();\n } catch (e) {\n logger.debug(\"Failed to set remote description\", e);\n this.terminate(CallParty.Local, CallErrorCode.SetRemoteDescription, false);\n return;\n }\n\n const remoteStream = this.feeds.find((feed) => !feed.isLocal())?.stream;\n\n // According to previous comments in this file, firefox at some point did not\n // add streams until media started arriving on them. Testing latest firefox\n // (81 at time of writing), this is no longer a problem, so let's do it the correct way.\n if (!remoteStream || remoteStream.getTracks().length === 0) {\n logger.error(\"No remote stream or no tracks after setting remote description!\");\n this.terminate(CallParty.Local, CallErrorCode.SetRemoteDescription, false);\n return;\n }\n\n this.type = remoteStream.getTracks().some(t => t.kind === 'video') ? CallType.Video : CallType.Voice;\n\n this.setState(CallState.Ringing);\n\n if (event.getLocalAge()) {\n setTimeout(() => {\n if (this.state == CallState.Ringing) {\n logger.debug(\"Call invite has expired. Hanging up.\");\n this.hangupParty = CallParty.Remote; // effectively\n this.setState(CallState.Ended);\n this.stopAllMedia();\n if (this.peerConn.signalingState != 'closed') {\n this.peerConn.close();\n }\n this.emit(CallEvent.Hangup);\n }\n }, invite.lifetime - event.getLocalAge());\n }\n }\n\n /**\n * Configure this call from a hangup or reject event. Used by MatrixClient.\n * @param {MatrixEvent} event The m.call.hangup event\n */\n public initWithHangup(event: MatrixEvent): void {\n // perverse as it may seem, sometimes we want to instantiate a call with a\n // hangup message (because when getting the state of the room on load, events\n // come in reverse order and we want to remember that a call has been hung up)\n this.setState(CallState.Ended);\n }\n\n /**\n * Answer a call.\n */\n public async answer(): Promise {\n if (this.inviteOrAnswerSent) {\n return;\n }\n\n logger.debug(`Answering call ${this.callId} of type ${this.type}`);\n\n if (!this.localUsermediaStream && !this.waitForLocalAVStream) {\n const constraints = getUserMediaContraints(\n this.type == CallType.Video ?\n ConstraintsType.Video:\n ConstraintsType.Audio,\n );\n logger.log(\"Getting user media with constraints\", constraints);\n this.setState(CallState.WaitLocalMedia);\n this.waitForLocalAVStream = true;\n\n try {\n let mediaStream: MediaStream;\n\n if (this.type === CallType.Voice) {\n mediaStream = await this.client.getLocalAudioStream();\n } else {\n mediaStream = await this.client.getLocalVideoStream();\n }\n\n this.waitForLocalAVStream = false;\n this.gotUserMediaForAnswer(mediaStream);\n } catch (e) {\n this.getUserMediaFailed(e);\n return;\n }\n } else if (this.waitForLocalAVStream) {\n this.setState(CallState.WaitLocalMedia);\n }\n }\n\n /**\n * Replace this call with a new call, e.g. for glare resolution. Used by\n * MatrixClient.\n * @param {MatrixCall} newCall The new call.\n */\n public replacedBy(newCall: MatrixCall): void {\n if (this.state === CallState.WaitLocalMedia) {\n logger.debug(\"Telling new call to wait for local media\");\n newCall.waitForLocalAVStream = true;\n } else if ([CallState.CreateOffer, CallState.InviteSent].includes(this.state)) {\n logger.debug(\"Handing local stream to new call\");\n newCall.gotUserMediaForAnswer(this.localUsermediaStream);\n }\n this.successor = newCall;\n this.emit(CallEvent.Replaced, newCall);\n this.hangup(CallErrorCode.Replaced, true);\n }\n\n /**\n * Hangup a call.\n * @param {string} reason The reason why the call is being hung up.\n * @param {boolean} suppressEvent True to suppress emitting an event.\n */\n public hangup(reason: CallErrorCode, suppressEvent: boolean): void {\n if (this.callHasEnded()) return;\n\n logger.debug(\"Ending call \" + this.callId);\n this.terminate(CallParty.Local, reason, !suppressEvent);\n // We don't want to send hangup here if we didn't even get to sending an invite\n if (this.state === CallState.WaitLocalMedia) return;\n const content = {};\n // Don't send UserHangup reason to older clients\n if ((this.opponentVersion && this.opponentVersion >= 1) || reason !== CallErrorCode.UserHangup) {\n content[\"reason\"] = reason;\n }\n this.sendVoipEvent(EventType.CallHangup, content);\n }\n\n /**\n * Reject a call\n * This used to be done by calling hangup, but is a separate method and protocol\n * event as of MSC2746.\n */\n public reject(): void {\n if (this.state !== CallState.Ringing) {\n throw Error(\"Call must be in 'ringing' state to reject!\");\n }\n\n if (this.opponentVersion < 1) {\n logger.info(\n `Opponent version is less than 1 (${this.opponentVersion}): sending hangup instead of reject`,\n );\n this.hangup(CallErrorCode.UserHangup, true);\n return;\n }\n\n logger.debug(\"Rejecting call: \" + this.callId);\n this.terminate(CallParty.Local, CallErrorCode.UserHangup, true);\n this.sendVoipEvent(EventType.CallReject, {});\n }\n\n /**\n * Returns true if this.remoteSDPStreamMetadata is defined, otherwise returns false\n * @returns {boolean} can screenshare\n */\n public opponentSupportsSDPStreamMetadata(): boolean {\n return Boolean(this.remoteSDPStreamMetadata);\n }\n\n /**\n * If there is a screensharing stream returns true, otherwise returns false\n * @returns {boolean} is screensharing\n */\n public isScreensharing(): boolean {\n return Boolean(this.localScreensharingStream);\n }\n\n /**\n * Starts/stops screensharing\n * @param enabled the desired screensharing state\n * @param selectDesktopCapturerSource callBack to select a screensharing stream on desktop\n * @returns {boolean} new screensharing state\n */\n public async setScreensharingEnabled(\n enabled: boolean,\n selectDesktopCapturerSource?: () => Promise,\n ): Promise {\n // Skip if there is nothing to do\n if (enabled && this.isScreensharing()) {\n logger.warn(`There is already a screensharing stream - there is nothing to do!`);\n return true;\n } else if (!enabled && !this.isScreensharing()) {\n logger.warn(`There already isn't a screensharing stream - there is nothing to do!`);\n return false;\n }\n\n // Fallback to replaceTrack()\n if (!this.opponentSupportsSDPStreamMetadata()) {\n return await this.setScreensharingEnabledWithoutMetadataSupport(enabled, selectDesktopCapturerSource);\n }\n\n logger.debug(`Set screensharing enabled? ${enabled}`);\n if (enabled) {\n try {\n const stream = await getScreensharingStream(selectDesktopCapturerSource);\n if (!stream) return false;\n this.pushLocalFeed(stream, SDPStreamMetadataPurpose.Screenshare);\n return true;\n } catch (err) {\n this.emit(CallEvent.Error,\n new CallError(CallErrorCode.NoUserMedia, \"Failed to get screen-sharing stream: \", err),\n );\n return false;\n }\n } else {\n for (const sender of this.screensharingSenders) {\n this.peerConn.removeTrack(sender);\n }\n for (const track of this.localScreensharingStream.getTracks()) {\n track.stop();\n }\n this.deleteFeedByStream(this.localScreensharingStream);\n return false;\n }\n }\n\n /**\n * Starts/stops screensharing\n * Should be used ONLY if the opponent doesn't support SDPStreamMetadata\n * @param enabled the desired screensharing state\n * @param selectDesktopCapturerSource callBack to select a screensharing stream on desktop\n * @returns {boolean} new screensharing state\n */\n private async setScreensharingEnabledWithoutMetadataSupport(\n enabled: boolean,\n selectDesktopCapturerSource?: () => Promise,\n ): Promise {\n logger.debug(`Set screensharing enabled? ${enabled} using replaceTrack()`);\n if (enabled) {\n try {\n const stream = await getScreensharingStream(selectDesktopCapturerSource);\n if (!stream) return false;\n\n const track = stream.getTracks().find((track) => {\n return track.kind === \"video\";\n });\n const sender = this.usermediaSenders.find((sender) => {\n return sender.track?.kind === \"video\";\n });\n sender.replaceTrack(track);\n\n this.pushLocalFeed(stream, SDPStreamMetadataPurpose.Screenshare, false);\n\n return true;\n } catch (err) {\n this.emit(CallEvent.Error,\n new CallError(CallErrorCode.NoUserMedia, \"Failed to get screen-sharing stream: \", err),\n );\n return false;\n }\n } else {\n const track = this.localUsermediaStream.getTracks().find((track) => {\n return track.kind === \"video\";\n });\n const sender = this.usermediaSenders.find((sender) => {\n return sender.track?.kind === \"video\";\n });\n sender.replaceTrack(track);\n\n for (const track of this.localScreensharingStream.getTracks()) {\n track.stop();\n }\n this.deleteFeedByStream(this.localScreensharingStream);\n\n return false;\n }\n }\n\n /**\n * Set whether our outbound video should be muted or not.\n * @param {boolean} muted True to mute the outbound video.\n */\n public setLocalVideoMuted(muted: boolean): void {\n this.localUsermediaFeed?.setVideoMuted(muted);\n this.updateMuteStatus();\n }\n\n /**\n * Check if local video is muted.\n *\n * If there are multiple video tracks, all of the tracks need to be muted\n * for this to return true. This means if there are no video tracks, this will\n * return true.\n * @return {Boolean} True if the local preview video is muted, else false\n * (including if the call is not set up yet).\n */\n public isLocalVideoMuted(): boolean {\n return this.localUsermediaFeed?.isVideoMuted();\n }\n\n /**\n * Set whether the microphone should be muted or not.\n * @param {boolean} muted True to mute the mic.\n */\n public setMicrophoneMuted(muted: boolean): void {\n this.localUsermediaFeed?.setAudioMuted(muted);\n this.updateMuteStatus();\n }\n\n /**\n * Check if the microphone is muted.\n *\n * If there are multiple audio tracks, all of the tracks need to be muted\n * for this to return true. This means if there are no audio tracks, this will\n * return true.\n * @return {Boolean} True if the mic is muted, else false (including if the call\n * is not set up yet).\n */\n public isMicrophoneMuted(): boolean {\n return this.localUsermediaFeed?.isAudioMuted();\n }\n\n /**\n * @returns true if we have put the party on the other side of the call on hold\n * (that is, we are signalling to them that we are not listening)\n */\n public isRemoteOnHold(): boolean {\n return this.remoteOnHold;\n }\n\n public setRemoteOnHold(onHold: boolean): void {\n if (this.isRemoteOnHold() === onHold) return;\n this.remoteOnHold = onHold;\n\n for (const transceiver of this.peerConn.getTransceivers()) {\n // We don't send hold music or anything so we're not actually\n // sending anything, but sendrecv is fairly standard for hold and\n // it makes it a lot easier to figure out who's put who on hold.\n transceiver.direction = onHold ? 'sendonly' : 'sendrecv';\n }\n this.updateMuteStatus();\n\n this.emit(CallEvent.RemoteHoldUnhold, this.remoteOnHold);\n }\n\n /**\n * Indicates whether we are 'on hold' to the remote party (ie. if true,\n * they cannot hear us).\n * @returns true if the other party has put us on hold\n */\n public isLocalOnHold(): boolean {\n if (this.state !== CallState.Connected) return false;\n\n let callOnHold = true;\n\n // We consider a call to be on hold only if *all* the tracks are on hold\n // (is this the right thing to do?)\n for (const transceiver of this.peerConn.getTransceivers()) {\n const trackOnHold = ['inactive', 'recvonly'].includes(transceiver.currentDirection);\n\n if (!trackOnHold) callOnHold = false;\n }\n\n return callOnHold;\n }\n\n /**\n * Sends a DTMF digit to the other party\n * @param digit The digit (nb. string - '#' and '*' are dtmf too)\n */\n public sendDtmfDigit(digit: string): void {\n for (const sender of this.peerConn.getSenders()) {\n if (sender.track.kind === 'audio' && sender.dtmf) {\n sender.dtmf.insertDTMF(digit);\n return;\n }\n }\n\n throw new Error(\"Unable to find a track to send DTMF on\");\n }\n\n private updateMuteStatus(): void {\n this.sendVoipEvent(EventType.CallSDPStreamMetadataChangedPrefix, {\n [SDPStreamMetadataKey]: this.getLocalSDPStreamMetadata(),\n });\n\n const micShouldBeMuted = this.localUsermediaFeed?.isAudioMuted() || this.remoteOnHold;\n const vidShouldBeMuted = this.localUsermediaFeed?.isVideoMuted() || this.remoteOnHold;\n\n setTracksEnabled(this.localUsermediaStream.getAudioTracks(), !micShouldBeMuted);\n setTracksEnabled(this.localUsermediaStream.getVideoTracks(), !vidShouldBeMuted);\n }\n\n /**\n * Internal\n * @param {Object} stream\n */\n private gotUserMediaForInvite = async (stream: MediaStream): Promise => {\n if (this.successor) {\n this.successor.gotUserMediaForAnswer(stream);\n return;\n }\n if (this.callHasEnded()) {\n this.stopAllMedia();\n return;\n }\n\n this.pushLocalFeed(stream, SDPStreamMetadataPurpose.Usermedia);\n this.setState(CallState.CreateOffer);\n\n logger.debug(\"gotUserMediaForInvite -> \" + this.type);\n // Now we wait for the negotiationneeded event\n };\n\n private async sendAnswer(): Promise {\n const answerContent = {\n answer: {\n sdp: this.peerConn.localDescription.sdp,\n // type is now deprecated as of Matrix VoIP v1, but\n // required to still be sent for backwards compat\n type: this.peerConn.localDescription.type,\n },\n [SDPStreamMetadataKey]: this.getLocalSDPStreamMetadata(),\n } as MCallAnswer;\n\n answerContent.capabilities = {\n 'm.call.transferee': this.client.supportsCallTransfer,\n 'm.call.dtmf': false,\n };\n\n // We have just taken the local description from the peerConn which will\n // contain all the local candidates added so far, so we can discard any candidates\n // we had queued up because they'll be in the answer.\n logger.info(`Discarding ${this.candidateSendQueue.length} candidates that will be sent in answer`);\n this.candidateSendQueue = [];\n\n try {\n await this.sendVoipEvent(EventType.CallAnswer, answerContent);\n // If this isn't the first time we've tried to send the answer,\n // we may have candidates queued up, so send them now.\n this.inviteOrAnswerSent = true;\n } catch (error) {\n // We've failed to answer: back to the ringing state\n this.setState(CallState.Ringing);\n this.client.cancelPendingEvent(error.event);\n\n let code = CallErrorCode.SendAnswer;\n let message = \"Failed to send answer\";\n if (error.name == 'UnknownDeviceError') {\n code = CallErrorCode.UnknownDevices;\n message = \"Unknown devices present in the room\";\n }\n this.emit(CallEvent.Error, new CallError(code, message, error));\n throw error;\n }\n\n // error handler re-throws so this won't happen on error, but\n // we don't want the same error handling on the candidate queue\n this.sendCandidateQueue();\n }\n\n private gotUserMediaForAnswer = async (stream: MediaStream): Promise => {\n if (this.callHasEnded()) {\n return;\n }\n\n this.pushLocalFeed(stream, SDPStreamMetadataPurpose.Usermedia);\n this.setState(CallState.CreateAnswer);\n\n let myAnswer;\n try {\n this.getRidOfRTXCodecs();\n myAnswer = await this.peerConn.createAnswer();\n } catch (err) {\n logger.debug(\"Failed to create answer: \", err);\n this.terminate(CallParty.Local, CallErrorCode.CreateAnswer, true);\n return;\n }\n\n try {\n await this.peerConn.setLocalDescription(myAnswer);\n this.setState(CallState.Connecting);\n\n // Allow a short time for initial candidates to be gathered\n await new Promise(resolve => {\n setTimeout(resolve, 200);\n });\n\n this.sendAnswer();\n } catch (err) {\n logger.debug(\"Error setting local description!\", err);\n this.terminate(CallParty.Local, CallErrorCode.SetLocalDescription, true);\n return;\n }\n };\n\n /**\n * Internal\n * @param {Object} event\n */\n private gotLocalIceCandidate = (event: RTCPeerConnectionIceEvent): Promise => {\n if (event.candidate) {\n logger.debug(\n \"Call \" + this.callId + \" got local ICE \" + event.candidate.sdpMid + \" candidate: \" +\n event.candidate.candidate,\n );\n\n if (this.callHasEnded()) return;\n\n // As with the offer, note we need to make a copy of this object, not\n // pass the original: that broke in Chrome ~m43.\n if (event.candidate.candidate !== '' || !this.sentEndOfCandidates) {\n this.queueCandidate(event.candidate);\n\n if (event.candidate.candidate === '') this.sentEndOfCandidates = true;\n }\n }\n };\n\n private onIceGatheringStateChange = (event: Event): void => {\n logger.debug(\"ice gathering state changed to \" + this.peerConn.iceGatheringState);\n if (this.peerConn.iceGatheringState === 'complete' && !this.sentEndOfCandidates) {\n // If we didn't get an empty-string candidate to signal the end of candidates,\n // create one ourselves now gathering has finished.\n // We cast because the interface lists all the properties as required but we\n // only want to send 'candidate'\n // XXX: We probably want to send either sdpMid or sdpMLineIndex, as it's not strictly\n // correct to have a candidate that lacks both of these. We'd have to figure out what\n // previous candidates had been sent with and copy them.\n const c = {\n candidate: '',\n } as RTCIceCandidate;\n this.queueCandidate(c);\n this.sentEndOfCandidates = true;\n }\n };\n\n public async onRemoteIceCandidatesReceived(ev: MatrixEvent): Promise {\n if (this.callHasEnded()) {\n //debuglog(\"Ignoring remote ICE candidate because call has ended\");\n return;\n }\n\n const content = ev.getContent();\n const candidates = content.candidates;\n if (!candidates) {\n logger.info(\"Ignoring candidates event with no candidates!\");\n return;\n }\n\n const fromPartyId = content.version === 0 ? null : content.party_id || null;\n\n if (this.opponentPartyId === undefined) {\n // we haven't picked an opponent yet so save the candidates\n logger.info(`Buffering ${candidates.length} candidates until we pick an opponent`);\n const bufferedCandidates = this.remoteCandidateBuffer.get(fromPartyId) || [];\n bufferedCandidates.push(...candidates);\n this.remoteCandidateBuffer.set(fromPartyId, bufferedCandidates);\n return;\n }\n\n if (!this.partyIdMatches(content)) {\n logger.info(\n `Ignoring candidates from party ID ${content.party_id}: ` +\n `we have chosen party ID ${this.opponentPartyId}`,\n );\n\n return;\n }\n\n await this.addIceCandidates(candidates);\n }\n\n /**\n * Used by MatrixClient.\n * @param {Object} msg\n */\n public async onAnswerReceived(event: MatrixEvent): Promise {\n const content = event.getContent();\n logger.debug(`Got answer for call ID ${this.callId} from party ID ${content.party_id}`);\n\n if (this.callHasEnded()) {\n logger.debug(`Ignoring answer because call ID ${this.callId} has ended`);\n return;\n }\n\n if (this.opponentPartyId !== undefined) {\n logger.info(\n `Ignoring answer from party ID ${content.party_id}: ` +\n `we already have an answer/reject from ${this.opponentPartyId}`,\n );\n return;\n }\n\n this.chooseOpponent(event);\n await this.addBufferedIceCandidates();\n\n this.setState(CallState.Connecting);\n\n const sdpStreamMetadata = content[SDPStreamMetadataKey];\n if (sdpStreamMetadata) {\n this.updateRemoteSDPStreamMetadata(sdpStreamMetadata);\n } else {\n logger.warn(\"Did not get any SDPStreamMetadata! Can not send/receive multiple streams\");\n }\n\n try {\n await this.peerConn.setRemoteDescription(content.answer);\n } catch (e) {\n logger.debug(\"Failed to set remote description\", e);\n this.terminate(CallParty.Local, CallErrorCode.SetRemoteDescription, false);\n return;\n }\n\n // If the answer we selected has a party_id, send a select_answer event\n // We do this after setting the remote description since otherwise we'd block\n // call setup on it\n if (this.opponentPartyId !== null) {\n try {\n await this.sendVoipEvent(EventType.CallSelectAnswer, {\n selected_party_id: this.opponentPartyId,\n });\n } catch (err) {\n // This isn't fatal, and will just mean that if another party has raced to answer\n // the call, they won't know they got rejected, so we carry on & don't retry.\n logger.warn(\"Failed to send select_answer event\", err);\n }\n }\n }\n\n public async onSelectAnswerReceived(event: MatrixEvent): Promise {\n if (this.direction !== CallDirection.Inbound) {\n logger.warn(\"Got select_answer for an outbound call: ignoring\");\n return;\n }\n\n const selectedPartyId = event.getContent().selected_party_id;\n\n if (selectedPartyId === undefined || selectedPartyId === null) {\n logger.warn(\"Got nonsensical select_answer with null/undefined selected_party_id: ignoring\");\n return;\n }\n\n if (selectedPartyId !== this.ourPartyId) {\n logger.info(`Got select_answer for party ID ${selectedPartyId}: we are party ID ${this.ourPartyId}.`);\n // The other party has picked somebody else's answer\n this.terminate(CallParty.Remote, CallErrorCode.AnsweredElsewhere, true);\n }\n }\n\n public async onNegotiateReceived(event: MatrixEvent): Promise {\n const content = event.getContent();\n const description = content.description;\n if (!description || !description.sdp || !description.type) {\n logger.info(\"Ignoring invalid m.call.negotiate event\");\n return;\n }\n // Politeness always follows the direction of the call: in a glare situation,\n // we pick either the inbound or outbound call, so one side will always be\n // inbound and one outbound\n const polite = this.direction === CallDirection.Inbound;\n\n // Here we follow the perfect negotiation logic from\n // https://developer.mozilla.org/en-US/docs/Web/API/WebRTC_API/Perfect_negotiation\n const offerCollision = (\n (description.type === 'offer') &&\n (this.makingOffer || this.peerConn.signalingState !== 'stable')\n );\n\n this.ignoreOffer = !polite && offerCollision;\n if (this.ignoreOffer) {\n logger.info(\"Ignoring colliding negotiate event because we're impolite\");\n return;\n }\n\n const prevLocalOnHold = this.isLocalOnHold();\n\n const sdpStreamMetadata = content[SDPStreamMetadataKey];\n if (sdpStreamMetadata) {\n this.updateRemoteSDPStreamMetadata(sdpStreamMetadata);\n } else {\n logger.warn(\"Received negotiation event without SDPStreamMetadata!\");\n }\n\n try {\n await this.peerConn.setRemoteDescription(description);\n\n if (description.type === 'offer') {\n this.getRidOfRTXCodecs();\n const localDescription = await this.peerConn.createAnswer();\n await this.peerConn.setLocalDescription(localDescription);\n\n this.sendVoipEvent(EventType.CallNegotiate, {\n description: this.peerConn.localDescription,\n [SDPStreamMetadataKey]: this.getLocalSDPStreamMetadata(),\n });\n }\n } catch (err) {\n logger.warn(\"Failed to complete negotiation\", err);\n }\n\n const newLocalOnHold = this.isLocalOnHold();\n if (prevLocalOnHold !== newLocalOnHold) {\n this.emit(CallEvent.LocalHoldUnhold, newLocalOnHold);\n // also this one for backwards compat\n this.emit(CallEvent.HoldUnhold, newLocalOnHold);\n }\n }\n\n private updateRemoteSDPStreamMetadata(metadata: SDPStreamMetadata): void {\n this.remoteSDPStreamMetadata = utils.recursivelyAssign(this.remoteSDPStreamMetadata || {}, metadata, true);\n for (const feed of this.getRemoteFeeds()) {\n const streamId = feed.stream.id;\n feed.setAudioMuted(this.remoteSDPStreamMetadata[streamId]?.audio_muted);\n feed.setVideoMuted(this.remoteSDPStreamMetadata[streamId]?.video_muted);\n feed.purpose = this.remoteSDPStreamMetadata[streamId]?.purpose;\n }\n }\n\n public onSDPStreamMetadataChangedReceived(event: MatrixEvent): void {\n const content = event.getContent();\n const metadata = content[SDPStreamMetadataKey];\n this.updateRemoteSDPStreamMetadata(metadata);\n }\n\n public async onAssertedIdentityReceived(event: MatrixEvent): Promise {\n const content = event.getContent();\n if (!content.asserted_identity) return;\n\n this.remoteAssertedIdentity = {\n id: content.asserted_identity.id,\n displayName: content.asserted_identity.display_name,\n };\n this.emit(CallEvent.AssertedIdentityChanged);\n }\n\n private callHasEnded(): boolean {\n // This exists as workaround to typescript trying to be clever and erroring\n // when putting if (this.state === CallState.Ended) return; twice in the same\n // function, even though that function is async.\n return this.state === CallState.Ended;\n }\n\n private gotLocalOffer = async (description: RTCSessionDescriptionInit): Promise => {\n logger.debug(\"Created offer: \", description);\n\n if (this.callHasEnded()) {\n logger.debug(\"Ignoring newly created offer on call ID \" + this.callId +\n \" because the call has ended\");\n return;\n }\n\n try {\n await this.peerConn.setLocalDescription(description);\n } catch (err) {\n logger.debug(\"Error setting local description!\", err);\n this.terminate(CallParty.Local, CallErrorCode.SetLocalDescription, true);\n return;\n }\n\n if (this.peerConn.iceGatheringState === 'gathering') {\n // Allow a short time for initial candidates to be gathered\n await new Promise(resolve => {\n setTimeout(resolve, 200);\n });\n }\n\n if (this.callHasEnded()) return;\n\n const eventType = this.state === CallState.CreateOffer ? EventType.CallInvite : EventType.CallNegotiate;\n\n const content = {\n lifetime: CALL_TIMEOUT_MS,\n } as MCallInviteNegotiate;\n\n if (eventType === EventType.CallInvite && this.invitee) {\n content.invitee = this.invitee;\n }\n\n // clunky because TypeScript can't follow the types through if we use an expression as the key\n if (this.state === CallState.CreateOffer) {\n content.offer = this.peerConn.localDescription;\n } else {\n content.description = this.peerConn.localDescription;\n }\n\n content.capabilities = {\n 'm.call.transferee': this.client.supportsCallTransfer,\n 'm.call.dtmf': false,\n };\n\n content[SDPStreamMetadataKey] = this.getLocalSDPStreamMetadata();\n\n // Get rid of any candidates waiting to be sent: they'll be included in the local\n // description we just got and will send in the offer.\n logger.info(`Discarding ${this.candidateSendQueue.length} candidates that will be sent in offer`);\n this.candidateSendQueue = [];\n\n try {\n await this.sendVoipEvent(eventType, content);\n } catch (error) {\n logger.error(\"Failed to send invite\", error);\n if (error.event) this.client.cancelPendingEvent(error.event);\n\n let code = CallErrorCode.SignallingFailed;\n let message = \"Signalling failed\";\n if (this.state === CallState.CreateOffer) {\n code = CallErrorCode.SendInvite;\n message = \"Failed to send invite\";\n }\n if (error.name == 'UnknownDeviceError') {\n code = CallErrorCode.UnknownDevices;\n message = \"Unknown devices present in the room\";\n }\n\n this.emit(CallEvent.Error, new CallError(code, message, error));\n this.terminate(CallParty.Local, code, false);\n\n // no need to carry on & send the candidate queue, but we also\n // don't want to rethrow the error\n return;\n }\n\n this.sendCandidateQueue();\n if (this.state === CallState.CreateOffer) {\n this.inviteOrAnswerSent = true;\n this.setState(CallState.InviteSent);\n this.inviteTimeout = setTimeout(() => {\n this.inviteTimeout = null;\n if (this.state === CallState.InviteSent) {\n this.hangup(CallErrorCode.InviteTimeout, false);\n }\n }, CALL_TIMEOUT_MS);\n }\n };\n\n private getLocalOfferFailed = (err: Error): void => {\n logger.error(\"Failed to get local offer\", err);\n\n this.emit(\n CallEvent.Error,\n new CallError(\n CallErrorCode.LocalOfferFailed,\n \"Failed to get local offer!\", err,\n ),\n );\n this.terminate(CallParty.Local, CallErrorCode.LocalOfferFailed, false);\n };\n\n private getUserMediaFailed = (err: Error): void => {\n if (this.successor) {\n this.successor.getUserMediaFailed(err);\n return;\n }\n\n logger.warn(\"Failed to get user media - ending call\", err);\n\n this.emit(\n CallEvent.Error,\n new CallError(\n CallErrorCode.NoUserMedia,\n \"Couldn't start capturing media! Is your microphone set up and \" +\n \"does this app have permission?\", err,\n ),\n );\n this.terminate(CallParty.Local, CallErrorCode.NoUserMedia, false);\n };\n\n private onIceConnectionStateChanged = (): void => {\n if (this.callHasEnded()) {\n return; // because ICE can still complete as we're ending the call\n }\n logger.debug(\n \"Call ID \" + this.callId + \": ICE connection state changed to: \" + this.peerConn.iceConnectionState,\n );\n // ideally we'd consider the call to be connected when we get media but\n // chrome doesn't implement any of the 'onstarted' events yet\n if (this.peerConn.iceConnectionState == 'connected') {\n clearTimeout(this.iceDisconnectedTimeout);\n this.setState(CallState.Connected);\n } else if (this.peerConn.iceConnectionState == 'failed') {\n this.hangup(CallErrorCode.IceFailed, false);\n } else if (this.peerConn.iceConnectionState == 'disconnected') {\n this.iceDisconnectedTimeout = setTimeout(() => {\n this.hangup(CallErrorCode.IceFailed, false);\n }, 30 * 1000);\n }\n };\n\n private onSignallingStateChanged = (): void => {\n logger.debug(\n \"call \" + this.callId + \": Signalling state changed to: \" +\n this.peerConn.signalingState,\n );\n };\n\n private onTrack = (ev: RTCTrackEvent): void => {\n if (ev.streams.length === 0) {\n logger.warn(`Streamless ${ev.track.kind} found: ignoring.`);\n return;\n }\n\n const stream = ev.streams[0];\n this.pushRemoteFeed(stream);\n stream.addEventListener(\"removetrack\", () => this.deleteFeedByStream(stream));\n };\n\n /**\n * This method removes all video/rtx codecs from screensharing video\n * transceivers. This is necessary since they can cause problems. Without\n * this the following steps should produce an error:\n * Chromium calls Firefox\n * Firefox answers\n * Firefox starts screen-sharing\n * Chromium starts screen-sharing\n * Call crashes for Chromium with:\n * [96685:23:0518/162603.933321:ERROR:webrtc_video_engine.cc(3296)] RTX codec (PT=97) mapped to PT=96 which is not in the codec list.\n * [96685:23:0518/162603.933377:ERROR:webrtc_video_engine.cc(1171)] GetChangedRecvParameters called without any video codecs.\n * [96685:23:0518/162603.933430:ERROR:sdp_offer_answer.cc(4302)] Failed to set local video description recv parameters for m-section with mid='2'. (INVALID_PARAMETER)\n */\n private getRidOfRTXCodecs(): void {\n // RTCRtpReceiver.getCapabilities and RTCRtpSender.getCapabilities don't seem to be supported on FF\n if (!RTCRtpReceiver.getCapabilities || !RTCRtpSender.getCapabilities) return;\n\n const recvCodecs = RTCRtpReceiver.getCapabilities(\"video\").codecs;\n const sendCodecs = RTCRtpSender.getCapabilities(\"video\").codecs;\n const codecs = [...sendCodecs, ...recvCodecs];\n\n for (const codec of codecs) {\n if (codec.mimeType === \"video/rtx\") {\n const rtxCodecIndex = codecs.indexOf(codec);\n codecs.splice(rtxCodecIndex, 1);\n }\n }\n\n for (const trans of this.peerConn.getTransceivers()) {\n if (\n this.screensharingSenders.includes(trans.sender) &&\n (\n trans.sender.track?.kind === \"video\" ||\n trans.receiver.track?.kind === \"video\"\n )\n ) {\n trans.setCodecPreferences(codecs);\n }\n }\n }\n\n private onNegotiationNeeded = async (): Promise => {\n logger.info(\"Negotiation is needed!\");\n\n if (this.state !== CallState.CreateOffer && this.opponentVersion === 0) {\n logger.info(\"Opponent does not support renegotiation: ignoring negotiationneeded event\");\n return;\n }\n\n this.makingOffer = true;\n try {\n this.getRidOfRTXCodecs();\n const myOffer = await this.peerConn.createOffer();\n await this.gotLocalOffer(myOffer);\n } catch (e) {\n this.getLocalOfferFailed(e);\n return;\n } finally {\n this.makingOffer = false;\n }\n };\n\n public onHangupReceived = (msg: MCallHangupReject): void => {\n logger.debug(\"Hangup received for call ID \" + this.callId);\n\n // party ID must match (our chosen partner hanging up the call) or be undefined (we haven't chosen\n // a partner yet but we're treating the hangup as a reject as per VoIP v0)\n if (this.partyIdMatches(msg) || this.state === CallState.Ringing) {\n // default reason is user_hangup\n this.terminate(CallParty.Remote, msg.reason || CallErrorCode.UserHangup, true);\n } else {\n logger.info(`Ignoring message from party ID ${msg.party_id}: our partner is ${this.opponentPartyId}`);\n }\n };\n\n public onRejectReceived = (msg: MCallHangupReject): void => {\n logger.debug(\"Reject received for call ID \" + this.callId);\n\n // No need to check party_id for reject because if we'd received either\n // an answer or reject, we wouldn't be in state InviteSent\n\n const shouldTerminate = (\n // reject events also end the call if it's ringing: it's another of\n // our devices rejecting the call.\n ([CallState.InviteSent, CallState.Ringing].includes(this.state)) ||\n // also if we're in the init state and it's an inbound call, since\n // this means we just haven't entered the ringing state yet\n this.state === CallState.Fledgling && this.direction === CallDirection.Inbound\n );\n\n if (shouldTerminate) {\n this.terminate(CallParty.Remote, msg.reason || CallErrorCode.UserHangup, true);\n } else {\n logger.debug(`Call is in state: ${this.state}: ignoring reject`);\n }\n };\n\n public onAnsweredElsewhere = (msg: MCallAnswer): void => {\n logger.debug(\"Call ID \" + this.callId + \" answered elsewhere\");\n this.terminate(CallParty.Remote, CallErrorCode.AnsweredElsewhere, true);\n };\n\n private setState(state: CallState): void {\n const oldState = this.state;\n this.state = state;\n this.emit(CallEvent.State, state, oldState);\n }\n\n /**\n * Internal\n * @param {string} eventType\n * @param {Object} content\n * @return {Promise}\n */\n private sendVoipEvent(eventType: string, content: object): Promise {\n return this.client.sendEvent(this.roomId, eventType, Object.assign({}, content, {\n version: VOIP_PROTO_VERSION,\n call_id: this.callId,\n party_id: this.ourPartyId,\n }));\n }\n\n private queueCandidate(content: RTCIceCandidate): void {\n // We partially de-trickle candidates by waiting for `delay` before sending them\n // amalgamated, in order to avoid sending too many m.call.candidates events and hitting\n // rate limits in Matrix.\n // In practice, it'd be better to remove rate limits for m.call.*\n\n // N.B. this deliberately lets you queue and send blank candidates, which MSC2746\n // currently proposes as the way to indicate that candidate gathering is complete.\n // This will hopefully be changed to an explicit rather than implicit notification\n // shortly.\n this.candidateSendQueue.push(content);\n\n // Don't send the ICE candidates yet if the call is in the ringing state: this\n // means we tried to pick (ie. started generating candidates) and then failed to\n // send the answer and went back to the ringing state. Queue up the candidates\n // to send if we successfully send the answer.\n // Equally don't send if we haven't yet sent the answer because we can send the\n // first batch of candidates along with the answer\n if (this.state === CallState.Ringing || !this.inviteOrAnswerSent) return;\n\n // MSC2746 recommends these values (can be quite long when calling because the\n // callee will need a while to answer the call)\n const delay = this.direction === CallDirection.Inbound ? 500 : 2000;\n\n if (this.candidateSendTries === 0) {\n setTimeout(() => {\n this.sendCandidateQueue();\n }, delay);\n }\n }\n\n /*\n * Transfers this call to another user\n */\n public async transfer(targetUserId: string): Promise {\n // Fetch the target user's global profile info: their room avatar / displayname\n // could be different in whatever room we share with them.\n const profileInfo = await this.client.getProfileInfo(targetUserId);\n\n const replacementId = genCallID();\n\n const body = {\n replacement_id: genCallID(),\n target_user: {\n id: targetUserId,\n display_name: profileInfo.displayname,\n avatar_url: profileInfo.avatar_url,\n },\n create_call: replacementId,\n } as MCallReplacesEvent;\n\n await this.sendVoipEvent(EventType.CallReplaces, body);\n\n await this.terminate(CallParty.Local, CallErrorCode.Transfered, true);\n }\n\n /*\n * Transfers this call to the target call, effectively 'joining' the\n * two calls (so the remote parties on each call are connected together).\n */\n public async transferToCall(transferTargetCall?: MatrixCall): Promise {\n const targetProfileInfo = await this.client.getProfileInfo(transferTargetCall.getOpponentMember().userId);\n const transfereeProfileInfo = await this.client.getProfileInfo(this.getOpponentMember().userId);\n\n const newCallId = genCallID();\n\n const bodyToTransferTarget = {\n // the replacements on each side have their own ID, and it's distinct from the\n // ID of the new call (but we can use the same function to generate it)\n replacement_id: genCallID(),\n target_user: {\n id: this.getOpponentMember().userId,\n display_name: transfereeProfileInfo.displayname,\n avatar_url: transfereeProfileInfo.avatar_url,\n },\n await_call: newCallId,\n } as MCallReplacesEvent;\n\n await transferTargetCall.sendVoipEvent(EventType.CallReplaces, bodyToTransferTarget);\n\n const bodyToTransferee = {\n replacement_id: genCallID(),\n target_user: {\n id: transferTargetCall.getOpponentMember().userId,\n display_name: targetProfileInfo.displayname,\n avatar_url: targetProfileInfo.avatar_url,\n },\n create_call: newCallId,\n } as MCallReplacesEvent;\n\n await this.sendVoipEvent(EventType.CallReplaces, bodyToTransferee);\n\n await this.terminate(CallParty.Local, CallErrorCode.Replaced, true);\n await transferTargetCall.terminate(CallParty.Local, CallErrorCode.Transfered, true);\n }\n\n private async terminate(hangupParty: CallParty, hangupReason: CallErrorCode, shouldEmit: boolean): Promise {\n if (this.callHasEnded()) return;\n\n this.callStatsAtEnd = await this.collectCallStats();\n\n if (this.inviteTimeout) {\n clearTimeout(this.inviteTimeout);\n this.inviteTimeout = null;\n }\n\n // Order is important here: first we stopAllMedia() and only then we can deleteAllFeeds()\n // We don't stop media if the call was replaced as we want to re-use streams in the successor\n if (hangupReason !== CallErrorCode.Replaced) this.stopAllMedia();\n this.deleteAllFeeds();\n\n this.hangupParty = hangupParty;\n this.hangupReason = hangupReason;\n this.setState(CallState.Ended);\n if (this.peerConn && this.peerConn.signalingState !== 'closed') {\n this.peerConn.close();\n }\n if (shouldEmit) {\n this.emit(CallEvent.Hangup, this);\n }\n }\n\n private stopAllMedia(): void {\n logger.debug(`stopAllMedia (stream=${this.localUsermediaStream})`);\n\n for (const feed of this.feeds) {\n for (const track of feed.stream.getTracks()) {\n track.stop();\n }\n }\n }\n\n private checkForErrorListener(): void {\n if (this.listeners(\"error\").length === 0) {\n throw new Error(\n \"You MUST attach an error listener using call.on('error', function() {})\",\n );\n }\n }\n\n private async sendCandidateQueue(): Promise {\n if (this.candidateSendQueue.length === 0) {\n return;\n }\n\n const candidates = this.candidateSendQueue;\n this.candidateSendQueue = [];\n ++this.candidateSendTries;\n const content = {\n candidates: candidates,\n };\n logger.debug(\"Attempting to send \" + candidates.length + \" candidates\");\n try {\n await this.sendVoipEvent(EventType.CallCandidates, content);\n // reset our retry count if we have successfully sent our candidates\n // otherwise queueCandidate() will refuse to try to flush the queue\n this.candidateSendTries = 0;\n } catch (error) {\n // don't retry this event: we'll send another one later as we might\n // have more candidates by then.\n if (error.event) this.client.cancelPendingEvent(error.event);\n\n // put all the candidates we failed to send back in the queue\n this.candidateSendQueue.push(...candidates);\n\n if (this.candidateSendTries > 5) {\n logger.debug(\n \"Failed to send candidates on attempt \" + this.candidateSendTries +\n \". Giving up on this call.\", error,\n );\n\n const code = CallErrorCode.SignallingFailed;\n const message = \"Signalling failed\";\n\n this.emit(CallEvent.Error, new CallError(code, message, error));\n this.hangup(code, false);\n\n return;\n }\n\n const delayMs = 500 * Math.pow(2, this.candidateSendTries);\n ++this.candidateSendTries;\n logger.debug(\"Failed to send candidates. Retrying in \" + delayMs + \"ms\", error);\n setTimeout(() => {\n this.sendCandidateQueue();\n }, delayMs);\n }\n }\n\n private async placeCallWithConstraints(constraintsType: ConstraintsType): Promise {\n // XXX Find a better way to do this\n this.client.callEventHandler.calls.set(this.callId, this);\n this.setState(CallState.WaitLocalMedia);\n this.direction = CallDirection.Outbound;\n\n // make sure we have valid turn creds. Unless something's gone wrong, it should\n // poll and keep the credentials valid so this should be instant.\n const haveTurnCreds = await this.client.checkTurnServers();\n if (!haveTurnCreds) {\n logger.warn(\"Failed to get TURN credentials! Proceeding with call anyway...\");\n }\n\n // create the peer connection now so it can be gathering candidates while we get user\n // media (assuming a candidate pool size is configured)\n this.peerConn = this.createPeerConnection();\n\n try {\n let mediaStream: MediaStream;\n\n if (constraintsType === ConstraintsType.Audio) {\n mediaStream = await this.client.getLocalAudioStream();\n } else {\n mediaStream = await this.client.getLocalVideoStream();\n }\n\n this.gotUserMediaForInvite(mediaStream);\n } catch (e) {\n this.getUserMediaFailed(e);\n return;\n }\n }\n\n private createPeerConnection(): RTCPeerConnection {\n const pc = new window.RTCPeerConnection({\n iceTransportPolicy: this.forceTURN ? 'relay' : undefined,\n iceServers: this.turnServers,\n iceCandidatePoolSize: this.client.iceCandidatePoolSize,\n });\n\n // 'connectionstatechange' would be better, but firefox doesn't implement that.\n pc.addEventListener('iceconnectionstatechange', this.onIceConnectionStateChanged);\n pc.addEventListener('signalingstatechange', this.onSignallingStateChanged);\n pc.addEventListener('icecandidate', this.gotLocalIceCandidate);\n pc.addEventListener('icegatheringstatechange', this.onIceGatheringStateChange);\n pc.addEventListener('track', this.onTrack);\n pc.addEventListener('negotiationneeded', this.onNegotiationNeeded);\n\n return pc;\n }\n\n private partyIdMatches(msg: MCallBase): boolean {\n // They must either match or both be absent (in which case opponentPartyId will be null)\n // Also we ignore party IDs on the invite/offer if the version is 0, so we must do the same\n // here and use null if the version is 0 (woe betide any opponent sending messages in the\n // same call with different versions)\n const msgPartyId = msg.version === 0 ? null : msg.party_id || null;\n return msgPartyId === this.opponentPartyId;\n }\n\n // Commits to an opponent for the call\n // ev: An invite or answer event\n private chooseOpponent(ev: MatrixEvent): void {\n // I choo-choo-choose you\n const msg = ev.getContent();\n\n logger.debug(`Choosing party ID ${msg.party_id} for call ID ${this.callId}`);\n\n this.opponentVersion = msg.version;\n if (this.opponentVersion === 0) {\n // set to null to indicate that we've chosen an opponent, but because\n // they're v0 they have no party ID (even if they sent one, we're ignoring it)\n this.opponentPartyId = null;\n } else {\n // set to their party ID, or if they're naughty and didn't send one despite\n // not being v0, set it to null to indicate we picked an opponent with no\n // party ID\n this.opponentPartyId = msg.party_id || null;\n }\n this.opponentCaps = msg.capabilities || {} as CallCapabilities;\n this.opponentMember = ev.sender;\n }\n\n private async addBufferedIceCandidates(): Promise {\n const bufferedCandidates = this.remoteCandidateBuffer.get(this.opponentPartyId);\n if (bufferedCandidates) {\n logger.info(`Adding ${bufferedCandidates.length} buffered candidates for opponent ${this.opponentPartyId}`);\n await this.addIceCandidates(bufferedCandidates);\n }\n this.remoteCandidateBuffer = null;\n }\n\n private async addIceCandidates(candidates: RTCIceCandidate[]): Promise {\n for (const candidate of candidates) {\n if (\n (candidate.sdpMid === null || candidate.sdpMid === undefined) &&\n (candidate.sdpMLineIndex === null || candidate.sdpMLineIndex === undefined)\n ) {\n logger.debug(\"Ignoring remote ICE candidate with no sdpMid or sdpMLineIndex\");\n continue;\n }\n logger.debug(\n \"Call \" + this.callId + \" got remote ICE \" + candidate.sdpMid + \" candidate: \" + candidate.candidate,\n );\n try {\n await this.peerConn.addIceCandidate(candidate);\n } catch (err) {\n if (!this.ignoreOffer) {\n logger.info(\"Failed to add remote ICE candidate\", err);\n }\n }\n }\n }\n\n public get hasPeerConnection(): boolean {\n return Boolean(this.peerConn);\n }\n}\n\nasync function getScreensharingStream(\n selectDesktopCapturerSource?: () => Promise,\n): Promise {\n const screenshareConstraints = await getScreenshareContraints(selectDesktopCapturerSource);\n if (!screenshareConstraints) return null;\n\n if (window.electron?.getDesktopCapturerSources) {\n // We are using Electron\n logger.debug(\"Getting screen stream using getUserMedia()...\");\n return await navigator.mediaDevices.getUserMedia(screenshareConstraints);\n } else {\n // We are not using Electron\n logger.debug(\"Getting screen stream using getDisplayMedia()...\");\n return await navigator.mediaDevices.getDisplayMedia(screenshareConstraints);\n }\n}\n\nfunction setTracksEnabled(tracks: Array, enabled: boolean): void {\n for (let i = 0; i < tracks.length; i++) {\n tracks[i].enabled = enabled;\n }\n}\n\nexport function getUserMediaContraints(type: ConstraintsType): MediaStreamConstraints {\n const isWebkit = !!navigator.webkitGetUserMedia;\n\n switch (type) {\n case ConstraintsType.Audio: {\n return {\n audio: {\n deviceId: audioInput ? { ideal: audioInput } : undefined,\n },\n video: false,\n };\n }\n case ConstraintsType.Video: {\n return {\n audio: {\n deviceId: audioInput ? { ideal: audioInput } : undefined,\n }, video: {\n deviceId: videoInput ? { ideal: videoInput } : undefined,\n /* We want 640x360. Chrome will give it only if we ask exactly,\n FF refuses entirely if we ask exactly, so have to ask for ideal\n instead\n XXX: Is this still true?\n */\n width: isWebkit ? { exact: 640 } : { ideal: 640 },\n height: isWebkit ? { exact: 360 } : { ideal: 360 },\n },\n };\n }\n }\n}\n\nasync function getScreenshareContraints(\n selectDesktopCapturerSource?: () => Promise,\n): Promise {\n if (window.electron?.getDesktopCapturerSources && selectDesktopCapturerSource) {\n // We have access to getDesktopCapturerSources()\n logger.debug(\"Electron getDesktopCapturerSources() is available...\");\n const selectedSource = await selectDesktopCapturerSource();\n if (!selectedSource) return null;\n return {\n audio: false,\n video: {\n mandatory: {\n chromeMediaSource: \"desktop\",\n chromeMediaSourceId: selectedSource.id,\n },\n },\n };\n } else {\n // We do not have access to the Electron desktop capturer,\n // therefore we can assume we are on the web\n logger.debug(\"Electron desktopCapturer is not available...\");\n return {\n audio: false,\n video: true,\n };\n }\n}\n\nlet audioInput: string;\nlet videoInput: string;\n/**\n * Set an audio input device to use for MatrixCalls\n * @function\n * @param {string=} deviceId the identifier for the device\n * undefined treated as unset\n */\nexport function setAudioInput(deviceId: string): void { audioInput = deviceId; }\n/**\n * Set a video input device to use for MatrixCalls\n * @function\n * @param {string=} deviceId the identifier for the device\n * undefined treated as unset\n */\nexport function setVideoInput(deviceId: string): void { videoInput = deviceId; }\n\n/**\n * DEPRECATED\n * Use client.createCall()\n *\n * Create a new Matrix call for the browser.\n * @param {MatrixClient} client The client instance to use.\n * @param {string} roomId The room the call is in.\n * @param {Object?} options DEPRECATED optional options map.\n * @param {boolean} options.forceTURN DEPRECATED whether relay through TURN should be\n * forced. This option is deprecated - use opts.forceTURN when creating the matrix client\n * since it's only possible to set this option on outbound calls.\n * @return {MatrixCall} the call or null if the browser doesn't support calling.\n */\nexport function createNewMatrixCall(client: any, roomId: string, options?: CallOpts): MatrixCall {\n // typeof prevents Node from erroring on an undefined reference\n if (typeof(window) === 'undefined' || typeof(document) === 'undefined') {\n // NB. We don't log here as apps try to create a call object as a test for\n // whether calls are supported, so we shouldn't fill the logs up.\n return null;\n }\n\n // Firefox throws on so little as accessing the RTCPeerConnection when operating in\n // a secure mode. There's some information at https://bugzilla.mozilla.org/show_bug.cgi?id=1542616\n // though the concern is that the browser throwing a SecurityError will brick the\n // client creation process.\n try {\n const supported = Boolean(\n window.RTCPeerConnection || window.RTCSessionDescription ||\n window.RTCIceCandidate || navigator.mediaDevices,\n );\n if (!supported) {\n // Adds a lot of noise to test runs, so disable logging there.\n if (process.env.NODE_ENV !== \"test\") {\n logger.error(\"WebRTC is not supported in this browser / environment\");\n }\n return null;\n }\n } catch (e) {\n logger.error(\"Exception thrown when trying to access WebRTC\", e);\n return null;\n }\n\n const optionsForceTURN = options ? options.forceTURN : false;\n\n const opts = {\n client: client,\n roomId: roomId,\n invitee: options && options.invitee,\n turnServers: client.getTurnServers(),\n // call level options\n forceTURN: client.forceTURN || optionsForceTURN,\n };\n const call = new MatrixCall(opts);\n\n client.reEmitter.reEmit(call, Object.values(CallEvent));\n\n return call;\n}\n", + "/*\nCopyright 2020 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\nimport { MatrixEvent } from '../models/event';\nimport { logger } from '../logger';\nimport { createNewMatrixCall, MatrixCall, CallErrorCode, CallState, CallDirection } from './call';\nimport { EventType } from '../@types/event';\nimport { MatrixClient } from '../client';\nimport { MCallAnswer, MCallHangupReject } from \"./callEventTypes\";\n\n// Don't ring unless we'd be ringing for at least 3 seconds: the user needs some\n// time to press the 'accept' button\nconst RING_GRACE_PERIOD = 3000;\n\nexport class CallEventHandler {\n client: MatrixClient;\n calls: Map;\n callEventBuffer: MatrixEvent[];\n candidateEventsByCall: Map>;\n\n constructor(client: MatrixClient) {\n this.client = client;\n this.calls = new Map();\n // The sync code always emits one event at a time, so it will patiently\n // wait for us to finish processing a call invite before delivering the\n // next event, even if that next event is a hangup. We therefore accumulate\n // all our call events and then process them on the 'sync' event, ie.\n // each time a sync has completed. This way, we can avoid emitting incoming\n // call events if we get both the invite and answer/hangup in the same sync.\n // This happens quite often, eg. replaying sync from storage, catchup sync\n // after loading and after we've been offline for a bit.\n this.callEventBuffer = [];\n this.candidateEventsByCall = new Map>();\n }\n\n public start() {\n this.client.on(\"sync\", this.evaluateEventBuffer);\n this.client.on(\"Room.timeline\", this.onRoomTimeline);\n }\n\n public stop() {\n this.client.removeListener(\"sync\", this.evaluateEventBuffer);\n this.client.removeListener(\"Room.timeline\", this.onRoomTimeline);\n }\n\n private evaluateEventBuffer = async () => {\n if (this.client.getSyncState() === \"SYNCING\") {\n await Promise.all(this.callEventBuffer.map(event => {\n this.client.decryptEventIfNeeded(event);\n }));\n\n const ignoreCallIds = new Set();\n // inspect the buffer and mark all calls which have been answered\n // or hung up before passing them to the call event handler.\n for (const ev of this.callEventBuffer) {\n if (ev.getType() === EventType.CallAnswer ||\n ev.getType() === EventType.CallHangup) {\n ignoreCallIds.add(ev.getContent().call_id);\n }\n }\n // now loop through the buffer chronologically and inject them\n for (const e of this.callEventBuffer) {\n if (\n e.getType() === EventType.CallInvite &&\n ignoreCallIds.has(e.getContent().call_id)\n ) {\n // This call has previously been answered or hung up: ignore it\n continue;\n }\n try {\n await this.handleCallEvent(e);\n } catch (e) {\n logger.error(\"Caught exception handling call event\", e);\n }\n }\n this.callEventBuffer = [];\n }\n };\n\n private onRoomTimeline = (event: MatrixEvent) => {\n this.client.decryptEventIfNeeded(event);\n // any call events or ones that might be once they're decrypted\n if (this.eventIsACall(event) || event.isBeingDecrypted()) {\n // queue up for processing once all events from this sync have been\n // processed (see above).\n this.callEventBuffer.push(event);\n }\n\n if (event.isBeingDecrypted() || event.isDecryptionFailure()) {\n // add an event listener for once the event is decrypted.\n event.once(\"Event.decrypted\", async () => {\n if (!this.eventIsACall(event)) return;\n\n if (this.callEventBuffer.includes(event)) {\n // we were waiting for that event to decrypt, so recheck the buffer\n this.evaluateEventBuffer();\n } else {\n // This one wasn't buffered so just run the event handler for it\n // straight away\n try {\n await this.handleCallEvent(event);\n } catch (e) {\n logger.error(\"Caught exception handling call event\", e);\n }\n }\n });\n }\n };\n\n private eventIsACall(event: MatrixEvent): boolean {\n const type = event.getType();\n /**\n * Unstable prefixes:\n * - org.matrix.call. : MSC3086 https://github.com/matrix-org/matrix-doc/pull/3086\n */\n return type.startsWith(\"m.call.\") || type.startsWith(\"org.matrix.call.\");\n }\n\n private async handleCallEvent(event: MatrixEvent) {\n const content = event.getContent();\n const type = event.getType() as EventType;\n const weSentTheEvent = event.getSender() === this.client.credentials.userId;\n let call = content.call_id ? this.calls.get(content.call_id) : undefined;\n //console.info(\"RECV %s content=%s\", type, JSON.stringify(content));\n\n if (type === EventType.CallInvite) {\n // ignore invites you send\n if (weSentTheEvent) return;\n // expired call\n if (event.getLocalAge() > content.lifetime - RING_GRACE_PERIOD) return;\n // stale/old invite event\n if (call && call.state === CallState.Ended) return;\n\n if (call) {\n logger.log(\n `WARN: Already have a MatrixCall with id ${content.call_id} but got an ` +\n `invite. Clobbering.`,\n );\n }\n\n if (content.invitee && content.invitee !== this.client.getUserId()) {\n return; // This invite was meant for another user in the room\n }\n\n const timeUntilTurnCresExpire = this.client.getTurnServersExpiry() - Date.now();\n logger.info(\"Current turn creds expire in \" + timeUntilTurnCresExpire + \" ms\");\n call = createNewMatrixCall(\n this.client,\n event.getRoomId(),\n { forceTURN: this.client.forceTURN },\n );\n if (!call) {\n logger.log(\n \"Incoming call ID \" + content.call_id + \" but this client \" +\n \"doesn't support WebRTC\",\n );\n // don't hang up the call: there could be other clients\n // connected that do support WebRTC and declining the\n // the call on their behalf would be really annoying.\n return;\n }\n\n call.callId = content.call_id;\n await call.initWithInvite(event);\n this.calls.set(call.callId, call);\n\n // if we stashed candidate events for that call ID, play them back now\n if (this.candidateEventsByCall.get(call.callId)) {\n for (const ev of this.candidateEventsByCall.get(call.callId)) {\n call.onRemoteIceCandidatesReceived(ev);\n }\n }\n\n // Were we trying to call that user (room)?\n let existingCall;\n for (const thisCall of this.calls.values()) {\n const isCalling = [CallState.WaitLocalMedia, CallState.CreateOffer, CallState.InviteSent].includes(\n thisCall.state,\n );\n\n if (\n call.roomId === thisCall.roomId &&\n thisCall.direction === CallDirection.Outbound &&\n call.invitee === thisCall.invitee &&\n isCalling\n ) {\n existingCall = thisCall;\n break;\n }\n }\n\n if (existingCall) {\n // If we've only got to wait_local_media or create_offer and\n // we've got an invite, pick the incoming call because we know\n // we haven't sent our invite yet otherwise, pick whichever\n // call has the lowest call ID (by string comparison)\n if (\n existingCall.state === CallState.WaitLocalMedia ||\n existingCall.state === CallState.CreateOffer ||\n existingCall.callId > call.callId\n ) {\n logger.log(\n \"Glare detected: answering incoming call \" + call.callId +\n \" and canceling outgoing call \" + existingCall.callId,\n );\n existingCall.replacedBy(call);\n call.answer();\n } else {\n logger.log(\n \"Glare detected: rejecting incoming call \" + call.callId +\n \" and keeping outgoing call \" + existingCall.callId,\n );\n call.hangup(CallErrorCode.Replaced, true);\n }\n } else {\n this.client.emit(\"Call.incoming\", call);\n }\n return;\n } else if (type === EventType.CallCandidates) {\n if (weSentTheEvent) return;\n\n if (!call) {\n // store the candidates; we may get a call eventually.\n if (!this.candidateEventsByCall.has(content.call_id)) {\n this.candidateEventsByCall.set(content.call_id, []);\n }\n this.candidateEventsByCall.get(content.call_id).push(event);\n } else {\n call.onRemoteIceCandidatesReceived(event);\n }\n return;\n } else if ([EventType.CallHangup, EventType.CallReject].includes(type)) {\n // Note that we also observe our own hangups here so we can see\n // if we've already rejected a call that would otherwise be valid\n if (!call) {\n // if not live, store the fact that the call has ended because\n // we're probably getting events backwards so\n // the hangup will come before the invite\n call = createNewMatrixCall(this.client, event.getRoomId());\n if (call) {\n call.callId = content.call_id;\n call.initWithHangup(event);\n this.calls.set(content.call_id, call);\n }\n } else {\n if (call.state !== CallState.Ended) {\n if (type === EventType.CallHangup) {\n call.onHangupReceived(content as MCallHangupReject);\n } else {\n call.onRejectReceived(content as MCallHangupReject);\n }\n this.calls.delete(content.call_id);\n }\n }\n return;\n }\n\n // The following events need a call and a peer connection\n if (!call || !call.hasPeerConnection) {\n logger.warn(\"Discarding an event, we don't have a call/peerConn\", type);\n return;\n }\n // Ignore remote echo\n if (event.getContent().party_id === call.ourPartyId) return;\n\n switch (type) {\n case EventType.CallAnswer:\n if (weSentTheEvent) {\n if (call.state === CallState.Ringing) {\n call.onAnsweredElsewhere(content as MCallAnswer);\n }\n } else {\n call.onAnswerReceived(event);\n }\n break;\n case EventType.CallSelectAnswer:\n call.onSelectAnswerReceived(event);\n break;\n\n case EventType.CallNegotiate:\n call.onNegotiateReceived(event);\n break;\n\n case EventType.CallAssertedIdentity:\n case EventType.CallAssertedIdentityPrefix:\n call.onAssertedIdentityReceived(event);\n break;\n\n case EventType.CallSDPStreamMetadataChanged:\n case EventType.CallSDPStreamMetadataChangedPrefix:\n call.onSDPStreamMetadataChangedReceived(event);\n break;\n }\n }\n}\n", + "// allow non-camelcase as these are events type that go onto the wire\n/* eslint-disable camelcase */\n\nimport { CallErrorCode } from \"./call\";\n\n// TODO: Change to \"sdp_stream_metadata\" when MSC3077 is merged\nexport const SDPStreamMetadataKey = \"org.matrix.msc3077.sdp_stream_metadata\";\n\nexport enum SDPStreamMetadataPurpose {\n Usermedia = \"m.usermedia\",\n Screenshare = \"m.screenshare\",\n}\n\nexport interface SDPStreamMetadataObject {\n purpose: SDPStreamMetadataPurpose;\n audio_muted: boolean;\n video_muted: boolean;\n}\n\nexport interface SDPStreamMetadata {\n [key: string]: SDPStreamMetadataObject;\n}\n\nexport interface CallCapabilities {\n 'm.call.transferee': boolean;\n 'm.call.dtmf': boolean;\n}\n\nexport interface CallReplacesTarget {\n id: string;\n display_name: string;\n avatar_url: string;\n}\n\nexport interface MCallBase {\n call_id: string;\n version: string | number;\n party_id?: string;\n}\n\nexport interface MCallAnswer extends MCallBase {\n answer: RTCSessionDescription;\n capabilities?: CallCapabilities;\n [SDPStreamMetadataKey]: SDPStreamMetadata;\n}\n\nexport interface MCallSelectAnswer extends MCallBase {\n selected_party_id: string;\n}\n\nexport interface MCallInviteNegotiate extends MCallBase {\n offer: RTCSessionDescription;\n description: RTCSessionDescription;\n lifetime: number;\n capabilities?: CallCapabilities;\n invitee?: string;\n [SDPStreamMetadataKey]: SDPStreamMetadata;\n}\n\nexport interface MCallSDPStreamMetadataChanged extends MCallBase {\n [SDPStreamMetadataKey]: SDPStreamMetadata;\n}\n\nexport interface MCallReplacesEvent extends MCallBase {\n replacement_id: string;\n target_user: CallReplacesTarget;\n create_call: string;\n await_call: string;\n target_room: string;\n}\n\nexport interface MCAllAssertedIdentity extends MCallBase {\n asserted_identity: {\n id: string;\n display_name: string;\n avatar_url: string;\n };\n}\n\nexport interface MCallCandidates extends MCallBase {\n candidates: RTCIceCandidate[];\n}\n\nexport interface MCallHangupReject extends MCallBase {\n reason?: CallErrorCode;\n}\n\n/* eslint-enable camelcase */\n", + "/*\nCopyright 2021 Šimon Brandner \n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\nimport EventEmitter from \"events\";\nimport { SDPStreamMetadataPurpose } from \"./callEventTypes\";\nimport { MatrixClient } from \"../client\";\nimport { RoomMember } from \"../models/room-member\";\n\nconst POLLING_INTERVAL = 250; // ms\nconst SPEAKING_THRESHOLD = -60; // dB\n\nexport enum CallFeedEvent {\n NewStream = \"new_stream\",\n MuteStateChanged = \"mute_state_changed\",\n VolumeChanged = \"volume_changed\",\n Speaking = \"speaking\",\n}\n\nexport class CallFeed extends EventEmitter {\n private measuringVolumeActivity = false;\n private audioContext: AudioContext;\n private analyser: AnalyserNode;\n private frequencyBinCount: Float32Array;\n private speakingThreshold = SPEAKING_THRESHOLD;\n private speaking = false;\n\n constructor(\n public stream: MediaStream,\n public userId: string,\n public purpose: SDPStreamMetadataPurpose,\n private client: MatrixClient,\n private roomId: string,\n private audioMuted: boolean,\n private videoMuted: boolean,\n ) {\n super();\n\n if (this.hasAudioTrack) {\n this.initVolumeMeasuring();\n }\n }\n\n private get hasAudioTrack(): boolean {\n return this.stream.getAudioTracks().length > 0;\n }\n\n private initVolumeMeasuring(): void {\n const AudioContext = window.AudioContext || window.webkitAudioContext;\n if (!this.hasAudioTrack || !AudioContext) return;\n\n this.audioContext = new AudioContext();\n\n this.analyser = this.audioContext.createAnalyser();\n this.analyser.fftSize = 512;\n this.analyser.smoothingTimeConstant = 0.1;\n\n const mediaStreamAudioSourceNode = this.audioContext.createMediaStreamSource(this.stream);\n mediaStreamAudioSourceNode.connect(this.analyser);\n\n this.frequencyBinCount = new Float32Array(this.analyser.frequencyBinCount);\n }\n\n /**\n * Returns callRoom member\n * @returns member of the callRoom\n */\n public getMember(): RoomMember {\n const callRoom = this.client.getRoom(this.roomId);\n return callRoom.getMember(this.userId);\n }\n\n /**\n * Returns true if CallFeed is local, otherwise returns false\n * @returns {boolean} is local?\n */\n public isLocal(): boolean {\n return this.userId === this.client.getUserId();\n }\n\n /**\n * Returns true if audio is muted or if there are no audio\n * tracks, otherwise returns false\n * @returns {boolean} is audio muted?\n */\n public isAudioMuted(): boolean {\n return this.stream.getAudioTracks().length === 0 || this.audioMuted;\n }\n\n /**\n * Returns true video is muted or if there are no video\n * tracks, otherwise returns false\n * @returns {boolean} is video muted?\n */\n public isVideoMuted(): boolean {\n // We assume only one video track\n return this.stream.getVideoTracks().length === 0 || this.videoMuted;\n }\n\n /**\n * Replaces the current MediaStream with a new one.\n * This method should be only used by MatrixCall.\n * @param newStream new stream with which to replace the current one\n */\n public setNewStream(newStream: MediaStream): void {\n this.stream = newStream;\n this.emit(CallFeedEvent.NewStream, this.stream);\n\n if (this.hasAudioTrack) {\n this.initVolumeMeasuring();\n } else {\n this.measureVolumeActivity(false);\n }\n }\n\n /**\n * Set feed's internal audio mute state\n * @param muted is the feed's audio muted?\n */\n public setAudioMuted(muted: boolean): void {\n this.audioMuted = muted;\n this.emit(CallFeedEvent.MuteStateChanged, this.audioMuted, this.videoMuted);\n }\n\n /**\n * Set feed's internal video mute state\n * @param muted is the feed's video muted?\n */\n public setVideoMuted(muted: boolean): void {\n this.videoMuted = muted;\n this.emit(CallFeedEvent.MuteStateChanged, this.audioMuted, this.videoMuted);\n }\n\n /**\n * Starts emitting volume_changed events where the emitter value is in decibels\n * @param enabled emit volume changes\n */\n public measureVolumeActivity(enabled: boolean): void {\n if (enabled) {\n if (!this.audioContext || !this.analyser || !this.frequencyBinCount || !this.hasAudioTrack) return;\n\n this.measuringVolumeActivity = true;\n this.volumeLooper();\n } else {\n this.measuringVolumeActivity = false;\n this.emit(CallFeedEvent.VolumeChanged, -Infinity);\n }\n }\n\n public setSpeakingThreshold(threshold: number) {\n this.speakingThreshold = threshold;\n }\n\n private volumeLooper(): void {\n if (!this.analyser) return;\n\n setTimeout(() => {\n if (!this.measuringVolumeActivity) return;\n\n this.analyser.getFloatFrequencyData(this.frequencyBinCount);\n\n let maxVolume = -Infinity;\n for (let i = 0; i < this.frequencyBinCount.length; i++) {\n if (this.frequencyBinCount[i] > maxVolume) {\n maxVolume = this.frequencyBinCount[i];\n }\n }\n\n this.emit(CallFeedEvent.VolumeChanged, maxVolume);\n const newSpeaking = maxVolume > this.speakingThreshold;\n if (this.speaking !== newSpeaking) {\n this.speaking = newSpeaking;\n this.emit(CallFeedEvent.Speaking, this.speaking);\n }\n\n this.volumeLooper();\n }, POLLING_INTERVAL);\n }\n}\n" ] } \ No newline at end of file