connector/tomatrix: handle circular videos
Signed-off-by: Sumner Evans <sumner.evans@automattic.com>
This commit is contained in:
@@ -322,8 +322,14 @@ func (c *TelegramClient) convertMediaRequiringUpload(ctx context.Context, portal
|
|||||||
case *tg.DocumentAttributeVideo:
|
case *tg.DocumentAttributeVideo:
|
||||||
content.MsgType = event.MsgVideo
|
content.MsgType = event.MsgVideo
|
||||||
transferer = transferer.WithVideo(a)
|
transferer = transferer.WithVideo(a)
|
||||||
|
|
||||||
|
extraInfo["fi.mau.telegram.round_message"] = true
|
||||||
|
extraInfo["duration"] = int(a.Duration * 1000)
|
||||||
case *tg.DocumentAttributeAudio:
|
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{
|
content.MSC1767Audio = &event.MSC1767Audio{
|
||||||
Duration: a.Duration * 1000,
|
Duration: a.Duration * 1000,
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user