@unwanted/matrix-sdk-mini 34.13.0 → 36.0.1

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 (96) hide show
  1. package/git-revision.txt +1 -1
  2. package/lib/@types/event.d.ts +25 -0
  3. package/lib/@types/event.d.ts.map +1 -1
  4. package/lib/@types/event.js +5 -0
  5. package/lib/@types/event.js.map +1 -1
  6. package/lib/client.d.ts +44 -19
  7. package/lib/client.d.ts.map +1 -1
  8. package/lib/client.js +148 -90
  9. package/lib/client.js.map +1 -1
  10. package/lib/embedded.d.ts +4 -3
  11. package/lib/embedded.d.ts.map +1 -1
  12. package/lib/embedded.js +57 -74
  13. package/lib/embedded.js.map +1 -1
  14. package/lib/feature.d.ts.map +1 -1
  15. package/lib/feature.js +2 -1
  16. package/lib/feature.js.map +1 -1
  17. package/lib/http-api/errors.d.ts +3 -3
  18. package/lib/http-api/errors.js +3 -3
  19. package/lib/http-api/errors.js.map +1 -1
  20. package/lib/http-api/utils.js +2 -2
  21. package/lib/http-api/utils.js.map +1 -1
  22. package/lib/models/event-timeline.d.ts.map +1 -1
  23. package/lib/models/event-timeline.js +1 -21
  24. package/lib/models/event-timeline.js.map +1 -1
  25. package/lib/models/event.d.ts +11 -1
  26. package/lib/models/event.d.ts.map +1 -1
  27. package/lib/models/event.js +48 -5
  28. package/lib/models/event.js.map +1 -1
  29. package/lib/models/invites-ignorer-types.d.ts +27 -0
  30. package/lib/models/invites-ignorer-types.d.ts.map +1 -0
  31. package/lib/models/invites-ignorer-types.js +36 -0
  32. package/lib/models/invites-ignorer-types.js.map +1 -0
  33. package/lib/models/invites-ignorer.d.ts +2 -26
  34. package/lib/models/invites-ignorer.d.ts.map +1 -1
  35. package/lib/models/invites-ignorer.js +2 -27
  36. package/lib/models/invites-ignorer.js.map +1 -1
  37. package/lib/models/room-member.d.ts +6 -1
  38. package/lib/models/room-member.d.ts.map +1 -1
  39. package/lib/models/room-member.js +7 -1
  40. package/lib/models/room-member.js.map +1 -1
  41. package/lib/models/room.d.ts +6 -1
  42. package/lib/models/room.d.ts.map +1 -1
  43. package/lib/models/room.js +7 -1
  44. package/lib/models/room.js.map +1 -1
  45. package/lib/oidc/authorize.d.ts +2 -2
  46. package/lib/oidc/authorize.d.ts.map +1 -1
  47. package/lib/oidc/authorize.js +5 -5
  48. package/lib/oidc/authorize.js.map +1 -1
  49. package/lib/oidc/discovery.d.ts +8 -0
  50. package/lib/oidc/discovery.d.ts.map +1 -1
  51. package/lib/oidc/discovery.js +22 -11
  52. package/lib/oidc/discovery.js.map +1 -1
  53. package/lib/oidc/index.d.ts +3 -4
  54. package/lib/oidc/index.d.ts.map +1 -1
  55. package/lib/oidc/index.js.map +1 -1
  56. package/lib/oidc/register.js +3 -3
  57. package/lib/oidc/register.js.map +1 -1
  58. package/lib/oidc/tokenRefresher.d.ts.map +1 -1
  59. package/lib/oidc/tokenRefresher.js +6 -5
  60. package/lib/oidc/tokenRefresher.js.map +1 -1
  61. package/lib/oidc/validate.d.ts +9 -23
  62. package/lib/oidc/validate.d.ts.map +1 -1
  63. package/lib/oidc/validate.js +13 -28
  64. package/lib/oidc/validate.js.map +1 -1
  65. package/lib/randomstring.d.ts +30 -3
  66. package/lib/randomstring.d.ts.map +1 -1
  67. package/lib/randomstring.js +68 -16
  68. package/lib/randomstring.js.map +1 -1
  69. package/lib/store/indexeddb-local-backend.js +4 -2
  70. package/lib/store/indexeddb-local-backend.js.map +1 -1
  71. package/lib/testing.d.ts +17 -0
  72. package/lib/testing.d.ts.map +1 -1
  73. package/lib/testing.js +42 -0
  74. package/lib/testing.js.map +1 -1
  75. package/package.json +5 -5
  76. package/src/@types/event.ts +17 -0
  77. package/src/client.ts +87 -41
  78. package/src/embedded.ts +41 -51
  79. package/src/feature.ts +1 -0
  80. package/src/http-api/errors.ts +3 -3
  81. package/src/http-api/utils.ts +2 -2
  82. package/src/models/event-timeline.ts +1 -21
  83. package/src/models/event.ts +46 -0
  84. package/src/models/invites-ignorer-types.ts +48 -0
  85. package/src/models/invites-ignorer.ts +7 -42
  86. package/src/models/room-member.ts +16 -1
  87. package/src/models/room.ts +16 -1
  88. package/src/oidc/authorize.ts +7 -7
  89. package/src/oidc/discovery.ts +16 -10
  90. package/src/oidc/index.ts +3 -4
  91. package/src/oidc/register.ts +3 -3
  92. package/src/oidc/tokenRefresher.ts +3 -2
  93. package/src/oidc/validate.ts +40 -63
  94. package/src/randomstring.ts +65 -19
  95. package/src/store/indexeddb-local-backend.ts +2 -2
  96. package/src/testing.ts +41 -0
