MCPcopy Create free account
hub / github.com/asternic/wuzapi / validatePrivacySetting

Function validatePrivacySetting

handlers.go:7052–7063  ·  view source on GitHub ↗

validatePrivacySetting reports whether name is a supported privacy setting and value is one of the values WhatsApp accepts for it.

(name, value string)

Source from the content-addressed store, hash-verified

7050 // Parse the timestamp and format it properly to remove monotonic clock info
7051 var formattedTime string
7052 if parsedTime, err := time.Parse("2006-01-02 15:04:05.999999999 -0700 MST", mapping.LastMessageTime); err == nil {
7053 formattedTime = parsedTime.Format(time.RFC3339Nano)
7054 } else if parsedTime, err := time.Parse(time.RFC3339Nano, mapping.LastMessageTime); err == nil {
7055 formattedTime = parsedTime.Format(time.RFC3339Nano)
7056 } else {
7057 // If parsing fails, clean up the monotonic clock part manually
7058 formattedTime = strings.Split(mapping.LastMessageTime, " m=")[0]
7059 }
7060
7061 chatInfo := ChatInfo{
7062 ChatJID: mapping.ChatJID,
7063 LastUpdated: formattedTime,
7064 }
7065 result[mapping.UserID] = append(result[mapping.UserID], chatInfo)
7066 }

Callers 2

SetPrivacySettingMethod · 0.85

Calls

no outgoing calls

Tested by 1