mirror of
https://github.com/status-im/status-desktop.git
synced 2025-01-22 04:21:44 +00:00
update statusgo
This commit is contained in:
parent
2205d57636
commit
42a31f66b3
@ -4,6 +4,7 @@ import ../../status/constants
|
|||||||
import ../../status/utils as status_utils
|
import ../../status/utils as status_utils
|
||||||
import ../../status/chat as status_chat
|
import ../../status/chat as status_chat
|
||||||
import ../../status/messages as status_messages
|
import ../../status/messages as status_messages
|
||||||
|
import ../../status/mailservers
|
||||||
import ../../status/contacts as status_contacts
|
import ../../status/contacts as status_contacts
|
||||||
import ../../status/ens as status_ens
|
import ../../status/ens as status_ens
|
||||||
import ../../status/chat/[chat, message]
|
import ../../status/chat/[chat, message]
|
||||||
@ -462,9 +463,11 @@ QtObject:
|
|||||||
proc markMessageAsSent*(self: ChatsView, chat: string, messageId: string) =
|
proc markMessageAsSent*(self: ChatsView, chat: string, messageId: string) =
|
||||||
self.messageView.markMessageAsSent(chat, messageId)
|
self.messageView.markMessageAsSent(chat, messageId)
|
||||||
|
|
||||||
|
# TODO: this method was created just to test the store functionality.
|
||||||
|
# It should be removed, once peer management is added to status-go
|
||||||
proc requestAllHistoricMessages(self: ChatsView) {.slot.} =
|
proc requestAllHistoricMessages(self: ChatsView) {.slot.} =
|
||||||
debug "Requesting messages"
|
debug "Requesting messages"
|
||||||
# TODO: the mailservers must change depending on whether we are using wakuV1 or wakuV2
|
# TODO: the mailservers must change depending on whether we are using wakuV1 or wakuV2
|
||||||
# in the meantime I'm hardcoding a specific mailserver
|
# in the meantime I'm hardcoding a specific mailserver
|
||||||
echo status_mailservers.setMailserver("16Uiu2HAmVVi6Q4j7MAKVibquW8aA27UNrA4Q8Wkz9EetGViu8ZF1")
|
echo self.status.mailservers.setMailserver("16Uiu2HAmVVi6Q4j7MAKVibquW8aA27UNrA4Q8Wkz9EetGViu8ZF1")
|
||||||
echo status_mailservers.requestAllHistoricMessages()
|
echo self.status.mailservers.requestAllHistoricMessages()
|
||||||
|
@ -27,15 +27,15 @@ QtObject:
|
|||||||
proc setFleet*(self: Fleets, newFleet: string) {.slot.} =
|
proc setFleet*(self: Fleets, newFleet: string) {.slot.} =
|
||||||
discard self.status.settings.saveSetting(Setting.Fleet, newFleet)
|
discard self.status.settings.saveSetting(Setting.Fleet, newFleet)
|
||||||
let fleet = parseEnum[Fleet](newFleet)
|
let fleet = parseEnum[Fleet](newFleet)
|
||||||
let installationId = status_settings.getSetting[string](Setting.InstallationId)
|
let installationId = self.status.settings.getSetting[:string](Setting.InstallationId)
|
||||||
let updatedNodeConfig = status_accounts.getNodeConfig(self.status.fleet.config, installationId, $status_settings.getCurrentNetwork(), fleet)
|
let updatedNodeConfig = self.status.accounts.getNodeConfig(self.status.fleet.config, installationId, $self.status.settings.getCurrentNetwork(), fleet)
|
||||||
discard status_settings.saveSetting(Setting.NodeConfig, updatedNodeConfig)
|
discard self.status.settings.saveSetting(Setting.NodeConfig, updatedNodeConfig)
|
||||||
let isWakuV2 = if fleet == WakuV2Prod or fleet == WakuV2Test: true else: false
|
let isWakuV2 = if fleet == WakuV2Prod or fleet == WakuV2Test: true else: false
|
||||||
# Updating waku version because it makes no sense for some fleets to run under wakuv1 or v2 config
|
# Updating waku version because it makes no sense for some fleets to run under wakuv1 or v2 config
|
||||||
if isWakuV2:
|
if isWakuV2:
|
||||||
status_settings.setWakuVersion(2)
|
self.status.settings.setWakuVersion(2)
|
||||||
else:
|
else:
|
||||||
status_settings.setWakuVersion(1)
|
self.status.settings.setWakuVersion(1)
|
||||||
|
|
||||||
self.fleetChanged(newFleet)
|
self.fleetChanged(newFleet)
|
||||||
quit(QuitSuccess) # quits the app TODO: change this to logout instead when supported
|
quit(QuitSuccess) # quits the app TODO: change this to logout instead when supported
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import json
|
import json, times
|
||||||
import core, ../utils
|
import core, ../utils
|
||||||
|
|
||||||
proc ping*(mailservers: seq[string], timeoutMs: int): string =
|
proc ping*(mailservers: seq[string], timeoutMs: int): string =
|
||||||
|
@ -139,3 +139,5 @@ proc setWakuVersion*(newVersion: int) =
|
|||||||
nodeConfig["NoDiscovery"] = newJBool(true)
|
nodeConfig["NoDiscovery"] = newJBool(true)
|
||||||
nodeConfig["Rendezvous"] = newJBool(false)
|
nodeConfig["Rendezvous"] = newJBool(false)
|
||||||
discard saveSetting(Setting.NodeConfig, nodeConfig)
|
discard saveSetting(Setting.NodeConfig, nodeConfig)
|
||||||
|
echo $nodeConfig
|
||||||
|
|
||||||
|
@ -16,3 +16,9 @@ proc newMailserversModel*(events: EventEmitter): MailserversModel =
|
|||||||
|
|
||||||
proc fillGaps*(self: MailserversModel, chatId: string, messageIds: seq[string]): string =
|
proc fillGaps*(self: MailserversModel, chatId: string, messageIds: seq[string]): string =
|
||||||
result = status_mailservers.fillGaps(chatId, messageIds)
|
result = status_mailservers.fillGaps(chatId, messageIds)
|
||||||
|
|
||||||
|
proc setMailserver*(self: MailserversModel, peer: string): string =
|
||||||
|
result = status_mailservers.setMailserver(peer)
|
||||||
|
|
||||||
|
proc requestAllHistoricMessages*(self: MailserversModel): string =
|
||||||
|
result = status_mailservers.requestAllHistoricMessages()
|
@ -57,3 +57,6 @@ proc getCurrentNetwork*(): Network =
|
|||||||
|
|
||||||
proc getCurrentNetwork*(self: SettingsModel): Network =
|
proc getCurrentNetwork*(self: SettingsModel): Network =
|
||||||
result = getCurrentNetwork()
|
result = getCurrentNetwork()
|
||||||
|
|
||||||
|
proc setWakuVersion*(self: SettingsModel, newVersion: int) =
|
||||||
|
libstatus_settings.setWakuVersion(newVersion)
|
@ -5,6 +5,7 @@ from times import cpuTime
|
|||||||
|
|
||||||
import
|
import
|
||||||
../../../libstatus/settings as status_settings,
|
../../../libstatus/settings as status_settings,
|
||||||
|
../../../libstatus/chat as status_chat,
|
||||||
../../../libstatus/mailservers as status_mailservers,
|
../../../libstatus/mailservers as status_mailservers,
|
||||||
../../../libstatus/core as status_core,
|
../../../libstatus/core as status_core,
|
||||||
../../../types, ../../../fleet,
|
../../../types, ../../../fleet,
|
||||||
|
2
vendor/status-go
vendored
2
vendor/status-go
vendored
@ -1 +1 @@
|
|||||||
Subproject commit 491e2a84c4bc42a365b5e3c22fc9ca51e8719222
|
Subproject commit 003f384409b0c6471450543809e7aee568cce170
|
Loading…
x
Reference in New Issue
Block a user