Notify ditto activity when restarting long polling

This commit is contained in:
Tulir Asokan 2023-07-10 19:52:03 +03:00
parent fc0882f285
commit 43ec0da6e9

View file

@ -71,6 +71,14 @@ func (r *RPC) ListenReceiveMessages(payload []byte) {
}
r.client.Logger.Debug().Int("statusCode", resp.StatusCode).Msg("Long polling opened")
r.conn = resp.Body
if r.client.authData.DevicePair != nil {
go func() {
err := r.client.Session.NotifyDittoActivity()
if err != nil {
r.client.Logger.Err(err).Msg("Error notifying ditto activity")
}
}()
}
r.startReadingData(resp.Body)
}
}