forked from asternic/wuzapi
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconstants.go
More file actions
91 lines (76 loc) · 1.52 KB
/
constants.go
File metadata and controls
91 lines (76 loc) · 1.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
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]
}