From f076376caac261a7a7df2bed3ca08a84231780e0 Mon Sep 17 00:00:00 2001 From: Sumner Evans Date: Mon, 21 Oct 2024 15:55:45 -0600 Subject: [PATCH] connector/tomatrix: handle circular videos Signed-off-by: Sumner Evans --- pkg/connector/tomatrix.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pkg/connector/tomatrix.go b/pkg/connector/tomatrix.go index 8837157d..4e43e973 100644 --- a/pkg/connector/tomatrix.go +++ b/pkg/connector/tomatrix.go @@ -322,8 +322,14 @@ func (c *TelegramClient) convertMediaRequiringUpload(ctx context.Context, portal case *tg.DocumentAttributeVideo: content.MsgType = event.MsgVideo transferer = transferer.WithVideo(a) + + extraInfo["fi.mau.telegram.round_message"] = true + extraInfo["duration"] = int(a.Duration * 1000) case *tg.DocumentAttributeAudio: - content.MsgType = event.MsgAudio + if content.MsgType != event.MsgVideo { + content.MsgType = event.MsgAudio + extraInfo["duration"] = int(a.Duration * 1000) // only set the duration is not already set by the video handling logic + } content.MSC1767Audio = &event.MSC1767Audio{ Duration: a.Duration * 1000, }