diff --git a/.github/workflows/prod-deploy.yml b/.github/workflows/prod-deploy.yml index 24edda96..7b58f56f 100644 --- a/.github/workflows/prod-deploy.yml +++ b/.github/workflows/prod-deploy.yml @@ -52,7 +52,7 @@ jobs: gpg --export | xxd -p echo '${{ secrets.GNUPG_PASSPHRASE }}' | gpg --batch --yes --pinentry-mode loopback --passphrase-fd 0 --armor --detach-sign cinny-${{ steps.vars.outputs.tag }}.tar.gz - name: Upload tagged release - uses: softprops/action-gh-release@72f2c25fcb47643c292f7107632f7a47c1df5cd8 + uses: softprops/action-gh-release@6cbd405e2c4e67a21c47fa9e383d020e4e28b836 with: files: | cinny-${{ steps.vars.outputs.tag }}.tar.gz @@ -70,7 +70,7 @@ jobs: - name: Set up QEMU uses: docker/setup-qemu-action@v3.6.0 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3.10.0 + uses: docker/setup-buildx-action@v3.11.1 - name: Login to Docker Hub uses: docker/login-action@v3.5.0 with: diff --git a/Dockerfile b/Dockerfile index 718fed72..46d0db6e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,7 +11,7 @@ RUN npm run build ## App -FROM nginx:1.29.0-alpine +FROM nginx:1.29.1-alpine COPY --from=builder /src/dist /app COPY --from=builder /src/docker-nginx.conf /etc/nginx/conf.d/default.conf diff --git a/package-lock.json b/package-lock.json index 207b3648..da7e271f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "cinny", - "version": "4.10.0", + "version": "4.10.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "cinny", - "version": "4.10.0", + "version": "4.10.1", "license": "AGPL-3.0-only", "dependencies": { "@atlaskit/pragmatic-drag-and-drop": "1.1.6", @@ -43,7 +43,7 @@ "jotai": "2.6.0", "linkify-react": "4.1.3", "linkifyjs": "4.1.3", - "matrix-js-sdk": "37.5.0", + "matrix-js-sdk": "38.2.0", "millify": "6.1.0", "pdfjs-dist": "4.2.67", "prismjs": "1.30.0", @@ -2257,20 +2257,14 @@ } }, "node_modules/@matrix-org/matrix-sdk-crypto-wasm": { - "version": "14.1.0", - "resolved": "https://registry.npmjs.org/@matrix-org/matrix-sdk-crypto-wasm/-/matrix-sdk-crypto-wasm-14.1.0.tgz", - "integrity": "sha512-vcSxHJIr6lP0Fgo8jl0sTHg+OZxZn+skGjiyB62erfgw/R2QqJl0ZVSY8SRcbk9LtHo/ZGld1tnaOyjL2e3cLQ==", + "version": "15.3.0", + "resolved": "https://registry.npmjs.org/@matrix-org/matrix-sdk-crypto-wasm/-/matrix-sdk-crypto-wasm-15.3.0.tgz", + "integrity": "sha512-QyxHvncvkl7nf+tnn92PjQ54gMNV8hMSpiukiDgNrqF6IYwgySTlcSdkPYdw8QjZJ0NR6fnVrNzMec0OohM3wA==", "license": "Apache-2.0", "engines": { "node": ">= 18" } }, - "node_modules/@matrix-org/olm": { - "version": "3.2.15", - "resolved": "https://registry.npmjs.org/@matrix-org/olm/-/olm-3.2.15.tgz", - "integrity": "sha512-S7lOrndAK9/8qOtaTq/WhttJC/o4GAzdfK0MUPpo8ApzsJEC0QjtwrkC3KBXdFP1cD1MXi/mlKR7aaoVMKgs6Q==", - "license": "Apache-2.0" - }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", @@ -8632,14 +8626,13 @@ "license": "Apache-2.0" }, "node_modules/matrix-js-sdk": { - "version": "37.5.0", - "resolved": "https://registry.npmjs.org/matrix-js-sdk/-/matrix-js-sdk-37.5.0.tgz", - "integrity": "sha512-5tyuAi5hnKud1UkVq8Z2/3c22hWGELBZzErJPZkE6Hju2uGUfGtrIx6uj6puv0ZjvsUU3X6Qgm8vdReKO1PGig==", + "version": "38.2.0", + "resolved": "https://registry.npmjs.org/matrix-js-sdk/-/matrix-js-sdk-38.2.0.tgz", + "integrity": "sha512-R3jzK8rDGi/3OXOax8jFFyxblCG9KTT5yuXAbvnZCGcpTm8lZ4mHQAn5UydVD8qiyUMNMpaaMd6/k7N+5I/yaQ==", "license": "Apache-2.0", "dependencies": { "@babel/runtime": "^7.12.5", - "@matrix-org/matrix-sdk-crypto-wasm": "^14.0.1", - "@matrix-org/olm": "3.2.15", + "@matrix-org/matrix-sdk-crypto-wasm": "^15.1.0", "another-json": "^0.2.0", "bs58": "^6.0.0", "content-type": "^1.0.4", @@ -8654,7 +8647,7 @@ "uuid": "11" }, "engines": { - "node": ">=20.0.0" + "node": ">=22.0.0" } }, "node_modules/matrix-js-sdk/node_modules/uuid": { diff --git a/package.json b/package.json index 991fbd88..a7172366 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cinny", - "version": "4.10.0", + "version": "4.10.1", "description": "Yet another matrix client", "main": "index.js", "type": "module", @@ -54,7 +54,7 @@ "jotai": "2.6.0", "linkify-react": "4.1.3", "linkifyjs": "4.1.3", - "matrix-js-sdk": "37.5.0", + "matrix-js-sdk": "38.2.0", "millify": "6.1.0", "pdfjs-dist": "4.2.67", "prismjs": "1.30.0", diff --git a/src/app/components/RenderMessageContent.tsx b/src/app/components/RenderMessageContent.tsx index 2457e5e3..4cfcb7dc 100644 --- a/src/app/components/RenderMessageContent.tsx +++ b/src/app/components/RenderMessageContent.tsx @@ -209,13 +209,11 @@ export function RenderMessageContent({ ( + renderVideoContent={({ body, info, ...props }) => ( ( diff --git a/src/app/components/message/MsgTypeRenderers.tsx b/src/app/components/message/MsgTypeRenderers.tsx index 15c95ddf..a40ecae1 100644 --- a/src/app/components/message/MsgTypeRenderers.tsx +++ b/src/app/components/message/MsgTypeRenderers.tsx @@ -224,6 +224,8 @@ type RenderVideoContentProps = { mimeType: string; url: string; encInfo?: IEncryptedFile; + markedAsSpoiler?: boolean; + spoilerReason?: string; }; type MVideoProps = { content: IVideoContent; @@ -274,6 +276,8 @@ export function MVideo({ content, renderAsFile, renderVideoContent, outlined }: mimeType: safeMimeType, url: mxcUrl, encInfo: content.file, + markedAsSpoiler: content[MATRIX_SPOILER_PROPERTY_NAME], + spoilerReason: content[MATRIX_SPOILER_REASON_PROPERTY_NAME], })} diff --git a/src/app/components/message/content/ImageContent.tsx b/src/app/components/message/content/ImageContent.tsx index cc0c0c91..84e3709e 100644 --- a/src/app/components/message/content/ImageContent.tsx +++ b/src/app/components/message/content/ImageContent.tsx @@ -214,7 +214,7 @@ export const ImageContent = as<'div', ImageContentProps>( )} {(srcState.status === AsyncStatus.Loading || srcState.status === AsyncStatus.Success) && !load && - !markedAsSpoiler && ( + !blurred && ( diff --git a/src/app/components/message/content/VideoContent.tsx b/src/app/components/message/content/VideoContent.tsx index 3b613803..52073ac1 100644 --- a/src/app/components/message/content/VideoContent.tsx +++ b/src/app/components/message/content/VideoContent.tsx @@ -3,6 +3,7 @@ import { Badge, Box, Button, + Chip, Icon, Icons, Spinner, @@ -47,6 +48,8 @@ type VideoContentProps = { info: IVideoInfo & IThumbnailContent; encInfo?: EncryptedAttachmentInfo; autoPlay?: boolean; + markedAsSpoiler?: boolean; + spoilerReason?: string; renderThumbnail?: () => ReactNode; renderVideo: (props: RenderVideoProps) => ReactNode; }; @@ -60,6 +63,8 @@ export const VideoContent = as<'div', VideoContentProps>( info, encInfo, autoPlay, + markedAsSpoiler, + spoilerReason, renderThumbnail, renderVideo, ...props @@ -72,6 +77,7 @@ export const VideoContent = as<'div', VideoContentProps>( const [load, setLoad] = useState(false); const [error, setError] = useState(false); + const [blurred, setBlurred] = useState(markedAsSpoiler ?? false); const [srcState, loadSrc] = useAsyncCallback( useCallback(async () => { @@ -114,11 +120,15 @@ export const VideoContent = as<'div', VideoContentProps>( /> )} {renderThumbnail && !load && ( - + {renderThumbnail()} )} - {!autoPlay && srcState.status === AsyncStatus.Idle && ( + {!autoPlay && !blurred && srcState.status === AsyncStatus.Idle && (