From 32d26ec0ab1b7221504148ae4144707651c69fa7 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Wed, 9 Aug 2023 15:31:21 +0300 Subject: [PATCH] Add support for round video messages --- portal.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/portal.go b/portal.go index a0f1f8f2..fa30ee73 100644 --- a/portal.go +++ b/portal.go @@ -410,7 +410,7 @@ func containsSupportedMessage(waMsg *waProto.Message) bool { return false } return waMsg.Conversation != nil || waMsg.ExtendedTextMessage != nil || waMsg.ImageMessage != nil || - waMsg.StickerMessage != nil || waMsg.AudioMessage != nil || waMsg.VideoMessage != nil || + waMsg.StickerMessage != nil || waMsg.AudioMessage != nil || waMsg.VideoMessage != nil || waMsg.PtvMessage != nil || waMsg.DocumentMessage != nil || waMsg.ContactMessage != nil || waMsg.LocationMessage != nil || waMsg.LiveLocationMessage != nil || waMsg.GroupInviteMessage != nil || waMsg.ContactsArrayMessage != nil || waMsg.HighlyStructuredMessage != nil || waMsg.TemplateMessage != nil || waMsg.TemplateButtonReplyMessage != nil || @@ -429,6 +429,8 @@ func getMessageType(waMsg *waProto.Message) string { return fmt.Sprintf("sticker %s", waMsg.GetStickerMessage().GetMimetype()) case waMsg.VideoMessage != nil: return fmt.Sprintf("video %s", waMsg.GetVideoMessage().GetMimetype()) + case waMsg.PtvMessage != nil: + return fmt.Sprintf("round video %s", waMsg.GetPtvMessage().GetMimetype()) case waMsg.AudioMessage != nil: return fmt.Sprintf("audio %s", waMsg.GetAudioMessage().GetMimetype()) case waMsg.DocumentMessage != nil: @@ -578,6 +580,8 @@ func (portal *Portal) convertMessage(intent *appservice.IntentAPI, source *User, return portal.convertMediaMessage(intent, source, info, waMsg.GetStickerMessage(), "sticker", isBackfill) case waMsg.VideoMessage != nil: return portal.convertMediaMessage(intent, source, info, waMsg.GetVideoMessage(), "video attachment", isBackfill) + case waMsg.PtvMessage != nil: + return portal.convertMediaMessage(intent, source, info, waMsg.GetPtvMessage(), "video message", isBackfill) case waMsg.AudioMessage != nil: typeName := "audio attachment" if waMsg.GetAudioMessage().GetPtt() {