INNER CODE UNIT · Go
func
tulir/whatsmeow · appstate.go:31
func (cli *Client) FetchAppState(ctx context.Context, name appstate.WAPatchName, fullSync, onlyIfNotSynced bool) error {
eventsToDispatch, err := cli.fetchAppState(ctx, name, fullSync, onlyIfNotSynced)
if err != nil {
return err
}
for _, evt := range eventsToDispatch {
cli.dispatchEvent(evt)
}
return nil
}
func (cli *Client) fetchAppState(ctx context.Context, name appstate.WAPatchName, fullSync, onlyIfNotSynced bool) ([]any, error) {
if cli == nil {
return nil, ErrClientIsNil
}
cli.appStateSyncLock.Lock()
defer cli.appStateSyncLock.Unlock()
if until := cli.appStateBackoff[name]; time.Now().Before(until) {