mirror of
https://github.com/cinnyapp/cinny.git
synced 2025-11-05 23:10:28 +03:00
Add authenticated media support (#1930)
* chore: Bump matrix-js-sdk to 34.4.0 * feat: Authenticated media support * chore: Use Vite PWA for service worker support * fix: Fix Vite PWA SW entry point Forget this. :P * fix: Also add Nginx rewrite for sw.js * fix: Correct Nginx rewrite * fix: Add Netlify redirect for sw.js Otherwise the generic SPA rewrite to index.html would take effect, breaking Service Worker. * fix: Account for subpath when regisering service worker * chore: Correct types
This commit is contained in:
parent
043012e809
commit
c6a8fb1117
46 changed files with 3562 additions and 487 deletions
|
|
@ -273,16 +273,26 @@ export const joinRuleToIconSrc = (
|
|||
export const getRoomAvatarUrl = (
|
||||
mx: MatrixClient,
|
||||
room: Room,
|
||||
size: 32 | 96 = 32
|
||||
): string | undefined => room.getAvatarUrl(mx.baseUrl, size, size, 'crop') ?? undefined;
|
||||
size: 32 | 96 = 32,
|
||||
useAuthentication = false
|
||||
): string | undefined => {
|
||||
const mxcUrl = room.getMxcAvatarUrl();
|
||||
return mxcUrl
|
||||
? mx.mxcUrlToHttp(mxcUrl, size, size, 'crop', undefined, false, useAuthentication) ?? undefined
|
||||
: undefined;
|
||||
};
|
||||
|
||||
export const getDirectRoomAvatarUrl = (
|
||||
mx: MatrixClient,
|
||||
room: Room,
|
||||
size: 32 | 96 = 32
|
||||
): string | undefined =>
|
||||
room.getAvatarFallbackMember()?.getAvatarUrl(mx.baseUrl, size, size, 'crop', undefined, false) ??
|
||||
undefined;
|
||||
size: 32 | 96 = 32,
|
||||
useAuthentication = false
|
||||
): string | undefined => {
|
||||
const mxcUrl = room.getAvatarFallbackMember()?.getMxcAvatarUrl();
|
||||
return mxcUrl
|
||||
? mx.mxcUrlToHttp(mxcUrl, size, size, 'crop', undefined, false, useAuthentication) ?? undefined
|
||||
: undefined;
|
||||
};
|
||||
|
||||
export const trimReplyFromBody = (body: string): string => {
|
||||
const match = body.match(/^> <.+?> .+\n(>.*\n)*?\n/m);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue