From 7c9483bc2b50cd32f3724d59c04511de12e4d549 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Mon, 11 Mar 2024 17:09:02 +0200 Subject: [PATCH] Fix Matrix voice message check --- CHANGELOG.md | 1 + portal.go | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4802988..e874457 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ be online. Google Fi cloud sync is still not supported. * Added deduplication for DM participants, as Google randomly sends duplicate participant entries sometimes. +* Added voice message conversion. * Changed custom image reactions to be bridged as `:custom:` instead of a UUID. Google Messages for Web doesn't support fetching the actual image yet. * Fixed sending reactions breaking for some users. diff --git a/portal.go b/portal.go index 84a8523..1c91767 100644 --- a/portal.go +++ b/portal.go @@ -1985,8 +1985,8 @@ func (portal *Portal) reuploadMedia(ctx context.Context, sender *User, content * if content.FileName != "" { fileName = content.FileName } - isVoice, ok := raw["org.matrix.msc3245.voice"].(bool) - if ok && isVoice { + _, isVoice := raw["org.matrix.msc3245.voice"] + if isVoice { data, err = ffmpeg.ConvertBytes(ctx, data, ".m4a", []string{}, []string{"-c:a", "aac"}, content.Info.MimeType) if err != nil { return nil, fmt.Errorf("%w (ogg to m4a): %w", errMediaConvertFailed, err)