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)