@unwanted/matrix-sdk-mini 34.12.0-8 → 34.12.0-9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/lib/client.js +11 -11
  2. package/lib/client.js.map +1 -1
  3. package/lib/embedded.d.ts.map +1 -1
  4. package/lib/embedded.js +35 -2
  5. package/lib/embedded.js.map +1 -1
  6. package/lib/models/event-timeline-set.d.ts +6 -10
  7. package/lib/models/event-timeline-set.d.ts.map +1 -1
  8. package/lib/models/event-timeline-set.js +28 -36
  9. package/lib/models/event-timeline-set.js.map +1 -1
  10. package/lib/models/event-timeline.d.ts +7 -2
  11. package/lib/models/event-timeline.d.ts.map +1 -1
  12. package/lib/models/event-timeline.js +8 -9
  13. package/lib/models/event-timeline.js.map +1 -1
  14. package/lib/models/event.d.ts.map +1 -1
  15. package/lib/models/event.js +1 -1
  16. package/lib/models/event.js.map +1 -1
  17. package/lib/models/room-state.d.ts +2 -13
  18. package/lib/models/room-state.d.ts.map +1 -1
  19. package/lib/models/room-state.js +2 -30
  20. package/lib/models/room-state.js.map +1 -1
  21. package/lib/models/room.d.ts +2 -2
  22. package/lib/models/room.d.ts.map +1 -1
  23. package/lib/models/room.js +27 -14
  24. package/lib/models/room.js.map +1 -1
  25. package/lib/models/thread.d.ts.map +1 -1
  26. package/lib/models/thread.js +5 -3
  27. package/lib/models/thread.js.map +1 -1
  28. package/lib/sliding-sync-sdk.d.ts +1 -1
  29. package/lib/sliding-sync-sdk.d.ts.map +1 -1
  30. package/lib/sliding-sync-sdk.js +15 -13
  31. package/lib/sliding-sync-sdk.js.map +1 -1
  32. package/lib/sync-accumulator.d.ts +6 -4
  33. package/lib/sync-accumulator.d.ts.map +1 -1
  34. package/lib/sync-accumulator.js +23 -12
  35. package/lib/sync-accumulator.js.map +1 -1
  36. package/lib/sync.d.ts +10 -1
  37. package/lib/sync.d.ts.map +1 -1
  38. package/lib/sync.js +93 -42
  39. package/lib/sync.js.map +1 -1
  40. package/package.json +6 -6
  41. package/src/client.ts +11 -11
  42. package/src/embedded.ts +35 -2
  43. package/src/models/event-timeline-set.ts +17 -38
  44. package/src/models/event-timeline.ts +10 -5
  45. package/src/models/event.ts +3 -1
  46. package/src/models/room-state.ts +2 -29
  47. package/src/models/room.ts +18 -6
  48. package/src/models/thread.ts +4 -2
  49. package/src/sliding-sync-sdk.ts +8 -11
  50. package/src/sync-accumulator.ts +33 -16
  51. package/src/sync.ts +111 -45
