From 55577f17f64b8923e8bad1c629096cec4bc15052 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Wed, 9 Oct 2024 14:27:59 +0300 Subject: [PATCH] wamsgtype: add more known types --- go.mod | 2 +- go.sum | 4 ++-- pkg/connector/wamsgtype.go | 35 +++++++++++++++++++++++++++++++++++ 3 files changed, 38 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 9f5575e3..15d7ea31 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/rs/zerolog v1.33.0 go.mau.fi/util v0.8.1-0.20241003092848-3b49d3e0b9ee go.mau.fi/webp v0.1.0 - go.mau.fi/whatsmeow v0.0.0-20241001150013-71e7937b706a + go.mau.fi/whatsmeow v0.0.0-20241009112614-70d73b690a8d golang.org/x/exp v0.0.0-20240909161429-701f63a606c0 golang.org/x/image v0.20.0 golang.org/x/net v0.29.0 diff --git a/go.sum b/go.sum index 2588a297..d396f2fd 100644 --- a/go.sum +++ b/go.sum @@ -69,8 +69,8 @@ go.mau.fi/util v0.8.1-0.20241003092848-3b49d3e0b9ee h1:/BGpUK7fzVyFgy5KBiyP7ktED go.mau.fi/util v0.8.1-0.20241003092848-3b49d3e0b9ee/go.mod h1:L9qnqEkhe4KpuYmILrdttKTXL79MwGLyJ4EOskWxO3I= go.mau.fi/webp v0.1.0 h1:BHObH/DcFntT9KYun5pDr0Ot4eUZO8k2C7eP7vF4ueA= go.mau.fi/webp v0.1.0/go.mod h1:e42Z+VMFrUMS9cpEwGRIor+lQWO8oUAyPyMtcL+NMt8= -go.mau.fi/whatsmeow v0.0.0-20241001150013-71e7937b706a h1:6f0HGXBZiGrQMrI8MF5u0zjrdsBXLzWAneikUOhbN3E= -go.mau.fi/whatsmeow v0.0.0-20241001150013-71e7937b706a/go.mod h1:UvaXcdb8y5Mryj2LSXAMw7u4/exnWJIXn8Gvpmf6ndI= +go.mau.fi/whatsmeow v0.0.0-20241009112614-70d73b690a8d h1:0OV2Ula2IGaoHVfvv7ns+Gn3xGT0SHn5yDecJBB8FQY= +go.mau.fi/whatsmeow v0.0.0-20241009112614-70d73b690a8d/go.mod h1:UvaXcdb8y5Mryj2LSXAMw7u4/exnWJIXn8Gvpmf6ndI= go.mau.fi/zeroconfig v0.1.3 h1:As9wYDKmktjmNZW5i1vn8zvJlmGKHeVxHVIBMXsm4kM= go.mau.fi/zeroconfig v0.1.3/go.mod h1:NcSJkf180JT+1IId76PcMuLTNa1CzsFFZ0nBygIQM70= golang.org/x/crypto v0.27.0 h1:GXm2NjJrPaiv/h1tb2UH8QfgC/hOf/+z0p6PT8o1w7A= diff --git a/pkg/connector/wamsgtype.go b/pkg/connector/wamsgtype.go index 5487d5ce..75b92ab9 100644 --- a/pkg/connector/wamsgtype.go +++ b/pkg/connector/wamsgtype.go @@ -50,6 +50,12 @@ func getMessageType(waMsg *waE2E.Message) string { return "live location start" case waMsg.GroupInviteMessage != nil: return "group invite" + case waMsg.GroupMentionedMessage != nil: + return "group mention" + case waMsg.ScheduledCallCreationMessage != nil: + return "scheduled call create" + case waMsg.ScheduledCallEditMessage != nil: + return "scheduled call edit" case waMsg.ReactionMessage != nil: if waMsg.ReactionMessage.GetText() == "" { return "reaction remove" @@ -101,8 +107,35 @@ func getMessageType(waMsg *waE2E.Message) string { return "order" case waMsg.InvoiceMessage != nil: return "invoice" + case waMsg.BotInvokeMessage != nil: + return "bot invoke" case waMsg.EventMessage != nil: return "event" + case waMsg.EventCoverImage != nil: + return "event cover image" + case waMsg.EncEventResponseMessage != nil: + return "ignore" // these are ignored for now as they're not meant to be shown as new messages + //return "encrypted event response" + case waMsg.CommentMessage != nil: + return "comment" + case waMsg.EncCommentMessage != nil: + return "encrypted comment" + case waMsg.NewsletterAdminInviteMessage != nil: + return "newsletter admin invite" + case waMsg.SecretEncryptedMessage != nil: + return "secret encrypted" + case waMsg.PollResultSnapshotMessage != nil: + return "poll result snapshot" + case waMsg.MessageHistoryBundle != nil: + return "message history bundle" + case waMsg.RequestPhoneNumberMessage != nil: + return "request phone number" + case waMsg.KeepInChatMessage != nil: + return "keep in chat" + case waMsg.StatusMentionMessage != nil: + return "status mention" + case waMsg.StickerPackMessage != nil: + return "sticker pack" case waMsg.AlbumMessage != nil: return "album" // or maybe these should be ignored? case waMsg.SendPaymentMessage != nil, waMsg.RequestPaymentMessage != nil, @@ -113,6 +146,8 @@ func getMessageType(waMsg *waE2E.Message) string { return "call" case waMsg.Chat != nil: return "chat" + case waMsg.PlaceholderMessage != nil: + return "placeholder" case waMsg.SenderKeyDistributionMessage != nil, waMsg.StickerSyncRmrMessage != nil: return "ignore" default: