Files
wuzapi/constants.go
Felipe Aquino 8b80b70471
Some checks failed
Build and Test / Build Go Application (push) Has been cancelled
Publish Docker image / build-and-push (push) Has been cancelled
Update Contributors / update-contributors (push) Has been cancelled
upload
2026-03-04 10:54:04 -03:00

92 lines
1.5 KiB
Go

package main
// List of supported event types
var supportedEventTypes = []string{
// Messages and Communication
"Message",
"UndecryptableMessage",
"Receipt",
"MediaRetry",
"ReadReceipt",
// Groups and Contacts
"GroupInfo",
"JoinedGroup",
"Picture",
"BlocklistChange",
"Blocklist",
// Connection and Session
"Connected",
"Disconnected",
"ConnectFailure",
"KeepAliveRestored",
"KeepAliveTimeout",
"QRTimeout",
"LoggedOut",
"ClientOutdated",
"TemporaryBan",
"StreamError",
"StreamReplaced",
"PairSuccess",
"PairError",
"QR",
"QRScannedWithoutMultidevice",
// Privacy and Settings
"PrivacySettings",
"PushNameSetting",
"UserAbout",
// Synchronization and State
"AppState",
"AppStateSyncComplete",
"HistorySync",
"OfflineSyncCompleted",
"OfflineSyncPreview",
// Calls
"CallOffer",
"CallAccept",
"CallTerminate",
"CallOfferNotice",
"CallRelayLatency",
// Presence and Activity
"Presence",
"ChatPresence",
// Identity
"IdentityChange",
// Erros
"CATRefreshError",
// Newsletter (WhatsApp Channels)
"NewsletterJoin",
"NewsletterLeave",
"NewsletterMuteChange",
"NewsletterLiveUpdate",
// Facebook/Meta Bridge
"FBMessage",
// Special - receives all events
"All",
}
// Map for quick validation
var eventTypeMap map[string]bool
func init() {
eventTypeMap = make(map[string]bool)
for _, eventType := range supportedEventTypes {
eventTypeMap[eventType] = true
}
}
// Auxiliary function to validate event type
func isValidEventType(eventType string) bool {
return eventTypeMap[eventType]
}