From 62c9ac8436461f76eed32f2820b1b1619498ac35 Mon Sep 17 00:00:00 2001 From: Lotus CI Date: Mon, 19 Oct 2026 12:54:23 -0400 Subject: [PATCH] feat(lotus): load avatar decorations from chat.lotusguild.org (matrix #22) DECORATION_CDN moves from Nextcloud's public DAV (a PHP session and four cookies per image, no cache headers) to https://chat.lotusguild.org/decorations, static files from the versioned avatar-decorations package with a one-week cache. Pin @lotusguild/element-call-embedded 0.25.0-lotus.26, whose call tiles accept the new origin. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_017PCb59uY3UKqDqt7B6hzd5 --- LOTUS_FEATURES.md | 2 +- package-lock.json | 8 ++++---- package.json | 2 +- src/app/features/lotus/avatarDecorations.ts | 6 ++++-- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/LOTUS_FEATURES.md b/LOTUS_FEATURES.md index 0215a0d38..8025a4812 100644 --- a/LOTUS_FEATURES.md +++ b/LOTUS_FEATURES.md @@ -233,7 +233,7 @@ All decoration files are 256×256 APNGs. They animate natively in all modern bro Decoration preference is stored in the public Matrix profile field `io.lotus.avatar_decoration` (a slug string, e.g. `lotus_flower`). Any Lotus Chat user viewing your profile sees your current decoration. **CDN:** -Files are self-hosted on the Lotus Nextcloud instance. Direct access: `https://drive.lotusguild.org/public.php/dav/files/{token}/cinny-decorations/{slug}.png`. `` elements load cross-origin freely — no CORS headers needed. +Static files at `https://chat.lotusguild.org/decorations/{slug}.png` (thumbnails: `thumbs/{slug}.webp`), cached for a week. They come from the versioned `avatar-decorations` package in Gitea's package registry, installed by the matrix repo's LXC 106 deploy (see its README, "Avatar decorations"). To add or replace decorations, publish a new package version there, then update the catalog in `avatarDecorations.ts`. They used to be served from Nextcloud (matrix #22). `` elements load cross-origin freely, so no CORS headers are needed. **Module-level cache with in-flight deduplication:** `useAvatarDecoration(userId)` fetches the profile field once per user per session. A `Map` cache prevents redundant requests; a second `pending` waiters map ensures multiple components requesting the same userId simultaneously share one HTTP request rather than firing duplicates. diff --git a/package-lock.json b/package-lock.json index da81dbbf9..87ccce8b4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -81,7 +81,7 @@ }, "devDependencies": { "@axe-core/playwright": "4.13.0", - "@lotusguild/element-call-embedded": "0.25.0-lotus.25", + "@lotusguild/element-call-embedded": "0.25.0-lotus.26", "@playwright/test": "1.63.0", "@rollup/plugin-inject": "5.0.5", "@rollup/plugin-wasm": "6.2.2", @@ -2695,9 +2695,9 @@ "integrity": "sha512-dfLbk+PwWvFzSxwk3n5ySL0hfBog779o8h68wK/7/APo/7cgyWp5jcXockbxdk5kFRkbeXWm4Fbi9FrdN381sA==" }, "node_modules/@lotusguild/element-call-embedded": { - "version": "0.25.0-lotus.25", - "resolved": "https://code.lotusguild.org/api/packages/LotusGuild/npm/%40lotusguild%2Felement-call-embedded/-/0.25.0-lotus.25/element-call-embedded-0.25.0-lotus.25.tgz", - "integrity": "sha512-Vvw6B+QoG0/qFJcBzhlAbE+vnk83DikpeeF2xbygpoHfmG9r1H/mS47V91jAMH2vmNbGiALwFlLbJjEET43A2g==", + "version": "0.25.0-lotus.26", + "resolved": "https://code.lotusguild.org/api/packages/LotusGuild/npm/%40lotusguild%2Felement-call-embedded/-/0.25.0-lotus.26/element-call-embedded-0.25.0-lotus.26.tgz", + "integrity": "sha512-u0gFV/ne61MHVkl2JFY6TjC0C/vY2oYTz6dFaDtAmdLUBH6gU+6ar0QOr5xs9bhr4+HT8CSBibU8mLTR+ByjKA==", "dev": true }, "node_modules/@matrix-org/matrix-sdk-crypto-wasm": { diff --git a/package.json b/package.json index 66da31d52..406f70ecd 100644 --- a/package.json +++ b/package.json @@ -108,7 +108,7 @@ }, "devDependencies": { "@axe-core/playwright": "4.13.0", - "@lotusguild/element-call-embedded": "0.25.0-lotus.25", + "@lotusguild/element-call-embedded": "0.25.0-lotus.26", "@playwright/test": "1.63.0", "@rollup/plugin-inject": "5.0.5", "@rollup/plugin-wasm": "6.2.2", diff --git a/src/app/features/lotus/avatarDecorations.ts b/src/app/features/lotus/avatarDecorations.ts index b2debb6a3..c0a7c5b5f 100644 --- a/src/app/features/lotus/avatarDecorations.ts +++ b/src/app/features/lotus/avatarDecorations.ts @@ -3,8 +3,10 @@ // of this file at runtime (by regex) instead of re-declaring it, so the two can // never drift. If you migrate the CDN, change it here ONLY — keep the // `export const DECORATION_CDN = '...'` shape so the sync script can still parse it. -export const DECORATION_CDN = - 'https://drive.lotusguild.org/public.php/dav/files/bHswJ9pNKp2t26N/cinny-decorations'; +// matrix #22: static files on chat.lotusguild.org (a versioned package installed +// by the matrix repo's LXC 106 deploy), not Nextcloud's public DAV. Absolute, so +// the desktop app and the Element Call fork's origin allowlist both work. +export const DECORATION_CDN = 'https://chat.lotusguild.org/decorations'; // Runtime base. A deployment can repoint the decorations at a different host // without editing the catalog literal above (which scripts/syncDecorations.mjs