Merge pull request #227 from melogale/dev

avatars!
This commit is contained in:
7w1 authored and GitHub committed 2026-03-08 20:25:29 -05:00
commit d41f1479af
10 files changed
+39 -11

No files matched your search

+5
View File
@@ -0,0 +1,5 @@
---
sable: minor
---
Add avatars to calls by forking element call, among other things.
+1
View File
@@ -18,3 +18,4 @@ devAssets
*.tfbackend
!*.tfbackend.example
crash.log
build.sh
+3
View File
@@ -0,0 +1,3 @@
[submodule "element-call"]
path = element-call
url = https://github.com/melogale/element-call.git
+1
View File
@@ -1,5 +1,6 @@
dist
node_modules
element-call
package.json
package-lock.json
LICENSE
Submodule
+1
Submodule element-call added at ecef381c24.
+1
View File
@@ -134,6 +134,7 @@ const projectOverrides = defineConfig([
]);
export default defineConfig([
{ ignores: ['element-call/'] },
includeIgnoreFile(gitignorePath),
...jsConfig,
...reactConfig,
+10 -10
View File
@@ -71,7 +71,7 @@
},
"devDependencies": {
"@cloudflare/vite-plugin": "^1.26.0",
"@element-hq/element-call-embedded": "0.16.3",
"@element-hq/element-call-embedded": "file:element-call/embedded/web",
"@esbuild-plugins/node-globals-polyfill": "^0.2.3",
"@eslint/compat": "2.0.2",
"@eslint/js": "9.39.3",
@@ -110,6 +110,11 @@
"npm": "11.x"
}
},
"element-call/embedded/web": {
"name": "@element-hq/element-call-embedded",
"version": "0.0.0",
"dev": true
},
"node_modules/@apideck/better-ajv-errors": {
"version": "0.3.6",
"resolved": "https://registry.npmjs.org/@apideck/better-ajv-errors/-/better-ajv-errors-0.3.6.tgz",
@@ -1912,10 +1917,8 @@
}
},
"node_modules/@element-hq/element-call-embedded": {
"version": "0.16.3",
"resolved": "https://registry.npmjs.org/@element-hq/element-call-embedded/-/element-call-embedded-0.16.3.tgz",
"integrity": "sha512-OViKJonDaDNVBUW9WdV9mk78/Ruh34C7XsEgt3O8D9z+64C39elbIgllHSoH5S12IRlv9RYrrV37FZLo6QWsDQ==",
"dev": true
"resolved": "element-call/embedded/web",
"link": true
},
"node_modules/@emnapi/core": {
"version": "1.8.1",
@@ -17884,10 +17887,7 @@
}
},
"@element-hq/element-call-embedded": {
"version": "0.16.3",
"resolved": "https://registry.npmjs.org/@element-hq/element-call-embedded/-/element-call-embedded-0.16.3.tgz",
"integrity": "sha512-OViKJonDaDNVBUW9WdV9mk78/Ruh34C7XsEgt3O8D9z+64C39elbIgllHSoH5S12IRlv9RYrrV37FZLo6QWsDQ==",
"dev": true
"version": "file:element-call/embedded/web"
},
"@emnapi/core": {
"version": "1.8.1",
@@ -26905,4 +26905,4 @@
"dev": true
}
}
}
}
+1 -1
View File
@@ -87,7 +87,7 @@
},
"devDependencies": {
"@cloudflare/vite-plugin": "^1.26.0",
"@element-hq/element-call-embedded": "0.16.3",
"@element-hq/element-call-embedded": "file:element-call/embedded/web",
"@esbuild-plugins/node-globals-polyfill": "^0.2.3",
"@eslint/compat": "2.0.2",
"@eslint/js": "9.39.3",
+2
View File
@@ -18,6 +18,8 @@ export function getCallCapabilities(
capabilities.add(MatrixCapabilities.MSC3846TurnServers);
capabilities.add(MatrixCapabilities.MSC4157SendDelayedEvent);
capabilities.add(MatrixCapabilities.MSC4157UpdateDelayedEvent);
capabilities.add('moe.sable.thumbnails');
capabilities.add('moe.sable.media_proxy');
capabilities.add(`org.matrix.msc2762.timeline:${roomId}`);
capabilities.add(`org.matrix.msc2762.state:${roomId}`);
+14
View File
@@ -270,6 +270,20 @@ self.addEventListener('fetch', (event: FetchEvent) => {
return;
}
// Since widgets like element call have their own client ids,
// we need this logic. We just go through the sessions list and get a session
// with the right base url. Media requests to a homeserver simply are fine with any account
// on the homeserver authenticating it, so this is fine. But it can be technically wrong.
// If you have two tabs for different users on the same homeserver, it might authenticate
// as the wrong one.
// Thus any logic in the future which cares about which user is authenticating the request
// might break this. Also, again, it is technically wrong.
const byBaseUrl = [...sessions.values()].find((s) => validMediaRequest(url, s.baseUrl));
if (byBaseUrl) {
event.respondWith(fetch(url, { ...fetchConfig(byBaseUrl.accessToken), redirect }));
return;
}
event.respondWith(
requestSessionWithTimeout(clientId).then((s) => {
if (s && validMediaRequest(url, s.baseUrl)) {