ios: advanced network settings (#873)

* ios: advanced network settings

* save network config

* update network settins, set in NSE

* update UI, update simplexmq

* show advanced network settings only with dev tools on
This commit is contained in:
Evgeny Poberezkin
2022-08-03 15:36:51 +04:00
committed by GitHub
parent e39f9bc251
commit 0fe7e64989
12 changed files with 322 additions and 11 deletions
+5 -2
View File
@@ -296,8 +296,10 @@ func getNetworkConfig() async throws -> NetCfg? {
throw r
}
func setNetworkConfig(cfg: NetCfg) async throws {
try await sendCommandOkResp(.apiSetNetworkConfig(networkConfig: cfg))
func setNetworkConfig(_ cfg: NetCfg) throws {
let r = chatSendCmdSync(.apiSetNetworkConfig(networkConfig: cfg))
if case .cmdOk = r { return }
throw r
}
func apiContactInfo(contactId: Int64) async throws -> ConnectionStats? {
@@ -657,6 +659,7 @@ func initializeChat(start: Bool) throws {
func startChat() throws {
logger.debug("startChat")
let m = ChatModel.shared
try setNetworkConfig(getNetCfg())
let justStarted = try apiStartChat()
if justStarted {
m.userAddress = try apiGetUserAddress()