Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { toast } from "sonner";

import {
formatVoiceNoteDuration,
isVoiceNoteAttachment,
nextVoiceNotePlaybackRate,
resolveAudioAttachment,
summarizeWaveform,
Expand Down Expand Up @@ -51,7 +52,10 @@ export function renderAudioMessageAttachment(
) {
const attachment = resolveAudioAttachment(entry, href, label);
return attachment ? (
<AudioMessageAttachment {...attachment} downloadUrl={downloadUrl} />
<AudioMessageAttachment
{...attachment}
downloadUrl={isVoiceNoteAttachment(entry) ? undefined : downloadUrl}
/>
) : null;
}

Expand Down
33 changes: 33 additions & 0 deletions desktop/tests/e2e/voice-note.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,39 @@ test("generic audio retains the relay-native download action", async ({
});
});

test("voice notes omit the relay-native download action", async ({ page }) => {
const audioUrl = `http://localhost:3000/media/${"e".repeat(64)}.mp4`;
await page.goto("/");
await page.getByTestId("channel-general").click();
await waitForMockLiveSubscription(page, "general");
await page.evaluate(
({ href }) => {
const emit = window.__BUZZ_E2E_EMIT_MOCK_MESSAGE__;
if (!emit) throw new Error("Mock message emitter is unavailable.");
emit({
channelName: "general",
content: `[voice-note-123.mp4](${href})`,
extraTags: [
[
"imeta",
`url ${href}`,
"m video/mp4",
"duration 9.4",
"filename voice-note-123.mp4",
],
],
});
},
{ href: audioUrl },
);

const card = page.getByTestId("audio-message-attachment").last();
await expect(card).toBeVisible();
await expect(
card.getByRole("button", { name: "Download voice-note-123.mp4" }),
).toHaveCount(0);
});

test("hard-caps audio work and cancels active and queued loads on unmount", async ({
page,
}) => {
Expand Down
Loading