diff --git a/pkg/internal/event_types/event_types.go b/pkg/internal/event_types/event_types.go index 3f7a632..8c7569a 100644 --- a/pkg/internal/event_types/event_types.go +++ b/pkg/internal/event_types/event_types.go @@ -16,6 +16,9 @@ const ( NEWSLETTER = "NEWSLETTER" QRCODE = "QRCODE" BUTTON_CLICK = "BUTTON_CLICK" + PICTURE = "PICTURE" + USER_ABOUT = "USER_ABOUT" + BUSINESS_NAME = "BUSINESS_NAME" ) var AllEventTypes = []string{ @@ -33,6 +36,9 @@ var AllEventTypes = []string{ NEWSLETTER, QRCODE, BUTTON_CLICK, + PICTURE, + USER_ABOUT, + BUSINESS_NAME, } var validEventTypes = map[string]bool{ @@ -51,6 +57,9 @@ var validEventTypes = map[string]bool{ NEWSLETTER: true, QRCODE: true, BUTTON_CLICK: true, + PICTURE: true, + USER_ABOUT: true, + BUSINESS_NAME: true, } func IsEventType(eventType string) bool { diff --git a/pkg/whatsmeow/service/whatsmeow.go b/pkg/whatsmeow/service/whatsmeow.go index 78ec6c1..949a69b 100644 --- a/pkg/whatsmeow/service/whatsmeow.go +++ b/pkg/whatsmeow/service/whatsmeow.go @@ -1898,6 +1898,15 @@ func (mycli *MyClient) myEventHandler(rawEvt interface{}) { case *events.PushName: doWebhook = true postMap["event"] = "PushName" + case *events.Picture: + doWebhook = true + postMap["event"] = "Picture" + case *events.UserAbout: + doWebhook = true + postMap["event"] = "UserAbout" + case *events.BusinessName: + doWebhook = true + postMap["event"] = "BusinessName" case *events.IdentityChange: doWebhook = false case *events.GroupInfo: @@ -2127,6 +2136,21 @@ func (w *whatsmeowService) CallWebhook(instance *instance_model.Instance, queueN w.loggerWrapper.GetLogger(instance.Id).LogInfo("[%s] Event received of type %s", instance.Id, eventType) w.sendToQueueOrWebhook(instance, queueName, jsonData) } + case "Picture": + if contains(subscriptions, "PICTURE") { + w.loggerWrapper.GetLogger(instance.Id).LogInfo("[%s] Event received of type %s", instance.Id, eventType) + w.sendToQueueOrWebhook(instance, queueName, jsonData) + } + case "UserAbout": + if contains(subscriptions, "USER_ABOUT") { + w.loggerWrapper.GetLogger(instance.Id).LogInfo("[%s] Event received of type %s", instance.Id, eventType) + w.sendToQueueOrWebhook(instance, queueName, jsonData) + } + case "BusinessName": + if contains(subscriptions, "BUSINESS_NAME") { + w.loggerWrapper.GetLogger(instance.Id).LogInfo("[%s] Event received of type %s", instance.Id, eventType) + w.sendToQueueOrWebhook(instance, queueName, jsonData) + } default: return