@@ -1 +1 @@
1
- {"version":3,"file":"room-state.js","names":["RoomMember","logger","isNumber","removeHiddenChars","EventType","UNSTABLE_MSC2716_MARKER","GuestAccess","HistoryVisibility","JoinRule","TypedEventEmitter","Beacon","BeaconEvent","getBeaconInfoIdentifier","TypedReEmitter","M_BEACON","M_BEACON_INFO","KnownMembership","OobStatus","RoomStateEvent","RoomState","constructor","roomId","oobMemberFlags","arguments","length","undefined","status","NotStarted","isStartTimelineState","_defineProperty","Map","updateModifiedTime","getJoinedMemberCount","summaryJoinedMemberCount","joinedMemberCount","getMembers","reduce","count","m","membership","Join","setJoinedMemberCount","getInvitedMemberCount","summaryInvitedMemberCount","invitedMemberCount","Invite","setInvitedMemberCount","Object","values","members","getMembersExcept","excludedIds","filter","includes","userId","getMember","getSentinelMember","sentinel","sentinels","member","events","setMembershipEvent","getStateEvents","eventType","stateKey","has","Array","from","get","event","hasLiveBeacons","_this$liveBeaconIds","liveBeaconIds","_liveBeaconIds","clone","copy","forEach","eventsByStateKey","setStateEvents","Finished","isOutOfBand","_copy$getMember","markOutOfBand","setUnknownStateEvents","unknownStateEvents","getType","getStateKey","stateEvents","options","_lastStateEvent$event","_event$event$unsigned","getRoomId","isState","matches","setBeacon","lastStateEvent","getStateEventMatching","lastReplaceId","unsigned","replaces_state","lastId","event_id","newReplaceId","newId","setStateEvent","_event$getContent$dis","updateDisplayNameCache","getContent","displayname","updateThirdPartyTokenCache","emit","Events","onBeaconLivenessChange","Leave","Ban","avatar_url","getPrevContent","getOrCreateMember","updateMember","Members","RoomPowerLevels","oldLastModified","getLastModifiedTime","setPowerLevelEvent","Marker","Update","processBeaconEvents","matrixClient","_this","_asyncToGenerator","beacons","size","beaconByEventIdDict","dict","beacon","beaconInfoId","processBeaconRelation","beaconInfoEventId","addLocations","_event$getRelation","relatedToEventId","getRelation","isEncrypted","_unused","NewMember","set","beaconIdentifier","isRedacted","_event$getRedactionEv","getRedactionEvent","redacts","destroy","delete","update","reEmitter","reEmit","New","Destroy","LivenessChange","on","bind","identifier","isLive","map","BeaconLiveness","_this$events$get$get","_this$events$get","pwrLvlEvent","needsOutOfBandMembers","outOfBandMembersReady","markOutOfBandMembersStarted","InProgress","markOutOfBandMembersFailed","clearOutOfBandMembers","keys","log","concat","setOutOfBandMembers","e","setOutOfBandMember","stateEvent","existingMember","name","setTypingEvent","getInviteForThreePidToken","token","tokenToInvite","modified","Date","now","getUserIdsWithDisplayName","displayName","_this$displayNameToUs","displayNameToUserIds","maySendRedactionForEvent","mxEvent","canRedact","maySendEvent","RoomRedaction","getSender","hasSufficientPowerLevelFor","powerLevel","action","powerLevelsEvent","powerLevels","requiredLevel","maySendMessage","maySendEventOfType","RoomMessage","mayClientSendStateEvent","stateEventType","cli","isGuest","credentials","maySendStateEvent","state","eventsLevels","stateDefault","eventsDefault","Number","isSafeInteger","state_default","userPowerLevel","users","users_default","events_default","mayTriggerNotifOfType","notifLevelKey","notifLevel","notifications","getJoinRule","_joinRuleEvent$getCon","joinRuleEvent","RoomJoinRules","joinRuleContent","getHistoryVisibility","_historyVisibilityEve","historyVisibilityEvent","RoomHistoryVisibility","historyVisibilityContent","Shared","getGuestAccess","_guestAccessEvent$get","guestAccessEvent","RoomGuestAccess","guestAccessContent","Forbidden","findPredecessor","msc3946ProcessDynamicPredecessor","predecessorEvent","RoomPredecessor","content","predecessor_room_id","eventId","last_known_event_id","viaServers","via_servers","isArray","createEvent","RoomCreate","predecessor","memberEvent","third_party_invite","signed","threePidInvite","RoomThirdPartyInvite","oldName","userIdsToDisplayNames","strippedOldName","existingUserIds","filteredUserIDs","id","strippedDisplayname","_this$displayNameToUs2","arr","push"],"sources":["../../src/models/room-state.ts"],"sourcesContent":["/*\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 { RoomMember } from \"./room-member.ts\";\nimport { logger } from \"../logger.ts\";\nimport { isNumber, removeHiddenChars } from \"../utils.ts\";\nimport { EventType, UNSTABLE_MSC2716_MARKER } from \"../@types/event.ts\";\nimport { IEvent, MatrixEvent } from \"./event.ts\";\nimport { MatrixClient } from \"../client.ts\";\nimport { GuestAccess, HistoryVisibility, JoinRule } from \"../@types/partials.ts\";\nimport { TypedEventEmitter } from \"./typed-event-emitter.ts\";\nimport { Beacon, BeaconEvent, BeaconEventHandlerMap, getBeaconInfoIdentifier, BeaconIdentifier } from \"./beacon.ts\";\nimport { TypedReEmitter } from \"../ReEmitter.ts\";\nimport { M_BEACON, M_BEACON_INFO } from \"../@types/beacon.ts\";\nimport { KnownMembership } from \"../@types/membership.ts\";\nimport { RoomJoinRulesEventContent } from \"../@types/state_events.ts\";\n\nexport interface IMarkerFoundOptions {\n /** Whether the timeline was empty before the marker event arrived in the\n * room. This could be happen in a variety of cases:\n * 1. From the initial sync\n * 2. It's the first state we're seeing after joining the room\n * 3. Or whether it's coming from `syncFromCache`\n *\n * A marker event refers to `UNSTABLE_MSC2716_MARKER` and indicates that\n * history was imported somewhere back in time. It specifically points to an\n * MSC2716 insertion event where the history was imported at. Marker events\n * are sent as state events so they are easily discoverable by clients and\n * homeservers and don't get lost in timeline gaps.\n */\n timelineWasEmpty?: boolean;\n}\n\n// possible statuses for out-of-band member loading\nenum OobStatus {\n NotStarted,\n InProgress,\n Finished,\n}\n\nexport interface IPowerLevelsContent {\n users?: Record<string, number>;\n events?: Record<string, number>;\n notifications?: Partial<Record<\"room\", number>>;\n // eslint-disable-next-line camelcase\n users_default?: number;\n // eslint-disable-next-line camelcase\n events_default?: number;\n // eslint-disable-next-line camelcase\n state_default?: number;\n ban?: number;\n invite?: number;\n kick?: number;\n redact?: number;\n}\n\nexport enum RoomStateEvent {\n Events = \"RoomState.events\",\n Members = \"RoomState.members\",\n NewMember = \"RoomState.newMember\",\n Update = \"RoomState.update\", // signals batches of updates without specificity\n BeaconLiveness = \"RoomState.BeaconLiveness\",\n Marker = \"RoomState.Marker\",\n}\n\nexport type RoomStateEventHandlerMap = {\n /**\n * Fires whenever the event dictionary in room state is updated.\n * This does not guarantee that any related objects (like RoomMember) have been updated.\n * Use RoomStateEvent.Update for that.\n * @param event - The matrix event which caused this event to fire.\n * @param state - The room state whose RoomState.events dictionary\n * was updated.\n * @param 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 * ```\n * matrixClient.on(\"RoomState.events\", function(event, state, prevEvent){\n * var newStateEvent = event;\n * });\n * ```\n */\n [RoomStateEvent.Events]: (event: MatrixEvent, state: RoomState, prevEvent: MatrixEvent | null) => void;\n /**\n * Fires whenever a member in the members dictionary is updated in any way.\n * @param event - The matrix event which caused this event to fire.\n * @param state - The room state whose RoomState.members dictionary\n * was updated.\n * @param member - The room member that was updated.\n * @example\n * ```\n * matrixClient.on(\"RoomState.members\", function(event, state, member){\n * var newMembershipState = member.membership;\n * });\n * ```\n */\n [RoomStateEvent.Members]: (event: MatrixEvent, state: RoomState, member: RoomMember) => void;\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 * @param event - The matrix event which caused this event to fire.\n * @param state - The room state whose RoomState.members dictionary\n * was updated with a new entry.\n * @param member - The room member that was added.\n * @example\n * ```\n * matrixClient.on(\"RoomState.newMember\", function(event, state, member){\n * // add event listeners on 'member'\n * });\n * ```\n */\n [RoomStateEvent.NewMember]: (event: MatrixEvent, state: RoomState, member: RoomMember) => void;\n [RoomStateEvent.Update]: (state: RoomState) => void;\n [RoomStateEvent.BeaconLiveness]: (state: RoomState, hasLiveBeacons: boolean) => void;\n [RoomStateEvent.Marker]: (event: MatrixEvent, setStateOptions?: IMarkerFoundOptions) => void;\n [BeaconEvent.New]: (event: MatrixEvent, beacon: Beacon) => void;\n};\n\ntype EmittedEvents = RoomStateEvent | BeaconEvent;\ntype EventHandlerMap = RoomStateEventHandlerMap & BeaconEventHandlerMap;\n\ntype KeysMatching<T, V> = { [K in keyof T]-?: T[K] extends V ? K : never }[keyof T];\n\nexport class RoomState extends TypedEventEmitter<EmittedEvents, EventHandlerMap> {\n public readonly reEmitter = new TypedReEmitter<EmittedEvents, EventHandlerMap>(this);\n private sentinels: Record<string, RoomMember> = {}; // userId: RoomMember\n // stores fuzzy matches to a list of userIDs (applies utils.removeHiddenChars to keys)\n private displayNameToUserIds = new Map<string, string[]>();\n private userIdsToDisplayNames: Record<string, string> = {};\n private tokenToInvite: Record<string, MatrixEvent> = {}; // 3pid invite state_key to m.room.member invite\n private joinedMemberCount: number | null = 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 = null;\n // same for invited member count\n private invitedMemberCount: number | null = null;\n private summaryInvitedMemberCount: number | null = null;\n private modified = -1;\n\n // XXX: Should be read-only\n // The room member dictionary, keyed on the user's ID.\n public members: Record<string, RoomMember> = {}; // userId: RoomMember\n // The state events dictionary, keyed on the event type and then the state_key value.\n public events = new Map<string, Map<string, MatrixEvent>>(); // Map<eventType, Map<stateKey, MatrixEvent>>\n // The pagination token for this state.\n public paginationToken: string | null = null;\n\n public readonly beacons = new Map<BeaconIdentifier, Beacon>();\n private _liveBeaconIds: BeaconIdentifier[] = [];\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, e.g.\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 * @param 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 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 * @param isStartTimelineState - Optional. This state is marked as a start state.\n * This is used to skip state insertions that are\n * in the wrong order. The order is determined by the `replaces_state` id.\n *\n * Example:\n * A current state events `replaces_state` value is `1`.\n * Trying to insert a state event with `event_id` `1` in its place would fail if isStartTimelineState = false.\n *\n * A current state events `event_id` is `2`.\n * Trying to insert a state event where its `replaces_state` value is `2` would fail if isStartTimelineState = true.\n */\n\n public constructor(\n public readonly roomId: string,\n private oobMemberFlags = { status: OobStatus.NotStarted },\n public readonly isStartTimelineState = false,\n ) {\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 * @returns 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 === KnownMembership.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 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 * @returns 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 === KnownMembership.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 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 * @returns 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 excludedIds - The user IDs to exclude.\n * @returns 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 userId - The room member's user ID.\n * @returns 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 userId - The room member's user ID.\n * @returns 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?.events.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 eventType - The event type of the state event.\n * @returns A list of events\n */\n public getStateEvents(eventType: EventType | string): MatrixEvent[];\n /**\n * Get state events from the state of the room.\n * @param eventType - The event type of the state event.\n * @param stateKey - The state_key of the state event.\n * @returns A single event (or null if no match found).\n */\n public getStateEvents(eventType: EventType | string, stateKey: string): MatrixEvent | null;\n public getStateEvents(eventType: EventType | string, stateKey?: string): MatrixEvent[] | MatrixEvent | null {\n if (!this.events.has(eventType)) {\n // no match\n return stateKey === undefined ? [] : null;\n }\n if (stateKey === undefined) {\n // 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 public get hasLiveBeacons(): boolean {\n return !!this.liveBeaconIds?.length;\n }\n\n public get liveBeaconIds(): BeaconIdentifier[] {\n return this._liveBeaconIds;\n }\n\n /**\n * Creates a copy of this room state so that mutations to either won't affect the other.\n * @returns 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 copy.getMember(member.userId)?.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 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()) || !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 any existing\n * state with the same `{type, stateKey}` tuple. Will fire \"RoomState.events\"\n * for every event added. May fire \"RoomState.members\" if there are\n * `m.room.member` events. May fire \"RoomStateEvent.Marker\" if there are\n * `UNSTABLE_MSC2716_MARKER` events.\n * @param stateEvents - a list of state events for this room.\n *\n * @remarks\n * Fires {@link RoomStateEvent.Members}\n * Fires {@link RoomStateEvent.NewMember}\n * Fires {@link RoomStateEvent.Events}\n * Fires {@link RoomStateEvent.Marker}\n */\n public setStateEvents(stateEvents: MatrixEvent[], options?: IMarkerFoundOptions): void {\n this.updateModifiedTime();\n\n // update the core event dict\n stateEvents.forEach((event) => {\n if (event.getRoomId() !== this.roomId || !event.isState()) return;\n\n if (M_BEACON_INFO.matches(event.getType())) {\n this.setBeacon(event);\n }\n\n const lastStateEvent = this.getStateEventMatching(event);\n\n // Safety measure to not update the room (and emit the update) with older state.\n // The sync loop really should not send old events but it does very regularly.\n // Logging on return in those two conditions results in a large amount of logging. (on startup and when running element)\n const lastReplaceId = lastStateEvent?.event.unsigned?.replaces_state;\n const lastId = lastStateEvent?.event.event_id;\n const newReplaceId = event.event.unsigned?.replaces_state;\n const newId = event.event.event_id;\n if (this.isStartTimelineState) {\n // Add an event to the start of the timeline. Its replace id should not be the same as the one of the current/last start state event.\n if (newReplaceId && lastId && newReplaceId === lastId) return;\n } else {\n // Add an event to the end of the timeline. It should not be the same as the one replaced by the current/last end state event.\n if (lastReplaceId && newId && lastReplaceId === newId) return;\n }\n\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(RoomStateEvent.Events, event, this, lastStateEvent);\n });\n\n this.onBeaconLivenessChange();\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 || !event.isState()) return;\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 (\n event.getContent().membership === KnownMembership.Leave ||\n event.getContent().membership === KnownMembership.Ban\n ) {\n event.getContent().avatar_url = event.getContent().avatar_url || event.getPrevContent().avatar_url;\n event.getContent().displayname =\n event.getContent().displayname || event.getPrevContent().displayname;\n }\n\n const member = this.getOrCreateMember(userId, event);\n member.setMembershipEvent(event, this);\n this.updateMember(member);\n this.emit(RoomStateEvent.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(RoomStateEvent.Members, event, this, member);\n }\n });\n\n // assume all our sentinels are now out-of-date\n this.sentinels = {};\n } else if (UNSTABLE_MSC2716_MARKER.matches(event.getType())) {\n this.emit(RoomStateEvent.Marker, event, options);\n }\n });\n\n this.emit(RoomStateEvent.Update, this);\n }\n\n public async processBeaconEvents(events: MatrixEvent[], matrixClient: MatrixClient): Promise<void> {\n if (\n !events.length ||\n // discard locations if we have no beacons\n !this.beacons.size\n ) {\n return;\n }\n\n const beaconByEventIdDict = [...this.beacons.values()].reduce<Record<string, Beacon>>((dict, beacon) => {\n dict[beacon.beaconInfoId] = beacon;\n return dict;\n }, {});\n\n const processBeaconRelation = (beaconInfoEventId: string, event: MatrixEvent): void => {\n if (!M_BEACON.matches(event.getType())) {\n return;\n }\n\n const beacon = beaconByEventIdDict[beaconInfoEventId];\n\n if (beacon) {\n beacon.addLocations([event]);\n }\n };\n\n for (const event of events) {\n const relatedToEventId = event.getRelation()?.event_id;\n // not related to a beacon we know about; discard\n if (!relatedToEventId || !beaconByEventIdDict[relatedToEventId]) return;\n if (!M_BEACON.matches(event.getType()) && !event.isEncrypted()) return;\n\n try {\n processBeaconRelation(relatedToEventId, event);\n } catch {\n //\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 userId - the id of the user to look up\n * @param event - the membership event for the (new) member. Used to emit.\n * @returns the member, existing or newly created.\n *\n * @remarks\n * Fires {@link RoomStateEvent.NewMember}\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(RoomStateEvent.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 /**\n * @experimental\n */\n private setBeacon(event: MatrixEvent): void {\n const beaconIdentifier = getBeaconInfoIdentifier(event);\n\n if (this.beacons.has(beaconIdentifier)) {\n const beacon = this.beacons.get(beaconIdentifier)!;\n\n if (event.isRedacted()) {\n if (beacon.beaconInfoId === (<IEvent>event.getRedactionEvent())?.redacts) {\n beacon.destroy();\n this.beacons.delete(beaconIdentifier);\n }\n return;\n }\n\n return beacon.update(event);\n }\n\n if (event.isRedacted()) {\n return;\n }\n\n const beacon = new Beacon(event);\n\n this.reEmitter.reEmit<BeaconEvent, BeaconEvent>(beacon, [\n BeaconEvent.New,\n BeaconEvent.Update,\n BeaconEvent.Destroy,\n BeaconEvent.LivenessChange,\n ]);\n\n this.emit(BeaconEvent.New, event, beacon);\n beacon.on(BeaconEvent.LivenessChange, this.onBeaconLivenessChange.bind(this));\n beacon.on(BeaconEvent.Destroy, this.onBeaconLivenessChange.bind(this));\n\n this.beacons.set(beacon.identifier, beacon);\n }\n\n /**\n * @experimental\n * Check liveness of room beacons\n * emit RoomStateEvent.BeaconLiveness event\n */\n private onBeaconLivenessChange(): void {\n this._liveBeaconIds = Array.from(this.beacons.values())\n .filter((beacon) => beacon.isLive)\n .map((beacon) => beacon.identifier);\n\n this.emit(RoomStateEvent.BeaconLiveness, this, this.hasLiveBeacons);\n }\n\n private getStateEventMatching(event: MatrixEvent): MatrixEvent | null {\n return this.events.get(event.getType())?.get(event.getStateKey()!) ?? null;\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 * @returns 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 * Check if loading of out-of-band-members has completed\n *\n * @returns true if the full membership list of this room has been loaded. False if it is not started or is in\n * progress.\n */\n public outOfBandMembersReady(): boolean {\n return this.oobMemberFlags.status === OobStatus.Finished;\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 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 this.emit(RoomStateEvent.Update, this);\n }\n\n /**\n * Sets a single out of band member, used by both setOutOfBandMembers and clone\n * @param 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(RoomStateEvent.Members, stateEvent, this, member);\n }\n\n /**\n * Set the current typing event for this room.\n * @param 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 token - The token\n * @returns 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 * @returns 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 displayName - The display name to get user IDs from.\n * @returns An array of user IDs or an empty array.\n */\n public getUserIdsWithDisplayName(displayName: string): string[] {\n return this.displayNameToUserIds.get(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 mxEvent - The event to test permission for\n * @param userId - The user ID of the user to test permission for\n * @returns 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 === KnownMembership.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\n if (!canRedact) return false;\n if (mxEvent.getSender() === userId) return true;\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 action - The type of power level to check\n * @param powerLevel - The power level of the member\n * @returns true if the given power level is sufficient\n */\n public hasSufficientPowerLevelFor(\n action: KeysMatching<Required<IPowerLevelsContent>, number>,\n powerLevel: number,\n ): boolean {\n const powerLevelsEvent = this.getStateEvents(EventType.RoomPowerLevels, \"\");\n\n let powerLevels: IPowerLevelsContent = {};\n if (powerLevelsEvent) {\n powerLevels = powerLevelsEvent.getContent();\n }\n\n let requiredLevel = 50;\n if (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 userId - The user ID of the user to test permission for\n * @returns 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 eventType - The type of event to test\n * @param userId - The user ID of the user to test permission for\n * @returns 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 stateEventType - The type of state events to test\n * @param cli - The client to test permission for\n * @returns 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() || !cli.credentials.userId) {\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 stateEventType - The type of state events to test\n * @param userId - The user ID of the user to test permission for\n * @returns 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 eventType - The type of event to test\n * @param userId - The user ID of the user to test permission for\n * @param 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 * @returns 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: IPowerLevelsContent;\n let eventsLevels: Record<EventType | string, number> = {};\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 notifLevelKey - The level of notification to test (eg. 'room')\n * @param userId - The user ID of the user to test permission for\n * @returns 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 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 the join_rule applied to this room\n */\n public getJoinRule(): JoinRule {\n const joinRuleEvent = this.getStateEvents(EventType.RoomJoinRules, \"\");\n const joinRuleContent: Partial<RoomJoinRulesEventContent> = joinRuleEvent?.getContent() ?? {};\n return joinRuleContent[\"join_rule\"] || JoinRule.Invite;\n }\n\n /**\n * Returns the history visibility based on the m.room.history_visibility state event, defaulting to `shared`.\n * @returns the history_visibility applied to this room\n */\n public getHistoryVisibility(): HistoryVisibility {\n const historyVisibilityEvent = this.getStateEvents(EventType.RoomHistoryVisibility, \"\");\n const historyVisibilityContent = historyVisibilityEvent?.getContent() ?? {};\n return historyVisibilityContent[\"history_visibility\"] || HistoryVisibility.Shared;\n }\n\n /**\n * Returns the guest access based on the m.room.guest_access state event, defaulting to `shared`.\n * @returns the guest_access applied to this room\n */\n public getGuestAccess(): GuestAccess {\n const guestAccessEvent = this.getStateEvents(EventType.RoomGuestAccess, \"\");\n const guestAccessContent = guestAccessEvent?.getContent() ?? {};\n return guestAccessContent[\"guest_access\"] || GuestAccess.Forbidden;\n }\n\n /**\n * Find the predecessor room based on this room state.\n *\n * @param msc3946ProcessDynamicPredecessor - if true, look for an\n * m.room.predecessor state event and use it if found (MSC3946).\n * @returns null if this room has no predecessor. Otherwise, returns\n * the roomId, last eventId and viaServers of the predecessor room.\n *\n * If msc3946ProcessDynamicPredecessor is true, use m.predecessor events\n * as well as m.room.create events to find predecessors.\n *\n * Note: if an m.predecessor event is used, eventId may be undefined\n * since last_known_event_id is optional.\n *\n * Note: viaServers may be undefined, and will definitely be undefined if\n * this predecessor comes from a RoomCreate event (rather than a\n * RoomPredecessor, which has the optional via_servers property).\n */\n public findPredecessor(\n msc3946ProcessDynamicPredecessor = false,\n ): { roomId: string; eventId?: string; viaServers?: string[] } | null {\n // Note: the tests for this function are against Room.findPredecessor,\n // which just calls through to here.\n\n if (msc3946ProcessDynamicPredecessor) {\n const predecessorEvent = this.getStateEvents(EventType.RoomPredecessor, \"\");\n if (predecessorEvent) {\n const content = predecessorEvent.getContent<{\n predecessor_room_id: string;\n last_known_event_id?: string;\n via_servers?: string[];\n }>();\n const roomId = content.predecessor_room_id;\n let eventId = content.last_known_event_id;\n if (typeof eventId !== \"string\") {\n eventId = undefined;\n }\n let viaServers = content.via_servers;\n if (!Array.isArray(viaServers)) {\n viaServers = undefined;\n }\n if (typeof roomId === \"string\") {\n return { roomId, eventId, viaServers };\n }\n }\n }\n\n const createEvent = this.getStateEvents(EventType.RoomCreate, \"\");\n if (createEvent) {\n const predecessor = createEvent.getContent<{\n predecessor?: Partial<{\n room_id: string;\n event_id: string;\n }>;\n }>()[\"predecessor\"];\n if (predecessor) {\n const roomId = predecessor[\"room_id\"];\n if (typeof roomId === \"string\") {\n let eventId = predecessor[\"event_id\"];\n if (typeof eventId !== \"string\" || eventId === \"\") {\n eventId = undefined;\n }\n return { roomId, eventId };\n }\n }\n }\n return null;\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 = removeHiddenChars(oldName);\n\n const existingUserIds = this.displayNameToUserIds.get(strippedOldName);\n if (existingUserIds) {\n // remove this user ID from this array\n const filteredUserIDs = existingUserIds.filter((id) => id !== userId);\n this.displayNameToUserIds.set(strippedOldName, filteredUserIDs);\n }\n }\n\n this.userIdsToDisplayNames[userId] = displayName;\n\n const strippedDisplayname = displayName && removeHiddenChars(displayName);\n // an empty stripped displayname (undefined/'') will be set to MXID in room-member.js\n if (strippedDisplayname) {\n const arr = this.displayNameToUserIds.get(strippedDisplayname) ?? [];\n arr.push(userId);\n this.displayNameToUserIds.set(strippedDisplayname, arr);\n }\n }\n}\n"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,UAAU,QAAQ,kBAAkB;AAC7C,SAASC,MAAM,QAAQ,cAAc;AACrC,SAASC,QAAQ,EAAEC,iBAAiB,QAAQ,aAAa;AACzD,SAASC,SAAS,EAAEC,uBAAuB,QAAQ,oBAAoB;AAGvE,SAASC,WAAW,EAAEC,iBAAiB,EAAEC,QAAQ,QAAQ,uBAAuB;AAChF,SAASC,iBAAiB,QAAQ,0BAA0B;AAC5D,SAASC,MAAM,EAAEC,WAAW,EAAyBC,uBAAuB,QAA0B,aAAa;AACnH,SAASC,cAAc,QAAQ,iBAAiB;AAChD,SAASC,QAAQ,EAAEC,aAAa,QAAQ,qBAAqB;AAC7D,SAASC,eAAe,QAAQ,yBAAyB;AAmBzD;AAAA,IACKC,SAAS,0BAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EAAA,OAATA,SAAS;AAAA,EAATA,SAAS;AAsBd,WAAYC,cAAc,0BAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAA,OAAdA,cAAc;AAAA;AAsE1B,OAAO,MAAMC,SAAS,SAASV,iBAAiB,CAAiC;EA8B7E;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,GAAGyI,WAAW;IAEhD,IAAMiF,mBAAmB,GAAGjF,WAAW,IAAI5L,iBAAiB,CAAC4L,WAAW,CAAC;IACzE;IACA,IAAIiF,mBAAmB,EAAE;MAAA,IAAAC,sBAAA;MACrB,IAAMC,GAAG,IAAAD,sBAAA,GAAG,IAAI,CAAChF,oBAAoB,CAAC7H,GAAG,CAAC4M,mBAAmB,CAAC,cAAAC,sBAAA,cAAAA,sBAAA,GAAI,EAAE;MACpEC,GAAG,CAACC,IAAI,CAAC7N,MAAM,CAAC;MAChB,IAAI,CAAC2I,oBAAoB,CAAChD,GAAG,CAAC+H,mBAAmB,EAAEE,GAAG,CAAC;IAC3D;EACJ;AACJ","ignoreList":[]}
1
+ {"version":3,"file":"room-state.js","names":["RoomMember","logger","isNumber","removeHiddenChars","EventType","UNSTABLE_MSC2716_MARKER","GuestAccess","HistoryVisibility","JoinRule","TypedEventEmitter","Beacon","BeaconEvent","getBeaconInfoIdentifier","TypedReEmitter","M_BEACON","M_BEACON_INFO","KnownMembership","OobStatus","RoomStateEvent","RoomState","constructor","roomId","oobMemberFlags","arguments","length","undefined","status","NotStarted","_defineProperty","Map","updateModifiedTime","getJoinedMemberCount","summaryJoinedMemberCount","joinedMemberCount","getMembers","reduce","count","m","membership","Join","setJoinedMemberCount","getInvitedMemberCount","summaryInvitedMemberCount","invitedMemberCount","Invite","setInvitedMemberCount","Object","values","members","getMembersExcept","excludedIds","filter","includes","userId","getMember","getSentinelMember","sentinel","sentinels","member","events","setMembershipEvent","getStateEvents","eventType","stateKey","has","Array","from","get","event","hasLiveBeacons","_this$liveBeaconIds","liveBeaconIds","_liveBeaconIds","clone","copy","forEach","eventsByStateKey","setStateEvents","Finished","isOutOfBand","_copy$getMember","markOutOfBand","setUnknownStateEvents","unknownStateEvents","getType","getStateKey","stateEvents","markerFoundOptions","getRoomId","isState","matches","setBeacon","lastStateEvent","getStateEventMatching","setStateEvent","_event$getContent$dis","updateDisplayNameCache","getContent","displayname","updateThirdPartyTokenCache","emit","Events","onBeaconLivenessChange","Leave","Ban","avatar_url","getPrevContent","getOrCreateMember","updateMember","Members","RoomPowerLevels","oldLastModified","getLastModifiedTime","setPowerLevelEvent","Marker","Update","processBeaconEvents","matrixClient","_this","_asyncToGenerator","beacons","size","beaconByEventIdDict","dict","beacon","beaconInfoId","processBeaconRelation","beaconInfoEventId","addLocations","_event$getRelation","relatedToEventId","getRelation","event_id","isEncrypted","_unused","NewMember","set","beaconIdentifier","isRedacted","_event$getRedactionEv","getRedactionEvent","redacts","destroy","delete","update","reEmitter","reEmit","New","Destroy","LivenessChange","on","bind","identifier","isLive","map","BeaconLiveness","_this$events$get$get","_this$events$get","pwrLvlEvent","needsOutOfBandMembers","outOfBandMembersReady","markOutOfBandMembersStarted","InProgress","markOutOfBandMembersFailed","clearOutOfBandMembers","keys","log","concat","setOutOfBandMembers","e","setOutOfBandMember","stateEvent","existingMember","name","setTypingEvent","getInviteForThreePidToken","token","tokenToInvite","modified","Date","now","getUserIdsWithDisplayName","displayName","_this$displayNameToUs","displayNameToUserIds","maySendRedactionForEvent","mxEvent","canRedact","maySendEvent","RoomRedaction","getSender","hasSufficientPowerLevelFor","powerLevel","action","powerLevelsEvent","powerLevels","requiredLevel","maySendMessage","maySendEventOfType","RoomMessage","mayClientSendStateEvent","stateEventType","cli","isGuest","credentials","maySendStateEvent","state","eventsLevels","stateDefault","eventsDefault","Number","isSafeInteger","state_default","userPowerLevel","users","users_default","events_default","mayTriggerNotifOfType","notifLevelKey","notifLevel","notifications","getJoinRule","_joinRuleEvent$getCon","joinRuleEvent","RoomJoinRules","joinRuleContent","getHistoryVisibility","_historyVisibilityEve","historyVisibilityEvent","RoomHistoryVisibility","historyVisibilityContent","Shared","getGuestAccess","_guestAccessEvent$get","guestAccessEvent","RoomGuestAccess","guestAccessContent","Forbidden","findPredecessor","msc3946ProcessDynamicPredecessor","predecessorEvent","RoomPredecessor","content","predecessor_room_id","eventId","last_known_event_id","viaServers","via_servers","isArray","createEvent","RoomCreate","predecessor","memberEvent","third_party_invite","signed","threePidInvite","RoomThirdPartyInvite","oldName","userIdsToDisplayNames","strippedOldName","existingUserIds","filteredUserIDs","id","strippedDisplayname","_this$displayNameToUs2","arr","push"],"sources":["../../src/models/room-state.ts"],"sourcesContent":["/*\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 { RoomMember } from \"./room-member.ts\";\nimport { logger } from \"../logger.ts\";\nimport { isNumber, removeHiddenChars } from \"../utils.ts\";\nimport { EventType, UNSTABLE_MSC2716_MARKER } from \"../@types/event.ts\";\nimport { IEvent, MatrixEvent } from \"./event.ts\";\nimport { MatrixClient } from \"../client.ts\";\nimport { GuestAccess, HistoryVisibility, JoinRule } from \"../@types/partials.ts\";\nimport { TypedEventEmitter } from \"./typed-event-emitter.ts\";\nimport { Beacon, BeaconEvent, BeaconEventHandlerMap, getBeaconInfoIdentifier, BeaconIdentifier } from \"./beacon.ts\";\nimport { TypedReEmitter } from \"../ReEmitter.ts\";\nimport { M_BEACON, M_BEACON_INFO } from \"../@types/beacon.ts\";\nimport { KnownMembership } from \"../@types/membership.ts\";\nimport { RoomJoinRulesEventContent } from \"../@types/state_events.ts\";\n\nexport interface IMarkerFoundOptions {\n /** Whether the timeline was empty before the marker event arrived in the\n * room. This could be happen in a variety of cases:\n * 1. From the initial sync\n * 2. It's the first state we're seeing after joining the room\n * 3. Or whether it's coming from `syncFromCache`\n *\n * A marker event refers to `UNSTABLE_MSC2716_MARKER` and indicates that\n * history was imported somewhere back in time. It specifically points to an\n * MSC2716 insertion event where the history was imported at. Marker events\n * are sent as state events so they are easily discoverable by clients and\n * homeservers and don't get lost in timeline gaps.\n */\n timelineWasEmpty?: boolean;\n}\n\n// possible statuses for out-of-band member loading\nenum OobStatus {\n NotStarted,\n InProgress,\n Finished,\n}\n\nexport interface IPowerLevelsContent {\n users?: Record<string, number>;\n events?: Record<string, number>;\n notifications?: Partial<Record<\"room\", number>>;\n // eslint-disable-next-line camelcase\n users_default?: number;\n // eslint-disable-next-line camelcase\n events_default?: number;\n // eslint-disable-next-line camelcase\n state_default?: number;\n ban?: number;\n invite?: number;\n kick?: number;\n redact?: number;\n}\n\nexport enum RoomStateEvent {\n Events = \"RoomState.events\",\n Members = \"RoomState.members\",\n NewMember = \"RoomState.newMember\",\n Update = \"RoomState.update\", // signals batches of updates without specificity\n BeaconLiveness = \"RoomState.BeaconLiveness\",\n Marker = \"RoomState.Marker\",\n}\n\nexport type RoomStateEventHandlerMap = {\n /**\n * Fires whenever the event dictionary in room state is updated.\n * This does not guarantee that any related objects (like RoomMember) have been updated.\n * Use RoomStateEvent.Update for that.\n * @param event - The matrix event which caused this event to fire.\n * @param state - The room state whose RoomState.events dictionary\n * was updated.\n * @param 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 * ```\n * matrixClient.on(\"RoomState.events\", function(event, state, prevEvent){\n * var newStateEvent = event;\n * });\n * ```\n */\n [RoomStateEvent.Events]: (event: MatrixEvent, state: RoomState, prevEvent: MatrixEvent | null) => void;\n /**\n * Fires whenever a member in the members dictionary is updated in any way.\n * @param event - The matrix event which caused this event to fire.\n * @param state - The room state whose RoomState.members dictionary\n * was updated.\n * @param member - The room member that was updated.\n * @example\n * ```\n * matrixClient.on(\"RoomState.members\", function(event, state, member){\n * var newMembershipState = member.membership;\n * });\n * ```\n */\n [RoomStateEvent.Members]: (event: MatrixEvent, state: RoomState, member: RoomMember) => void;\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 * @param event - The matrix event which caused this event to fire.\n * @param state - The room state whose RoomState.members dictionary\n * was updated with a new entry.\n * @param member - The room member that was added.\n * @example\n * ```\n * matrixClient.on(\"RoomState.newMember\", function(event, state, member){\n * // add event listeners on 'member'\n * });\n * ```\n */\n [RoomStateEvent.NewMember]: (event: MatrixEvent, state: RoomState, member: RoomMember) => void;\n [RoomStateEvent.Update]: (state: RoomState) => void;\n [RoomStateEvent.BeaconLiveness]: (state: RoomState, hasLiveBeacons: boolean) => void;\n [RoomStateEvent.Marker]: (event: MatrixEvent, setStateOptions?: IMarkerFoundOptions) => void;\n [BeaconEvent.New]: (event: MatrixEvent, beacon: Beacon) => void;\n};\n\ntype EmittedEvents = RoomStateEvent | BeaconEvent;\ntype EventHandlerMap = RoomStateEventHandlerMap & BeaconEventHandlerMap;\n\ntype KeysMatching<T, V> = { [K in keyof T]-?: T[K] extends V ? K : never }[keyof T];\n\nexport class RoomState extends TypedEventEmitter<EmittedEvents, EventHandlerMap> {\n public readonly reEmitter = new TypedReEmitter<EmittedEvents, EventHandlerMap>(this);\n private sentinels: Record<string, RoomMember> = {}; // userId: RoomMember\n // stores fuzzy matches to a list of userIDs (applies utils.removeHiddenChars to keys)\n private displayNameToUserIds = new Map<string, string[]>();\n private userIdsToDisplayNames: Record<string, string> = {};\n private tokenToInvite: Record<string, MatrixEvent> = {}; // 3pid invite state_key to m.room.member invite\n private joinedMemberCount: number | null = 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 = null;\n // same for invited member count\n private invitedMemberCount: number | null = null;\n private summaryInvitedMemberCount: number | null = null;\n private modified = -1;\n\n // XXX: Should be read-only\n // The room member dictionary, keyed on the user's ID.\n public members: Record<string, RoomMember> = {}; // userId: RoomMember\n // The state events dictionary, keyed on the event type and then the state_key value.\n public events = new Map<string, Map<string, MatrixEvent>>(); // Map<eventType, Map<stateKey, MatrixEvent>>\n // The pagination token for this state.\n public paginationToken: string | null = null;\n\n public readonly beacons = new Map<BeaconIdentifier, Beacon>();\n private _liveBeaconIds: BeaconIdentifier[] = [];\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, e.g.\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 * @param 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 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 */\n\n public constructor(\n public readonly roomId: string,\n private oobMemberFlags = { status: OobStatus.NotStarted },\n ) {\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 * @returns 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 === KnownMembership.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 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 * @returns 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 === KnownMembership.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 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 * @returns 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 excludedIds - The user IDs to exclude.\n * @returns 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 userId - The room member's user ID.\n * @returns 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 userId - The room member's user ID.\n * @returns 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?.events.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 eventType - The event type of the state event.\n * @returns A list of events\n */\n public getStateEvents(eventType: EventType | string): MatrixEvent[];\n /**\n * Get state events from the state of the room.\n * @param eventType - The event type of the state event.\n * @param stateKey - The state_key of the state event.\n * @returns A single event (or null if no match found).\n */\n public getStateEvents(eventType: EventType | string, stateKey: string): MatrixEvent | null;\n public getStateEvents(eventType: EventType | string, stateKey?: string): MatrixEvent[] | MatrixEvent | null {\n if (!this.events.has(eventType)) {\n // no match\n return stateKey === undefined ? [] : null;\n }\n if (stateKey === undefined) {\n // 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 public get hasLiveBeacons(): boolean {\n return !!this.liveBeaconIds?.length;\n }\n\n public get liveBeaconIds(): BeaconIdentifier[] {\n return this._liveBeaconIds;\n }\n\n /**\n * Creates a copy of this room state so that mutations to either won't affect the other.\n * @returns 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 copy.getMember(member.userId)?.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 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()) || !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 any existing\n * state with the same `{type, stateKey}` tuple. Will fire \"RoomState.events\"\n * for every event added. May fire \"RoomState.members\" if there are\n * `m.room.member` events. May fire \"RoomStateEvent.Marker\" if there are\n * `UNSTABLE_MSC2716_MARKER` events.\n * @param stateEvents - a list of state events for this room.\n *\n * @remarks\n * Fires {@link RoomStateEvent.Members}\n * Fires {@link RoomStateEvent.NewMember}\n * Fires {@link RoomStateEvent.Events}\n * Fires {@link RoomStateEvent.Marker}\n */\n public setStateEvents(stateEvents: MatrixEvent[], markerFoundOptions?: IMarkerFoundOptions): void {\n this.updateModifiedTime();\n\n // update the core event dict\n stateEvents.forEach((event) => {\n if (event.getRoomId() !== this.roomId || !event.isState()) return;\n\n if (M_BEACON_INFO.matches(event.getType())) {\n this.setBeacon(event);\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(RoomStateEvent.Events, event, this, lastStateEvent);\n });\n\n this.onBeaconLivenessChange();\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 || !event.isState()) return;\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 (\n event.getContent().membership === KnownMembership.Leave ||\n event.getContent().membership === KnownMembership.Ban\n ) {\n event.getContent().avatar_url = event.getContent().avatar_url || event.getPrevContent().avatar_url;\n event.getContent().displayname =\n event.getContent().displayname || event.getPrevContent().displayname;\n }\n\n const member = this.getOrCreateMember(userId, event);\n member.setMembershipEvent(event, this);\n this.updateMember(member);\n this.emit(RoomStateEvent.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(RoomStateEvent.Members, event, this, member);\n }\n });\n\n // assume all our sentinels are now out-of-date\n this.sentinels = {};\n } else if (UNSTABLE_MSC2716_MARKER.matches(event.getType())) {\n this.emit(RoomStateEvent.Marker, event, markerFoundOptions);\n }\n });\n\n this.emit(RoomStateEvent.Update, this);\n }\n\n public async processBeaconEvents(events: MatrixEvent[], matrixClient: MatrixClient): Promise<void> {\n if (\n !events.length ||\n // discard locations if we have no beacons\n !this.beacons.size\n ) {\n return;\n }\n\n const beaconByEventIdDict = [...this.beacons.values()].reduce<Record<string, Beacon>>((dict, beacon) => {\n dict[beacon.beaconInfoId] = beacon;\n return dict;\n }, {});\n\n const processBeaconRelation = (beaconInfoEventId: string, event: MatrixEvent): void => {\n if (!M_BEACON.matches(event.getType())) {\n return;\n }\n\n const beacon = beaconByEventIdDict[beaconInfoEventId];\n\n if (beacon) {\n beacon.addLocations([event]);\n }\n };\n\n for (const event of events) {\n const relatedToEventId = event.getRelation()?.event_id;\n // not related to a beacon we know about; discard\n if (!relatedToEventId || !beaconByEventIdDict[relatedToEventId]) return;\n if (!M_BEACON.matches(event.getType()) && !event.isEncrypted()) return;\n\n try {\n processBeaconRelation(relatedToEventId, event);\n } catch {\n //\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 userId - the id of the user to look up\n * @param event - the membership event for the (new) member. Used to emit.\n * @returns the member, existing or newly created.\n *\n * @remarks\n * Fires {@link RoomStateEvent.NewMember}\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(RoomStateEvent.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 /**\n * @experimental\n */\n private setBeacon(event: MatrixEvent): void {\n const beaconIdentifier = getBeaconInfoIdentifier(event);\n\n if (this.beacons.has(beaconIdentifier)) {\n const beacon = this.beacons.get(beaconIdentifier)!;\n\n if (event.isRedacted()) {\n if (beacon.beaconInfoId === (<IEvent>event.getRedactionEvent())?.redacts) {\n beacon.destroy();\n this.beacons.delete(beaconIdentifier);\n }\n return;\n }\n\n return beacon.update(event);\n }\n\n if (event.isRedacted()) {\n return;\n }\n\n const beacon = new Beacon(event);\n\n this.reEmitter.reEmit<BeaconEvent, BeaconEvent>(beacon, [\n BeaconEvent.New,\n BeaconEvent.Update,\n BeaconEvent.Destroy,\n BeaconEvent.LivenessChange,\n ]);\n\n this.emit(BeaconEvent.New, event, beacon);\n beacon.on(BeaconEvent.LivenessChange, this.onBeaconLivenessChange.bind(this));\n beacon.on(BeaconEvent.Destroy, this.onBeaconLivenessChange.bind(this));\n\n this.beacons.set(beacon.identifier, beacon);\n }\n\n /**\n * @experimental\n * Check liveness of room beacons\n * emit RoomStateEvent.BeaconLiveness event\n */\n private onBeaconLivenessChange(): void {\n this._liveBeaconIds = Array.from(this.beacons.values())\n .filter((beacon) => beacon.isLive)\n .map((beacon) => beacon.identifier);\n\n this.emit(RoomStateEvent.BeaconLiveness, this, this.hasLiveBeacons);\n }\n\n private getStateEventMatching(event: MatrixEvent): MatrixEvent | null {\n return this.events.get(event.getType())?.get(event.getStateKey()!) ?? null;\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 * @returns 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 * Check if loading of out-of-band-members has completed\n *\n * @returns true if the full membership list of this room has been loaded. False if it is not started or is in\n * progress.\n */\n public outOfBandMembersReady(): boolean {\n return this.oobMemberFlags.status === OobStatus.Finished;\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 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 this.emit(RoomStateEvent.Update, this);\n }\n\n /**\n * Sets a single out of band member, used by both setOutOfBandMembers and clone\n * @param 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(RoomStateEvent.Members, stateEvent, this, member);\n }\n\n /**\n * Set the current typing event for this room.\n * @param 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 token - The token\n * @returns 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 * @returns 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 displayName - The display name to get user IDs from.\n * @returns An array of user IDs or an empty array.\n */\n public getUserIdsWithDisplayName(displayName: string): string[] {\n return this.displayNameToUserIds.get(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 mxEvent - The event to test permission for\n * @param userId - The user ID of the user to test permission for\n * @returns 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 === KnownMembership.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\n if (!canRedact) return false;\n if (mxEvent.getSender() === userId) return true;\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 action - The type of power level to check\n * @param powerLevel - The power level of the member\n * @returns true if the given power level is sufficient\n */\n public hasSufficientPowerLevelFor(\n action: KeysMatching<Required<IPowerLevelsContent>, number>,\n powerLevel: number,\n ): boolean {\n const powerLevelsEvent = this.getStateEvents(EventType.RoomPowerLevels, \"\");\n\n let powerLevels: IPowerLevelsContent = {};\n if (powerLevelsEvent) {\n powerLevels = powerLevelsEvent.getContent();\n }\n\n let requiredLevel = 50;\n if (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 userId - The user ID of the user to test permission for\n * @returns 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 eventType - The type of event to test\n * @param userId - The user ID of the user to test permission for\n * @returns 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 stateEventType - The type of state events to test\n * @param cli - The client to test permission for\n * @returns 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() || !cli.credentials.userId) {\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 stateEventType - The type of state events to test\n * @param userId - The user ID of the user to test permission for\n * @returns 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 eventType - The type of event to test\n * @param userId - The user ID of the user to test permission for\n * @param 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 * @returns 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: IPowerLevelsContent;\n let eventsLevels: Record<EventType | string, number> = {};\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 notifLevelKey - The level of notification to test (eg. 'room')\n * @param userId - The user ID of the user to test permission for\n * @returns 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 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 the join_rule applied to this room\n */\n public getJoinRule(): JoinRule {\n const joinRuleEvent = this.getStateEvents(EventType.RoomJoinRules, \"\");\n const joinRuleContent: Partial<RoomJoinRulesEventContent> = joinRuleEvent?.getContent() ?? {};\n return joinRuleContent[\"join_rule\"] || JoinRule.Invite;\n }\n\n /**\n * Returns the history visibility based on the m.room.history_visibility state event, defaulting to `shared`.\n * @returns the history_visibility applied to this room\n */\n public getHistoryVisibility(): HistoryVisibility {\n const historyVisibilityEvent = this.getStateEvents(EventType.RoomHistoryVisibility, \"\");\n const historyVisibilityContent = historyVisibilityEvent?.getContent() ?? {};\n return historyVisibilityContent[\"history_visibility\"] || HistoryVisibility.Shared;\n }\n\n /**\n * Returns the guest access based on the m.room.guest_access state event, defaulting to `shared`.\n * @returns the guest_access applied to this room\n */\n public getGuestAccess(): GuestAccess {\n const guestAccessEvent = this.getStateEvents(EventType.RoomGuestAccess, \"\");\n const guestAccessContent = guestAccessEvent?.getContent() ?? {};\n return guestAccessContent[\"guest_access\"] || GuestAccess.Forbidden;\n }\n\n /**\n * Find the predecessor room based on this room state.\n *\n * @param msc3946ProcessDynamicPredecessor - if true, look for an\n * m.room.predecessor state event and use it if found (MSC3946).\n * @returns null if this room has no predecessor. Otherwise, returns\n * the roomId, last eventId and viaServers of the predecessor room.\n *\n * If msc3946ProcessDynamicPredecessor is true, use m.predecessor events\n * as well as m.room.create events to find predecessors.\n *\n * Note: if an m.predecessor event is used, eventId may be undefined\n * since last_known_event_id is optional.\n *\n * Note: viaServers may be undefined, and will definitely be undefined if\n * this predecessor comes from a RoomCreate event (rather than a\n * RoomPredecessor, which has the optional via_servers property).\n */\n public findPredecessor(\n msc3946ProcessDynamicPredecessor = false,\n ): { roomId: string; eventId?: string; viaServers?: string[] } | null {\n // Note: the tests for this function are against Room.findPredecessor,\n // which just calls through to here.\n\n if (msc3946ProcessDynamicPredecessor) {\n const predecessorEvent = this.getStateEvents(EventType.RoomPredecessor, \"\");\n if (predecessorEvent) {\n const content = predecessorEvent.getContent<{\n predecessor_room_id: string;\n last_known_event_id?: string;\n via_servers?: string[];\n }>();\n const roomId = content.predecessor_room_id;\n let eventId = content.last_known_event_id;\n if (typeof eventId !== \"string\") {\n eventId = undefined;\n }\n let viaServers = content.via_servers;\n if (!Array.isArray(viaServers)) {\n viaServers = undefined;\n }\n if (typeof roomId === \"string\") {\n return { roomId, eventId, viaServers };\n }\n }\n }\n\n const createEvent = this.getStateEvents(EventType.RoomCreate, \"\");\n if (createEvent) {\n const predecessor = createEvent.getContent<{\n predecessor?: Partial<{\n room_id: string;\n event_id: string;\n }>;\n }>()[\"predecessor\"];\n if (predecessor) {\n const roomId = predecessor[\"room_id\"];\n if (typeof roomId === \"string\") {\n let eventId = predecessor[\"event_id\"];\n if (typeof eventId !== \"string\" || eventId === \"\") {\n eventId = undefined;\n }\n return { roomId, eventId };\n }\n }\n }\n return null;\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 = removeHiddenChars(oldName);\n\n const existingUserIds = this.displayNameToUserIds.get(strippedOldName);\n if (existingUserIds) {\n // remove this user ID from this array\n const filteredUserIDs = existingUserIds.filter((id) => id !== userId);\n this.displayNameToUserIds.set(strippedOldName, filteredUserIDs);\n }\n }\n\n this.userIdsToDisplayNames[userId] = displayName;\n\n const strippedDisplayname = displayName && removeHiddenChars(displayName);\n // an empty stripped displayname (undefined/'') will be set to MXID in room-member.js\n if (strippedDisplayname) {\n const arr = this.displayNameToUserIds.get(strippedDisplayname) ?? [];\n arr.push(userId);\n this.displayNameToUserIds.set(strippedDisplayname, arr);\n }\n }\n}\n"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,UAAU,QAAQ,kBAAkB;AAC7C,SAASC,MAAM,QAAQ,cAAc;AACrC,SAASC,QAAQ,EAAEC,iBAAiB,QAAQ,aAAa;AACzD,SAASC,SAAS,EAAEC,uBAAuB,QAAQ,oBAAoB;AAGvE,SAASC,WAAW,EAAEC,iBA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C,GAAG,CAACC,IAAI,CAACrN,MAAM,CAAC;MAChB,IAAI,CAACmI,oBAAoB,CAAChD,GAAG,CAAC+H,mBAAmB,EAAEE,GAAG,CAAC;IAC3D;EACJ;AACJ","ignoreList":[]}
@@ -682,7 +682,7 @@ export declare class Room extends ReadReceipt<RoomEmittedEvents, RoomEventHandle
682
682
  * @remarks
683
683
  * Fires {@link RoomEvent.Timeline}
684
684
  */
685
- addEventsToTimeline(events: MatrixEvent[], toStartOfTimeline: boolean, timeline: EventTimeline, paginationToken?: string): void;
685
+ addEventsToTimeline(events: MatrixEvent[], toStartOfTimeline: boolean, addToState: boolean, timeline: EventTimeline, paginationToken?: string): void;
686
686
  /**
687
687
  * Get the instance of the thread associated with the current event
688
688
  * @param eventId - the ID of the current event
@@ -940,7 +940,7 @@ export declare class Room extends ReadReceipt<RoomEmittedEvents, RoomEventHandle
940
940
  * @param addLiveEventOptions - addLiveEvent options
941
941
  * @throws If `duplicateStrategy` is not falsey, 'replace' or 'ignore'.
942
942
  */
943
- addLiveEvents(events: MatrixEvent[], addLiveEventOptions?: IAddLiveEventOptions): Promise<void>;
943
+ addLiveEvents(events: MatrixEvent[], addLiveEventOptions: IAddLiveEventOptions): Promise<void>;
944
944
  partitionThreadedEvents(events: MatrixEvent[]): [timelineEvents: MatrixEvent[], threadedEvents: MatrixEvent[], unknownRelations: MatrixEvent[]];
945
945
  /**
946
946
  * Given some events, find the IDs of all the thread roots that are referred to by them.
@@ -1 +1 @@
1
- {"version":3,"file":"room.d.ts","sourceRoot":"","sources":["../../src/models/room.ts"],"names":[],"mappings":"AAkBA,OAAO,EACH,gBAAgB,EAEhB,oBAAoB,EACpB,0BAA0B,EAC7B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAa,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAI/D,OAAO,EAAsC,WAAW,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AACtH,OAAO,EAAE,WAAW,EAAE,MAA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AuB;IAiE/B,OAAO,CAAC,2BAA2B;IA8CnC;;;;;;;;OAQG;IACH,OAAO,CAAC,4BAA4B;IAyBpC;;;;OAIG;IACI,0BAA0B,IAAI,MAAM;IAI3C;;;;;;;;OAQG;IACI,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO;IAIjE;;;;;;OAMG;IACI,2BAA2B,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS;IAIvE;;;;;;;;;;OAUG;IACI,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAY/C;;;;;;;;;;;;;;;;;;;OAmBG;IACI,oBAAoB,CAAC,WAAW,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;IAIrF;;;;;OAKG;IACI,uBAAuB,IAAI,OAAO;CAK5C;AAYD,oBAAY,YAAY;IACpB,SAAS,IAAA;IACT,SAAS,IAAA;IACT,MAAM,IAAA;CACT;AAED,MAAM,WAAW,kBAAkB;IAC/B,IAAI,EAAE,YAAY,CAAC,SAAS,CAAC;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,sBAAsB;IACnC,IAAI,EAAE,YAAY,CAAC,SAAS,CAAC;IAC7B,OAAO,CAAC,EAAE,UAAU,CAAC;IACrB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,mBAAmB;IAChC,IAAI,EAAE,YAAY,CAAC,MAAM,CAAC;IAC1B,IAAI,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,MAAM,aAAa,GAAG,kBAAkB,GAAG,sBAAsB,GAAG,mBAAmB,CAAC"}
@@ -250,11 +250,13 @@ export class Room extends ReadReceipt {
250
250
  timelineSet.addLiveEvent(thread.rootEvent, {
251
251
  duplicateStrategy: DuplicateStrategy.Replace,
252
252
  fromCache: false,
253
- roomState: this.currentState
253
+ roomState: this.currentState,
254
+ addToState: false
254
255
  });
255
256
  } else {
256
257
  timelineSet.addEventToTimeline(thread.rootEvent, timelineSet.getLiveTimeline(), {
257
- toStartOfTimeline
258
+ toStartOfTimeline,
259
+ addToState: false
258
260
  });
259
261
  }
260
262
  }
@@ -1437,8 +1439,8 @@ export class Room extends ReadReceipt {
1437
1439
  * @remarks
1438
1440
  * Fires {@link RoomEvent.Timeline}
1439
1441
  */
1440
- addEventsToTimeline(events, toStartOfTimeline, timeline, paginationToken) {
1441
- timeline.getTimelineSet().addEventsToTimeline(events, toStartOfTimeline, timeline, paginationToken);
1442
+ addEventsToTimeline(events, toStartOfTimeline, addToState, timeline, paginationToken) {
1443
+ timeline.getTimelineSet().addEventsToTimeline(events, toStartOfTimeline, addToState, timeline, paginationToken);
1442
1444
  }
1443
1445
 
1444
1446
  /**
@@ -1612,7 +1614,9 @@ export class Room extends ReadReceipt {
1612
1614
  // see https://github.com/vector-im/vector-web/issues/2109
1613
1615
 
1614
1616
  unfilteredLiveTimeline.getEvents().forEach(function (event) {
1615
- timelineSet.addLiveEvent(event);
1617
+ timelineSet.addLiveEvent(event, {
1618
+ addToState: false
1619
+ }); // Filtered timeline sets should not track state
1616
1620
  });
1617
1621
 
1618
1622
  // find the earliest unfiltered timeline
@@ -1687,7 +1691,8 @@ export class Room extends ReadReceipt {
1687
1691
  });
1688
1692
  if (filterType !== ThreadFilterType.My || currentUserParticipated) {
1689
1693
  timelineSet.getLiveTimeline().addEvent(thread.rootEvent, {
1690
- toStartOfTimeline: false
1694
+ toStartOfTimeline: false,
1695
+ addToState: false
1691
1696
  });
1692
1697
  }
1693
1698
  });
@@ -1746,6 +1751,7 @@ export class Room extends ReadReceipt {
1746
1751
  var _opts = {
1747
1752
  duplicateStrategy: DuplicateStrategy.Ignore,
1748
1753
  fromCache: false,
1754
+ addToState: false,
1749
1755
  roomState
1750
1756
  };
1751
1757
  (_this11$threadsTimeli = _this11.threadsTimelineSets[0]) === null || _this11$threadsTimeli === void 0 || _this11$threadsTimeli.addLiveEvent(rootEvent, _opts);
@@ -1847,7 +1853,8 @@ export class Room extends ReadReceipt {
1847
1853
  timelineSet.addLiveEvent(rootEvent, {
1848
1854
  duplicateStrategy: DuplicateStrategy.Replace,
1849
1855
  fromCache: false,
1850
- roomState
1856
+ roomState,
1857
+ addToState: false
1851
1858
  });
1852
1859
  }
1853
1860
  })();
@@ -2104,7 +2111,8 @@ export class Room extends ReadReceipt {
2104
2111
  var {
2105
2112
  duplicateStrategy,
2106
2113
  timelineWasEmpty,
2107
- fromCache
2114
+ fromCache,
2115
+ addToState
2108
2116
  } = addLiveEventOptions;
2109
2117
 
2110
2118
  // add to our timeline sets
@@ -2112,7 +2120,8 @@ export class Room extends ReadReceipt {
2112
2120
  timelineSet.addLiveEvent(event, {
2113
2121
  duplicateStrategy,
2114
2122
  fromCache,
2115
- timelineWasEmpty
2123
+ timelineWasEmpty,
2124
+ addToState
2116
2125
  });
2117
2126
  }
2118
2127
 
@@ -2192,12 +2201,14 @@ export class Room extends ReadReceipt {
2192
2201
  if (timelineSet.getFilter()) {
2193
2202
  if (timelineSet.getFilter().filterRoomTimeline([event]).length) {
2194
2203
  timelineSet.addEventToTimeline(event, timelineSet.getLiveTimeline(), {
2195
- toStartOfTimeline: false
2204
+ toStartOfTimeline: false,
2205
+ addToState: false // We don't support localEcho of state events yet
2196
2206
  });
2197
2207
  }
2198
2208
  } else {
2199
2209
  timelineSet.addEventToTimeline(event, timelineSet.getLiveTimeline(), {
2200
- toStartOfTimeline: false
2210
+ toStartOfTimeline: false,
2211
+ addToState: false // We don't support localEcho of state events yet
2201
2212
  });
2202
2213
  }
2203
2214
  }
@@ -2430,8 +2441,9 @@ export class Room extends ReadReceipt {
2430
2441
  var {
2431
2442
  duplicateStrategy,
2432
2443
  fromCache,
2433
- timelineWasEmpty = false
2434
- } = addLiveEventOptions !== null && addLiveEventOptions !== void 0 ? addLiveEventOptions : {};
2444
+ timelineWasEmpty = false,
2445
+ addToState
2446
+ } = addLiveEventOptions;
2435
2447
  if (duplicateStrategy && ["replace", "ignore"].indexOf(duplicateStrategy) === -1) {
2436
2448
  throw new Error("duplicateStrategy MUST be either 'replace' or 'ignore'");
2437
2449
  }
@@ -2443,7 +2455,8 @@ export class Room extends ReadReceipt {
2443
2455
  var options = {
2444
2456
  duplicateStrategy,
2445
2457
  fromCache,
2446
- timelineWasEmpty
2458
+ timelineWasEmpty,
2459
+ addToState
2447
2460
  };
2448
2461
 
2449
2462
  // List of extra events to check for being parents of any relations encountered