diff --git a/src/app/boot/app_controller.nim b/src/app/boot/app_controller.nim index c5ac3baf7b..ca43afaf30 100644 --- a/src/app/boot/app_controller.nim +++ b/src/app/boot/app_controller.nim @@ -20,7 +20,6 @@ import ../../app_service/service/privacy/service as privacy_service import ../../app_service/service/provider/service as provider_service import ../../app_service/service/ens/service as ens_service -import ../core/local_account_settings import ../../app_service/service/profile/service as profile_service import ../../app_service/service/settings/service as settings_service import ../../app_service/service/about/service as about_service @@ -45,7 +44,6 @@ import ../wallet/v1/core as wallet import ../wallet/v2/core as walletV2 import ../node/core as node import ../utilsView/core as utilsView -import ../provider/core as provider import ../keycard/core as keycard import status/types/[account, setting] ################################################# @@ -118,7 +116,6 @@ type chat: ChatController node: NodeController utilsController: UtilsController - provider: Web3ProviderController keycard: KeycardController ################################################# @@ -145,7 +142,6 @@ proc connect(self: AppController) = self.profile.init(args.account) self.wallet.init() self.wallet2.init() - self.provider.init() self.chat.init() self.utilsController.init() self.node.init() @@ -236,7 +232,6 @@ proc newAppController*(statusFoundation: StatusFoundation): AppController = result.chat = chat.newController(statusFoundation.status, statusFoundation, OPENURI) result.node = node.newController(statusFoundation) result.utilsController = utilsView.newController(statusFoundation.status, statusFoundation) - result.provider = provider.newController(statusFoundation.status) result.keycard = keycard.newController(statusFoundation.status) result.connect() ################################################# @@ -270,7 +265,6 @@ proc delete*(self: AppController) = self.chat.delete self.node.delete self.utilsController.delete - self.provider.delete self.keycard.delete ################################################# @@ -301,7 +295,6 @@ proc startupDidLoad*(self: AppController) = singletonInstance.engine.setRootContextProperty("chatsModel", self.chat.variant) singletonInstance.engine.setRootContextProperty("nodeModel", self.node.variant) singletonInstance.engine.setRootContextProperty("utilsModel", self.utilsController.variant) - singletonInstance.engine.setRootContextProperty("web3Provider", self.provider.variant) singletonInstance.engine.setRootContextProperty("keycardModel", self.keycard.variant) ################################################# @@ -329,14 +322,7 @@ proc start*(self: AppController) = self.startupModule.load() -proc load*(self: AppController) = - ################################################# - # Once SettingService gets added, `pubKey` should be fetched from there, instead the following line: - let pubKey = self.statusFoundation.status.settings.getSetting[:string](Setting.PublicKey, "0x0") - singletonInstance.localAccountSensitiveSettings.setFileName(pubKey) - singletonInstance.engine.setRootContextProperty("localAccountSensitiveSettings", self.localAccountSensitiveSettingsVariant) - ################################################# - +proc load(self: AppController) = self.settingService.init() self.contactsService.init() self.chatService.init() @@ -351,6 +337,13 @@ proc load*(self: AppController) = self.transactionService.init() self.languageService.init() + ################################################# + # Once SettingService gets added, `pubKey` should be fetched from there, instead the following line: + let pubKey = self.settingsService.getPubKey() + singletonInstance.localAccountSensitiveSettings.setFileName(pubKey) + singletonInstance.engine.setRootContextProperty("localAccountSensitiveSettings", self.localAccountSensitiveSettingsVariant) + ################################################# + # other global instances self.buildAndRegisterLocalAccountSensitiveSettings() self.buildAndRegisterUserProfile() diff --git a/src/app/core/signals/remote_signals/mailserver.nim b/src/app/core/signals/remote_signals/mailserver.nim index d51bc9e405..55e7c49470 100644 --- a/src/app/core/signals/remote_signals/mailserver.nim +++ b/src/app/core/signals/remote_signals/mailserver.nim @@ -14,12 +14,22 @@ type MailserverRequestExpiredSignal* = ref object of Signal # TODO type HistoryRequestStartedSignal* = ref object of Signal + requestId*: string + numBatches*: int + +type HistoryRequestBatchProcessedSignal* = ref object of Signal + requestId*: string + batchIndex*: int + numBatches*: int + type HistoryRequestCompletedSignal* = ref object of Signal + requestId*: string + type HistoryRequestFailedSignal* = ref object of Signal + requestId*: string errorMessage*: string error*: bool - proc fromEvent*(T: type MailserverRequestCompletedSignal, jsonSignal: JsonNode): MailserverRequestCompletedSignal = result = MailserverRequestCompletedSignal() result.signalType = SignalType.MailserverRequestCompleted @@ -38,14 +48,25 @@ proc fromEvent*(T: type MailserverRequestExpiredSignal, jsonSignal: JsonNode): M proc fromEvent*(T: type HistoryRequestStartedSignal, jsonSignal: JsonNode): HistoryRequestStartedSignal = result = HistoryRequestStartedSignal() result.signalType = SignalType.HistoryRequestStarted + result.requestId = jsonSignal["event"]{"requestId"}.getStr() + result.numBatches = jsonSIgnal["event"]{"numBatches"}.getInt() + +proc fromEvent*(T: type HistoryRequestBatchProcessedSignal, jsonSignal: JsonNode): HistoryRequestBatchProcessedSignal = + result = HistoryRequestBatchProcessedSignal() + result.signalType = SignalType.HistoryRequestBatchProcessed + result.requestId = jsonSignal["event"]{"requestId"}.getStr() + result.batchIndex = jsonSIgnal["event"]{"batchIndex"}.getInt() + result.numBatches = jsonSIgnal["event"]{"numBatches"}.getInt() proc fromEvent*(T: type HistoryRequestCompletedSignal, jsonSignal: JsonNode): HistoryRequestCompletedSignal = result = HistoryRequestCompletedSignal() result.signalType = SignalType.HistoryRequestCompleted + result.requestId = jsonSignal["event"]{"requestId"}.getStr() proc fromEvent*(T: type HistoryRequestFailedSignal, jsonSignal: JsonNode): HistoryRequestFailedSignal = result = HistoryRequestFailedSignal() result.signalType = SignalType.HistoryRequestStarted + result.requestId = jsonSignal["event"]{"requestId"}.getStr() if jsonSignal["event"].kind != JNull: result.errorMessage = jsonSignal["event"]{"errorMessage"}.getStr() result.error = result.errorMessage != "" diff --git a/src/app/core/signals/remote_signals/signal_type.nim b/src/app/core/signals/remote_signals/signal_type.nim index c20bea5af7..ba550f5e2a 100644 --- a/src/app/core/signals/remote_signals/signal_type.nim +++ b/src/app/core/signals/remote_signals/signal_type.nim @@ -25,6 +25,7 @@ type SignalType* {.pure.} = enum HistoryRequestStarted = "history.request.started" HistoryRequestCompleted = "history.request.completed" HistoryRequestFailed = "history.request.failed" + HistoryRequestBatchProcessed = "history.request.batch.processed" KeycardConnected = "keycard.connected" Unknown diff --git a/src/app/core/signals/signals_manager.nim b/src/app/core/signals/signals_manager.nim index 5ad6e067dc..165c498f81 100644 --- a/src/app/core/signals/signals_manager.nim +++ b/src/app/core/signals/signals_manager.nim @@ -80,6 +80,7 @@ QtObject: of SignalType.HistoryRequestCompleted: HistoryRequestCompletedSignal.fromEvent(jsonSignal) of SignalType.HistoryRequestStarted: HistoryRequestStartedSignal.fromEvent(jsonSignal) of SignalType.HistoryRequestFailed: HistoryRequestFailedSignal.fromEvent(jsonSignal) + of SignalType.HistoryRequestBatchProcessed: HistoryRequestBatchProcessedSignal.fromEvent(jsonSignal) of SignalType.KeycardConnected: KeycardConnectedSignal.fromEvent(jsonSignal) else: Signal() diff --git a/src/app/modules/main/profile_section/profile/controller.nim b/src/app/modules/main/profile_section/profile/controller.nim index 2b00b609a4..b6c76b98b8 100644 --- a/src/app/modules/main/profile_section/profile/controller.nim +++ b/src/app/modules/main/profile_section/profile/controller.nim @@ -1,6 +1,6 @@ import ./controller_interface -import ../../../../core/global_singleton +import ../../../../global/global_singleton import ../../../../../app_service/service/profile/service as profile_service import ../../../../../app_service/service/accounts/service as accounts_service import ../../../../../app_service/service/settings/service as settings_service diff --git a/src/app/profile/view.nim b/src/app/profile/view.nim index 07d2ed8585..8315a0d1ad 100644 --- a/src/app/profile/view.nim +++ b/src/app/profile/view.nim @@ -172,12 +172,6 @@ QtObject: QtProperty[QVariant] mutedChats: read = getMutedChats - proc setSendUserStatus*(self: ProfileView, sendUserStatus: bool) {.slot.} = - if (sendUserStatus == self.profile.sendUserStatus): - return - self.profile.setSendUserStatus(sendUserStatus) - self.status.saveSetting(Setting.SendUserStatus, sendUserStatus) - proc showOSNotification*(self: ProfileView, title: string, message: string, notificationType: int, useOSNotifications: bool) {.slot.} = discard diff --git a/src/app_service/service/token/async_tasks.nim b/src/app_service/service/token/async_tasks.nim index afb1a26498..26280ef12e 100644 --- a/src/app_service/service/token/async_tasks.nim +++ b/src/app_service/service/token/async_tasks.nim @@ -1,6 +1,6 @@ # include strformat, json include ../../common/json_utils -include ../../tasks/common +include ../../../app/core/tasks/common import status/[utils, tokens] ################################################# diff --git a/src/app_service/service/token/service.nim b/src/app_service/service/token/service.nim index b62c8a7898..6c7235462d 100644 --- a/src/app_service/service/token/service.nim +++ b/src/app_service/service/token/service.nim @@ -6,7 +6,7 @@ from web3/conversions import `$` import status/statusgo_backend_new/custom_tokens as custom_tokens import ../setting/service as setting_service import ../settings/service as settings_service - +import ../../../app/core/tasks/[qt, threadpool] import ./dto, ./static_token export dto @@ -14,9 +14,6 @@ export dto logScope: topics = "token-service" -import ../../../app_service/[main] -import ../../../app_service/tasks/[qt, threadpool] - include async_tasks # Signals which may be emitted by this service: diff --git a/ui/StatusQ b/ui/StatusQ index eed0b83a2d..7eadd201d7 160000 --- a/ui/StatusQ +++ b/ui/StatusQ @@ -1 +1 @@ -Subproject commit eed0b83a2dce8a69e97fa3e16c72eb4460024835 +Subproject commit 7eadd201d7aa69053c740a517ac080a5f4cc48d9 diff --git a/vendor/status-lib b/vendor/status-lib index 41e12c0e3c..2c7f2efe88 160000 --- a/vendor/status-lib +++ b/vendor/status-lib @@ -1 +1 @@ -Subproject commit 41e12c0e3c12a444893ee20e1266fd4f30b561c5 +Subproject commit 2c7f2efe88a6348907dfed9f9697f0f818a9abfe