@@ -1 +1 @@
1
- {"version":3,"file":"invites-ignorer.js","names":["UnstableValue","EventTimeline","Preset","globToRegexp","EventType","POLICIES_ACCOUNT_EVENT_TYPE","IGNORE_INVITES_ACCOUNT_EVENT_KEY","PolicyRecommendation","PolicyScope","scopeToEventTypeMap","User","PolicyRuleUser","Room","PolicyRuleRoom","Server","PolicyRuleServer","IgnoredInvites","constructor","client","addRule","scope","entity","reason","_this","_asyncToGenerator","target","getOrCreateTargetRoom","response","sendStateEvent","roomId","recommendation","Ban","event_id","removeRule","event","_this2","redactEvent","getRoomId","getId","addSource","_this3","joinRoom","sources","getOrCreateSourceRooms","map","room","includes","push","withIgnoreInvitesPolicies","ignoreInvitesPolicies","getRuleForInvite","_ref","_this4","sender","policyRooms","senderServer","split","roomServer","state","getUnfilteredTimelineSet","getLiveTimeline","getState","FORWARDS","entities","events","getStateEvents","content","getContent","glob","regexp","RegExp","_unused","test","_this5","getIgnoreInvitesPolicies","getRoom","createRoom","name","preset","PrivateChat","room_id","_this6","hasChanges","Array","isArray","sourceRooms","filter","length","getPoliciesAndIgnoreInvitesPolicies","cb","_this7","policies","setAccountData","key","altName","_this$client$getAccou","value","getAccountData","hasIgnoreInvitesPolicies"],"sources":["../../src/models/invites-ignorer.ts"],"sourcesContent":["/*\nCopyright 2022 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\nimport { UnstableValue } from \"matrix-events-sdk\";\n\nimport { MatrixClient } from \"../client.ts\";\nimport { IContent, MatrixEvent } from \"./event.ts\";\nimport { EventTimeline } from \"./event-timeline.ts\";\nimport { Preset } from \"../@types/partials.ts\";\nimport { globToRegexp } from \"../utils.ts\";\nimport { Room } from \"./room.ts\";\nimport { EventType, StateEvents } from \"../@types/event.ts\";\n\n/// The event type storing the user's individual policies.\n///\n/// Exported for testing purposes.\nexport const POLICIES_ACCOUNT_EVENT_TYPE = new UnstableValue(\"m.policies\", \"org.matrix.msc3847.policies\");\n\n/// The key within the user's individual policies storing the user's ignored invites.\n///\n/// Exported for testing purposes.\nexport const IGNORE_INVITES_ACCOUNT_EVENT_KEY = new UnstableValue(\n \"m.ignore.invites\",\n \"org.matrix.msc3847.ignore.invites\",\n);\n\n/// The types of recommendations understood.\nexport enum PolicyRecommendation {\n Ban = \"m.ban\",\n}\n\n/**\n * The various scopes for policies.\n */\nexport enum PolicyScope {\n /**\n * The policy deals with an individual user, e.g. reject invites\n * from this user.\n */\n User = \"m.policy.user\",\n\n /**\n * The policy deals with a room, e.g. reject invites towards\n * a specific room.\n */\n Room = \"m.policy.room\",\n\n /**\n * The policy deals with a server, e.g. reject invites from\n * this server.\n */\n Server = \"m.policy.server\",\n}\n\nconst scopeToEventTypeMap: Record<PolicyScope, keyof StateEvents> = {\n [PolicyScope.User]: EventType.PolicyRuleUser,\n [PolicyScope.Room]: EventType.PolicyRuleRoom,\n [PolicyScope.Server]: EventType.PolicyRuleServer,\n};\n\n/**\n * A container for ignored invites.\n *\n * # Performance\n *\n * This implementation is extremely naive. It expects that we are dealing\n * with a very short list of sources (e.g. only one). If real-world\n * applications turn out to require longer lists, we may need to rework\n * our data structures.\n */\nexport class IgnoredInvites {\n public constructor(private readonly client: MatrixClient) {}\n\n /**\n * Add a new rule.\n *\n * @param scope - The scope for this rule.\n * @param entity - The entity covered by this rule. Globs are supported.\n * @param reason - A human-readable reason for introducing this new rule.\n * @returns The event id for the new rule.\n */\n public async addRule(scope: PolicyScope, entity: string, reason: string): Promise<string> {\n const target = await this.getOrCreateTargetRoom();\n const response = await this.client.sendStateEvent(target.roomId, scopeToEventTypeMap[scope], {\n entity,\n reason,\n recommendation: PolicyRecommendation.Ban,\n });\n return response.event_id;\n }\n\n /**\n * Remove a rule.\n */\n public async removeRule(event: MatrixEvent): Promise<void> {\n await this.client.redactEvent(event.getRoomId()!, event.getId()!);\n }\n\n /**\n * Add a new room to the list of sources. If the user isn't a member of the\n * room, attempt to join it.\n *\n * @param roomId - A valid room id. If this room is already in the list\n * of sources, it will not be duplicated.\n * @returns `true` if the source was added, `false` if it was already present.\n * @throws If `roomId` isn't the id of a room that the current user is already\n * member of or can join.\n *\n * # Safety\n *\n * This method will rewrite the `Policies` object in the user's account data.\n * This rewrite is inherently racy and could overwrite or be overwritten by\n * other concurrent rewrites of the same object.\n */\n public async addSource(roomId: string): Promise<boolean> {\n // We attempt to join the room *before* calling\n // `await this.getOrCreateSourceRooms()` to decrease the duration\n // of the racy section.\n await this.client.joinRoom(roomId);\n // Race starts.\n const sources = (await this.getOrCreateSourceRooms()).map((room) => room.roomId);\n if (sources.includes(roomId)) {\n return false;\n }\n sources.push(roomId);\n await this.withIgnoreInvitesPolicies((ignoreInvitesPolicies) => {\n ignoreInvitesPolicies.sources = sources;\n });\n\n // Race ends.\n return true;\n }\n\n /**\n * Find out whether an invite should be ignored.\n *\n * @param params\n * @param params.sender - The user id for the user who issued the invite.\n * @param params.roomId - The room to which the user is invited.\n * @returns A rule matching the entity, if any was found, `null` otherwise.\n */\n public async getRuleForInvite({\n sender,\n roomId,\n }: {\n sender: string;\n roomId: string;\n }): Promise<Readonly<MatrixEvent | null>> {\n // In this implementation, we perform a very naive lookup:\n // - search in each policy room;\n // - turn each (potentially glob) rule entity into a regexp.\n //\n // Real-world testing will tell us whether this is performant enough.\n // In the (unfortunately likely) case it isn't, there are several manners\n // in which we could optimize this:\n // - match several entities per go;\n // - pre-compile each rule entity into a regexp;\n // - pre-compile entire rooms into a single regexp.\n const policyRooms = await this.getOrCreateSourceRooms();\n const senderServer = sender.split(\":\")[1];\n const roomServer = roomId.split(\":\")[1];\n for (const room of policyRooms) {\n const state = room.getUnfilteredTimelineSet().getLiveTimeline().getState(EventTimeline.FORWARDS)!;\n\n for (const { scope, entities } of [\n { scope: PolicyScope.Room, entities: [roomId] },\n { scope: PolicyScope.User, entities: [sender] },\n { scope: PolicyScope.Server, entities: [senderServer, roomServer] },\n ]) {\n const events = state.getStateEvents(scopeToEventTypeMap[scope]);\n for (const event of events) {\n const content = event.getContent();\n if (content?.recommendation != PolicyRecommendation.Ban) {\n // Ignoring invites only looks at `m.ban` recommendations.\n continue;\n }\n const glob = content?.entity;\n if (!glob) {\n // Invalid event.\n continue;\n }\n let regexp: RegExp;\n try {\n regexp = new RegExp(globToRegexp(glob));\n } catch {\n // Assume invalid event.\n continue;\n }\n for (const entity of entities) {\n if (entity && regexp.test(entity)) {\n return event;\n }\n }\n // No match.\n }\n }\n }\n return null;\n }\n\n /**\n * Get the target room, i.e. the room in which any new rule should be written.\n *\n * If there is no target room setup, a target room is created.\n *\n * Note: This method is public for testing reasons. Most clients should not need\n * to call it directly.\n *\n * # Safety\n *\n * This method will rewrite the `Policies` object in the user's account data.\n * This rewrite is inherently racy and could overwrite or be overwritten by\n * other concurrent rewrites of the same object.\n */\n public async getOrCreateTargetRoom(): Promise<Room> {\n const ignoreInvitesPolicies = this.getIgnoreInvitesPolicies();\n let target = ignoreInvitesPolicies.target;\n // Validate `target`. If it is invalid, trash out the current `target`\n // and create a new room.\n if (typeof target !== \"string\") {\n target = null;\n }\n if (target) {\n // Check that the room exists and is valid.\n const room = this.client.getRoom(target);\n if (room) {\n return room;\n } else {\n target = null;\n }\n }\n // We need to create our own policy room for ignoring invites.\n target = (\n await this.client.createRoom({\n name: \"Individual Policy Room\",\n preset: Preset.PrivateChat,\n })\n ).room_id;\n await this.withIgnoreInvitesPolicies((ignoreInvitesPolicies) => {\n ignoreInvitesPolicies.target = target;\n });\n\n // Since we have just called `createRoom`, `getRoom` should not be `null`.\n return this.client.getRoom(target)!;\n }\n\n /**\n * Get the list of source rooms, i.e. the rooms from which rules need to be read.\n *\n * If no source rooms are setup, the target room is used as sole source room.\n *\n * Note: This method is public for testing reasons. Most clients should not need\n * to call it directly.\n *\n * # Safety\n *\n * This method will rewrite the `Policies` object in the user's account data.\n * This rewrite is inherently racy and could overwrite or be overwritten by\n * other concurrent rewrites of the same object.\n */\n public async getOrCreateSourceRooms(): Promise<Room[]> {\n const ignoreInvitesPolicies = this.getIgnoreInvitesPolicies();\n let sources: string[] = ignoreInvitesPolicies.sources;\n\n // Validate `sources`. If it is invalid, trash out the current `sources`\n // and create a new list of sources from `target`.\n let hasChanges = false;\n if (!Array.isArray(sources)) {\n // `sources` could not be an array.\n hasChanges = true;\n sources = [];\n }\n let sourceRooms = sources\n // `sources` could contain non-string / invalid room ids\n .filter((roomId) => typeof roomId === \"string\")\n .map((roomId) => this.client.getRoom(roomId))\n .filter((room) => !!room) as Room[];\n if (sourceRooms.length != sources.length) {\n hasChanges = true;\n }\n if (sourceRooms.length == 0) {\n // `sources` could be empty (possibly because we've removed\n // invalid content)\n const target = await this.getOrCreateTargetRoom();\n hasChanges = true;\n sourceRooms = [target];\n }\n if (hasChanges) {\n // Reload `policies`/`ignoreInvitesPolicies` in case it has been changed\n // during or by our call to `this.getTargetRoom()`.\n await this.withIgnoreInvitesPolicies((ignoreInvitesPolicies) => {\n ignoreInvitesPolicies.sources = sources;\n });\n }\n return sourceRooms;\n }\n\n /**\n * Fetch the `IGNORE_INVITES_POLICIES` object from account data.\n *\n * If both an unstable prefix version and a stable prefix version are available,\n * it will return the stable prefix version preferentially.\n *\n * The result is *not* validated but is guaranteed to be a non-null object.\n *\n * @returns A non-null object.\n */\n private getIgnoreInvitesPolicies(): { [key: string]: any } {\n return this.getPoliciesAndIgnoreInvitesPolicies().ignoreInvitesPolicies;\n }\n\n /**\n * Modify in place the `IGNORE_INVITES_POLICIES` object from account data.\n */\n private async withIgnoreInvitesPolicies(\n cb: (ignoreInvitesPolicies: { [key: string]: any }) => void,\n ): Promise<void> {\n const { policies, ignoreInvitesPolicies } = this.getPoliciesAndIgnoreInvitesPolicies();\n cb(ignoreInvitesPolicies);\n policies[IGNORE_INVITES_ACCOUNT_EVENT_KEY.name] = ignoreInvitesPolicies;\n await this.client.setAccountData(POLICIES_ACCOUNT_EVENT_TYPE.name, policies);\n }\n\n /**\n * As `getIgnoreInvitesPolicies` but also return the `POLICIES_ACCOUNT_EVENT_TYPE`\n * object.\n */\n private getPoliciesAndIgnoreInvitesPolicies(): {\n policies: { [key: string]: any };\n ignoreInvitesPolicies: { [key: string]: any };\n } {\n let policies: IContent = {};\n for (const key of [POLICIES_ACCOUNT_EVENT_TYPE.name, POLICIES_ACCOUNT_EVENT_TYPE.altName]) {\n if (!key) {\n continue;\n }\n const value = this.client.getAccountData(key)?.getContent();\n if (value) {\n policies = value;\n break;\n }\n }\n\n let ignoreInvitesPolicies = {};\n let hasIgnoreInvitesPolicies = false;\n for (const key of [IGNORE_INVITES_ACCOUNT_EVENT_KEY.name, IGNORE_INVITES_ACCOUNT_EVENT_KEY.altName]) {\n if (!key) {\n continue;\n }\n const value = policies[key];\n if (value && typeof value == \"object\") {\n ignoreInvitesPolicies = value;\n hasIgnoreInvitesPolicies = true;\n break;\n }\n }\n if (!hasIgnoreInvitesPolicies) {\n policies[IGNORE_INVITES_ACCOUNT_EVENT_KEY.name] = ignoreInvitesPolicies;\n }\n\n return { policies, ignoreInvitesPolicies };\n }\n}\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA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AE;QACN;MACJ;MACA,IAAMG,MAAK,GAAGL,QAAQ,CAACE,IAAG,CAAC;MAC3B,IAAIG,MAAK,IAAI,OAAOA,MAAK,IAAI,QAAQ,EAAE;QACnC/C,qBAAqB,GAAG+C,MAAK;QAC7BE,wBAAwB,GAAG,IAAI;QAC/B;MACJ;IACJ;IACA,IAAI,CAACA,wBAAwB,EAAE;MAC3BP,QAAQ,CAACrF,gCAAgC,CAACuE,IAAI,CAAC,GAAG5B,qBAAqB;IAC3E;IAEA,OAAO;MAAE0C,QAAQ;MAAE1C;IAAsB,CAAC;EAC9C;AACJ","ignoreList":[]}
1
+ {"version":3,"file":"invites-ignorer.js","names":["EventTimeline","Preset","globToRegexp","EventType","IGNORE_INVITES_ACCOUNT_EVENT_KEY","POLICIES_ACCOUNT_EVENT_TYPE","PolicyRecommendation","PolicyScope","scopeToEventTypeMap","User","PolicyRuleUser","Room","PolicyRuleRoom","Server","PolicyRuleServer","IgnoredInvites","constructor","client","addRule","scope","entity","reason","_this","_asyncToGenerator","target","getOrCreateTargetRoom","response","sendStateEvent","roomId","recommendation","Ban","event_id","removeRule","event","_this2","redactEvent","getRoomId","getId","addSource","_this3","joinRoom","sources","getOrCreateSourceRooms","map","room","includes","push","withIgnoreInvitesPolicies","ignoreInvitesPolicies","getRuleForInvite","_ref","_this4","sender","policyRooms","senderServer","split","roomServer","state","getUnfilteredTimelineSet","getLiveTimeline","getState","FORWARDS","entities","events","getStateEvents","content","getContent","glob","regexp","RegExp","_unused","test","_this5","getIgnoreInvitesPolicies","getRoom","createRoom","name","preset","PrivateChat","room_id","_this6","hasChanges","Array","isArray","sourceRooms","filter","length","getPoliciesAndIgnoreInvitesPolicies","cb","_this7","policies","setAccountData","key","altName","_this$client$getAccou","value","getAccountData","hasIgnoreInvitesPolicies"],"sources":["../../src/models/invites-ignorer.ts"],"sourcesContent":["/*\nCopyright 2022 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\nimport { MatrixClient } from \"../client.ts\";\nimport { IContent, MatrixEvent } from \"./event.ts\";\nimport { EventTimeline } from \"./event-timeline.ts\";\nimport { Preset } from \"../@types/partials.ts\";\nimport { globToRegexp } from \"../utils.ts\";\nimport { Room } from \"./room.ts\";\nimport { EventType, StateEvents } from \"../@types/event.ts\";\nimport {\n IGNORE_INVITES_ACCOUNT_EVENT_KEY,\n POLICIES_ACCOUNT_EVENT_TYPE,\n PolicyRecommendation,\n PolicyScope,\n} from \"./invites-ignorer-types.ts\";\n\nexport { IGNORE_INVITES_ACCOUNT_EVENT_KEY, POLICIES_ACCOUNT_EVENT_TYPE, PolicyRecommendation, PolicyScope };\n\nconst scopeToEventTypeMap: Record<PolicyScope, keyof StateEvents> = {\n [PolicyScope.User]: EventType.PolicyRuleUser,\n [PolicyScope.Room]: EventType.PolicyRuleRoom,\n [PolicyScope.Server]: EventType.PolicyRuleServer,\n};\n\n/**\n * A container for ignored invites.\n *\n * # Performance\n *\n * This implementation is extremely naive. It expects that we are dealing\n * with a very short list of sources (e.g. only one). If real-world\n * applications turn out to require longer lists, we may need to rework\n * our data structures.\n */\nexport class IgnoredInvites {\n public constructor(private readonly client: MatrixClient) {}\n\n /**\n * Add a new rule.\n *\n * @param scope - The scope for this rule.\n * @param entity - The entity covered by this rule. Globs are supported.\n * @param reason - A human-readable reason for introducing this new rule.\n * @returns The event id for the new rule.\n */\n public async addRule(scope: PolicyScope, entity: string, reason: string): Promise<string> {\n const target = await this.getOrCreateTargetRoom();\n const response = await this.client.sendStateEvent(target.roomId, scopeToEventTypeMap[scope], {\n entity,\n reason,\n recommendation: PolicyRecommendation.Ban,\n });\n return response.event_id;\n }\n\n /**\n * Remove a rule.\n */\n public async removeRule(event: MatrixEvent): Promise<void> {\n await this.client.redactEvent(event.getRoomId()!, event.getId()!);\n }\n\n /**\n * Add a new room to the list of sources. If the user isn't a member of the\n * room, attempt to join it.\n *\n * @param roomId - A valid room id. If this room is already in the list\n * of sources, it will not be duplicated.\n * @returns `true` if the source was added, `false` if it was already present.\n * @throws If `roomId` isn't the id of a room that the current user is already\n * member of or can join.\n *\n * # Safety\n *\n * This method will rewrite the `Policies` object in the user's account data.\n * This rewrite is inherently racy and could overwrite or be overwritten by\n * other concurrent rewrites of the same object.\n */\n public async addSource(roomId: string): Promise<boolean> {\n // We attempt to join the room *before* calling\n // `await this.getOrCreateSourceRooms()` to decrease the duration\n // of the racy section.\n await this.client.joinRoom(roomId);\n // Race starts.\n const sources = (await this.getOrCreateSourceRooms()).map((room) => room.roomId);\n if (sources.includes(roomId)) {\n return false;\n }\n sources.push(roomId);\n await this.withIgnoreInvitesPolicies((ignoreInvitesPolicies) => {\n ignoreInvitesPolicies.sources = sources;\n });\n\n // Race ends.\n return true;\n }\n\n /**\n * Find out whether an invite should be ignored.\n *\n * @param params\n * @param params.sender - The user id for the user who issued the invite.\n * @param params.roomId - The room to which the user is invited.\n * @returns A rule matching the entity, if any was found, `null` otherwise.\n */\n public async getRuleForInvite({\n sender,\n roomId,\n }: {\n sender: string;\n roomId: string;\n }): Promise<Readonly<MatrixEvent | null>> {\n // In this implementation, we perform a very naive lookup:\n // - search in each policy room;\n // - turn each (potentially glob) rule entity into a regexp.\n //\n // Real-world testing will tell us whether this is performant enough.\n // In the (unfortunately likely) case it isn't, there are several manners\n // in which we could optimize this:\n // - match several entities per go;\n // - pre-compile each rule entity into a regexp;\n // - pre-compile entire rooms into a single regexp.\n const policyRooms = await this.getOrCreateSourceRooms();\n const senderServer = sender.split(\":\")[1];\n const roomServer = roomId.split(\":\")[1];\n for (const room of policyRooms) {\n const state = room.getUnfilteredTimelineSet().getLiveTimeline().getState(EventTimeline.FORWARDS)!;\n\n for (const { scope, entities } of [\n { scope: PolicyScope.Room, entities: [roomId] },\n { scope: PolicyScope.User, entities: [sender] },\n { scope: PolicyScope.Server, entities: [senderServer, roomServer] },\n ]) {\n const events = state.getStateEvents(scopeToEventTypeMap[scope]);\n for (const event of events) {\n const content = event.getContent();\n if (content?.recommendation != PolicyRecommendation.Ban) {\n // Ignoring invites only looks at `m.ban` recommendations.\n continue;\n }\n const glob = content?.entity;\n if (!glob) {\n // Invalid event.\n continue;\n }\n let regexp: RegExp;\n try {\n regexp = new RegExp(globToRegexp(glob));\n } catch {\n // Assume invalid event.\n continue;\n }\n for (const entity of entities) {\n if (entity && regexp.test(entity)) {\n return event;\n }\n }\n // No match.\n }\n }\n }\n return null;\n }\n\n /**\n * Get the target room, i.e. the room in which any new rule should be written.\n *\n * If there is no target room setup, a target room is created.\n *\n * Note: This method is public for testing reasons. Most clients should not need\n * to call it directly.\n *\n * # Safety\n *\n * This method will rewrite the `Policies` object in the user's account data.\n * This rewrite is inherently racy and could overwrite or be overwritten by\n * other concurrent rewrites of the same object.\n */\n public async getOrCreateTargetRoom(): Promise<Room> {\n const ignoreInvitesPolicies = this.getIgnoreInvitesPolicies();\n let target = ignoreInvitesPolicies.target;\n // Validate `target`. If it is invalid, trash out the current `target`\n // and create a new room.\n if (typeof target !== \"string\") {\n target = null;\n }\n if (target) {\n // Check that the room exists and is valid.\n const room = this.client.getRoom(target);\n if (room) {\n return room;\n } else {\n target = null;\n }\n }\n // We need to create our own policy room for ignoring invites.\n target = (\n await this.client.createRoom({\n name: \"Individual Policy Room\",\n preset: Preset.PrivateChat,\n })\n ).room_id;\n await this.withIgnoreInvitesPolicies((ignoreInvitesPolicies) => {\n ignoreInvitesPolicies.target = target;\n });\n\n // Since we have just called `createRoom`, `getRoom` should not be `null`.\n return this.client.getRoom(target)!;\n }\n\n /**\n * Get the list of source rooms, i.e. the rooms from which rules need to be read.\n *\n * If no source rooms are setup, the target room is used as sole source room.\n *\n * Note: This method is public for testing reasons. Most clients should not need\n * to call it directly.\n *\n * # Safety\n *\n * This method will rewrite the `Policies` object in the user's account data.\n * This rewrite is inherently racy and could overwrite or be overwritten by\n * other concurrent rewrites of the same object.\n */\n public async getOrCreateSourceRooms(): Promise<Room[]> {\n const ignoreInvitesPolicies = this.getIgnoreInvitesPolicies();\n let sources: string[] = ignoreInvitesPolicies.sources;\n\n // Validate `sources`. If it is invalid, trash out the current `sources`\n // and create a new list of sources from `target`.\n let hasChanges = false;\n if (!Array.isArray(sources)) {\n // `sources` could not be an array.\n hasChanges = true;\n sources = [];\n }\n let sourceRooms = sources\n // `sources` could contain non-string / invalid room ids\n .filter((roomId) => typeof roomId === \"string\")\n .map((roomId) => this.client.getRoom(roomId))\n .filter((room) => !!room) as Room[];\n if (sourceRooms.length != sources.length) {\n hasChanges = true;\n }\n if (sourceRooms.length == 0) {\n // `sources` could be empty (possibly because we've removed\n // invalid content)\n const target = await this.getOrCreateTargetRoom();\n hasChanges = true;\n sourceRooms = [target];\n }\n if (hasChanges) {\n // Reload `policies`/`ignoreInvitesPolicies` in case it has been changed\n // during or by our call to `this.getTargetRoom()`.\n await this.withIgnoreInvitesPolicies((ignoreInvitesPolicies) => {\n ignoreInvitesPolicies.sources = sources;\n });\n }\n return sourceRooms;\n }\n\n /**\n * Fetch the `IGNORE_INVITES_POLICIES` object from account data.\n *\n * If both an unstable prefix version and a stable prefix version are available,\n * it will return the stable prefix version preferentially.\n *\n * The result is *not* validated but is guaranteed to be a non-null object.\n *\n * @returns A non-null object.\n */\n private getIgnoreInvitesPolicies(): { [key: string]: any } {\n return this.getPoliciesAndIgnoreInvitesPolicies().ignoreInvitesPolicies;\n }\n\n /**\n * Modify in place the `IGNORE_INVITES_POLICIES` object from account data.\n */\n private async withIgnoreInvitesPolicies(\n cb: (ignoreInvitesPolicies: { [key: string]: any }) => void,\n ): Promise<void> {\n const { policies, ignoreInvitesPolicies } = this.getPoliciesAndIgnoreInvitesPolicies();\n cb(ignoreInvitesPolicies);\n policies[IGNORE_INVITES_ACCOUNT_EVENT_KEY.name] = ignoreInvitesPolicies;\n await this.client.setAccountData(POLICIES_ACCOUNT_EVENT_TYPE.name, policies);\n }\n\n /**\n * As `getIgnoreInvitesPolicies` but also return the `POLICIES_ACCOUNT_EVENT_TYPE`\n * object.\n */\n private getPoliciesAndIgnoreInvitesPolicies(): {\n policies: { [key: string]: any };\n ignoreInvitesPolicies: { [key: string]: any };\n } {\n let policies: IContent = {};\n for (const key of [POLICIES_ACCOUNT_EVENT_TYPE.name, POLICIES_ACCOUNT_EVENT_TYPE.altName]) {\n if (!key) {\n continue;\n }\n const value = this.client.getAccountData(key)?.getContent();\n if (value) {\n policies = value;\n break;\n }\n }\n\n let ignoreInvitesPolicies = {};\n let hasIgnoreInvitesPolicies = false;\n for (const key of [IGNORE_INVITES_ACCOUNT_EVENT_KEY.name, IGNORE_INVITES_ACCOUNT_EVENT_KEY.altName]) {\n if (!key) {\n continue;\n }\n const value = policies[key];\n if (value && typeof value == \"object\") {\n ignoreInvitesPolicies = value;\n hasIgnoreInvitesPolicies = true;\n break;\n }\n }\n if (!hasIgnoreInvitesPolicies) {\n policies[IGNORE_INVITES_ACCOUNT_EVENT_KEY.name] = ignoreInvitesPolicies;\n }\n\n return { policies, ignoreInvitesPolicies };\n }\n}\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,SAASA,aAAa,QAAQ,qBAAqB;AACnD,SAASC,MAAM,QAAQ,uBAAuB;AAC9C,SAASC,YAAY,QAAQ,aAAa;AAE1C,SAASC,SAAS,QAAqB,oBAAoB;AAC3D,SACIC,gCAAgC,EAChCC,2BAA2B,EAC3BC,oBAAoB,EACpBC,WAAW,QACR,4BAA4B;AAEnC,SAASH,gCAAgC,EAAEC,2BAA2B,EAAEC,oBAAoB,EAAEC,WAAW;AAEzG,IAAMC,mBAA2D,GAAG;EAChE,CAACD,WAAW,CA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KAAK,IAAME,GAAG,IAAI,CAACvF,2BAA2B,CAACuE,IAAI,EAAEvE,2BAA2B,CAACwF,OAAO,CAAC,EAAE;MAAA,IAAAC,qBAAA;MACvF,IAAI,CAACF,GAAG,EAAE;QACN;MACJ;MACA,IAAMG,KAAK,IAAAD,qBAAA,GAAG,IAAI,CAAC7E,MAAM,CAAC+E,cAAc,CAACJ,GAAG,CAAC,cAAAE,qBAAA,uBAA/BA,qBAAA,CAAiC5B,UAAU,CAAC,CAAC;MAC3D,IAAI6B,KAAK,EAAE;QACPL,QAAQ,GAAGK,KAAK;QAChB;MACJ;IACJ;IAEA,IAAI/C,qBAAqB,GAAG,CAAC,CAAC;IAC9B,IAAIiD,wBAAwB,GAAG,KAAK;IACpC,KAAK,IAAML,IAAG,IAAI,CAACxF,gCAAgC,CAACwE,IAAI,EAAExE,gCAAgC,CAACyF,OAAO,CAAC,EAAE;MACjG,IAAI,CAACD,IAAG,EAAE;QACN;MACJ;MACA,IAAMG,MAAK,GAAGL,QAAQ,CAACE,IAAG,CAAC;MAC3B,IAAIG,MAAK,IAAI,OAAOA,MAAK,IAAI,QAAQ,EAAE;QACnC/C,qBAAqB,GAAG+C,MAAK;QAC7BE,wBAAwB,GAAG,IAAI;QAC/B;MACJ;IACJ;IACA,IAAI,CAACA,wBAAwB,EAAE;MAC3BP,QAAQ,CAACtF,gCAAgC,CAACwE,IAAI,CAAC,GAAG5B,qBAAqB;IAC3E;IAEA,OAAO;MAAE0C,QAAQ;MAAE1C;IAAsB,CAAC;EAC9C;AACJ","ignoreList":[]}
@@ -192,9 +192,14 @@ export declare class RoomMember extends TypedEventEmitter<RoomMemberEvent, RoomM
192
192
  * If false, any non-matrix content URLs will be ignored. Setting this option to
193
193
  * true will expose URLs that, if fetched, will leak information about the user
194
194
  * to anyone who they share a room with.
195
+ * @param useAuthentication - (optional) If true, the caller supports authenticated
196
+ * media and wants an authentication-required URL. Note that server support for
197
+ * authenticated media will not be checked - it is the caller's responsibility
198
+ * to do so before calling this function. Note also that useAuthentication
199
+ * implies allowRedirects. Defaults to false (unauthenticated endpoints).
195
200
  * @returns the avatar URL or null.
196
201
  */
197
- getAvatarUrl(baseUrl: string, width: number, height: number, resizeMethod: string, allowDefault: boolean | undefined, allowDirectLinks: boolean): string | null;
202
+ getAvatarUrl(baseUrl: string, width: number, height: number, resizeMethod: string, allowDefault: boolean | undefined, allowDirectLinks: boolean, useAuthentication?: boolean): string | null;
198
203
  /**
199
204
  * get the mxc avatar url, either from a state event, or from a lazily loaded member
200
205
  * @returns the mxc avatar url
@@ -1 +1 @@
1
- {"version":3,"file":"room-member.d.ts","sourceRoot":"","sources":["../../src/models/room-member.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE7D,OAAO,EAAmB,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAEtE,oBAAY,eAAe;IACvB,UAAU,0BAA0B;IACpC,IAAI,oBAAoB;IACxB,UAAU,0BAA0B;IACpC,MAAM,sBAAsB;CAC/B;AAED,MAAM,MAAM,yBAAyB,GAAG;IACpC;;;;;;;;;;;OAWG;IACH,CAAC,eAAe,CAAC,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,UAAU,EAAE,aAAa,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACvG;;;;;;;;;;;OAWG;IACH,CAAC,eAAe,CAAC,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IACjG;;;;;;;;;;;OAWG;IACH,CAAC,eAAe,CAAC,UAAU,CAAC,EAAE,CAAC,KAAK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O,CAAC,kBAAkB;IAI1B;;;;;OAKG;IACI,mBAAmB,IAAI,MAAM;IAI7B,QAAQ,IAAI,OAAO;IAQ1B;;;;OAIG;IACI,YAAY,IAAI,MAAM,GAAG,SAAS;IA0BzC;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACI,YAAY,CACf,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,MAAM,EACpB,YAAY,qBAAO,EACnB,gBAAgB,EAAE,OAAO,EACzB,iBAAiB,GAAE,OAAe,GACnC,MAAM,GAAG,IAAI;IAsBhB;;;OAGG;IACI,eAAe,IAAI,MAAM,GAAG,SAAS;CAO/C"}
@@ -282,16 +282,22 @@ export class RoomMember extends TypedEventEmitter {
282
282
  * If false, any non-matrix content URLs will be ignored. Setting this option to
283
283
  * true will expose URLs that, if fetched, will leak information about the user
284
284
  * to anyone who they share a room with.
285
+ * @param useAuthentication - (optional) If true, the caller supports authenticated
286
+ * media and wants an authentication-required URL. Note that server support for
287
+ * authenticated media will not be checked - it is the caller's responsibility
288
+ * to do so before calling this function. Note also that useAuthentication
289
+ * implies allowRedirects. Defaults to false (unauthenticated endpoints).
285
290
  * @returns the avatar URL or null.
286
291
  */
287
292
  getAvatarUrl(baseUrl, width, height, resizeMethod) {
288
293
  var allowDefault = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true;
289
294
  var allowDirectLinks = arguments.length > 5 ? arguments[5] : undefined;
295
+ var useAuthentication = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : false;
290
296
  var rawUrl = this.getMxcAvatarUrl();
291
297
  if (!rawUrl && !allowDefault) {
292
298
  return null;
293
299
  }
294
- var httpUrl = getHttpUriForMxc(baseUrl, rawUrl, width, height, resizeMethod, allowDirectLinks);
300
+ var httpUrl = getHttpUriForMxc(baseUrl, rawUrl, width, height, resizeMethod, allowDirectLinks, undefined, useAuthentication);
295
301
  if (httpUrl) {
296
302
  return httpUrl;
297
303
  }
@@ -1 +1 @@
1
- {"version":3,"file":"room-member.js","names":["getHttpUriForMxc","removeDirectionOverrideChars","removeHiddenChars","logger","TypedEventEmitter","EventType","KnownMembership","RoomMemberEvent","RoomMember","constructor","roomId","userId","_defineProperty","name","rawDisplayName","updateModifiedTime","markOutOfBand","_isOutOfBand","isOutOfBand","setMembershipEvent","event","roomState","_event$getDirectional","_event$getDirectional2","displayName","getDirectionalContent","displayname","getType","events","member","oldMembership","membership","undefined","trace","concat","forwardLooking","getContent","getPrevContent","disambiguate","shouldDisambiguate","oldName","calculateDisplayName","emit","Membership","Name","setPowerLevelEvent","powerLevelEvent","RoomPowerLevels","getStateKey","evContent","maxLevel","users_default","users","Object","values","forEach","lvl","Math","max","oldPowerLevel","powerLevel","oldPowerLevelNorm","powerLevelNorm","Number","isInteger","PowerLevel","setTypingEvent","oldTyping","typing","typingList","user_ids","Array","isArray","indexOf","Typing","modified","Date","now","getLastModifiedTime","isKicked","Leave","getSender","getDMInviter","memberEvent","memberContent","inviteSender","Join","getUnsigned","prev_sender","Invite","is_direct","getAvatarUrl","baseUrl","width","height","resizeMethod","allowDefault","arguments","length","allowDirectLinks","rawUrl","getMxcAvatarUrl","httpUrl","avatar_url","user","avatarUrl","MXID_PATTERN","LTR_RTL_PATTERN","selfUserId","test","userIds","getUserIdsWithDisplayName","some","u"],"sources":["../../src/models/room-member.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 { getHttpUriForMxc } from \"../content-repo.ts\";\nimport { removeDirectionOverrideChars, removeHiddenChars } from \"../utils.ts\";\nimport { User } from \"./user.ts\";\nimport { MatrixEvent } from \"./event.ts\";\nimport { RoomState } from \"./room-state.ts\";\nimport { logger } from \"../logger.ts\";\nimport { TypedEventEmitter } from \"./typed-event-emitter.ts\";\nimport { EventType } from \"../@types/event.ts\";\nimport { KnownMembership, Membership } from \"../@types/membership.ts\";\n\nexport enum RoomMemberEvent {\n Membership = \"RoomMember.membership\",\n Name = \"RoomMember.name\",\n PowerLevel = \"RoomMember.powerLevel\",\n Typing = \"RoomMember.typing\",\n}\n\nexport type RoomMemberEventHandlerMap = {\n /**\n * Fires whenever any room member's membership state changes.\n * @param event - The matrix event which caused this event to fire.\n * @param member - The member whose RoomMember.membership changed.\n * @param oldMembership - The previous membership state. Null if it's a new member.\n * @example\n * ```\n * matrixClient.on(\"RoomMember.membership\", function(event, member, oldMembership){\n * var newState = member.membership;\n * });\n * ```\n */\n [RoomMemberEvent.Membership]: (event: MatrixEvent, member: RoomMember, oldMembership?: string) => void;\n /**\n * Fires whenever any room member's name changes.\n * @param event - The matrix event which caused this event to fire.\n * @param member - The member whose RoomMember.name changed.\n * @param oldName - The previous name. Null if the member didn't have a name previously.\n * @example\n * ```\n * matrixClient.on(\"RoomMember.name\", function(event, member){\n * var newName = member.name;\n * });\n * ```\n */\n [RoomMemberEvent.Name]: (event: MatrixEvent, member: RoomMember, oldName: string | null) => void;\n /**\n * Fires whenever any room member's power level changes.\n * @param event - The matrix event which caused this event to fire.\n * @param member - The member whose RoomMember.powerLevel changed.\n * @example\n * ```\n * matrixClient.on(\"RoomMember.powerLevel\", function(event, member){\n * var newPowerLevel = member.powerLevel;\n * var newNormPowerLevel = member.powerLevelNorm;\n * });\n * ```\n */\n [RoomMemberEvent.PowerLevel]: (event: MatrixEvent, member: RoomMember) => void;\n /**\n * Fires whenever any room member's typing state changes.\n * @param event - The matrix event which caused this event to fire.\n * @param member - The member whose RoomMember.typing changed.\n * @example\n * ```\n * matrixClient.on(\"RoomMember.typing\", function(event, member){\n * var isTyping = member.typing;\n * });\n * ```\n */\n [RoomMemberEvent.Typing]: (event: MatrixEvent, member: RoomMember) => void;\n};\n\nexport class RoomMember extends TypedEventEmitter<RoomMemberEvent, RoomMemberEventHandlerMap> {\n private _isOutOfBand = false;\n private modified = -1;\n public requestedProfileInfo = false; // used by sync.ts\n\n // XXX these should be read-only\n /**\n * True if the room member is currently typing.\n */\n public typing = false;\n /**\n * The human-readable name for this room member. This will be\n * disambiguated with a suffix of \" (\\@user_id:matrix.org)\" if another member shares the\n * same displayname.\n */\n public name: string;\n /**\n * The ambiguous displayname of this room member.\n */\n public rawDisplayName: string;\n /**\n * The power level for this room member.\n */\n public powerLevel = 0;\n /**\n * The normalised power level (0-100) for this room member.\n */\n public powerLevelNorm = 0;\n /**\n * The User object for this room member, if one exists.\n */\n public user?: User;\n /**\n * The membership state for this room member e.g. 'join'.\n */\n public membership?: Membership;\n /**\n * True if the member's name is disambiguated.\n */\n public disambiguate = false;\n /**\n * The events describing this RoomMember.\n */\n public events: {\n /**\n * The m.room.member event for this RoomMember.\n */\n member?: MatrixEvent;\n } = {};\n\n /**\n * Construct a new room member.\n *\n * @param roomId - The room ID of the member.\n * @param userId - The user ID of the member.\n */\n public constructor(\n public readonly roomId: string,\n public readonly userId: string,\n ) {\n super();\n\n this.name = userId;\n this.rawDisplayName = userId;\n this.updateModifiedTime();\n }\n\n /**\n * Mark the member as coming from a channel that is not sync\n */\n public markOutOfBand(): void {\n this._isOutOfBand = true;\n }\n\n /**\n * @returns does the member come from a channel that is not sync?\n * This is used to store the member seperately\n * from the sync state so it available across browser sessions.\n */\n public isOutOfBand(): boolean {\n return this._isOutOfBand;\n }\n\n /**\n * Update this room member's membership event. May fire \"RoomMember.name\" if\n * this event updates this member's name.\n * @param event - The `m.room.member` event\n * @param roomState - Optional. The room state to take into account\n * when calculating (e.g. for disambiguating users with the same name).\n *\n * @remarks\n * Fires {@link RoomMemberEvent.Name}\n * Fires {@link RoomMemberEvent.Membership}\n */\n public setMembershipEvent(event: MatrixEvent, roomState?: RoomState): void {\n const displayName = event.getDirectionalContent().displayname ?? \"\";\n\n if (event.getType() !== EventType.RoomMember) {\n return;\n }\n\n this._isOutOfBand = false;\n\n this.events.member = event;\n\n const oldMembership = this.membership;\n this.membership = event.getDirectionalContent().membership;\n if (this.membership === undefined) {\n // logging to diagnose https://github.com/vector-im/element-web/issues/20962\n // (logs event content, although only of membership events)\n logger.trace(\n `membership event with membership undefined (forwardLooking: ${event.forwardLooking})!`,\n event.getContent(),\n `prevcontent is `,\n event.getPrevContent(),\n );\n }\n\n this.disambiguate = shouldDisambiguate(this.userId, displayName, roomState);\n\n const oldName = this.name;\n this.name = calculateDisplayName(this.userId, displayName, this.disambiguate);\n\n // not quite raw: we strip direction override chars so it can safely be inserted into\n // blocks of text without breaking the text direction\n this.rawDisplayName = removeDirectionOverrideChars(event.getDirectionalContent().displayname ?? \"\");\n if (!this.rawDisplayName || !removeHiddenChars(this.rawDisplayName)) {\n this.rawDisplayName = this.userId;\n }\n\n if (oldMembership !== this.membership) {\n this.updateModifiedTime();\n this.emit(RoomMemberEvent.Membership, event, this, oldMembership);\n }\n if (oldName !== this.name) {\n this.updateModifiedTime();\n this.emit(RoomMemberEvent.Name, event, this, oldName);\n }\n }\n\n /**\n * Update this room member's power level event. May fire\n * \"RoomMember.powerLevel\" if this event updates this member's power levels.\n * @param powerLevelEvent - The `m.room.power_levels` event\n *\n * @remarks\n * Fires {@link RoomMemberEvent.PowerLevel}\n */\n public setPowerLevelEvent(powerLevelEvent: MatrixEvent): void {\n if (powerLevelEvent.getType() !== EventType.RoomPowerLevels || powerLevelEvent.getStateKey() !== \"\") {\n return;\n }\n\n const evContent = powerLevelEvent.getDirectionalContent();\n\n let maxLevel = evContent.users_default || 0;\n const users: { [userId: string]: number } = evContent.users || {};\n Object.values(users).forEach((lvl: number) => {\n maxLevel = Math.max(maxLevel, lvl);\n });\n const oldPowerLevel = this.powerLevel;\n const oldPowerLevelNorm = this.powerLevelNorm;\n\n if (users[this.userId] !== undefined && Number.isInteger(users[this.userId])) {\n this.powerLevel = users[this.userId];\n } else if (evContent.users_default !== undefined) {\n this.powerLevel = evContent.users_default;\n } else {\n this.powerLevel = 0;\n }\n this.powerLevelNorm = 0;\n if (maxLevel > 0) {\n this.powerLevelNorm = (this.powerLevel * 100) / maxLevel;\n }\n\n // emit for changes in powerLevelNorm as well (since the app will need to\n // redraw everyone's level if the max has changed)\n if (oldPowerLevel !== this.powerLevel || oldPowerLevelNorm !== this.powerLevelNorm) {\n this.updateModifiedTime();\n this.emit(RoomMemberEvent.PowerLevel, powerLevelEvent, this);\n }\n }\n\n /**\n * Update this room member's typing event. May fire \"RoomMember.typing\" if\n * this event changes this member's typing state.\n * @param event - The typing event\n *\n * @remarks\n * Fires {@link RoomMemberEvent.Typing}\n */\n public setTypingEvent(event: MatrixEvent): void {\n if (event.getType() !== \"m.typing\") {\n return;\n }\n const oldTyping = this.typing;\n this.typing = false;\n const typingList = event.getContent().user_ids;\n if (!Array.isArray(typingList)) {\n // malformed event :/ bail early. TODO: whine?\n return;\n }\n if (typingList.indexOf(this.userId) !== -1) {\n this.typing = true;\n }\n if (oldTyping !== this.typing) {\n this.updateModifiedTime();\n this.emit(RoomMemberEvent.Typing, event, this);\n }\n }\n\n /**\n * Update the last modified time to the current time.\n */\n private updateModifiedTime(): void {\n this.modified = Date.now();\n }\n\n /**\n * Get the timestamp when this RoomMember was last updated. This timestamp is\n * updated when properties on this RoomMember are updated.\n * It is updated <i>before</i> firing events.\n * @returns The timestamp\n */\n public getLastModifiedTime(): number {\n return this.modified;\n }\n\n public isKicked(): boolean {\n return (\n this.membership === KnownMembership.Leave &&\n this.events.member !== undefined &&\n this.events.member.getSender() !== this.events.member.getStateKey()\n );\n }\n\n /**\n * If this member was invited with the is_direct flag set, return\n * the user that invited this member\n * @returns user id of the inviter\n */\n public getDMInviter(): string | undefined {\n // when not available because that room state hasn't been loaded in,\n // we don't really know, but more likely to not be a direct chat\n if (this.events.member) {\n // TODO: persist the is_direct flag on the member as more member events\n // come in caused by displayName changes.\n\n // the is_direct flag is set on the invite member event.\n // This is copied on the prev_content section of the join member event\n // when the invite is accepted.\n\n const memberEvent = this.events.member;\n let memberContent = memberEvent.getContent();\n let inviteSender: string | undefined = memberEvent.getSender();\n\n if (memberContent.membership === KnownMembership.Join) {\n memberContent = memberEvent.getPrevContent();\n inviteSender = memberEvent.getUnsigned().prev_sender;\n }\n\n if (memberContent.membership === KnownMembership.Invite && memberContent.is_direct) {\n return inviteSender;\n }\n }\n }\n\n /**\n * Get the avatar URL for a room member.\n * @param baseUrl - The base homeserver URL See\n * {@link MatrixClient#getHomeserverUrl}.\n * @param width - The desired width of the thumbnail.\n * @param height - The desired height of the thumbnail.\n * @param resizeMethod - The thumbnail resize method to use, either\n * \"crop\" or \"scale\".\n * @param allowDefault - (optional) Passing false causes this method to\n * return null if the user has no avatar image. Otherwise, a default image URL\n * will be returned. Default: true. (Deprecated)\n * @param allowDirectLinks - (optional) If true, the avatar URL will be\n * returned even if it is a direct hyperlink rather than a matrix content URL.\n * If false, any non-matrix content URLs will be ignored. Setting this option to\n * true will expose URLs that, if fetched, will leak information about the user\n * to anyone who they share a room with.\n * @returns the avatar URL or null.\n */\n public getAvatarUrl(\n baseUrl: string,\n width: number,\n height: number,\n resizeMethod: string,\n allowDefault = true,\n allowDirectLinks: boolean,\n ): string | null {\n const rawUrl = this.getMxcAvatarUrl();\n\n if (!rawUrl && !allowDefault) {\n return null;\n }\n const httpUrl = getHttpUriForMxc(baseUrl, rawUrl, width, height, resizeMethod, allowDirectLinks);\n if (httpUrl) {\n return httpUrl;\n }\n return null;\n }\n\n /**\n * get the mxc avatar url, either from a state event, or from a lazily loaded member\n * @returns the mxc avatar url\n */\n public getMxcAvatarUrl(): string | undefined {\n if (this.events.member) {\n return this.events.member.getDirectionalContent().avatar_url;\n } else if (this.user) {\n return this.user.avatarUrl;\n }\n }\n}\n\nconst MXID_PATTERN = /@.+:.+/;\nconst LTR_RTL_PATTERN = /[\\u200E\\u200F\\u202A-\\u202F]/;\n\nfunction shouldDisambiguate(selfUserId: string, displayName?: string, roomState?: RoomState): boolean {\n if (!displayName || displayName === selfUserId) return false;\n\n // First check if the displayname is something we consider truthy\n // after stripping it of zero width characters and padding spaces\n if (!removeHiddenChars(displayName)) return false;\n\n if (!roomState) return false;\n\n // Next check if the name contains something that look like a mxid\n // If it does, it may be someone trying to impersonate someone else\n // Show full mxid in this case\n if (MXID_PATTERN.test(displayName)) return true;\n\n // Also show mxid if the display name contains any LTR/RTL characters as these\n // make it very difficult for us to find similar *looking* display names\n // E.g \"Mark\" could be cloned by writing \"kraM\" but in RTL.\n if (LTR_RTL_PATTERN.test(displayName)) return true;\n\n // Also show mxid if there are other people with the same or similar\n // displayname, after hidden character removal.\n const userIds = roomState.getUserIdsWithDisplayName(displayName);\n if (userIds.some((u) => u !== selfUserId)) return true;\n\n return false;\n}\n\nfunction calculateDisplayName(selfUserId: string, displayName: string | undefined, disambiguate: boolean): string {\n if (!displayName || displayName === selfUserId) return selfUserId;\n\n if (disambiguate) return removeDirectionOverrideChars(displayName) + \" (\" + selfUserId + \")\";\n\n // First check if the displayname is something we consider truthy\n // after stripping it of zero width characters and padding spaces\n if (!removeHiddenChars(displayName)) return selfUserId;\n\n // We always strip the direction override characters (LRO and RLO).\n // These override the text direction for all subsequent characters\n // in the paragraph so if display names contained these, they'd\n // need to be wrapped in something to prevent this from leaking out\n // (which we can do in HTML but not text) or we'd need to add\n // control characters to the string to reset any overrides (eg.\n // adding PDF characters at the end). As far as we can see,\n // there should be no reason these would be necessary - rtl display\n // names should flip into the correct direction automatically based on\n // the characters, and you can still embed rtl in ltr or vice versa\n // with the embed chars or marker chars.\n return removeDirectionOverrideChars(displayName);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,4BAA4B,EAA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W,IAAIA,WAAW,KAAKoF,UAAU,EAAE,OAAO,KAAK;;EAE5D;EACA;EACA,IAAI,CAAC1G,iBAAiB,CAACsB,WAAW,CAAC,EAAE,OAAO,KAAK;EAEjD,IAAI,CAACH,SAAS,EAAE,OAAO,KAAK;;EAE5B;EACA;EACA;EACA,IAAIqF,YAAY,CAACG,IAAI,CAACrF,WAAW,CAAC,EAAE,OAAO,IAAI;;EAE/C;EACA;EACA;EACA,IAAImF,eAAe,CAACE,IAAI,CAACrF,WAAW,CAAC,EAAE,OAAO,IAAI;;EAElD;EACA;EACA,IAAMsF,OAAO,GAAGzF,SAAS,CAAC0F,yBAAyB,CAACvF,WAAW,CAAC;EAChE,IAAIsF,OAAO,CAACE,IAAI,CAAEC,CAAC,IAAKA,CAAC,KAAKL,UAAU,CAAC,EAAE,OAAO,IAAI;EAEtD,OAAO,KAAK;AAChB;AAEA,SAASnE,oBAAoBA,CAACmE,UAAkB,EAAEpF,WAA+B,EAAEc,YAAqB,EAAU;EAC9G,IAAI,CAACd,WAAW,IAAIA,WAAW,KAAKoF,UAAU,EAAE,OAAOA,UAAU;EAEjE,IAAItE,YAAY,EAAE,OAAOrC,4BAA4B,CAACuB,WAAW,CAAC,GAAG,IAAI,GAAGoF,UAAU,GAAG,GAAG;;EAE5F;EACA;EACA,IAAI,CAAC1G,iBAAiB,CAACsB,WAAW,CAAC,EAAE,OAAOoF,UAAU;;EAEtD;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,OAAO3G,4BAA4B,CAACuB,WAAW,CAAC;AACpD","ignoreList":[]}
1
+ {"version":3,"file":"room-member.js","names":["getHttpUriForMxc","removeDirectionOverrideChars","removeHiddenChars","logger","TypedEventEmitter","EventType","KnownMembership","RoomMemberEvent","RoomMember","constructor","roomId","userId","_defineProperty","name","rawDisplayName","updateModifiedTime","markOutOfBand","_isOutOfBand","isOutOfBand","setMembershipEvent","event","roomState","_event$getDirectional","_event$getDirectional2","displayName","getDirectionalContent","displayname","getType","events","member","oldMembership","membership","undefined","trace","concat","forwardLooking","getContent","getPrevContent","disambiguate","shouldDisambiguate","oldName","calculateDisplayName","emit","Membership","Name","setPowerLevelEvent","powerLevelEvent","RoomPowerLevels","getStateKey","evContent","maxLevel","users_default","users","Object","values","forEach","lvl","Math","max","oldPowerLevel","powerLevel","oldPowerLevelNorm","powerLevelNorm","Number","isInteger","PowerLevel","setTypingEvent","oldTyping","typing","typingList","user_ids","Array","isArray","indexOf","Typing","modified","Date","now","getLastModifiedTime","isKicked","Leave","getSender","getDMInviter","memberEvent","memberContent","inviteSender","Join","getUnsigned","prev_sender","Invite","is_direct","getAvatarUrl","baseUrl","width","height","resizeMethod","allowDefault","arguments","length","allowDirectLinks","useAuthentication","rawUrl","getMxcAvatarUrl","httpUrl","avatar_url","user","avatarUrl","MXID_PATTERN","LTR_RTL_PATTERN","selfUserId","test","userIds","getUserIdsWithDisplayName","some","u"],"sources":["../../src/models/room-member.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 { getHttpUriForMxc } from \"../content-repo.ts\";\nimport { removeDirectionOverrideChars, removeHiddenChars } from \"../utils.ts\";\nimport { User } from \"./user.ts\";\nimport { MatrixEvent } from \"./event.ts\";\nimport { RoomState } from \"./room-state.ts\";\nimport { logger } from \"../logger.ts\";\nimport { TypedEventEmitter } from \"./typed-event-emitter.ts\";\nimport { EventType } from \"../@types/event.ts\";\nimport { KnownMembership, Membership } from \"../@types/membership.ts\";\n\nexport enum RoomMemberEvent {\n Membership = \"RoomMember.membership\",\n Name = \"RoomMember.name\",\n PowerLevel = \"RoomMember.powerLevel\",\n Typing = \"RoomMember.typing\",\n}\n\nexport type RoomMemberEventHandlerMap = {\n /**\n * Fires whenever any room member's membership state changes.\n * @param event - The matrix event which caused this event to fire.\n * @param member - The member whose RoomMember.membership changed.\n * @param oldMembership - The previous membership state. Null if it's a new member.\n * @example\n * ```\n * matrixClient.on(\"RoomMember.membership\", function(event, member, oldMembership){\n * var newState = member.membership;\n * });\n * ```\n */\n [RoomMemberEvent.Membership]: (event: MatrixEvent, member: RoomMember, oldMembership?: string) => void;\n /**\n * Fires whenever any room member's name changes.\n * @param event - The matrix event which caused this event to fire.\n * @param member - The member whose RoomMember.name changed.\n * @param oldName - The previous name. Null if the member didn't have a name previously.\n * @example\n * ```\n * matrixClient.on(\"RoomMember.name\", function(event, member){\n * var newName = member.name;\n * });\n * ```\n */\n [RoomMemberEvent.Name]: (event: MatrixEvent, member: RoomMember, oldName: string | null) => void;\n /**\n * Fires whenever any room member's power level changes.\n * @param event - The matrix event which caused this event to fire.\n * @param member - The member whose RoomMember.powerLevel changed.\n * @example\n * ```\n * matrixClient.on(\"RoomMember.powerLevel\", function(event, member){\n * var newPowerLevel = member.powerLevel;\n * var newNormPowerLevel = member.powerLevelNorm;\n * });\n * ```\n */\n [RoomMemberEvent.PowerLevel]: (event: MatrixEvent, member: RoomMember) => void;\n /**\n * Fires whenever any room member's typing state changes.\n * @param event - The matrix event which caused this event to fire.\n * @param member - The member whose RoomMember.typing changed.\n * @example\n * ```\n * matrixClient.on(\"RoomMember.typing\", function(event, member){\n * var isTyping = member.typing;\n * });\n * ```\n */\n [RoomMemberEvent.Typing]: (event: MatrixEvent, member: RoomMember) => void;\n};\n\nexport class RoomMember extends TypedEventEmitter<RoomMemberEvent, RoomMemberEventHandlerMap> {\n private _isOutOfBand = false;\n private modified = -1;\n public requestedProfileInfo = false; // used by sync.ts\n\n // XXX these should be read-only\n /**\n * True if the room member is currently typing.\n */\n public typing = false;\n /**\n * The human-readable name for this room member. This will be\n * disambiguated with a suffix of \" (\\@user_id:matrix.org)\" if another member shares the\n * same displayname.\n */\n public name: string;\n /**\n * The ambiguous displayname of this room member.\n */\n public rawDisplayName: string;\n /**\n * The power level for this room member.\n */\n public powerLevel = 0;\n /**\n * The normalised power level (0-100) for this room member.\n */\n public powerLevelNorm = 0;\n /**\n * The User object for this room member, if one exists.\n */\n public user?: User;\n /**\n * The membership state for this room member e.g. 'join'.\n */\n public membership?: Membership;\n /**\n * True if the member's name is disambiguated.\n */\n public disambiguate = false;\n /**\n * The events describing this RoomMember.\n */\n public events: {\n /**\n * The m.room.member event for this RoomMember.\n */\n member?: MatrixEvent;\n } = {};\n\n /**\n * Construct a new room member.\n *\n * @param roomId - The room ID of the member.\n * @param userId - The user ID of the member.\n */\n public constructor(\n public readonly roomId: string,\n public readonly userId: string,\n ) {\n super();\n\n this.name = userId;\n this.rawDisplayName = userId;\n this.updateModifiedTime();\n }\n\n /**\n * Mark the member as coming from a channel that is not sync\n */\n public markOutOfBand(): void {\n this._isOutOfBand = true;\n }\n\n /**\n * @returns does the member come from a channel that is not sync?\n * This is used to store the member seperately\n * from the sync state so it available across browser sessions.\n */\n public isOutOfBand(): boolean {\n return this._isOutOfBand;\n }\n\n /**\n * Update this room member's membership event. May fire \"RoomMember.name\" if\n * this event updates this member's name.\n * @param event - The `m.room.member` event\n * @param roomState - Optional. The room state to take into account\n * when calculating (e.g. for disambiguating users with the same name).\n *\n * @remarks\n * Fires {@link RoomMemberEvent.Name}\n * Fires {@link RoomMemberEvent.Membership}\n */\n public setMembershipEvent(event: MatrixEvent, roomState?: RoomState): void {\n const displayName = event.getDirectionalContent().displayname ?? \"\";\n\n if (event.getType() !== EventType.RoomMember) {\n return;\n }\n\n this._isOutOfBand = false;\n\n this.events.member = event;\n\n const oldMembership = this.membership;\n this.membership = event.getDirectionalContent().membership;\n if (this.membership === undefined) {\n // logging to diagnose https://github.com/vector-im/element-web/issues/20962\n // (logs event content, although only of membership events)\n logger.trace(\n `membership event with membership undefined (forwardLooking: ${event.forwardLooking})!`,\n event.getContent(),\n `prevcontent is `,\n event.getPrevContent(),\n );\n }\n\n this.disambiguate = shouldDisambiguate(this.userId, displayName, roomState);\n\n const oldName = this.name;\n this.name = calculateDisplayName(this.userId, displayName, this.disambiguate);\n\n // not quite raw: we strip direction override chars so it can safely be inserted into\n // blocks of text without breaking the text direction\n this.rawDisplayName = removeDirectionOverrideChars(event.getDirectionalContent().displayname ?? \"\");\n if (!this.rawDisplayName || !removeHiddenChars(this.rawDisplayName)) {\n this.rawDisplayName = this.userId;\n }\n\n if (oldMembership !== this.membership) {\n this.updateModifiedTime();\n this.emit(RoomMemberEvent.Membership, event, this, oldMembership);\n }\n if (oldName !== this.name) {\n this.updateModifiedTime();\n this.emit(RoomMemberEvent.Name, event, this, oldName);\n }\n }\n\n /**\n * Update this room member's power level event. May fire\n * \"RoomMember.powerLevel\" if this event updates this member's power levels.\n * @param powerLevelEvent - The `m.room.power_levels` event\n *\n * @remarks\n * Fires {@link RoomMemberEvent.PowerLevel}\n */\n public setPowerLevelEvent(powerLevelEvent: MatrixEvent): void {\n if (powerLevelEvent.getType() !== EventType.RoomPowerLevels || powerLevelEvent.getStateKey() !== \"\") {\n return;\n }\n\n const evContent = powerLevelEvent.getDirectionalContent();\n\n let maxLevel = evContent.users_default || 0;\n const users: { [userId: string]: number } = evContent.users || {};\n Object.values(users).forEach((lvl: number) => {\n maxLevel = Math.max(maxLevel, lvl);\n });\n const oldPowerLevel = this.powerLevel;\n const oldPowerLevelNorm = this.powerLevelNorm;\n\n if (users[this.userId] !== undefined && Number.isInteger(users[this.userId])) {\n this.powerLevel = users[this.userId];\n } else if (evContent.users_default !== undefined) {\n this.powerLevel = evContent.users_default;\n } else {\n this.powerLevel = 0;\n }\n this.powerLevelNorm = 0;\n if (maxLevel > 0) {\n this.powerLevelNorm = (this.powerLevel * 100) / maxLevel;\n }\n\n // emit for changes in powerLevelNorm as well (since the app will need to\n // redraw everyone's level if the max has changed)\n if (oldPowerLevel !== this.powerLevel || oldPowerLevelNorm !== this.powerLevelNorm) {\n this.updateModifiedTime();\n this.emit(RoomMemberEvent.PowerLevel, powerLevelEvent, this);\n }\n }\n\n /**\n * Update this room member's typing event. May fire \"RoomMember.typing\" if\n * this event changes this member's typing state.\n * @param event - The typing event\n *\n * @remarks\n * Fires {@link RoomMemberEvent.Typing}\n */\n public setTypingEvent(event: MatrixEvent): void {\n if (event.getType() !== \"m.typing\") {\n return;\n }\n const oldTyping = this.typing;\n this.typing = false;\n const typingList = event.getContent().user_ids;\n if (!Array.isArray(typingList)) {\n // malformed event :/ bail early. TODO: whine?\n return;\n }\n if (typingList.indexOf(this.userId) !== -1) {\n this.typing = true;\n }\n if (oldTyping !== this.typing) {\n this.updateModifiedTime();\n this.emit(RoomMemberEvent.Typing, event, this);\n }\n }\n\n /**\n * Update the last modified time to the current time.\n */\n private updateModifiedTime(): void {\n this.modified = Date.now();\n }\n\n /**\n * Get the timestamp when this RoomMember was last updated. This timestamp is\n * updated when properties on this RoomMember are updated.\n * It is updated <i>before</i> firing events.\n * @returns The timestamp\n */\n public getLastModifiedTime(): number {\n return this.modified;\n }\n\n public isKicked(): boolean {\n return (\n this.membership === KnownMembership.Leave &&\n this.events.member !== undefined &&\n this.events.member.getSender() !== this.events.member.getStateKey()\n );\n }\n\n /**\n * If this member was invited with the is_direct flag set, return\n * the user that invited this member\n * @returns user id of the inviter\n */\n public getDMInviter(): string | undefined {\n // when not available because that room state hasn't been loaded in,\n // we don't really know, but more likely to not be a direct chat\n if (this.events.member) {\n // TODO: persist the is_direct flag on the member as more member events\n // come in caused by displayName changes.\n\n // the is_direct flag is set on the invite member event.\n // This is copied on the prev_content section of the join member event\n // when the invite is accepted.\n\n const memberEvent = this.events.member;\n let memberContent = memberEvent.getContent();\n let inviteSender: string | undefined = memberEvent.getSender();\n\n if (memberContent.membership === KnownMembership.Join) {\n memberContent = memberEvent.getPrevContent();\n inviteSender = memberEvent.getUnsigned().prev_sender;\n }\n\n if (memberContent.membership === KnownMembership.Invite && memberContent.is_direct) {\n return inviteSender;\n }\n }\n }\n\n /**\n * Get the avatar URL for a room member.\n * @param baseUrl - The base homeserver URL See\n * {@link MatrixClient#getHomeserverUrl}.\n * @param width - The desired width of the thumbnail.\n * @param height - The desired height of the thumbnail.\n * @param resizeMethod - The thumbnail resize method to use, either\n * \"crop\" or \"scale\".\n * @param allowDefault - (optional) Passing false causes this method to\n * return null if the user has no avatar image. Otherwise, a default image URL\n * will be returned. Default: true. (Deprecated)\n * @param allowDirectLinks - (optional) If true, the avatar URL will be\n * returned even if it is a direct hyperlink rather than a matrix content URL.\n * If false, any non-matrix content URLs will be ignored. Setting this option to\n * true will expose URLs that, if fetched, will leak information about the user\n * to anyone who they share a room with.\n * @param useAuthentication - (optional) If true, the caller supports authenticated\n * media and wants an authentication-required URL. Note that server support for\n * authenticated media will not be checked - it is the caller's responsibility\n * to do so before calling this function. Note also that useAuthentication\n * implies allowRedirects. Defaults to false (unauthenticated endpoints).\n * @returns the avatar URL or null.\n */\n public getAvatarUrl(\n baseUrl: string,\n width: number,\n height: number,\n resizeMethod: string,\n allowDefault = true,\n allowDirectLinks: boolean,\n useAuthentication: boolean = false,\n ): string | null {\n const rawUrl = this.getMxcAvatarUrl();\n\n if (!rawUrl && !allowDefault) {\n return null;\n }\n const httpUrl = getHttpUriForMxc(\n baseUrl,\n rawUrl,\n width,\n height,\n resizeMethod,\n allowDirectLinks,\n undefined,\n useAuthentication,\n );\n if (httpUrl) {\n return httpUrl;\n }\n return null;\n }\n\n /**\n * get the mxc avatar url, either from a state event, or from a lazily loaded member\n * @returns the mxc avatar url\n */\n public getMxcAvatarUrl(): string | undefined {\n if (this.events.member) {\n return this.events.member.getDirectionalContent().avatar_url;\n } else if (this.user) {\n return this.user.avatarUrl;\n }\n }\n}\n\nconst MXID_PATTERN = /@.+:.+/;\nconst LTR_RTL_PATTERN = /[\\u200E\\u200F\\u202A-\\u202F]/;\n\nfunction shouldDisambiguate(selfUserId: string, displayName?: string, roomState?: RoomState): boolean {\n if (!displayName || displayName === selfUserId) return false;\n\n // First check if the displayname is something we consider truthy\n // after stripping it of zero width characters and padding spaces\n if (!removeHiddenChars(displayName)) return false;\n\n if (!roomState) return false;\n\n // Next check if the name contains something that look like a mxid\n // If it does, it may be someone trying to impersonate someone else\n // Show full mxid in this case\n if (MXID_PATTERN.test(displayName)) return true;\n\n // Also show mxid if the display name contains any LTR/RTL characters as these\n // make it very difficult for us to find similar *looking* display names\n // E.g \"Mark\" could be cloned by writing \"kraM\" but in RTL.\n if (LTR_RTL_PATTERN.test(displayName)) return true;\n\n // Also show mxid if there are other people with the same or similar\n // displayname, after hidden character removal.\n const userIds = roomState.getUserIdsWithDisplayName(displayName);\n if (userIds.some((u) => u !== selfUserId)) return true;\n\n return false;\n}\n\nfunction calculateDisplayName(selfUserId: string, displayName: string | undefined, disambiguate: boolean): string {\n if (!displayName || displayName === selfUserId) return selfUserId;\n\n if (disambiguate) return removeDirectionOverrideChars(displayName) + \" (\" + selfUserId + \")\";\n\n // First check if the displayname is something we consider truthy\n // after stripping it of zero width characters and padding spaces\n if (!removeHiddenChars(displayName)) return selfUserId;\n\n // We always strip the direction override characters (LRO and RLO).\n // These override the text direction for all subsequent characters\n // in the paragraph so if display names contained these, they'd\n // need to be wrapped in something to prevent this from leaking out\n // (which we can do in HTML but not text) or we'd need to add\n // control characters to the string to reset any overrides (eg.\n // adding PDF characters at the end). As far as we can see,\n // there should be no reason these would be necessary - rtl display\n // names should flip into the correct direction automatically based on\n // the characters, and you can still embed rtl in ltr or vice versa\n // with the embed chars or marker chars.\n return removeDirectionOverrideChars(displayName);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,4BAA4B,EAAEC,iBAAiB,QAAQ,aAAa;AAI7E,SAASC,MAAM,QAAQ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;AAErD,SAASrE,kBAAkBA,CAACsE,UAAkB,EAAErF,WAAoB,EAAEH,SAAqB,EAAW;EAClG,IAAI,CAACG,WAAW,IAAIA,WAAW,KAAKqF,UAAU,EAAE,OAAO,KAAK;;EAE5D;EACA;EACA,IAAI,CAAC3G,iBAAiB,CAACsB,WAAW,CAAC,EAAE,OAAO,KAAK;EAEjD,IAAI,CAACH,SAAS,EAAE,OAAO,KAAK;;EAE5B;EACA;EACA;EACA,IAAIsF,YAAY,CAACG,IAAI,CAACtF,WAAW,CAAC,EAAE,OAAO,IAAI;;EAE/C;EACA;EACA;EACA,IAAIoF,eAAe,CAACE,IAAI,CAACtF,WAAW,CAAC,EAAE,OAAO,IAAI;;EAElD;EACA;EACA,IAAMuF,OAAO,GAAG1F,SAAS,CAAC2F,yBAAyB,CAACxF,WAAW,CAAC;EAChE,IAAIuF,OAAO,CAACE,IAAI,CAAEC,CAAC,IAAKA,CAAC,KAAKL,UAAU,CAAC,EAAE,OAAO,IAAI;EAEtD,OAAO,KAAK;AAChB;AAEA,SAASpE,oBAAoBA,CAACoE,UAAkB,EAAErF,WAA+B,EAAEc,YAAqB,EAAU;EAC9G,IAAI,CAACd,WAAW,IAAIA,WAAW,KAAKqF,UAAU,EAAE,OAAOA,UAAU;EAEjE,IAAIvE,YAAY,EAAE,OAAOrC,4BAA4B,CAACuB,WAAW,CAAC,GAAG,IAAI,GAAGqF,UAAU,GAAG,GAAG;;EAE5F;EACA;EACA,IAAI,CAAC3G,iBAAiB,CAACsB,WAAW,CAAC,EAAE,OAAOqF,UAAU;;EAEtD;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,OAAO5G,4BAA4B,CAACuB,WAAW,CAAC;AACpD","ignoreList":[]}
@@ -643,9 +643,14 @@ export declare class Room extends ReadReceipt<RoomEmittedEvents, RoomEventHandle
643
643
  * "crop" or "scale".
644
644
  * @param allowDefault - True to allow an identicon for this room if an
645
645
  * avatar URL wasn't explicitly set. Default: true. (Deprecated)
646
+ * @param useAuthentication - (optional) If true, the caller supports authenticated
647
+ * media and wants an authentication-required URL. Note that server support for
648
+ * authenticated media will not be checked - it is the caller's responsibility
649
+ * to do so before calling this function. Note also that useAuthentication
650
+ * implies allowRedirects. Defaults to false (unauthenticated endpoints).
646
651
  * @returns the avatar URL or null.
647
652
  */
648
- getAvatarUrl(baseUrl: string, width: number, height: number, resizeMethod: ResizeMethod, allowDefault?: boolean): string | null;
653
+ getAvatarUrl(baseUrl: string, width: number, height: number, resizeMethod: ResizeMethod, allowDefault?: boolean, useAuthentication?: boolean): string | null;
649
654
  /**
650
655
  * Get the mxc avatar url for the room, if one was set.
651
656
  * @returns the mxc avatar url or falsy
@@ -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,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAE9D,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EACH,SAAS,EAET,QAAQ,EAKX,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC/F,OAAO,EAAE,MAAM,EAAqB,MAAM,cAAc,CAAC;AACzD,OAAO,EAAE,S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,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"}
@@ -1370,17 +1370,23 @@ export class Room extends ReadReceipt {
1370
1370
  * "crop" or "scale".
1371
1371
  * @param allowDefault - True to allow an identicon for this room if an
1372
1372
  * avatar URL wasn't explicitly set. Default: true. (Deprecated)
1373
+ * @param useAuthentication - (optional) If true, the caller supports authenticated
1374
+ * media and wants an authentication-required URL. Note that server support for
1375
+ * authenticated media will not be checked - it is the caller's responsibility
1376
+ * to do so before calling this function. Note also that useAuthentication
1377
+ * implies allowRedirects. Defaults to false (unauthenticated endpoints).
1373
1378
  * @returns the avatar URL or null.
1374
1379
  */
1375
1380
  getAvatarUrl(baseUrl, width, height, resizeMethod) {
1376
1381
  var allowDefault = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true;
1382
+ var useAuthentication = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false;
1377
1383
  var roomAvatarEvent = this.currentState.getStateEvents(EventType.RoomAvatar, "");
1378
1384
  if (!roomAvatarEvent && !allowDefault) {
1379
1385
  return null;
1380
1386
  }
1381
1387
  var mainUrl = roomAvatarEvent ? roomAvatarEvent.getContent().url : null;
1382
1388
  if (mainUrl) {
1383
- return getHttpUriForMxc(baseUrl, mainUrl, width, height, resizeMethod);
1389
+ return getHttpUriForMxc(baseUrl, mainUrl, width, height, resizeMethod, undefined, undefined, useAuthentication);
1384
1390
  }
1385
1391
  return null;
1386
1392
  }