fix: getNodeConfig

This commit is contained in:
Richard Ramos 2021-07-20 13:23:43 -04:00 committed by Iuri Matias
parent 42a31f66b3
commit d8053f5291
6 changed files with 17 additions and 7 deletions

View File

@ -469,5 +469,5 @@ QtObject:
debug "Requesting messages"
# TODO: the mailservers must change depending on whether we are using wakuV1 or wakuV2
# in the meantime I'm hardcoding a specific mailserver
echo self.status.mailservers.setMailserver("16Uiu2HAmVVi6Q4j7MAKVibquW8aA27UNrA4Q8Wkz9EetGViu8ZF1")
echo self.status.mailservers.setMailserver("16Uiu2HAm4v86W3bmT1BiH6oSPzcsSr24iDQpSN5Qa992BCjjwgrD")
echo self.status.mailservers.requestAllHistoricMessages()

View File

@ -85,5 +85,9 @@ QtObject:
proc init*(self: NodeView) {.slot.} =
self.wakuBloomFilterMode = self.status.settings.getSetting[:bool](Setting.WakuBloomFilterMode)
proc wakuVersion*(self: NodeView): int {.slot.} =
var fleetStr = self.status.settings.getSetting[:string](Setting.Fleet)
let fleet = parseEnum[Fleet](fleetStr)
let isWakuV2 = if fleet == WakuV2Prod or fleet == WakuV2Test: true else: false
if isWakuV2: return 2
return 1

View File

@ -194,8 +194,7 @@ proc setupAccount*(fleetConfig: FleetConfig, account: GeneratedAccount, password
let accountData = getAccountData(account)
let installationId = $genUUID()
var settingsJSON = getAccountSettings(account, constants.DEFAULT_NETWORKS, installationId)
var nodeConfig = getNodeConfig(fleetConfig, installationId, constants.DEFAULT_NETWORK_NAME, Fleet.PROD, true)
var nodeConfig = getNodeConfig(fleetConfig, installationId, constants.DEFAULT_NETWORK_NAME, Fleet.PROD, false, true)
result = saveAccountAndLogin(account, $accountData, password, $nodeConfig, $settingsJSON)
except StatusGoException as e:

View File

@ -139,5 +139,4 @@ proc setWakuVersion*(newVersion: int) =
nodeConfig["NoDiscovery"] = newJBool(true)
nodeConfig["Rendezvous"] = newJBool(false)
discard saveSetting(Setting.NodeConfig, nodeConfig)
echo $nodeConfig

View File

@ -53,6 +53,13 @@ StatusPopupMenu {
visible: viewProfileMenuItem.enabled
}
Action {
enabled: profileModel.fleets.fleet == Constants.waku_prod || profileModel.fleets.fleet == Constants.waku_test
text: qsTr("Test WakuV2 - requestAllHistoricMessages")
onTriggered: chatsModel.requestAllHistoricMessages()
}
StatusMenuItem {
text: chatItem && chatItem.muted ?
//% "Unmute chat"

View File

@ -137,6 +137,7 @@ Item {
StatusSettingsLineButton {
//% "Waku Bloom Mode"
visible: profileModel.fleets.fleet != Constants.waku_prod && profileModel.fleets.fleet != Constants.waku_test
text: qsTrId("waku-bloom-mode")
isSwitch: true
switchChecked: nodeModel.wakuBloomFilterMode
@ -152,7 +153,7 @@ Item {
id: confirmDialog
//% "Warning!"
title: qsTrId("close-app-title")
confirmationText: qsTrId("The account will be logged out. When you login again, the selected mode will be enabled")
confirmationText: qsTr("The account will be logged out. When you login again, the selected mode will be enabled")
onConfirmButtonClicked: {
nodeModel.setWakuBloomFilterMode(bloomFilterMode)
}