feat_: Allow to set light client
This commit is contained in:
parent
e1f61515ef
commit
f48f9cccc6
|
@ -786,3 +786,8 @@ func GetNodeConfigFromDB(db *sql.DB) (*params.NodeConfig, error) {
|
||||||
|
|
||||||
return loadNodeConfig(tx)
|
return loadNodeConfig(tx)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func SetLightClient(db *sql.DB, enabled bool) error {
|
||||||
|
_, err := db.Exec(`UPDATE wakuv2_config SET light_client = ?`, enabled)
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
package protocol
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/status-im/status-go/nodecfg"
|
||||||
|
"github.com/status-im/status-go/protocol/requests"
|
||||||
|
)
|
||||||
|
|
||||||
|
func (m *Messenger) SetLightClient(request *requests.SetLightClient) error {
|
||||||
|
return nodecfg.SetLightClient(m.database, request.Enabled)
|
||||||
|
}
|
|
@ -0,0 +1,5 @@
|
||||||
|
package requests
|
||||||
|
|
||||||
|
type SetLightClient struct {
|
||||||
|
Enabled bool `json:"enabled"`
|
||||||
|
}
|
|
@ -1685,6 +1685,10 @@ func (api *PublicAPI) SyncChat(request *requests.SyncChat) error {
|
||||||
return api.service.messenger.SyncChat(request)
|
return api.service.messenger.SyncChat(request)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (api *PublicAPI) SetLightClient(request *requests.SetLightClient) error {
|
||||||
|
return api.service.messenger.SetLightClient(request)
|
||||||
|
}
|
||||||
|
|
||||||
// -----
|
// -----
|
||||||
// HELPER
|
// HELPER
|
||||||
// -----
|
// -----
|
||||||
|
|
Loading…
Reference in New Issue