style: remove trailing whitespaces
This commit is contained in:
parent
914c7b2839
commit
ba7a6d5d34
|
@ -40,10 +40,10 @@ import ../global/global_singleton
|
||||||
|
|
||||||
import ../core/[main]
|
import ../core/[main]
|
||||||
|
|
||||||
type
|
type
|
||||||
AppController* = ref object of RootObj
|
AppController* = ref object of RootObj
|
||||||
statusFoundation: StatusFoundation
|
statusFoundation: StatusFoundation
|
||||||
|
|
||||||
# Global
|
# Global
|
||||||
localAppSettingsVariant: QVariant
|
localAppSettingsVariant: QVariant
|
||||||
localAccountSettingsVariant: QVariant
|
localAccountSettingsVariant: QVariant
|
||||||
|
@ -122,7 +122,7 @@ proc newAppController*(statusFoundation: StatusFoundation): AppController =
|
||||||
# Services
|
# Services
|
||||||
result.generalService = general_service.newService()
|
result.generalService = general_service.newService()
|
||||||
result.settingsService = settings_service.newService()
|
result.settingsService = settings_service.newService()
|
||||||
result.nodeConfigurationService = node_configuration_service.newService(statusFoundation.fleetConfiguration,
|
result.nodeConfigurationService = node_configuration_service.newService(statusFoundation.fleetConfiguration,
|
||||||
result.settingsService)
|
result.settingsService)
|
||||||
result.osNotificationService = os_notification_service.newService(statusFoundation.events)
|
result.osNotificationService = os_notification_service.newService(statusFoundation.events)
|
||||||
result.keychainService = keychain_service.newService(statusFoundation.events)
|
result.keychainService = keychain_service.newService(statusFoundation.events)
|
||||||
|
@ -136,12 +136,12 @@ proc newAppController*(statusFoundation: StatusFoundation): AppController =
|
||||||
result.contactsService)
|
result.contactsService)
|
||||||
result.activityCenterService = activity_center_service.newService(statusFoundation.events,
|
result.activityCenterService = activity_center_service.newService(statusFoundation.events,
|
||||||
statusFoundation.threadpool, result.chatService)
|
statusFoundation.threadpool, result.chatService)
|
||||||
result.tokenService = token_service.newService(statusFoundation.events, statusFoundation.threadpool,
|
result.tokenService = token_service.newService(statusFoundation.events, statusFoundation.threadpool,
|
||||||
result.settingsService)
|
result.settingsService)
|
||||||
result.collectibleService = collectible_service.newService(result.settingsService)
|
result.collectibleService = collectible_service.newService(result.settingsService)
|
||||||
result.walletAccountService = wallet_account_service.newService(statusFoundation.events, result.settingsService,
|
result.walletAccountService = wallet_account_service.newService(statusFoundation.events, result.settingsService,
|
||||||
result.accountsService, result.tokenService)
|
result.accountsService, result.tokenService)
|
||||||
result.transactionService = transaction_service.newService(statusFoundation.events, statusFoundation.threadpool,
|
result.transactionService = transaction_service.newService(statusFoundation.events, statusFoundation.threadpool,
|
||||||
result.walletAccountService, result.ethService, result.networkService, result.settingsService)
|
result.walletAccountService, result.ethService, result.networkService, result.settingsService)
|
||||||
result.bookmarkService = bookmark_service.newService()
|
result.bookmarkService = bookmark_service.newService()
|
||||||
result.profileService = profile_service.newService()
|
result.profileService = profile_service.newService()
|
||||||
|
@ -155,30 +155,30 @@ proc newAppController*(statusFoundation: StatusFoundation): AppController =
|
||||||
result.networkService,
|
result.networkService,
|
||||||
result.chatService
|
result.chatService
|
||||||
)
|
)
|
||||||
result.aboutService = about_service.newService(statusFoundation.events, statusFoundation.threadpool,
|
result.aboutService = about_service.newService(statusFoundation.events, statusFoundation.threadpool,
|
||||||
result.settingsService)
|
result.settingsService)
|
||||||
result.dappPermissionsService = dapp_permissions_service.newService()
|
result.dappPermissionsService = dapp_permissions_service.newService()
|
||||||
result.languageService = language_service.newService()
|
result.languageService = language_service.newService()
|
||||||
# result.mnemonicService = mnemonic_service.newService()
|
# result.mnemonicService = mnemonic_service.newService()
|
||||||
result.privacyService = privacy_service.newService(statusFoundation.events, result.settingsService,
|
result.privacyService = privacy_service.newService(statusFoundation.events, result.settingsService,
|
||||||
result.accountsService)
|
result.accountsService)
|
||||||
result.providerService = provider_service.newService(result.dappPermissionsService, result.settingsService)
|
result.providerService = provider_service.newService(result.dappPermissionsService, result.settingsService)
|
||||||
result.savedAddressService = saved_address_service.newService(statusFoundation.events)
|
result.savedAddressService = saved_address_service.newService(statusFoundation.events)
|
||||||
result.devicesService = devices_service.newService(statusFoundation.events, result.settingsService)
|
result.devicesService = devices_service.newService(statusFoundation.events, result.settingsService)
|
||||||
result.mailserversService = mailservers_service.newService(statusFoundation.events, statusFoundation.threadpool,
|
result.mailserversService = mailservers_service.newService(statusFoundation.events, statusFoundation.threadpool,
|
||||||
result.settingsService, result.nodeConfigurationService, statusFoundation.fleetConfiguration)
|
result.settingsService, result.nodeConfigurationService, statusFoundation.fleetConfiguration)
|
||||||
result.nodeService = node_service.newService(statusFoundation.events, statusFoundation.threadpool,
|
result.nodeService = node_service.newService(statusFoundation.events, statusFoundation.threadpool,
|
||||||
result.settingsService)
|
result.settingsService)
|
||||||
result.gifService = gif_service.newService(result.settingsService)
|
result.gifService = gif_service.newService(result.settingsService)
|
||||||
result.ensService = ens_service.newService(statusFoundation.events, statusFoundation.threadpool,
|
result.ensService = ens_service.newService(statusFoundation.events, statusFoundation.threadpool,
|
||||||
result.settingsService, result.walletAccountService, result.transactionService, result.ethService,
|
result.settingsService, result.walletAccountService, result.transactionService, result.ethService,
|
||||||
result.networkService, result.tokenService)
|
result.networkService, result.tokenService)
|
||||||
|
|
||||||
# Modules
|
# Modules
|
||||||
result.startupModule = startup_module.newModule[AppController](
|
result.startupModule = startup_module.newModule[AppController](
|
||||||
result,
|
result,
|
||||||
statusFoundation.events,
|
statusFoundation.events,
|
||||||
result.keychainService,
|
result.keychainService,
|
||||||
result.accountsService
|
result.accountsService
|
||||||
)
|
)
|
||||||
result.mainModule = main_module.newModule[AppController](
|
result.mainModule = main_module.newModule[AppController](
|
||||||
|
@ -228,7 +228,7 @@ proc delete*(self: AppController) =
|
||||||
self.mainModule.delete
|
self.mainModule.delete
|
||||||
self.ethService.delete
|
self.ethService.delete
|
||||||
self.languageService.delete
|
self.languageService.delete
|
||||||
|
|
||||||
self.localAppSettingsVariant.delete
|
self.localAppSettingsVariant.delete
|
||||||
self.localAccountSettingsVariant.delete
|
self.localAccountSettingsVariant.delete
|
||||||
self.localAccountSensitiveSettingsVariant.delete
|
self.localAccountSensitiveSettingsVariant.delete
|
||||||
|
@ -282,7 +282,7 @@ proc start*(self: AppController) =
|
||||||
self.generalService.init()
|
self.generalService.init()
|
||||||
self.ethService.init()
|
self.ethService.init()
|
||||||
self.accountsService.init()
|
self.accountsService.init()
|
||||||
|
|
||||||
self.startupModule.load()
|
self.startupModule.load()
|
||||||
|
|
||||||
proc load(self: AppController) =
|
proc load(self: AppController) =
|
||||||
|
@ -314,7 +314,7 @@ proc load(self: AppController) =
|
||||||
singletonInstance.engine.setRootContextProperty("globalUtils", self.globalUtilsVariant)
|
singletonInstance.engine.setRootContextProperty("globalUtils", self.globalUtilsVariant)
|
||||||
|
|
||||||
# other global instances
|
# other global instances
|
||||||
self.buildAndRegisterLocalAccountSensitiveSettings()
|
self.buildAndRegisterLocalAccountSensitiveSettings()
|
||||||
self.buildAndRegisterUserProfile()
|
self.buildAndRegisterUserProfile()
|
||||||
|
|
||||||
# load main module
|
# load main module
|
||||||
|
@ -341,12 +341,12 @@ proc userLoggedIn*(self: AppController) =
|
||||||
|
|
||||||
self.osNotificationService.userLoggedIn()
|
self.osNotificationService.userLoggedIn()
|
||||||
|
|
||||||
proc buildAndRegisterLocalAccountSensitiveSettings(self: AppController) =
|
proc buildAndRegisterLocalAccountSensitiveSettings(self: AppController) =
|
||||||
var pubKey = self.settingsService.getPublicKey()
|
var pubKey = self.settingsService.getPublicKey()
|
||||||
singletonInstance.localAccountSensitiveSettings.setFileName(pubKey)
|
singletonInstance.localAccountSensitiveSettings.setFileName(pubKey)
|
||||||
singletonInstance.engine.setRootContextProperty("localAccountSensitiveSettings", self.localAccountSensitiveSettingsVariant)
|
singletonInstance.engine.setRootContextProperty("localAccountSensitiveSettings", self.localAccountSensitiveSettingsVariant)
|
||||||
|
|
||||||
proc buildAndRegisterUserProfile(self: AppController) =
|
proc buildAndRegisterUserProfile(self: AppController) =
|
||||||
let pubKey = self.settingsService.getPublicKey()
|
let pubKey = self.settingsService.getPublicKey()
|
||||||
let preferredName = self.settingsService.getPreferredName()
|
let preferredName = self.settingsService.getPreferredName()
|
||||||
let ensUsernames = self.settingsService.getEnsUsernames()
|
let ensUsernames = self.settingsService.getEnsUsernames()
|
||||||
|
@ -365,7 +365,7 @@ proc buildAndRegisterUserProfile(self: AppController) =
|
||||||
|
|
||||||
let meAsContact = self.contactsService.getContactById(pubKey)
|
let meAsContact = self.contactsService.getContactById(pubKey)
|
||||||
|
|
||||||
singletonInstance.userProfile.setFixedData(loggedInAccount.name, loggedInAccount.keyUid, loggedInAccount.identicon,
|
singletonInstance.userProfile.setFixedData(loggedInAccount.name, loggedInAccount.keyUid, loggedInAccount.identicon,
|
||||||
pubKey)
|
pubKey)
|
||||||
singletonInstance.userProfile.setPreferredName(preferredName)
|
singletonInstance.userProfile.setPreferredName(preferredName)
|
||||||
singletonInstance.userProfile.setEnsName(meAsContact.name)
|
singletonInstance.userProfile.setEnsName(meAsContact.name)
|
||||||
|
|
|
@ -4,13 +4,13 @@ import # system libs
|
||||||
import # deps
|
import # deps
|
||||||
uuids
|
uuids
|
||||||
|
|
||||||
type
|
type
|
||||||
Args* = ref object of RootObj # ...args
|
Args* = ref object of RootObj # ...args
|
||||||
Handler* = proc (args: Args) {.closure.} # callback function type
|
Handler* = proc (args: Args) {.closure.} # callback function type
|
||||||
EventEmitter* = ref object
|
EventEmitter* = ref object
|
||||||
events: Table[string, Table[UUID, Handler]]
|
events: Table[string, Table[UUID, Handler]]
|
||||||
|
|
||||||
proc createEventEmitter*(): EventEmitter =
|
proc createEventEmitter*(): EventEmitter =
|
||||||
result.new
|
result.new
|
||||||
result.events = initTable[string, Table[UUID, Handler]]()
|
result.events = initTable[string, Table[UUID, Handler]]()
|
||||||
|
|
||||||
|
@ -19,10 +19,10 @@ proc on(this: EventEmitter, name: string, handlerId: UUID, handler: Handler): vo
|
||||||
if this.events.hasKey(name):
|
if this.events.hasKey(name):
|
||||||
this.events[name].add handlerId, handler
|
this.events[name].add handlerId, handler
|
||||||
return
|
return
|
||||||
|
|
||||||
this.events[name] = [(handlerId, handler)].toTable
|
this.events[name] = [(handlerId, handler)].toTable
|
||||||
|
|
||||||
proc on*(this: EventEmitter, name: string, handler: Handler): void =
|
proc on*(this: EventEmitter, name: string, handler: Handler): void =
|
||||||
var uuid: UUID
|
var uuid: UUID
|
||||||
this.on(name, uuid, handler)
|
this.on(name, uuid, handler)
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ type
|
||||||
WakuV2Prod = "wakuv2.prod"
|
WakuV2Prod = "wakuv2.prod"
|
||||||
WakuV2Test = "wakuv2.test"
|
WakuV2Test = "wakuv2.test"
|
||||||
GoWakuTest = "go-waku.test"
|
GoWakuTest = "go-waku.test"
|
||||||
|
|
||||||
FleetNodes* {.pure.} = enum
|
FleetNodes* {.pure.} = enum
|
||||||
Bootnodes = "boot",
|
Bootnodes = "boot",
|
||||||
Mailservers = "mail",
|
Mailservers = "mail",
|
||||||
|
@ -57,11 +57,11 @@ proc getNodes*(self: FleetConfiguration, fleet: Fleet, nodeType: FleetNodes = Fl
|
||||||
result = toSeq(self.fleet[$fleet][$nodeType].values)
|
result = toSeq(self.fleet[$fleet][$nodeType].values)
|
||||||
|
|
||||||
proc getMailservers*(self: FleetConfiguration, fleet: Fleet, isWakuV2: bool): Table[string, string] =
|
proc getMailservers*(self: FleetConfiguration, fleet: Fleet, isWakuV2: bool): Table[string, string] =
|
||||||
# TODO: If using wakuV2, this assumes that Waku nodes in fleet.status.json are also store nodes.
|
# TODO: If using wakuV2, this assumes that Waku nodes in fleet.status.json are also store nodes.
|
||||||
# Maybe it make senses to add a "waku-store" section in case we want to have separate node types?
|
# Maybe it make senses to add a "waku-store" section in case we want to have separate node types?
|
||||||
# Discuss with @iurimatias, @cammellos and Vac team
|
# Discuss with @iurimatias, @cammellos and Vac team
|
||||||
let fleetKey = if isWakuV2: $FleetNodes.Waku else: $FleetNodes.Mailservers
|
let fleetKey = if isWakuV2: $FleetNodes.Waku else: $FleetNodes.Mailservers
|
||||||
if not self.fleet[$fleet].hasKey(fleetKey) :
|
if not self.fleet[$fleet].hasKey(fleetKey) :
|
||||||
result = initTable[string,string]()
|
result = initTable[string,string]()
|
||||||
return
|
return
|
||||||
result = self.fleet[$fleet][fleetKey]
|
result = self.fleet[$fleet][fleetKey]
|
||||||
|
|
|
@ -17,7 +17,7 @@ type StatusFoundation* = ref object
|
||||||
|
|
||||||
proc newStatusFoundation*(fleetConfig: string): StatusFoundation =
|
proc newStatusFoundation*(fleetConfig: string): StatusFoundation =
|
||||||
result = StatusFoundation()
|
result = StatusFoundation()
|
||||||
result.events = createEventEmitter()
|
result.events = createEventEmitter()
|
||||||
result.fleetConfiguration = newFleetConfiguration(fleetConfig)
|
result.fleetConfiguration = newFleetConfiguration(fleetConfig)
|
||||||
result.threadpool = newThreadPool()
|
result.threadpool = newThreadPool()
|
||||||
result.signalsManager = newSignalsManager(result.events)
|
result.signalsManager = newSignalsManager(result.events)
|
||||||
|
|
|
@ -5,7 +5,7 @@ import signal_type
|
||||||
type ChroniclesLogsSignal* = ref object of Signal
|
type ChroniclesLogsSignal* = ref object of Signal
|
||||||
content*: string
|
content*: string
|
||||||
|
|
||||||
proc fromEvent*(T: type ChroniclesLogsSignal, jsonSignal: JsonNode): ChroniclesLogsSignal =
|
proc fromEvent*(T: type ChroniclesLogsSignal, jsonSignal: JsonNode): ChroniclesLogsSignal =
|
||||||
result = ChroniclesLogsSignal()
|
result = ChroniclesLogsSignal()
|
||||||
result.signalType = SignalType.ChroniclesLogs
|
result.signalType = SignalType.ChroniclesLogs
|
||||||
if jsonSignal["event"].kind != JNull:
|
if jsonSignal["event"].kind != JNull:
|
||||||
|
|
|
@ -8,7 +8,7 @@ import signal_type
|
||||||
type CommunitySignal* = ref object of Signal
|
type CommunitySignal* = ref object of Signal
|
||||||
community*: CommunityDto
|
community*: CommunityDto
|
||||||
|
|
||||||
proc fromEvent*(T: type CommunitySignal, event: JsonNode): CommunitySignal =
|
proc fromEvent*(T: type CommunitySignal, event: JsonNode): CommunitySignal =
|
||||||
result = CommunitySignal()
|
result = CommunitySignal()
|
||||||
result.signalType = SignalType.CommunityFound
|
result.signalType = SignalType.CommunityFound
|
||||||
result.community = event["event"].toCommunityDto()
|
result.community = event["event"].toCommunityDto()
|
||||||
|
|
|
@ -6,7 +6,7 @@ import signal_type
|
||||||
type DiscoverySummarySignal* = ref object of Signal
|
type DiscoverySummarySignal* = ref object of Signal
|
||||||
enodes*: seq[string]
|
enodes*: seq[string]
|
||||||
|
|
||||||
proc fromEvent*(T: type DiscoverySummarySignal, jsonSignal: JsonNode): DiscoverySummarySignal =
|
proc fromEvent*(T: type DiscoverySummarySignal, jsonSignal: JsonNode): DiscoverySummarySignal =
|
||||||
result = DiscoverySummarySignal()
|
result = DiscoverySummarySignal()
|
||||||
result.signalType = SignalType.DiscoverySummary
|
result.signalType = SignalType.DiscoverySummary
|
||||||
if jsonSignal["event"].kind != JNull:
|
if jsonSignal["event"].kind != JNull:
|
||||||
|
|
|
@ -6,10 +6,9 @@ import signal_type
|
||||||
type EnvelopeSentSignal* = ref object of Signal
|
type EnvelopeSentSignal* = ref object of Signal
|
||||||
messageIds*: seq[string]
|
messageIds*: seq[string]
|
||||||
|
|
||||||
proc fromEvent*(T: type EnvelopeSentSignal, jsonSignal: JsonNode): EnvelopeSentSignal =
|
proc fromEvent*(T: type EnvelopeSentSignal, jsonSignal: JsonNode): EnvelopeSentSignal =
|
||||||
result = EnvelopeSentSignal()
|
result = EnvelopeSentSignal()
|
||||||
result.signalType = SignalType.EnvelopeSent
|
result.signalType = SignalType.EnvelopeSent
|
||||||
if jsonSignal["event"].kind != JNull and jsonSignal["event"].hasKey("ids") and jsonSignal["event"]["ids"].kind != JNull:
|
if jsonSignal["event"].kind != JNull and jsonSignal["event"].hasKey("ids") and jsonSignal["event"]["ids"].kind != JNull:
|
||||||
for messageId in jsonSignal["event"]["ids"]:
|
for messageId in jsonSignal["event"]["ids"]:
|
||||||
result.messageIds.add(messageId.getStr)
|
result.messageIds.add(messageId.getStr)
|
||||||
|
|
|
@ -6,10 +6,9 @@ import signal_type
|
||||||
type EnvelopeExpiredSignal* = ref object of Signal
|
type EnvelopeExpiredSignal* = ref object of Signal
|
||||||
messageIds*: seq[string]
|
messageIds*: seq[string]
|
||||||
|
|
||||||
proc fromEvent*(T: type EnvelopeExpiredSignal, jsonSignal: JsonNode): EnvelopeExpiredSignal =
|
proc fromEvent*(T: type EnvelopeExpiredSignal, jsonSignal: JsonNode): EnvelopeExpiredSignal =
|
||||||
result = EnvelopeExpiredSignal()
|
result = EnvelopeExpiredSignal()
|
||||||
result.signalType = SignalType.EnvelopeExpired
|
result.signalType = SignalType.EnvelopeExpired
|
||||||
if jsonSignal["event"].kind != JNull and jsonSignal["event"].hasKey("ids") and jsonSignal["event"]["ids"].kind != JNull:
|
if jsonSignal["event"].kind != JNull and jsonSignal["event"].hasKey("ids") and jsonSignal["event"]["ids"].kind != JNull:
|
||||||
for messageId in jsonSignal["event"]["ids"]:
|
for messageId in jsonSignal["event"]["ids"]:
|
||||||
result.messageIds.add(messageId.getStr)
|
result.messageIds.add(messageId.getStr)
|
||||||
|
|
|
@ -9,7 +9,7 @@ type MailserverRequestCompletedSignal* = ref object of Signal
|
||||||
cursor*: string
|
cursor*: string
|
||||||
errorMessage*: string
|
errorMessage*: string
|
||||||
error*: bool
|
error*: bool
|
||||||
|
|
||||||
type MailserverRequestExpiredSignal* = ref object of Signal
|
type MailserverRequestExpiredSignal* = ref object of Signal
|
||||||
# TODO
|
# TODO
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ type HistoryRequestBatchProcessedSignal* = ref object of Signal
|
||||||
requestId*: string
|
requestId*: string
|
||||||
batchIndex*: int
|
batchIndex*: int
|
||||||
numBatches*: int
|
numBatches*: int
|
||||||
|
|
||||||
type HistoryRequestCompletedSignal* = ref object of Signal
|
type HistoryRequestCompletedSignal* = ref object of Signal
|
||||||
requestId*: string
|
requestId*: string
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ type MailserverAvailableSignal* = ref object of Signal
|
||||||
type MailserverChangedSignal* = ref object of Signal
|
type MailserverChangedSignal* = ref object of Signal
|
||||||
address*: string
|
address*: string
|
||||||
|
|
||||||
proc fromEvent*(T: type MailserverRequestCompletedSignal, jsonSignal: JsonNode): MailserverRequestCompletedSignal =
|
proc fromEvent*(T: type MailserverRequestCompletedSignal, jsonSignal: JsonNode): MailserverRequestCompletedSignal =
|
||||||
result = MailserverRequestCompletedSignal()
|
result = MailserverRequestCompletedSignal()
|
||||||
result.signalType = SignalType.MailserverRequestCompleted
|
result.signalType = SignalType.MailserverRequestCompleted
|
||||||
if jsonSignal["event"].kind != JNull:
|
if jsonSignal["event"].kind != JNull:
|
||||||
|
@ -45,31 +45,31 @@ proc fromEvent*(T: type MailserverRequestCompletedSignal, jsonSignal: JsonNode):
|
||||||
result.cursor = jsonSignal["event"]{"cursor"}.getStr()
|
result.cursor = jsonSignal["event"]{"cursor"}.getStr()
|
||||||
result.errorMessage = jsonSignal["event"]{"errorMessage"}.getStr()
|
result.errorMessage = jsonSignal["event"]{"errorMessage"}.getStr()
|
||||||
result.error = result.errorMessage != ""
|
result.error = result.errorMessage != ""
|
||||||
|
|
||||||
proc fromEvent*(T: type MailserverRequestExpiredSignal, jsonSignal: JsonNode): MailserverRequestExpiredSignal =
|
proc fromEvent*(T: type MailserverRequestExpiredSignal, jsonSignal: JsonNode): MailserverRequestExpiredSignal =
|
||||||
# TODO: parse signal
|
# TODO: parse signal
|
||||||
result = MailserverRequestExpiredSignal()
|
result = MailserverRequestExpiredSignal()
|
||||||
result.signalType = SignalType.MailserverRequestExpired
|
result.signalType = SignalType.MailserverRequestExpired
|
||||||
|
|
||||||
proc fromEvent*(T: type HistoryRequestStartedSignal, jsonSignal: JsonNode): HistoryRequestStartedSignal =
|
proc fromEvent*(T: type HistoryRequestStartedSignal, jsonSignal: JsonNode): HistoryRequestStartedSignal =
|
||||||
result = HistoryRequestStartedSignal()
|
result = HistoryRequestStartedSignal()
|
||||||
result.signalType = SignalType.HistoryRequestStarted
|
result.signalType = SignalType.HistoryRequestStarted
|
||||||
result.requestId = jsonSignal["event"]{"requestId"}.getStr()
|
result.requestId = jsonSignal["event"]{"requestId"}.getStr()
|
||||||
result.numBatches = jsonSIgnal["event"]{"numBatches"}.getInt()
|
result.numBatches = jsonSIgnal["event"]{"numBatches"}.getInt()
|
||||||
|
|
||||||
proc fromEvent*(T: type HistoryRequestBatchProcessedSignal, jsonSignal: JsonNode): HistoryRequestBatchProcessedSignal =
|
proc fromEvent*(T: type HistoryRequestBatchProcessedSignal, jsonSignal: JsonNode): HistoryRequestBatchProcessedSignal =
|
||||||
result = HistoryRequestBatchProcessedSignal()
|
result = HistoryRequestBatchProcessedSignal()
|
||||||
result.signalType = SignalType.HistoryRequestBatchProcessed
|
result.signalType = SignalType.HistoryRequestBatchProcessed
|
||||||
result.requestId = jsonSignal["event"]{"requestId"}.getStr()
|
result.requestId = jsonSignal["event"]{"requestId"}.getStr()
|
||||||
result.batchIndex = jsonSIgnal["event"]{"batchIndex"}.getInt()
|
result.batchIndex = jsonSIgnal["event"]{"batchIndex"}.getInt()
|
||||||
result.numBatches = jsonSIgnal["event"]{"numBatches"}.getInt()
|
result.numBatches = jsonSIgnal["event"]{"numBatches"}.getInt()
|
||||||
|
|
||||||
proc fromEvent*(T: type HistoryRequestCompletedSignal, jsonSignal: JsonNode): HistoryRequestCompletedSignal =
|
proc fromEvent*(T: type HistoryRequestCompletedSignal, jsonSignal: JsonNode): HistoryRequestCompletedSignal =
|
||||||
result = HistoryRequestCompletedSignal()
|
result = HistoryRequestCompletedSignal()
|
||||||
result.signalType = SignalType.HistoryRequestCompleted
|
result.signalType = SignalType.HistoryRequestCompleted
|
||||||
result.requestId = jsonSignal["event"]{"requestId"}.getStr()
|
result.requestId = jsonSignal["event"]{"requestId"}.getStr()
|
||||||
|
|
||||||
proc fromEvent*(T: type HistoryRequestFailedSignal, jsonSignal: JsonNode): HistoryRequestFailedSignal =
|
proc fromEvent*(T: type HistoryRequestFailedSignal, jsonSignal: JsonNode): HistoryRequestFailedSignal =
|
||||||
result = HistoryRequestFailedSignal()
|
result = HistoryRequestFailedSignal()
|
||||||
result.signalType = SignalType.HistoryRequestStarted
|
result.signalType = SignalType.HistoryRequestStarted
|
||||||
result.requestId = jsonSignal["event"]{"requestId"}.getStr()
|
result.requestId = jsonSignal["event"]{"requestId"}.getStr()
|
||||||
|
@ -77,12 +77,12 @@ proc fromEvent*(T: type HistoryRequestFailedSignal, jsonSignal: JsonNode): Histo
|
||||||
result.errorMessage = jsonSignal["event"]{"errorMessage"}.getStr()
|
result.errorMessage = jsonSignal["event"]{"errorMessage"}.getStr()
|
||||||
result.error = result.errorMessage != ""
|
result.error = result.errorMessage != ""
|
||||||
|
|
||||||
proc fromEvent*(T: type MailserverAvailableSignal, jsonSignal: JsonNode): MailserverAvailableSignal =
|
proc fromEvent*(T: type MailserverAvailableSignal, jsonSignal: JsonNode): MailserverAvailableSignal =
|
||||||
result = MailserverAvailableSignal()
|
result = MailserverAvailableSignal()
|
||||||
result.signalType = SignalType.MailserverAvailable
|
result.signalType = SignalType.MailserverAvailable
|
||||||
result.address = jsonSignal["event"]{"address"}.getStr()
|
result.address = jsonSignal["event"]{"address"}.getStr()
|
||||||
|
|
||||||
proc fromEvent*(T: type MailserverChangedSignal, jsonSignal: JsonNode): MailserverChangedSignal =
|
proc fromEvent*(T: type MailserverChangedSignal, jsonSignal: JsonNode): MailserverChangedSignal =
|
||||||
result = MailserverChangedSignal()
|
result = MailserverChangedSignal()
|
||||||
result.signalType = SignalType.MailserverChanged
|
result.signalType = SignalType.MailserverChanged
|
||||||
result.address = jsonSignal["event"]{"address"}.getStr()
|
result.address = jsonSignal["event"]{"address"}.getStr()
|
||||||
|
|
|
@ -22,7 +22,7 @@ type MessageSignal* = ref object of Signal
|
||||||
statusUpdates*: seq[StatusUpdateDto]
|
statusUpdates*: seq[StatusUpdateDto]
|
||||||
deletedMessages*: seq[RemovedMessageDto]
|
deletedMessages*: seq[RemovedMessageDto]
|
||||||
|
|
||||||
proc fromEvent*(T: type MessageSignal, event: JsonNode): MessageSignal =
|
proc fromEvent*(T: type MessageSignal, event: JsonNode): MessageSignal =
|
||||||
var signal:MessageSignal = MessageSignal()
|
var signal:MessageSignal = MessageSignal()
|
||||||
signal.messages = @[]
|
signal.messages = @[]
|
||||||
signal.contacts = @[]
|
signal.contacts = @[]
|
||||||
|
@ -44,7 +44,7 @@ proc fromEvent*(T: type MessageSignal, event: JsonNode): MessageSignal =
|
||||||
if event["event"]{"statusUpdates"} != nil:
|
if event["event"]{"statusUpdates"} != nil:
|
||||||
for jsonStatusUpdate in event["event"]["statusUpdates"]:
|
for jsonStatusUpdate in event["event"]["statusUpdates"]:
|
||||||
var statusUpdate = jsonStatusUpdate.toStatusUpdateDto()
|
var statusUpdate = jsonStatusUpdate.toStatusUpdateDto()
|
||||||
signal.statusUpdates.add(statusUpdate)
|
signal.statusUpdates.add(statusUpdate)
|
||||||
|
|
||||||
if event["event"]{"installations"} != nil:
|
if event["event"]{"installations"} != nil:
|
||||||
for jsonDevice in event["event"]["installations"]:
|
for jsonDevice in event["event"]["installations"]:
|
||||||
|
|
|
@ -5,7 +5,7 @@ import signal_type
|
||||||
type PeerStatsSignal* = ref object of Signal
|
type PeerStatsSignal* = ref object of Signal
|
||||||
peers*: seq[string]
|
peers*: seq[string]
|
||||||
|
|
||||||
proc fromEvent*(T: type PeerStatsSignal, jsonSignal: JsonNode): PeerStatsSignal =
|
proc fromEvent*(T: type PeerStatsSignal, jsonSignal: JsonNode): PeerStatsSignal =
|
||||||
result = PeerStatsSignal()
|
result = PeerStatsSignal()
|
||||||
result.signalType = SignalType.PeerStats
|
result.signalType = SignalType.PeerStats
|
||||||
if jsonSignal["event"].kind != JNull:
|
if jsonSignal["event"].kind != JNull:
|
||||||
|
|
|
@ -16,7 +16,7 @@ proc toStats(jsonMsg: JsonNode): Stats =
|
||||||
downloadRate: uint64(jsonMsg{"downloadRate"}.getBiggestInt())
|
downloadRate: uint64(jsonMsg{"downloadRate"}.getBiggestInt())
|
||||||
)
|
)
|
||||||
|
|
||||||
proc fromEvent*(T: type StatsSignal, event: JsonNode): StatsSignal =
|
proc fromEvent*(T: type StatsSignal, event: JsonNode): StatsSignal =
|
||||||
result = StatsSignal()
|
result = StatsSignal()
|
||||||
result.signalType = SignalType.Stats
|
result.signalType = SignalType.Stats
|
||||||
result.stats = event["event"].toStats
|
result.stats = event["event"].toStats
|
||||||
|
|
|
@ -12,10 +12,10 @@ type WalletSignal* = ref object of Signal
|
||||||
# newTransactions*: ???
|
# newTransactions*: ???
|
||||||
erc20*: bool
|
erc20*: bool
|
||||||
|
|
||||||
proc fromEvent*(T: type WalletSignal, jsonSignal: JsonNode): WalletSignal =
|
proc fromEvent*(T: type WalletSignal, jsonSignal: JsonNode): WalletSignal =
|
||||||
result = WalletSignal()
|
result = WalletSignal()
|
||||||
result.signalType = SignalType.Wallet
|
result.signalType = SignalType.Wallet
|
||||||
result.content = $jsonSignal
|
result.content = $jsonSignal
|
||||||
if jsonSignal["event"].kind != JNull:
|
if jsonSignal["event"].kind != JNull:
|
||||||
result.eventType = jsonSignal["event"]["type"].getStr
|
result.eventType = jsonSignal["event"]["type"].getStr
|
||||||
result.blockNumber = jsonSignal["event"]{"blockNumber"}.getInt
|
result.blockNumber = jsonSignal["event"]{"blockNumber"}.getInt
|
||||||
|
@ -25,4 +25,3 @@ proc fromEvent*(T: type WalletSignal, jsonSignal: JsonNode): WalletSignal =
|
||||||
if jsonSignal["event"]["accounts"].kind != JNull:
|
if jsonSignal["event"]["accounts"].kind != JNull:
|
||||||
for account in jsonSignal["event"]["accounts"]:
|
for account in jsonSignal["event"]["accounts"]:
|
||||||
result.accounts.add(account.getStr)
|
result.accounts.add(account.getStr)
|
||||||
|
|
|
@ -23,7 +23,7 @@ proc toFilter(jsonMsg: JsonNode): Filter =
|
||||||
topic: jsonMsg{"topic"}.getStr,
|
topic: jsonMsg{"topic"}.getStr,
|
||||||
)
|
)
|
||||||
|
|
||||||
proc fromEvent*(T: type WhisperFilterSignal, event: JsonNode): WhisperFilterSignal =
|
proc fromEvent*(T: type WhisperFilterSignal, event: JsonNode): WhisperFilterSignal =
|
||||||
if event["event"]{"filters"} != nil:
|
if event["event"]{"filters"} != nil:
|
||||||
for jsonMsg in event["event"]["filters"]:
|
for jsonMsg in event["event"]["filters"]:
|
||||||
result.filters.add(jsonMsg.toFilter)
|
result.filters.add(jsonMsg.toFilter)
|
||||||
|
|
|
@ -28,14 +28,14 @@ QtObject:
|
||||||
|
|
||||||
proc processSignal(self: SignalsManager, statusSignal: string) =
|
proc processSignal(self: SignalsManager, statusSignal: string) =
|
||||||
var jsonSignal: JsonNode
|
var jsonSignal: JsonNode
|
||||||
try:
|
try:
|
||||||
jsonSignal = statusSignal.parseJson
|
jsonSignal = statusSignal.parseJson
|
||||||
except:
|
except:
|
||||||
error "Invalid signal received", data = statusSignal
|
error "Invalid signal received", data = statusSignal
|
||||||
return
|
return
|
||||||
|
|
||||||
trace "Raw signal data", data = $jsonSignal
|
trace "Raw signal data", data = $jsonSignal
|
||||||
|
|
||||||
var signal:Signal
|
var signal:Signal
|
||||||
try:
|
try:
|
||||||
signal = self.decode(jsonSignal)
|
signal = self.decode(jsonSignal)
|
||||||
|
@ -86,4 +86,4 @@ QtObject:
|
||||||
of SignalType.MailserverChanged: MailserverChangedSignal.fromEvent(jsonSignal)
|
of SignalType.MailserverChanged: MailserverChangedSignal.fromEvent(jsonSignal)
|
||||||
else: Signal()
|
else: Signal()
|
||||||
|
|
||||||
result.signalType = signalType
|
result.signalType = signalType
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{.used.}
|
{.used.}
|
||||||
|
|
||||||
import ./remote_signals/[base, chronicles_logs, community, discovery_summary, envelope, expired, mailserver, messages,
|
import ./remote_signals/[base, chronicles_logs, community, discovery_summary, envelope, expired, mailserver, messages,
|
||||||
peerstats, signal_type, stats, wallet, whisper_filter, keycard]
|
peerstats, signal_type, stats, wallet, whisper_filter, keycard]
|
||||||
|
|
||||||
export base, chronicles_logs, community, discovery_summary, envelope, expired, mailserver, messages, peerstats,
|
export base, chronicles_logs, community, discovery_summary, envelope, expired, mailserver, messages, peerstats,
|
||||||
signal_type, stats, wallet, whisper_filter, keycard
|
signal_type, stats, wallet, whisper_filter, keycard
|
||||||
|
|
|
@ -43,4 +43,4 @@ method worker(arg: WorkerThreadArg) {.async, base, gcsafe, nimcall.} =
|
||||||
|
|
||||||
method workerThread(arg: WorkerThreadArg) {.thread, base, gcsafe, nimcall.} =
|
method workerThread(arg: WorkerThreadArg) {.thread, base, gcsafe, nimcall.} =
|
||||||
# override this base method
|
# override this base method
|
||||||
raise newException(CatchableError, "Method without implementation override")
|
raise newException(CatchableError, "Method without implementation override")
|
||||||
|
|
|
@ -8,4 +8,4 @@ type
|
||||||
ToggleSectionArgs* = ref object of Args
|
ToggleSectionArgs* = ref object of Args
|
||||||
sectionType*: SectionType
|
sectionType*: SectionType
|
||||||
|
|
||||||
const TOGGLE_SECTION* = "toggleSection"
|
const TOGGLE_SECTION* = "toggleSection"
|
||||||
|
|
|
@ -12,8 +12,8 @@ export local_app_settings
|
||||||
export user_profile
|
export user_profile
|
||||||
export utils
|
export utils
|
||||||
|
|
||||||
type
|
type
|
||||||
GlobalSingleton = object
|
GlobalSingleton = object
|
||||||
# Don't export GlobalSingleton type.
|
# Don't export GlobalSingleton type.
|
||||||
# Other global things like local/global settings will be added here.
|
# Other global things like local/global settings will be added here.
|
||||||
|
|
||||||
|
@ -66,4 +66,4 @@ proc delete*(self: GlobalSingleton) =
|
||||||
self.localAccountSettings.delete()
|
self.localAccountSettings.delete()
|
||||||
self.localAccountSensitiveSettings.delete()
|
self.localAccountSensitiveSettings.delete()
|
||||||
self.localAppSettings.delete()
|
self.localAppSettings.delete()
|
||||||
self.userProfile.delete()
|
self.userProfile.delete()
|
||||||
|
|
|
@ -107,7 +107,7 @@ QtObject:
|
||||||
type LocalAccountSensitiveSettings* = ref object of QObject
|
type LocalAccountSensitiveSettings* = ref object of QObject
|
||||||
settingsFileDir: string
|
settingsFileDir: string
|
||||||
settings: QSettings
|
settings: QSettings
|
||||||
|
|
||||||
proc setup(self: LocalAccountSensitiveSettings) =
|
proc setup(self: LocalAccountSensitiveSettings) =
|
||||||
self.QObject.setup
|
self.QObject.setup
|
||||||
self.settingsFileDir = os.joinPath(DATADIR, "qt")
|
self.settingsFileDir = os.joinPath(DATADIR, "qt")
|
||||||
|
@ -118,7 +118,7 @@ QtObject:
|
||||||
|
|
||||||
self.QObject.delete
|
self.QObject.delete
|
||||||
|
|
||||||
proc newLocalAccountSensitiveSettings*():
|
proc newLocalAccountSensitiveSettings*():
|
||||||
LocalAccountSensitiveSettings =
|
LocalAccountSensitiveSettings =
|
||||||
new(result, delete)
|
new(result, delete)
|
||||||
result.setup
|
result.setup
|
||||||
|
@ -152,7 +152,7 @@ QtObject:
|
||||||
when T is bool:
|
when T is bool:
|
||||||
result = getSettingsPropBool(self, prop, default)
|
result = getSettingsPropBool(self, prop, default)
|
||||||
|
|
||||||
template setSettingsProp(self: LocalAccountSensitiveSettings, prop: string, value: QVariant, signal: untyped) =
|
template setSettingsProp(self: LocalAccountSensitiveSettings, prop: string, value: QVariant, signal: untyped) =
|
||||||
if(self.settings.isNil):
|
if(self.settings.isNil):
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@ -237,7 +237,7 @@ QtObject:
|
||||||
write = setIsWalletV2Enabled
|
write = setIsWalletV2Enabled
|
||||||
notify = isWalletV2EnabledChanged
|
notify = isWalletV2EnabledChanged
|
||||||
|
|
||||||
|
|
||||||
proc nodeManagementEnabledChanged*(self: LocalAccountSensitiveSettings) {.signal.}
|
proc nodeManagementEnabledChanged*(self: LocalAccountSensitiveSettings) {.signal.}
|
||||||
proc getNodeManagementEnabled*(self: LocalAccountSensitiveSettings): bool {.slot.} =
|
proc getNodeManagementEnabled*(self: LocalAccountSensitiveSettings): bool {.slot.} =
|
||||||
getSettingsProp[bool](self, LSS_KEY_NODE_MANAGEMENT_ENABLED, newQVariant(DEFAULT_NODE_MANAGEMENT_ENABLED))
|
getSettingsProp[bool](self, LSS_KEY_NODE_MANAGEMENT_ENABLED, newQVariant(DEFAULT_NODE_MANAGEMENT_ENABLED))
|
||||||
|
@ -263,7 +263,7 @@ QtObject:
|
||||||
write = setIsBrowserEnabled
|
write = setIsBrowserEnabled
|
||||||
notify = isBrowserEnabledChanged
|
notify = isBrowserEnabledChanged
|
||||||
|
|
||||||
|
|
||||||
proc isActivityCenterEnabledChanged*(self: LocalAccountSensitiveSettings) {.signal.}
|
proc isActivityCenterEnabledChanged*(self: LocalAccountSensitiveSettings) {.signal.}
|
||||||
proc getIsActivityCenterEnabled*(self: LocalAccountSensitiveSettings): bool {.slot.} =
|
proc getIsActivityCenterEnabled*(self: LocalAccountSensitiveSettings): bool {.slot.} =
|
||||||
getSettingsProp[bool](self, LSS_KEY_IS_ACTIVITY_CENTER_ENABLED, newQVariant(DEFAULT_IS_ACTIVITY_CENTER_ENABLED))
|
getSettingsProp[bool](self, LSS_KEY_IS_ACTIVITY_CENTER_ENABLED, newQVariant(DEFAULT_IS_ACTIVITY_CENTER_ENABLED))
|
||||||
|
@ -289,7 +289,7 @@ QtObject:
|
||||||
write = setShowOnlineUsers
|
write = setShowOnlineUsers
|
||||||
notify = showOnlineUsersChanged
|
notify = showOnlineUsersChanged
|
||||||
|
|
||||||
|
|
||||||
proc expandUsersListChanged*(self: LocalAccountSensitiveSettings) {.signal.}
|
proc expandUsersListChanged*(self: LocalAccountSensitiveSettings) {.signal.}
|
||||||
proc getExpandUsersList*(self: LocalAccountSensitiveSettings): bool {.slot.} =
|
proc getExpandUsersList*(self: LocalAccountSensitiveSettings): bool {.slot.} =
|
||||||
getSettingsProp[bool](self, LSS_KEY_EXPAND_USERS_LIST, newQVariant(DEFAULT_EXPAND_USERS_LIST))
|
getSettingsProp[bool](self, LSS_KEY_EXPAND_USERS_LIST, newQVariant(DEFAULT_EXPAND_USERS_LIST))
|
||||||
|
@ -354,7 +354,7 @@ QtObject:
|
||||||
write = setRecentEmojis
|
write = setRecentEmojis
|
||||||
notify = recentEmojisChanged
|
notify = recentEmojisChanged
|
||||||
|
|
||||||
|
|
||||||
proc hiddenCommunityWelcomeBannersChanged*(self: LocalAccountSensitiveSettings) {.signal.}
|
proc hiddenCommunityWelcomeBannersChanged*(self: LocalAccountSensitiveSettings) {.signal.}
|
||||||
proc getHiddenCommunityWelcomeBanners*(self: LocalAccountSensitiveSettings): QVariant {.slot.} =
|
proc getHiddenCommunityWelcomeBanners*(self: LocalAccountSensitiveSettings): QVariant {.slot.} =
|
||||||
getSettingsPropQVariant(self, LSS_KEY_HIDDEN_COMMUNITY_WELCOME_BANNERS, newQVariant(DEFAULT_HIDDEN_COMMUNITY_WELCOME_BANNERS))
|
getSettingsPropQVariant(self, LSS_KEY_HIDDEN_COMMUNITY_WELCOME_BANNERS, newQVariant(DEFAULT_HIDDEN_COMMUNITY_WELCOME_BANNERS))
|
||||||
|
@ -458,7 +458,7 @@ QtObject:
|
||||||
write = setNotifyOnNewRequests
|
write = setNotifyOnNewRequests
|
||||||
notify = notifyOnNewRequestsChanged
|
notify = notifyOnNewRequestsChanged
|
||||||
|
|
||||||
|
|
||||||
proc whitelistedUnfurlingSitesChanged*(self: LocalAccountSensitiveSettings) {.signal.}
|
proc whitelistedUnfurlingSitesChanged*(self: LocalAccountSensitiveSettings) {.signal.}
|
||||||
proc getWhitelistedUnfurlingSites*(self: LocalAccountSensitiveSettings): QVariant {.slot.} =
|
proc getWhitelistedUnfurlingSites*(self: LocalAccountSensitiveSettings): QVariant {.slot.} =
|
||||||
getSettingsPropQVariant(self, LSS_KEY_WITHLISTED_UNFURLING_SITES, newQVariant(DEFAULT_WITHLISTED_UNFURLING_SITES))
|
getSettingsPropQVariant(self, LSS_KEY_WITHLISTED_UNFURLING_SITES, newQVariant(DEFAULT_WITHLISTED_UNFURLING_SITES))
|
||||||
|
@ -560,7 +560,7 @@ QtObject:
|
||||||
QtProperty[string] skinColor:
|
QtProperty[string] skinColor:
|
||||||
read = getSkinColor
|
read = getSkinColor
|
||||||
write = setSkinColor
|
write = setSkinColor
|
||||||
notify = skinColorChanged
|
notify = skinColorChanged
|
||||||
|
|
||||||
|
|
||||||
proc showDeleteMessageWarningChanged*(self: LocalAccountSensitiveSettings) {.signal.}
|
proc showDeleteMessageWarningChanged*(self: LocalAccountSensitiveSettings) {.signal.}
|
||||||
|
@ -599,7 +599,7 @@ QtObject:
|
||||||
QtProperty[string] activeSection:
|
QtProperty[string] activeSection:
|
||||||
read = getActiveSection
|
read = getActiveSection
|
||||||
write = setActiveSection
|
write = setActiveSection
|
||||||
notify = activeSectionChanged
|
notify = activeSectionChanged
|
||||||
|
|
||||||
|
|
||||||
proc showBrowserSelectorChanged*(self: LocalAccountSensitiveSettings) {.signal.}
|
proc showBrowserSelectorChanged*(self: LocalAccountSensitiveSettings) {.signal.}
|
||||||
|
@ -651,7 +651,7 @@ QtObject:
|
||||||
QtProperty[string] browserHomepage:
|
QtProperty[string] browserHomepage:
|
||||||
read = getBrowserHomepage
|
read = getBrowserHomepage
|
||||||
write = setBrowserHomepage
|
write = setBrowserHomepage
|
||||||
notify = browserHomepageChanged
|
notify = browserHomepageChanged
|
||||||
|
|
||||||
|
|
||||||
proc shouldShowBrowserSearchEngineChanged*(self: LocalAccountSensitiveSettings) {.signal.}
|
proc shouldShowBrowserSearchEngineChanged*(self: LocalAccountSensitiveSettings) {.signal.}
|
||||||
|
@ -821,12 +821,12 @@ QtObject:
|
||||||
read = getStickersEnsRopsten
|
read = getStickersEnsRopsten
|
||||||
write = setStickersEnsRopsten
|
write = setStickersEnsRopsten
|
||||||
notify = stickersEnsRopstenChanged
|
notify = stickersEnsRopstenChanged
|
||||||
|
|
||||||
|
|
||||||
proc removeKey*(self: LocalAccountSensitiveSettings, key: string) =
|
proc removeKey*(self: LocalAccountSensitiveSettings, key: string) =
|
||||||
if(self.settings.isNil):
|
if(self.settings.isNil):
|
||||||
return
|
return
|
||||||
|
|
||||||
self.settings.remove(key)
|
self.settings.remove(key)
|
||||||
|
|
||||||
case key:
|
case key:
|
||||||
|
|
|
@ -16,7 +16,7 @@ QtObject:
|
||||||
type LocalAccountSettings* = ref object of QObject
|
type LocalAccountSettings* = ref object of QObject
|
||||||
settingsFileDir: string
|
settingsFileDir: string
|
||||||
settings: QSettings
|
settings: QSettings
|
||||||
|
|
||||||
proc setup(self: LocalAccountSettings) =
|
proc setup(self: LocalAccountSettings) =
|
||||||
self.QObject.setup
|
self.QObject.setup
|
||||||
self.settingsFileDir = os.joinPath(DATADIR, "qt")
|
self.settingsFileDir = os.joinPath(DATADIR, "qt")
|
||||||
|
@ -27,7 +27,7 @@ QtObject:
|
||||||
|
|
||||||
self.QObject.delete
|
self.QObject.delete
|
||||||
|
|
||||||
proc newLocalAccountSettings*():
|
proc newLocalAccountSettings*():
|
||||||
LocalAccountSettings =
|
LocalAccountSettings =
|
||||||
new(result, delete)
|
new(result, delete)
|
||||||
result.setup
|
result.setup
|
||||||
|
@ -45,7 +45,7 @@ QtObject:
|
||||||
proc removeKey*(self: LocalAccountSettings, key: string) =
|
proc removeKey*(self: LocalAccountSettings, key: string) =
|
||||||
if(self.settings.isNil):
|
if(self.settings.isNil):
|
||||||
return
|
return
|
||||||
|
|
||||||
self.settings.remove(key)
|
self.settings.remove(key)
|
||||||
|
|
||||||
if(key == LS_KEY_STORE_TO_KEYCHAIN):
|
if(key == LS_KEY_STORE_TO_KEYCHAIN):
|
||||||
|
@ -71,7 +71,7 @@ QtObject:
|
||||||
write = setStoreToKeychainValue
|
write = setStoreToKeychainValue
|
||||||
notify = storeToKeychainValueChanged
|
notify = storeToKeychainValueChanged
|
||||||
|
|
||||||
|
|
||||||
proc getIsKeycardEnabled*(self: LocalAccountSettings): bool {.slot.} =
|
proc getIsKeycardEnabled*(self: LocalAccountSettings): bool {.slot.} =
|
||||||
if(self.settings.isNil):
|
if(self.settings.isNil):
|
||||||
return DEFAULT_IS_KEYCARD_ENABLED
|
return DEFAULT_IS_KEYCARD_ENABLED
|
||||||
|
@ -88,4 +88,4 @@ QtObject:
|
||||||
QtProperty[bool] isKeycardEnabled:
|
QtProperty[bool] isKeycardEnabled:
|
||||||
read = getIsKeycardEnabled
|
read = getIsKeycardEnabled
|
||||||
write = setIsKeycardEnabled
|
write = setIsKeycardEnabled
|
||||||
notify = isKeycardEnabledChanged
|
notify = isKeycardEnabledChanged
|
||||||
|
|
|
@ -17,7 +17,7 @@ const DEFAULT_APP_SIZE_INITIALIZED = false
|
||||||
QtObject:
|
QtObject:
|
||||||
type LocalAppSettings* = ref object of QObject
|
type LocalAppSettings* = ref object of QObject
|
||||||
settings: QSettings
|
settings: QSettings
|
||||||
|
|
||||||
proc setup(self: LocalAppSettings) =
|
proc setup(self: LocalAppSettings) =
|
||||||
self.QObject.setup
|
self.QObject.setup
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ QtObject:
|
||||||
QtProperty[string] locale:
|
QtProperty[string] locale:
|
||||||
read = getLocale
|
read = getLocale
|
||||||
write = setLocale
|
write = setLocale
|
||||||
notify = localeChanged
|
notify = localeChanged
|
||||||
|
|
||||||
|
|
||||||
proc themeChanged*(self: LocalAppSettings) {.signal.}
|
proc themeChanged*(self: LocalAppSettings) {.signal.}
|
||||||
|
@ -56,7 +56,7 @@ QtObject:
|
||||||
QtProperty[int] theme:
|
QtProperty[int] theme:
|
||||||
read = getTheme
|
read = getTheme
|
||||||
write = setTheme
|
write = setTheme
|
||||||
notify = themeChanged
|
notify = themeChanged
|
||||||
|
|
||||||
proc appWidthChanged*(self: LocalAppSettings) {.signal.}
|
proc appWidthChanged*(self: LocalAppSettings) {.signal.}
|
||||||
proc getAppWidth*(self: LocalAppSettings): int {.slot.} =
|
proc getAppWidth*(self: LocalAppSettings): int {.slot.} =
|
||||||
|
@ -97,9 +97,9 @@ QtObject:
|
||||||
proc removeKey*(self: LocalAppSettings, key: string) =
|
proc removeKey*(self: LocalAppSettings, key: string) =
|
||||||
if(self.settings.isNil):
|
if(self.settings.isNil):
|
||||||
return
|
return
|
||||||
|
|
||||||
self.settings.remove(key)
|
self.settings.remove(key)
|
||||||
|
|
||||||
case key:
|
case key:
|
||||||
of LAS_KEY_LOCALE: self.localeChanged()
|
of LAS_KEY_LOCALE: self.localeChanged()
|
||||||
of LAS_KEY_THEME: self.themeChanged()
|
of LAS_KEY_THEME: self.themeChanged()
|
||||||
|
|
|
@ -18,7 +18,7 @@ QtObject:
|
||||||
largeImage: string
|
largeImage: string
|
||||||
userStatus: bool
|
userStatus: bool
|
||||||
#currentUserStatus: int
|
#currentUserStatus: int
|
||||||
|
|
||||||
proc setup(self: UserProfile) =
|
proc setup(self: UserProfile) =
|
||||||
self.QObject.setup
|
self.QObject.setup
|
||||||
|
|
||||||
|
@ -36,38 +36,38 @@ QtObject:
|
||||||
self.pubKey = pubKey
|
self.pubKey = pubKey
|
||||||
self.isIdenticon = true
|
self.isIdenticon = true
|
||||||
|
|
||||||
proc getAddress*(self: UserProfile): string {.slot.} =
|
proc getAddress*(self: UserProfile): string {.slot.} =
|
||||||
self.address
|
self.address
|
||||||
|
|
||||||
QtProperty[string] address:
|
QtProperty[string] address:
|
||||||
read = getAddress
|
read = getAddress
|
||||||
|
|
||||||
|
|
||||||
proc getPubKey*(self: UserProfile): string {.slot.} =
|
proc getPubKey*(self: UserProfile): string {.slot.} =
|
||||||
self.pubKey
|
self.pubKey
|
||||||
|
|
||||||
QtProperty[string] pubKey:
|
QtProperty[string] pubKey:
|
||||||
read = getPubKey
|
read = getPubKey
|
||||||
|
|
||||||
|
|
||||||
proc nameChanged*(self: UserProfile) {.signal.}
|
proc nameChanged*(self: UserProfile) {.signal.}
|
||||||
|
|
||||||
proc getUsername*(self: UserProfile): string {.slot.} =
|
proc getUsername*(self: UserProfile): string {.slot.} =
|
||||||
self.username
|
self.username
|
||||||
|
|
||||||
QtProperty[string] username:
|
QtProperty[string] username:
|
||||||
read = getUsername
|
read = getUsername
|
||||||
notify = nameChanged
|
notify = nameChanged
|
||||||
|
|
||||||
# this is not a slot
|
# this is not a slot
|
||||||
proc setEnsName*(self: UserProfile, name: string) =
|
proc setEnsName*(self: UserProfile, name: string) =
|
||||||
if(self.ensName == name):
|
if(self.ensName == name):
|
||||||
return
|
return
|
||||||
self.ensName = name
|
self.ensName = name
|
||||||
self.nameChanged()
|
self.nameChanged()
|
||||||
|
|
||||||
proc getEnsName*(self: UserProfile): string {.slot.} =
|
proc getEnsName*(self: UserProfile): string {.slot.} =
|
||||||
self.ensName
|
self.ensName
|
||||||
QtProperty[string] ensName:
|
QtProperty[string] ensName:
|
||||||
read = getEnsName
|
read = getEnsName
|
||||||
notify = nameChanged
|
notify = nameChanged
|
||||||
|
@ -80,14 +80,14 @@ QtObject:
|
||||||
|
|
||||||
|
|
||||||
# this is not a slot
|
# this is not a slot
|
||||||
proc setFirstEnsName*(self: UserProfile, name: string) =
|
proc setFirstEnsName*(self: UserProfile, name: string) =
|
||||||
if(self.firstEnsName == name):
|
if(self.firstEnsName == name):
|
||||||
return
|
return
|
||||||
self.firstEnsName = name
|
self.firstEnsName = name
|
||||||
self.nameChanged()
|
self.nameChanged()
|
||||||
|
|
||||||
proc getFirstEnsName*(self: UserProfile): string {.slot.} =
|
proc getFirstEnsName*(self: UserProfile): string {.slot.} =
|
||||||
self.firstEnsName
|
self.firstEnsName
|
||||||
QtProperty[string] firstEnsName:
|
QtProperty[string] firstEnsName:
|
||||||
read = getFirstEnsName
|
read = getFirstEnsName
|
||||||
notify = nameChanged
|
notify = nameChanged
|
||||||
|
@ -100,12 +100,12 @@ QtObject:
|
||||||
|
|
||||||
|
|
||||||
# this is not a slot
|
# this is not a slot
|
||||||
proc setPreferredName*(self: UserProfile, name: string) =
|
proc setPreferredName*(self: UserProfile, name: string) =
|
||||||
if(self.preferredName == name):
|
if(self.preferredName == name):
|
||||||
return
|
return
|
||||||
self.preferredName = name
|
self.preferredName = name
|
||||||
self.nameChanged()
|
self.nameChanged()
|
||||||
|
|
||||||
proc getPreferredName*(self: UserProfile): string {.slot.} =
|
proc getPreferredName*(self: UserProfile): string {.slot.} =
|
||||||
self.preferredName
|
self.preferredName
|
||||||
QtProperty[string] preferredName:
|
QtProperty[string] preferredName:
|
||||||
|
@ -127,7 +127,7 @@ QtObject:
|
||||||
elif(self.ensName.len > 0):
|
elif(self.ensName.len > 0):
|
||||||
return self.getPrettyEnsName()
|
return self.getPrettyEnsName()
|
||||||
return self.username
|
return self.username
|
||||||
|
|
||||||
QtProperty[string] name:
|
QtProperty[string] name:
|
||||||
read = getName
|
read = getName
|
||||||
notify = nameChanged
|
notify = nameChanged
|
||||||
|
@ -155,7 +155,7 @@ QtObject:
|
||||||
return self.identicon
|
return self.identicon
|
||||||
|
|
||||||
# this is not a slot
|
# this is not a slot
|
||||||
proc setThumbnailImage*(self: UserProfile, image: string) =
|
proc setThumbnailImage*(self: UserProfile, image: string) =
|
||||||
if(self.thumbnailImage == image):
|
if(self.thumbnailImage == image):
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@ -174,7 +174,7 @@ QtObject:
|
||||||
QtProperty[string] thumbnailImage:
|
QtProperty[string] thumbnailImage:
|
||||||
read = getThumbnailImage
|
read = getThumbnailImage
|
||||||
notify = imageChanged
|
notify = imageChanged
|
||||||
|
|
||||||
proc largeImageChanged*(self: UserProfile) {.signal.}
|
proc largeImageChanged*(self: UserProfile) {.signal.}
|
||||||
|
|
||||||
proc getLargeImage*(self: UserProfile): string {.slot.} =
|
proc getLargeImage*(self: UserProfile): string {.slot.} =
|
||||||
|
@ -196,8 +196,8 @@ QtObject:
|
||||||
|
|
||||||
|
|
||||||
proc userStatusChanged*(self: UserProfile) {.signal.}
|
proc userStatusChanged*(self: UserProfile) {.signal.}
|
||||||
|
|
||||||
proc getUserStatus*(self: UserProfile): bool {.slot.} =
|
proc getUserStatus*(self: UserProfile): bool {.slot.} =
|
||||||
self.userStatus
|
self.userStatus
|
||||||
|
|
||||||
# this is not a slot
|
# this is not a slot
|
||||||
|
@ -213,9 +213,9 @@ QtObject:
|
||||||
|
|
||||||
|
|
||||||
## This is still not in use.
|
## This is still not in use.
|
||||||
## Once we decide to differ more than Online/Offline statuses we shouldn't use this code below,
|
## Once we decide to differ more than Online/Offline statuses we shouldn't use this code below,
|
||||||
## but update current `userStatus` which is a bool to something like the code bellow (`currentUserStatus`).
|
## but update current `userStatus` which is a bool to something like the code bellow (`currentUserStatus`).
|
||||||
##
|
##
|
||||||
## Proposal - some statuses we may have:
|
## Proposal - some statuses we may have:
|
||||||
## type
|
## type
|
||||||
## OnlineStatus* {.pure.} = enum
|
## OnlineStatus* {.pure.} = enum
|
||||||
|
@ -224,8 +224,8 @@ QtObject:
|
||||||
## DoNotDisturb
|
## DoNotDisturb
|
||||||
## Invisible
|
## Invisible
|
||||||
## Offline
|
## Offline
|
||||||
##
|
##
|
||||||
##
|
##
|
||||||
## proc currentUserStatusChanged*(self: UserProfile) {.signal.}
|
## proc currentUserStatusChanged*(self: UserProfile) {.signal.}
|
||||||
|
|
||||||
## proc getCurrentUserStatus*(self: UserProfile): int {.slot.} =
|
## proc getCurrentUserStatus*(self: UserProfile): int {.slot.} =
|
||||||
|
|
|
@ -9,7 +9,7 @@ import ../../app_service/service/accounts/service as procs_from_accounts
|
||||||
|
|
||||||
QtObject:
|
QtObject:
|
||||||
type Utils* = ref object of QObject
|
type Utils* = ref object of QObject
|
||||||
|
|
||||||
proc setup(self: Utils) =
|
proc setup(self: Utils) =
|
||||||
self.QObject.setup
|
self.QObject.setup
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ QtObject:
|
||||||
proc hex2Ascii*(self: Utils, value: string): string {.slot.} =
|
proc hex2Ascii*(self: Utils, value: string): string {.slot.} =
|
||||||
result = string.fromBytes(hexToSeqByte(value))
|
result = string.fromBytes(hexToSeqByte(value))
|
||||||
|
|
||||||
proc ascii2Hex*(self: Utils, value: string): string {.slot.} =
|
proc ascii2Hex*(self: Utils, value: string): string {.slot.} =
|
||||||
result = "0x" & toHex(value)
|
result = "0x" & toHex(value)
|
||||||
|
|
||||||
proc stripTrailingZeroes(value: string): string =
|
proc stripTrailingZeroes(value: string): string =
|
||||||
|
@ -118,4 +118,4 @@ QtObject:
|
||||||
result = "data:image/svg+xml;utf8," & self.generateQRCodeSVG(text, 2)
|
result = "data:image/svg+xml;utf8," & self.generateQRCodeSVG(text, 2)
|
||||||
|
|
||||||
proc plainText*(self: Utils, text: string): string {.slot.} =
|
proc plainText*(self: Utils, text: string): string {.slot.} =
|
||||||
result = plain_text(text)
|
result = plain_text(text)
|
||||||
|
|
|
@ -161,4 +161,4 @@ proc qrcodegen_getSize*(qrcode: ptr uint8): cint {.importc: "qrcodegen_getSize".
|
||||||
## If the given coordinates are out of bounds, then false (white) is returned.
|
## If the given coordinates are out of bounds, then false (white) is returned.
|
||||||
##
|
##
|
||||||
|
|
||||||
proc qrcodegen_getModule*(qrcode: ptr uint8; x: cint; y: cint): bool {.importc: "qrcodegen_getModule".}
|
proc qrcodegen_getModule*(qrcode: ptr uint8; x: cint; y: cint): bool {.importc: "qrcodegen_getModule".}
|
||||||
|
|
|
@ -10,7 +10,7 @@ import ../../../../app_service/service/eth/utils as eth_utils
|
||||||
|
|
||||||
export controller_interface
|
export controller_interface
|
||||||
|
|
||||||
type
|
type
|
||||||
Controller*[T: controller_interface.DelegateInterface] = ref object of controller_interface.AccessInterface
|
Controller*[T: controller_interface.DelegateInterface] = ref object of controller_interface.AccessInterface
|
||||||
delegate: io_interface.AccessInterface
|
delegate: io_interface.AccessInterface
|
||||||
events: EventEmitter
|
events: EventEmitter
|
||||||
|
@ -104,4 +104,4 @@ method decodeContentHash*[T](self: Controller[T], hash: string): string =
|
||||||
return eth_utils.decodeContentHash(hash)
|
return eth_utils.decodeContentHash(hash)
|
||||||
|
|
||||||
method switchTo*[T](self: Controller[T], sectionId, chatId, messageId: string) =
|
method switchTo*[T](self: Controller[T], sectionId, chatId, messageId: string) =
|
||||||
self.messageService.switchTo(sectionId, chatId, messageId)
|
self.messageService.switchTo(sectionId, chatId, messageId)
|
||||||
|
|
|
@ -2,7 +2,7 @@ import ../../../../app_service/service/contacts/service as contacts_service
|
||||||
import ../../../../app_service/service/activity_center/service as activity_center_service
|
import ../../../../app_service/service/activity_center/service as activity_center_service
|
||||||
import ../../../../app_service/service/message/dto/[message]
|
import ../../../../app_service/service/message/dto/[message]
|
||||||
|
|
||||||
type
|
type
|
||||||
AccessInterface* {.pure inheritable.} = ref object of RootObj
|
AccessInterface* {.pure inheritable.} = ref object of RootObj
|
||||||
## Abstract class for any input/interaction with this module.
|
## Abstract class for any input/interaction with this module.
|
||||||
|
|
||||||
|
@ -50,6 +50,6 @@ method switchTo*(self: AccessInterface, sectionId, chatId, messageId: string) {.
|
||||||
|
|
||||||
|
|
||||||
type
|
type
|
||||||
## Abstract class (concept) which must be implemented by object/s used in this
|
## Abstract class (concept) which must be implemented by object/s used in this
|
||||||
## module.
|
## module.
|
||||||
DelegateInterface* = concept c
|
DelegateInterface* = concept c
|
||||||
|
|
|
@ -2,7 +2,7 @@ import Tables, stint
|
||||||
import ./item
|
import ./item
|
||||||
import ../../../../app_service/service/activity_center/service as activity_center_service
|
import ../../../../app_service/service/activity_center/service as activity_center_service
|
||||||
|
|
||||||
type
|
type
|
||||||
AccessInterface* {.pure inheritable.} = ref object of RootObj
|
AccessInterface* {.pure inheritable.} = ref object of RootObj
|
||||||
## Abstract class for any input/interaction with this module.
|
## Abstract class for any input/interaction with this module.
|
||||||
|
|
||||||
|
@ -16,61 +16,61 @@ method isLoaded*(self: AccessInterface): bool {.base.} =
|
||||||
raise newException(ValueError, "No implementation available")
|
raise newException(ValueError, "No implementation available")
|
||||||
|
|
||||||
method viewDidLoad*(self: AccessInterface) {.base.} =
|
method viewDidLoad*(self: AccessInterface) {.base.} =
|
||||||
raise newException(ValueError, "No implementation available")
|
raise newException(ValueError, "No implementation available")
|
||||||
|
|
||||||
method hasMoreToShow*(self: AccessInterface): bool {.base.} =
|
method hasMoreToShow*(self: AccessInterface): bool {.base.} =
|
||||||
raise newException(ValueError, "No implementation available")
|
raise newException(ValueError, "No implementation available")
|
||||||
|
|
||||||
method unreadActivityCenterNotificationsCount*(self: AccessInterface): int {.base.} =
|
method unreadActivityCenterNotificationsCount*(self: AccessInterface): int {.base.} =
|
||||||
raise newException(ValueError, "No implementation available")
|
raise newException(ValueError, "No implementation available")
|
||||||
|
|
||||||
method convertToItems*(self: AccessInterface, activityCenterNotifications: seq[ActivityCenterNotificationDto]): seq[Item] {.base.} =
|
method convertToItems*(self: AccessInterface, activityCenterNotifications: seq[ActivityCenterNotificationDto]): seq[Item] {.base.} =
|
||||||
raise newException(ValueError, "No implementation available")
|
raise newException(ValueError, "No implementation available")
|
||||||
|
|
||||||
method getActivityCenterNotifications*(self: AccessInterface): seq[Item] {.base.} =
|
method getActivityCenterNotifications*(self: AccessInterface): seq[Item] {.base.} =
|
||||||
raise newException(ValueError, "No implementation available")
|
raise newException(ValueError, "No implementation available")
|
||||||
|
|
||||||
method markAllActivityCenterNotificationsRead*(self: AccessInterface): string {.base.} =
|
method markAllActivityCenterNotificationsRead*(self: AccessInterface): string {.base.} =
|
||||||
raise newException(ValueError, "No implementation available")
|
raise newException(ValueError, "No implementation available")
|
||||||
|
|
||||||
method markAllActivityCenterNotificationsReadDone*(self: AccessInterface) {.base.} =
|
method markAllActivityCenterNotificationsReadDone*(self: AccessInterface) {.base.} =
|
||||||
raise newException(ValueError, "No implementation available")
|
raise newException(ValueError, "No implementation available")
|
||||||
|
|
||||||
method dismissActivityCenterNotificationsDone*(self: AccessInterface, notificationIds: seq[string]) {.base.} =
|
method dismissActivityCenterNotificationsDone*(self: AccessInterface, notificationIds: seq[string]) {.base.} =
|
||||||
raise newException(ValueError, "No implementation available")
|
raise newException(ValueError, "No implementation available")
|
||||||
|
|
||||||
method markActivityCenterNotificationReadDone*(self: AccessInterface, notificationIds: seq[string]) {.base.} =
|
method markActivityCenterNotificationReadDone*(self: AccessInterface, notificationIds: seq[string]) {.base.} =
|
||||||
raise newException(ValueError, "No implementation available")
|
raise newException(ValueError, "No implementation available")
|
||||||
|
|
||||||
method markActivityCenterNotificationUnreadDone*(self: AccessInterface, notificationIds: seq[string]) {.base.} =
|
method markActivityCenterNotificationUnreadDone*(self: AccessInterface, notificationIds: seq[string]) {.base.} =
|
||||||
raise newException(ValueError, "No implementation available")
|
raise newException(ValueError, "No implementation available")
|
||||||
|
|
||||||
method acceptActivityCenterNotificationsDone*(self: AccessInterface, notificationIds: seq[string]) {.base.} =
|
method acceptActivityCenterNotificationsDone*(self: AccessInterface, notificationIds: seq[string]) {.base.} =
|
||||||
raise newException(ValueError, "No implementation available")
|
raise newException(ValueError, "No implementation available")
|
||||||
|
|
||||||
method markActivityCenterNotificationRead*(self: AccessInterface, notificationId: string, communityId: string, channelId: string, nType: int): string {.base.} =
|
method markActivityCenterNotificationRead*(self: AccessInterface, notificationId: string, communityId: string, channelId: string, nType: int): string {.base.} =
|
||||||
raise newException(ValueError, "No implementation available")
|
raise newException(ValueError, "No implementation available")
|
||||||
|
|
||||||
method markActivityCenterNotificationUnread*(self: AccessInterface, notificationId: string, communityId: string, channelId: string, nType: int): string {.base.} =
|
method markActivityCenterNotificationUnread*(self: AccessInterface, notificationId: string, communityId: string, channelId: string, nType: int): string {.base.} =
|
||||||
raise newException(ValueError, "No implementation available")
|
raise newException(ValueError, "No implementation available")
|
||||||
|
|
||||||
method pushActivityCenterNotifications*(self: AccessInterface, activityCenterNotifications: seq[ActivityCenterNotificationDto]) {.base.} =
|
method pushActivityCenterNotifications*(self: AccessInterface, activityCenterNotifications: seq[ActivityCenterNotificationDto]) {.base.} =
|
||||||
raise newException(ValueError, "No implementation available")
|
raise newException(ValueError, "No implementation available")
|
||||||
|
|
||||||
method addActivityCenterNotification*(self: AccessInterface, activityCenterNotifications: seq[ActivityCenterNotificationDto]) {.base.} =
|
method addActivityCenterNotification*(self: AccessInterface, activityCenterNotifications: seq[ActivityCenterNotificationDto]) {.base.} =
|
||||||
raise newException(ValueError, "No implementation available")
|
raise newException(ValueError, "No implementation available")
|
||||||
|
|
||||||
method acceptActivityCenterNotifications*(self: AccessInterface, notificationIds: seq[string]): string {.base.} =
|
method acceptActivityCenterNotifications*(self: AccessInterface, notificationIds: seq[string]): string {.base.} =
|
||||||
raise newException(ValueError, "No implementation available")
|
raise newException(ValueError, "No implementation available")
|
||||||
|
|
||||||
method dismissActivityCenterNotifications*(self: AccessInterface, notificationIds: seq[string]): string {.base.} =
|
method dismissActivityCenterNotifications*(self: AccessInterface, notificationIds: seq[string]): string {.base.} =
|
||||||
raise newException(ValueError, "No implementation available")
|
raise newException(ValueError, "No implementation available")
|
||||||
|
|
||||||
method switchTo*(self: AccessInterface, sectionId, chatId, messageId: string) {.base.} =
|
method switchTo*(self: AccessInterface, sectionId, chatId, messageId: string) {.base.} =
|
||||||
raise newException(ValueError, "No implementation available")
|
raise newException(ValueError, "No implementation available")
|
||||||
|
|
||||||
type
|
type
|
||||||
## Abstract class (concept) which must be implemented by object/s used in this
|
## Abstract class (concept) which must be implemented by object/s used in this
|
||||||
## module.
|
## module.
|
||||||
DelegateInterface* = concept c
|
DelegateInterface* = concept c
|
||||||
c.activityCenterDidLoad()
|
c.activityCenterDidLoad()
|
||||||
|
|
|
@ -39,7 +39,7 @@ proc initItem*(
|
||||||
|
|
||||||
proc `$`*(self: Item): string =
|
proc `$`*(self: Item): string =
|
||||||
result = fmt"""StickerItem(
|
result = fmt"""StickerItem(
|
||||||
id: {self.id},
|
id: {self.id},
|
||||||
name: {$self.name},
|
name: {$self.name},
|
||||||
chatId: {$self.chatId},
|
chatId: {$self.chatId},
|
||||||
author: {$self.author},
|
author: {$self.author},
|
||||||
|
@ -51,35 +51,35 @@ proc `$`*(self: Item): string =
|
||||||
# messageItem: {$self.messageItem},
|
# messageItem: {$self.messageItem},
|
||||||
]"""
|
]"""
|
||||||
|
|
||||||
proc id*(self: Item): string =
|
proc id*(self: Item): string =
|
||||||
return self.id
|
return self.id
|
||||||
|
|
||||||
proc name*(self: Item): string =
|
proc name*(self: Item): string =
|
||||||
return self.name
|
return self.name
|
||||||
|
|
||||||
proc author*(self: Item): string =
|
proc author*(self: Item): string =
|
||||||
return self.author
|
return self.author
|
||||||
|
|
||||||
proc chatId*(self: Item): string =
|
proc chatId*(self: Item): string =
|
||||||
return self.chatId
|
return self.chatId
|
||||||
|
|
||||||
proc notificationType*(self: Item): int =
|
proc notificationType*(self: Item): int =
|
||||||
return self.notificationType
|
return self.notificationType
|
||||||
|
|
||||||
proc timestamp*(self: Item): int64 =
|
proc timestamp*(self: Item): int64 =
|
||||||
return self.timestamp
|
return self.timestamp
|
||||||
|
|
||||||
proc read*(self: Item): bool =
|
proc read*(self: Item): bool =
|
||||||
return self.read
|
return self.read
|
||||||
|
|
||||||
proc `read=`*(self: Item, value: bool) =
|
proc `read=`*(self: Item, value: bool) =
|
||||||
self.read = value
|
self.read = value
|
||||||
|
|
||||||
proc dismissed*(self: Item): bool =
|
proc dismissed*(self: Item): bool =
|
||||||
return self.dismissed
|
return self.dismissed
|
||||||
|
|
||||||
proc accepted*(self: Item): bool =
|
proc accepted*(self: Item): bool =
|
||||||
return self.accepted
|
return self.accepted
|
||||||
|
|
||||||
proc messageItem*(self: Item): MessageItem =
|
proc messageItem*(self: Item): MessageItem =
|
||||||
return self.messageItem
|
return self.messageItem
|
||||||
|
|
|
@ -22,7 +22,7 @@ QtObject:
|
||||||
|
|
||||||
proc setup(self: Model) = self.QAbstractListModel.setup
|
proc setup(self: Model) = self.QAbstractListModel.setup
|
||||||
|
|
||||||
proc delete(self: Model) =
|
proc delete(self: Model) =
|
||||||
self.activityCenterNotifications = @[]
|
self.activityCenterNotifications = @[]
|
||||||
self.QAbstractListModel.delete
|
self.QAbstractListModel.delete
|
||||||
|
|
||||||
|
@ -52,7 +52,7 @@ QtObject:
|
||||||
|
|
||||||
for activityCenterNotification in self.activityCenterNotifications:
|
for activityCenterNotification in self.activityCenterNotifications:
|
||||||
activityCenterNotification.read = true
|
activityCenterNotification.read = true
|
||||||
|
|
||||||
let topLeft = self.createIndex(0, 0, nil)
|
let topLeft = self.createIndex(0, 0, nil)
|
||||||
let bottomRight = self.createIndex(self.activityCenterNotifications.len - 1, 0, nil)
|
let bottomRight = self.createIndex(self.activityCenterNotifications.len - 1, 0, nil)
|
||||||
self.dataChanged(topLeft, bottomRight, @[NotifRoles.Read.int])
|
self.dataChanged(topLeft, bottomRight, @[NotifRoles.Read.int])
|
||||||
|
@ -108,7 +108,7 @@ QtObject:
|
||||||
NotifRoles.Dismissed.int: "dismissed",
|
NotifRoles.Dismissed.int: "dismissed",
|
||||||
NotifRoles.Accepted.int: "accepted"
|
NotifRoles.Accepted.int: "accepted"
|
||||||
}.toTable
|
}.toTable
|
||||||
|
|
||||||
proc reduceUnreadCount(self: Model, numberNotifs: int) =
|
proc reduceUnreadCount(self: Model, numberNotifs: int) =
|
||||||
self.nbUnreadNotifications = self.nbUnreadNotifications - numberNotifs
|
self.nbUnreadNotifications = self.nbUnreadNotifications - numberNotifs
|
||||||
if (self.nbUnreadNotifications < 0):
|
if (self.nbUnreadNotifications < 0):
|
||||||
|
@ -152,7 +152,7 @@ QtObject:
|
||||||
indexesToDelete.add(i)
|
indexesToDelete.add(i)
|
||||||
break
|
break
|
||||||
i = i + 1
|
i = i + 1
|
||||||
|
|
||||||
i = 0
|
i = 0
|
||||||
for index in indexesToDelete:
|
for index in indexesToDelete:
|
||||||
let indexUpdated = index - i
|
let indexUpdated = index - i
|
||||||
|
|
|
@ -12,7 +12,7 @@ import ../../../../app_service/service/message/service as message_service
|
||||||
|
|
||||||
export io_interface
|
export io_interface
|
||||||
|
|
||||||
type
|
type
|
||||||
Module* [T: io_interface.DelegateInterface] = ref object of io_interface.AccessInterface
|
Module* [T: io_interface.DelegateInterface] = ref object of io_interface.AccessInterface
|
||||||
delegate: T
|
delegate: T
|
||||||
controller: controller.AccessInterface
|
controller: controller.AccessInterface
|
||||||
|
@ -77,7 +77,7 @@ method convertToItems*[T](
|
||||||
n.message.`from`,
|
n.message.`from`,
|
||||||
contactDetails.displayName,
|
contactDetails.displayName,
|
||||||
contactDetails.details.localNickname,
|
contactDetails.details.localNickname,
|
||||||
contactDetails.icon,
|
contactDetails.icon,
|
||||||
contactDetails.isIdenticon,
|
contactDetails.isIdenticon,
|
||||||
contactDetails.isCurrentUser,
|
contactDetails.isCurrentUser,
|
||||||
n.message.outgoingStatus,
|
n.message.outgoingStatus,
|
||||||
|
@ -86,13 +86,13 @@ method convertToItems*[T](
|
||||||
n.message.containsContactMentions(),
|
n.message.containsContactMentions(),
|
||||||
n.message.seen,
|
n.message.seen,
|
||||||
n.message.timestamp,
|
n.message.timestamp,
|
||||||
ContentType(n.message.contentType),
|
ContentType(n.message.contentType),
|
||||||
n.message.messageType,
|
n.message.messageType,
|
||||||
self.controller.decodeContentHash(n.message.sticker.hash),
|
self.controller.decodeContentHash(n.message.sticker.hash),
|
||||||
n.message.sticker.pack,
|
n.message.sticker.pack,
|
||||||
n.message.links,
|
n.message.links,
|
||||||
))
|
))
|
||||||
|
|
||||||
return notification_item.initItem(
|
return notification_item.initItem(
|
||||||
n.id,
|
n.id,
|
||||||
n.chatId,
|
n.chatId,
|
||||||
|
@ -183,4 +183,4 @@ method dismissActivityCenterNotifications*[T](self: Module[T], notificationIds:
|
||||||
self.controller.dismissActivityCenterNotifications(notificationIds)
|
self.controller.dismissActivityCenterNotifications(notificationIds)
|
||||||
|
|
||||||
method switchTo*[T](self: Module[T], sectionId, chatId, messageId: string) =
|
method switchTo*[T](self: Module[T], sectionId, chatId, messageId: string) =
|
||||||
self.controller.switchTo(sectionId, chatId, messageId)
|
self.controller.switchTo(sectionId, chatId, messageId)
|
||||||
|
|
|
@ -32,7 +32,7 @@ QtObject:
|
||||||
QtProperty[QVariant] model:
|
QtProperty[QVariant] model:
|
||||||
read = getModel
|
read = getModel
|
||||||
notify = activityNotificationsChanged
|
notify = activityNotificationsChanged
|
||||||
|
|
||||||
proc hasMoreToShowChanged*(self: View) {.signal.}
|
proc hasMoreToShowChanged*(self: View) {.signal.}
|
||||||
|
|
||||||
proc hasMoreToShow*(self: View): bool {.slot.} =
|
proc hasMoreToShow*(self: View): bool {.slot.} =
|
||||||
|
@ -101,7 +101,7 @@ QtObject:
|
||||||
|
|
||||||
proc acceptActivityCenterNotificationsDone*(self: View, notificationIds: seq[string]) =
|
proc acceptActivityCenterNotificationsDone*(self: View, notificationIds: seq[string]) =
|
||||||
self.model.removeNotifications(notificationIds)
|
self.model.removeNotifications(notificationIds)
|
||||||
|
|
||||||
proc acceptActivityCenterNotification(self: View, id: string): string {.slot.} =
|
proc acceptActivityCenterNotification(self: View, id: string): string {.slot.} =
|
||||||
self.acceptActivityCenterNotifications(fmt"[""{id}""]")
|
self.acceptActivityCenterNotifications(fmt"[""{id}""]")
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
type
|
type
|
||||||
BaseItem* {.pure inheritable.} = ref object of RootObj
|
BaseItem* {.pure inheritable.} = ref object of RootObj
|
||||||
value: string
|
value: string
|
||||||
text: string
|
text: string
|
||||||
|
@ -19,23 +19,23 @@ proc initBaseItem*(value, text, image, icon, iconColor: string, isIdenticon: boo
|
||||||
result = BaseItem()
|
result = BaseItem()
|
||||||
result.setup(value, text, image, icon, iconColor, isIdenticon)
|
result.setup(value, text, image, icon, iconColor, isIdenticon)
|
||||||
|
|
||||||
proc delete*(self: BaseItem) =
|
proc delete*(self: BaseItem) =
|
||||||
discard
|
discard
|
||||||
|
|
||||||
method value*(self: BaseItem): string {.inline base.} =
|
method value*(self: BaseItem): string {.inline base.} =
|
||||||
self.value
|
self.value
|
||||||
|
|
||||||
method text*(self: BaseItem): string {.inline base.} =
|
method text*(self: BaseItem): string {.inline base.} =
|
||||||
self.text
|
self.text
|
||||||
|
|
||||||
method image*(self: BaseItem): string {.inline base.} =
|
method image*(self: BaseItem): string {.inline base.} =
|
||||||
self.image
|
self.image
|
||||||
|
|
||||||
method icon*(self: BaseItem): string {.inline base.} =
|
method icon*(self: BaseItem): string {.inline base.} =
|
||||||
self.icon
|
self.icon
|
||||||
|
|
||||||
method iconColor*(self: BaseItem): string {.inline base.} =
|
method iconColor*(self: BaseItem): string {.inline base.} =
|
||||||
self.iconColor
|
self.iconColor
|
||||||
|
|
||||||
method isIdenticon*(self: BaseItem): bool {.inline base.} =
|
method isIdenticon*(self: BaseItem): bool {.inline base.} =
|
||||||
self.isIdenticon
|
self.isIdenticon
|
||||||
|
|
|
@ -21,11 +21,11 @@ type ResultItemDetails = object
|
||||||
messageId*: string
|
messageId*: string
|
||||||
|
|
||||||
method isEmpty(self: ResultItemDetails): bool =
|
method isEmpty(self: ResultItemDetails): bool =
|
||||||
self.sectionId.len == 0 and
|
self.sectionId.len == 0 and
|
||||||
self.channelId.len == 0 and
|
self.channelId.len == 0 and
|
||||||
self.messageId.len == 0
|
self.messageId.len == 0
|
||||||
|
|
||||||
type
|
type
|
||||||
Controller* = ref object of controller_interface.AccessInterface
|
Controller* = ref object of controller_interface.AccessInterface
|
||||||
delegate: io_interface.AccessInterface
|
delegate: io_interface.AccessInterface
|
||||||
events: EventEmitter
|
events: EventEmitter
|
||||||
|
@ -41,7 +41,7 @@ type
|
||||||
resultItems: Table[string, ResultItemDetails] # [resultItemId, ResultItemDetails]
|
resultItems: Table[string, ResultItemDetails] # [resultItemId, ResultItemDetails]
|
||||||
|
|
||||||
proc newController*(delegate: io_interface.AccessInterface, events: EventEmitter, contactsService: contact_service.Service,
|
proc newController*(delegate: io_interface.AccessInterface, events: EventEmitter, contactsService: contact_service.Service,
|
||||||
chatService: chat_service.Service, communityService: community_service.Service,
|
chatService: chat_service.Service, communityService: community_service.Service,
|
||||||
messageService: message_service.Service): Controller =
|
messageService: message_service.Service): Controller =
|
||||||
result = Controller()
|
result = Controller()
|
||||||
result.delegate = delegate
|
result.delegate = delegate
|
||||||
|
@ -51,11 +51,11 @@ proc newController*(delegate: io_interface.AccessInterface, events: EventEmitter
|
||||||
result.communityService = communityService
|
result.communityService = communityService
|
||||||
result.messageService = messageService
|
result.messageService = messageService
|
||||||
result.resultItems = initTable[string, ResultItemDetails]()
|
result.resultItems = initTable[string, ResultItemDetails]()
|
||||||
|
|
||||||
method delete*(self: Controller) =
|
method delete*(self: Controller) =
|
||||||
self.resultItems.clear
|
self.resultItems.clear
|
||||||
|
|
||||||
method init*(self: Controller) =
|
method init*(self: Controller) =
|
||||||
self.events.on(SIGNAL_SEARCH_MESSAGES_LOADED) do(e:Args):
|
self.events.on(SIGNAL_SEARCH_MESSAGES_LOADED) do(e:Args):
|
||||||
let args = MessagesArgs(e)
|
let args = MessagesArgs(e)
|
||||||
self.delegate.onSearchMessagesDone(args.messages)
|
self.delegate.onSearchMessagesDone(args.messages)
|
||||||
|
@ -79,8 +79,8 @@ method searchLocation*(self: Controller): string =
|
||||||
method searchSubLocation*(self: Controller): string =
|
method searchSubLocation*(self: Controller): string =
|
||||||
return self.searchSubLocation
|
return self.searchSubLocation
|
||||||
|
|
||||||
method setSearchLocation*(self: Controller, location: string, subLocation: string) =
|
method setSearchLocation*(self: Controller, location: string, subLocation: string) =
|
||||||
## Setting location and subLocation to an empty string means we're
|
## Setting location and subLocation to an empty string means we're
|
||||||
## searching in all available chats/channels/communities.
|
## searching in all available chats/channels/communities.
|
||||||
self.searchLocation = location
|
self.searchLocation = location
|
||||||
self.searchSubLocation = subLocation
|
self.searchSubLocation = subLocation
|
||||||
|
@ -132,11 +132,11 @@ method searchMessages*(self: Controller, searchTerm: string) =
|
||||||
|
|
||||||
self.messageService.asyncSearchMessages(communities, chats, self.searchTerm, false)
|
self.messageService.asyncSearchMessages(communities, chats, self.searchTerm, false)
|
||||||
|
|
||||||
method getOneToOneChatNameAndImage*(self: Controller, chatId: string):
|
method getOneToOneChatNameAndImage*(self: Controller, chatId: string):
|
||||||
tuple[name: string, image: string, isIdenticon: bool] =
|
tuple[name: string, image: string, isIdenticon: bool] =
|
||||||
return self.chatService.getOneToOneChatNameAndImage(chatId)
|
return self.chatService.getOneToOneChatNameAndImage(chatId)
|
||||||
|
|
||||||
method getContactNameAndImage*(self: Controller, contactId: string):
|
method getContactNameAndImage*(self: Controller, contactId: string):
|
||||||
tuple[name: string, image: string, isIdenticon: bool] =
|
tuple[name: string, image: string, isIdenticon: bool] =
|
||||||
return self.contactsService.getContactNameAndImage(contactId)
|
return self.contactsService.getContactNameAndImage(contactId)
|
||||||
|
|
||||||
|
@ -149,5 +149,5 @@ method resultItemClicked*(self: Controller, itemId: string) =
|
||||||
# we shouldn't be here ever
|
# we shouldn't be here ever
|
||||||
info "important: we don't have stored details for a searched result item with id: ", itemId
|
info "important: we don't have stored details for a searched result item with id: ", itemId
|
||||||
return
|
return
|
||||||
|
|
||||||
self.messageService.switchTo(itemDetails.sectionId, itemDetails.channelId, itemDetails.messageId)
|
self.messageService.switchTo(itemDetails.sectionId, itemDetails.channelId, itemDetails.messageId)
|
||||||
|
|
|
@ -2,7 +2,7 @@ import ../../../../app_service/service/contacts/dto/contacts
|
||||||
import ../../../../app_service/service/chat/dto/chat
|
import ../../../../app_service/service/chat/dto/chat
|
||||||
import ../../../../app_service/service/community/dto/community
|
import ../../../../app_service/service/community/dto/community
|
||||||
|
|
||||||
type
|
type
|
||||||
AccessInterface* {.pure inheritable.} = ref object of RootObj
|
AccessInterface* {.pure inheritable.} = ref object of RootObj
|
||||||
## Abstract class for any input/interaction with this module.
|
## Abstract class for any input/interaction with this module.
|
||||||
|
|
||||||
|
@ -51,17 +51,17 @@ method getChatDetails*(self: AccessInterface, communityId, chatId: string): Chat
|
||||||
method searchMessages*(self: AccessInterface, searchTerm: string) {.base.} =
|
method searchMessages*(self: AccessInterface, searchTerm: string) {.base.} =
|
||||||
raise newException(ValueError, "No implementation available")
|
raise newException(ValueError, "No implementation available")
|
||||||
|
|
||||||
method getOneToOneChatNameAndImage*(self: AccessInterface, chatId: string):
|
method getOneToOneChatNameAndImage*(self: AccessInterface, chatId: string):
|
||||||
tuple[name: string, image: string, isIdenticon: bool] {.base.} =
|
tuple[name: string, image: string, isIdenticon: bool] {.base.} =
|
||||||
raise newException(ValueError, "No implementation available")
|
raise newException(ValueError, "No implementation available")
|
||||||
|
|
||||||
method getContactNameAndImage*(self: AccessInterface, contactId: string):
|
method getContactNameAndImage*(self: AccessInterface, contactId: string):
|
||||||
tuple[name: string, image: string, isIdenticon: bool] {.base.} =
|
tuple[name: string, image: string, isIdenticon: bool] {.base.} =
|
||||||
raise newException(ValueError, "No implementation available")
|
raise newException(ValueError, "No implementation available")
|
||||||
|
|
||||||
method addResultItemDetails*(self: AccessInterface, itemId: string, sectionId = "", channelId = "", messageId = "")
|
method addResultItemDetails*(self: AccessInterface, itemId: string, sectionId = "", channelId = "", messageId = "")
|
||||||
{.base.} =
|
{.base.} =
|
||||||
raise newException(ValueError, "No implementation available")
|
raise newException(ValueError, "No implementation available")
|
||||||
|
|
||||||
method resultItemClicked*(self: AccessInterface, itemId: string) {.base.} =
|
method resultItemClicked*(self: AccessInterface, itemId: string) {.base.} =
|
||||||
raise newException(ValueError, "No implementation available")
|
raise newException(ValueError, "No implementation available")
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
import json, strformat
|
import json, strformat
|
||||||
import base_item, location_menu_sub_model, location_menu_sub_item
|
import base_item, location_menu_sub_model, location_menu_sub_item
|
||||||
|
|
||||||
type
|
type
|
||||||
Item* = ref object of BaseItem
|
Item* = ref object of BaseItem
|
||||||
subItems: SubModel
|
subItems: SubModel
|
||||||
|
|
||||||
|
@ -11,19 +11,19 @@ proc initItem*(value, text, image, icon, iconColor: string = "", isIdenticon: bo
|
||||||
result.setup(value, text, image, icon, iconColor, isIdenticon)
|
result.setup(value, text, image, icon, iconColor, isIdenticon)
|
||||||
result.subItems = newSubModel()
|
result.subItems = newSubModel()
|
||||||
|
|
||||||
proc delete*(self: Item) =
|
proc delete*(self: Item) =
|
||||||
self.subItems.delete
|
self.subItems.delete
|
||||||
self.BaseItem.delete
|
self.BaseItem.delete
|
||||||
|
|
||||||
proc subItems*(self: Item): SubModel {.inline.} =
|
proc subItems*(self: Item): SubModel {.inline.} =
|
||||||
self.subItems
|
self.subItems
|
||||||
|
|
||||||
proc `$`*(self: Item): string =
|
proc `$`*(self: Item): string =
|
||||||
result = fmt"""SearchMenuItem(
|
result = fmt"""SearchMenuItem(
|
||||||
value: {self.value},
|
value: {self.value},
|
||||||
title: {self.text},
|
title: {self.text},
|
||||||
imageSource: {self.image},
|
imageSource: {self.image},
|
||||||
iconName: {self.icon},
|
iconName: {self.icon},
|
||||||
iconColor: {self.iconColor},
|
iconColor: {self.iconColor},
|
||||||
isIdenticon: {self.isIdenticon},
|
isIdenticon: {self.isIdenticon},
|
||||||
subItems:[
|
subItems:[
|
||||||
|
@ -44,4 +44,4 @@ proc setSubItems*(self: Item, subItems: seq[SubItem]) =
|
||||||
self.subItems.setItems(subItems)
|
self.subItems.setItems(subItems)
|
||||||
|
|
||||||
proc getSubItemForValue*(self: Item, value: string): SubItem =
|
proc getSubItemForValue*(self: Item, value: string): SubItem =
|
||||||
self.subItems.getItemForValue(value)
|
self.subItems.getItemForValue(value)
|
||||||
|
|
|
@ -55,19 +55,19 @@ QtObject:
|
||||||
let enumRole = role.ModelRole
|
let enumRole = role.ModelRole
|
||||||
|
|
||||||
case enumRole:
|
case enumRole:
|
||||||
of ModelRole.Value:
|
of ModelRole.Value:
|
||||||
result = newQVariant(item.value)
|
result = newQVariant(item.value)
|
||||||
of ModelRole.Title:
|
of ModelRole.Title:
|
||||||
result = newQVariant(item.text)
|
result = newQVariant(item.text)
|
||||||
of ModelRole.ImageSource:
|
of ModelRole.ImageSource:
|
||||||
result = newQVariant(item.image)
|
result = newQVariant(item.image)
|
||||||
of ModelRole.IconName:
|
of ModelRole.IconName:
|
||||||
result = newQVariant(item.icon)
|
result = newQVariant(item.icon)
|
||||||
of ModelRole.IconColor:
|
of ModelRole.IconColor:
|
||||||
result = newQVariant(item.iconColor)
|
result = newQVariant(item.iconColor)
|
||||||
of ModelRole.IsIdenticon:
|
of ModelRole.IsIdenticon:
|
||||||
result = newQVariant(item.isIdenticon)
|
result = newQVariant(item.isIdenticon)
|
||||||
of ModelRole.SubItems:
|
of ModelRole.SubItems:
|
||||||
result = newQVariant(item.subItems)
|
result = newQVariant(item.subItems)
|
||||||
|
|
||||||
proc setItems*(self: Model, items: seq[Item]) =
|
proc setItems*(self: Model, items: seq[Item]) =
|
||||||
|
|
|
@ -3,22 +3,22 @@ import base_item
|
||||||
|
|
||||||
export base_item
|
export base_item
|
||||||
|
|
||||||
type
|
type
|
||||||
SubItem* = ref object of BaseItem
|
SubItem* = ref object of BaseItem
|
||||||
|
|
||||||
proc initSubItem*(value, text, image, icon, iconColor: string, isIdenticon: bool): SubItem =
|
proc initSubItem*(value, text, image, icon, iconColor: string, isIdenticon: bool): SubItem =
|
||||||
result = SubItem()
|
result = SubItem()
|
||||||
result.setup(value, text, image, icon, iconColor, isIdenticon)
|
result.setup(value, text, image, icon, iconColor, isIdenticon)
|
||||||
|
|
||||||
proc delete*(self: SubItem) =
|
proc delete*(self: SubItem) =
|
||||||
self.BaseItem.delete
|
self.BaseItem.delete
|
||||||
|
|
||||||
proc `$`*(self: SubItem): string =
|
proc `$`*(self: SubItem): string =
|
||||||
result = fmt"""SearchMenuSubItem(
|
result = fmt"""SearchMenuSubItem(
|
||||||
value: {self.value},
|
value: {self.value},
|
||||||
text: {self.text},
|
text: {self.text},
|
||||||
imageSource: {self.image},
|
imageSource: {self.image},
|
||||||
iconName: {self.icon},
|
iconName: {self.icon},
|
||||||
iconColor: {self.iconColor},
|
iconColor: {self.iconColor},
|
||||||
isIdenticon: {self.isIdenticon}
|
isIdenticon: {self.isIdenticon}
|
||||||
]"""
|
]"""
|
||||||
|
@ -31,4 +31,4 @@ proc toJsonNode*(self: SubItem): JsonNode =
|
||||||
"iconName": self.icon,
|
"iconName": self.icon,
|
||||||
"iconColor": self.iconColor,
|
"iconColor": self.iconColor,
|
||||||
"isIdenticon": self.isIdenticon
|
"isIdenticon": self.isIdenticon
|
||||||
}
|
}
|
||||||
|
|
|
@ -68,17 +68,17 @@ QtObject:
|
||||||
let enumRole = role.SubModelRole
|
let enumRole = role.SubModelRole
|
||||||
|
|
||||||
case enumRole:
|
case enumRole:
|
||||||
of SubModelRole.Value:
|
of SubModelRole.Value:
|
||||||
result = newQVariant(item.value)
|
result = newQVariant(item.value)
|
||||||
of SubModelRole.Text:
|
of SubModelRole.Text:
|
||||||
result = newQVariant(item.text)
|
result = newQVariant(item.text)
|
||||||
of SubModelRole.Image:
|
of SubModelRole.Image:
|
||||||
result = newQVariant(item.image)
|
result = newQVariant(item.image)
|
||||||
of SubModelRole.Icon:
|
of SubModelRole.Icon:
|
||||||
result = newQVariant(item.icon)
|
result = newQVariant(item.icon)
|
||||||
of SubModelRole.IconColor:
|
of SubModelRole.IconColor:
|
||||||
result = newQVariant(item.iconColor)
|
result = newQVariant(item.iconColor)
|
||||||
of SubModelRole.IsIdenticon:
|
of SubModelRole.IsIdenticon:
|
||||||
result = newQVariant(item.isIdenticon)
|
result = newQVariant(item.isIdenticon)
|
||||||
|
|
||||||
proc setItems*(self: SubModel, items: seq[SubItem]) =
|
proc setItems*(self: SubModel, items: seq[SubItem]) =
|
||||||
|
@ -89,4 +89,4 @@ QtObject:
|
||||||
proc getItemForValue*(self: SubModel, value: string): SubItem =
|
proc getItemForValue*(self: SubModel, value: string): SubItem =
|
||||||
for i in self.items:
|
for i in self.items:
|
||||||
if (i.value == value):
|
if (i.value == value):
|
||||||
return i
|
return i
|
||||||
|
|
|
@ -28,7 +28,7 @@ const SEARCH_RESULT_CHATS_SECTION_NAME = "Chats"
|
||||||
const SEARCH_RESULT_CHANNELS_SECTION_NAME = "Channels"
|
const SEARCH_RESULT_CHANNELS_SECTION_NAME = "Channels"
|
||||||
const SEARCH_RESULT_MESSAGES_SECTION_NAME = "Messages"
|
const SEARCH_RESULT_MESSAGES_SECTION_NAME = "Messages"
|
||||||
|
|
||||||
type
|
type
|
||||||
Module* = ref object of io_interface.AccessInterface
|
Module* = ref object of io_interface.AccessInterface
|
||||||
delegate: delegate_interface.AccessInterface
|
delegate: delegate_interface.AccessInterface
|
||||||
view: View
|
view: View
|
||||||
|
@ -36,17 +36,17 @@ type
|
||||||
controller: controller.AccessInterface
|
controller: controller.AccessInterface
|
||||||
moduleLoaded: bool
|
moduleLoaded: bool
|
||||||
|
|
||||||
proc newModule*(delegate: delegate_interface.AccessInterface, events: EventEmitter, contactsService: contact_service.Service,
|
proc newModule*(delegate: delegate_interface.AccessInterface, events: EventEmitter, contactsService: contact_service.Service,
|
||||||
chatService: chat_service.Service, communityService: community_service.Service, messageService: message_service.Service):
|
chatService: chat_service.Service, communityService: community_service.Service, messageService: message_service.Service):
|
||||||
Module =
|
Module =
|
||||||
result = Module()
|
result = Module()
|
||||||
result.delegate = delegate
|
result.delegate = delegate
|
||||||
result.view = view.newView(result)
|
result.view = view.newView(result)
|
||||||
result.viewVariant = newQVariant(result.view)
|
result.viewVariant = newQVariant(result.view)
|
||||||
result.controller = controller.newController(result, events, contactsService, chatService, communityService,
|
result.controller = controller.newController(result, events, contactsService, chatService, communityService,
|
||||||
messageService)
|
messageService)
|
||||||
result.moduleLoaded = false
|
result.moduleLoaded = false
|
||||||
|
|
||||||
method delete*(self: Module) =
|
method delete*(self: Module) =
|
||||||
self.view.delete
|
self.view.delete
|
||||||
self.viewVariant.delete
|
self.viewVariant.delete
|
||||||
|
@ -67,7 +67,7 @@ method getModuleAsVariant*(self: Module): QVariant =
|
||||||
return self.viewVariant
|
return self.viewVariant
|
||||||
|
|
||||||
proc buildLocationMenuForChat(self: Module): location_menu_item.Item =
|
proc buildLocationMenuForChat(self: Module): location_menu_item.Item =
|
||||||
var item = location_menu_item.initItem(conf.CHAT_SECTION_ID, SEARCH_MENU_LOCATION_CHAT_SECTION_NAME, "", "chat", "",
|
var item = location_menu_item.initItem(conf.CHAT_SECTION_ID, SEARCH_MENU_LOCATION_CHAT_SECTION_NAME, "", "chat", "",
|
||||||
false)
|
false)
|
||||||
|
|
||||||
let types = @[ChatType.OneToOne, ChatType.Public, ChatType.PrivateGroupChat]
|
let types = @[ChatType.OneToOne, ChatType.Public, ChatType.PrivateGroupChat]
|
||||||
|
@ -83,7 +83,7 @@ proc buildLocationMenuForChat(self: Module): location_menu_item.Item =
|
||||||
|
|
||||||
let subItem = location_menu_sub_item.initSubItem(c.id, chatName, chatImage, "", c.color, isIdenticon)
|
let subItem = location_menu_sub_item.initSubItem(c.id, chatName, chatImage, "", c.color, isIdenticon)
|
||||||
subItems.add(subItem)
|
subItems.add(subItem)
|
||||||
|
|
||||||
item.setSubItems(subItems)
|
item.setSubItems(subItems)
|
||||||
return item
|
return item
|
||||||
|
|
||||||
|
@ -95,7 +95,7 @@ proc buildLocationMenuForCommunity(self: Module, community: CommunityDto): locat
|
||||||
let chats = self.controller.getAllChatsForCommunity(community.id)
|
let chats = self.controller.getAllChatsForCommunity(community.id)
|
||||||
for c in chats:
|
for c in chats:
|
||||||
let chatDto = self.controller.getChatDetails(community.id, c.id)
|
let chatDto = self.controller.getChatDetails(community.id, c.id)
|
||||||
let subItem = location_menu_sub_item.initSubItem(chatDto.id, chatDto.name, chatDto.identicon, "", chatDto.color,
|
let subItem = location_menu_sub_item.initSubItem(chatDto.id, chatDto.name, chatDto.identicon, "", chatDto.color,
|
||||||
chatDto.identicon.len == 0)
|
chatDto.identicon.len == 0)
|
||||||
subItems.add(subItem)
|
subItems.add(subItem)
|
||||||
|
|
||||||
|
@ -105,7 +105,7 @@ proc buildLocationMenuForCommunity(self: Module, community: CommunityDto): locat
|
||||||
method prepareLocationMenuModel*(self: Module) =
|
method prepareLocationMenuModel*(self: Module) =
|
||||||
var items: seq[location_menu_item.Item]
|
var items: seq[location_menu_item.Item]
|
||||||
items.add(self.buildLocationMenuForChat())
|
items.add(self.buildLocationMenuForChat())
|
||||||
|
|
||||||
let communities = self.controller.getJoinedCommunities()
|
let communities = self.controller.getJoinedCommunities()
|
||||||
for c in communities:
|
for c in communities:
|
||||||
items.add(self.buildLocationMenuForCommunity(c))
|
items.add(self.buildLocationMenuForCommunity(c))
|
||||||
|
@ -118,11 +118,11 @@ method onActiveChatChange*(self: Module, sectionId: string, chatId: string) =
|
||||||
method setSearchLocation*(self: Module, location: string, subLocation: string) =
|
method setSearchLocation*(self: Module, location: string, subLocation: string) =
|
||||||
self.controller.setSearchLocation(location, subLocation)
|
self.controller.setSearchLocation(location, subLocation)
|
||||||
|
|
||||||
method getSearchLocationObject*(self: Module): string =
|
method getSearchLocationObject*(self: Module): string =
|
||||||
## This method returns location and subLocation with their details so we
|
## This method returns location and subLocation with their details so we
|
||||||
## may set initial search location on the side of qml.
|
## may set initial search location on the side of qml.
|
||||||
var jsonObject = %* {
|
var jsonObject = %* {
|
||||||
"location": "",
|
"location": "",
|
||||||
"subLocation": ""
|
"subLocation": ""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -144,7 +144,7 @@ method searchMessages*(self: Module, searchTerm: string) =
|
||||||
if (searchTerm.len == 0):
|
if (searchTerm.len == 0):
|
||||||
self.view.searchResultModel().clear()
|
self.view.searchResultModel().clear()
|
||||||
return
|
return
|
||||||
|
|
||||||
self.controller.searchMessages(searchTerm)
|
self.controller.searchMessages(searchTerm)
|
||||||
|
|
||||||
method onSearchMessagesDone*(self: Module, messages: seq[MessageDto]) =
|
method onSearchMessagesDone*(self: Module, messages: seq[MessageDto]) =
|
||||||
|
@ -155,7 +155,7 @@ method onSearchMessagesDone*(self: Module, messages: seq[MessageDto]) =
|
||||||
let communities = self.controller.getJoinedCommunities()
|
let communities = self.controller.getJoinedCommunities()
|
||||||
for co in communities:
|
for co in communities:
|
||||||
if(self.controller.searchLocation().len == 0 and co.name.toLower.startsWith(self.controller.searchTerm().toLower)):
|
if(self.controller.searchLocation().len == 0 and co.name.toLower.startsWith(self.controller.searchTerm().toLower)):
|
||||||
let item = result_item.initItem(co.id, "", "", co.id, co.name, SEARCH_RESULT_COMMUNITIES_SECTION_NAME,
|
let item = result_item.initItem(co.id, "", "", co.id, co.name, SEARCH_RESULT_COMMUNITIES_SECTION_NAME,
|
||||||
co.images.thumbnail, co.color, "", "", co.images.thumbnail, co.color, false)
|
co.images.thumbnail, co.color, "", "", co.images.thumbnail, co.color, false)
|
||||||
|
|
||||||
self.controller.addResultItemDetails(co.id, co.id)
|
self.controller.addResultItemDetails(co.id, co.id)
|
||||||
|
@ -167,8 +167,8 @@ method onSearchMessagesDone*(self: Module, messages: seq[MessageDto]) =
|
||||||
for c in co.chats:
|
for c in co.chats:
|
||||||
let chatDto = self.controller.getChatDetails(co.id, c.id)
|
let chatDto = self.controller.getChatDetails(co.id, c.id)
|
||||||
if(c.name.toLower.startsWith(self.controller.searchTerm().toLower)):
|
if(c.name.toLower.startsWith(self.controller.searchTerm().toLower)):
|
||||||
let item = result_item.initItem(chatDto.id, "", "", chatDto.id, chatDto.name,
|
let item = result_item.initItem(chatDto.id, "", "", chatDto.id, chatDto.name,
|
||||||
SEARCH_RESULT_CHANNELS_SECTION_NAME, chatDto.identicon, chatDto.color, "", "", chatDto.identicon, chatDto.color,
|
SEARCH_RESULT_CHANNELS_SECTION_NAME, chatDto.identicon, chatDto.color, "", "", chatDto.identicon, chatDto.color,
|
||||||
false)
|
false)
|
||||||
|
|
||||||
self.controller.addResultItemDetails(chatDto.id, co.id, chatDto.id)
|
self.controller.addResultItemDetails(chatDto.id, co.id, chatDto.id)
|
||||||
|
@ -192,7 +192,7 @@ method onSearchMessagesDone*(self: Module, messages: seq[MessageDto]) =
|
||||||
rawChatName = chatName[1 ..^ 1]
|
rawChatName = chatName[1 ..^ 1]
|
||||||
|
|
||||||
if(rawChatName.toLower.startsWith(self.controller.searchTerm().toLower)):
|
if(rawChatName.toLower.startsWith(self.controller.searchTerm().toLower)):
|
||||||
let item = result_item.initItem(c.id, "", "", c.id, chatName, SEARCH_RESULT_CHATS_SECTION_NAME, chatImage,
|
let item = result_item.initItem(c.id, "", "", c.id, chatName, SEARCH_RESULT_CHATS_SECTION_NAME, chatImage,
|
||||||
c.color, "", "", chatImage, c.color, isIdenticon)
|
c.color, "", "", chatImage, c.color, isIdenticon)
|
||||||
|
|
||||||
self.controller.addResultItemDetails(c.id, conf.CHAT_SECTION_ID, c.id)
|
self.controller.addResultItemDetails(c.id, conf.CHAT_SECTION_ID, c.id)
|
||||||
|
@ -210,7 +210,7 @@ method onSearchMessagesDone*(self: Module, messages: seq[MessageDto]) =
|
||||||
var (senderName, senderImage, senderIsIdenticon) = self.controller.getContactNameAndImage(m.`from`)
|
var (senderName, senderImage, senderIsIdenticon) = self.controller.getContactNameAndImage(m.`from`)
|
||||||
if(m.`from` == singletonInstance.userProfile.getPubKey()):
|
if(m.`from` == singletonInstance.userProfile.getPubKey()):
|
||||||
senderName = "You"
|
senderName = "You"
|
||||||
|
|
||||||
if(chatDto.communityId.len == 0):
|
if(chatDto.communityId.len == 0):
|
||||||
var chatName = chatDto.name
|
var chatName = chatDto.name
|
||||||
var chatImage = chatDto.identicon
|
var chatImage = chatDto.identicon
|
||||||
|
@ -218,7 +218,7 @@ method onSearchMessagesDone*(self: Module, messages: seq[MessageDto]) =
|
||||||
if(chatDto.chatType == ChatType.OneToOne):
|
if(chatDto.chatType == ChatType.OneToOne):
|
||||||
(chatName, chatImage, isIdenticon) = self.controller.getOneToOneChatNameAndImage(chatDto.id)
|
(chatName, chatImage, isIdenticon) = self.controller.getOneToOneChatNameAndImage(chatDto.id)
|
||||||
|
|
||||||
let item = result_item.initItem(m.id, m.text, $m.timestamp, m.`from`, senderName,
|
let item = result_item.initItem(m.id, m.text, $m.timestamp, m.`from`, senderName,
|
||||||
SEARCH_RESULT_MESSAGES_SECTION_NAME, senderImage, "", chatName, "", chatImage, chatDto.color, isIdenticon)
|
SEARCH_RESULT_MESSAGES_SECTION_NAME, senderImage, "", chatName, "", chatImage, chatDto.color, isIdenticon)
|
||||||
|
|
||||||
self.controller.addResultItemDetails(m.id, conf.CHAT_SECTION_ID, chatDto.id, m.id)
|
self.controller.addResultItemDetails(m.id, conf.CHAT_SECTION_ID, chatDto.id, m.id)
|
||||||
|
@ -227,8 +227,8 @@ method onSearchMessagesDone*(self: Module, messages: seq[MessageDto]) =
|
||||||
let community = self.controller.getCommunityById(chatDto.communityId)
|
let community = self.controller.getCommunityById(chatDto.communityId)
|
||||||
let channelName = "#" & chatDto.name
|
let channelName = "#" & chatDto.name
|
||||||
|
|
||||||
let item = result_item.initItem(m.id, m.text, $m.timestamp, m.`from`, senderName,
|
let item = result_item.initItem(m.id, m.text, $m.timestamp, m.`from`, senderName,
|
||||||
SEARCH_RESULT_MESSAGES_SECTION_NAME, senderImage, "", community.name, channelName, community.images.thumbnail,
|
SEARCH_RESULT_MESSAGES_SECTION_NAME, senderImage, "", community.name, channelName, community.images.thumbnail,
|
||||||
community.color, false)
|
community.color, false)
|
||||||
|
|
||||||
self.controller.addResultItemDetails(m.id, chatDto.communityId, chatDto.id, m.id)
|
self.controller.addResultItemDetails(m.id, chatDto.communityId, chatDto.id, m.id)
|
||||||
|
|
|
@ -13,4 +13,4 @@ method getModuleAsVariant*(self: AccessInterface): QVariant {.base.} =
|
||||||
raise newException(ValueError, "No implementation available")
|
raise newException(ValueError, "No implementation available")
|
||||||
|
|
||||||
method onActiveChatChange*(self: AccessInterface, sectionId: string, chatId: string) {.base.} =
|
method onActiveChatChange*(self: AccessInterface, sectionId: string, chatId: string) {.base.} =
|
||||||
raise newException(ValueError, "No implementation available")
|
raise newException(ValueError, "No implementation available")
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
type
|
type
|
||||||
AccessInterface* {.pure inheritable.} = ref object of RootObj
|
AccessInterface* {.pure inheritable.} = ref object of RootObj
|
||||||
|
|
||||||
# Since nim doesn't support using concepts in second level nested types we
|
# Since nim doesn't support using concepts in second level nested types we
|
||||||
# define delegate interfaces within access interface.
|
# define delegate interfaces within access interface.
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import ../../../../../app_service/service/message/dto/message
|
import ../../../../../app_service/service/message/dto/message
|
||||||
|
|
||||||
method onSearchMessagesDone*(self: AccessInterface, messages: seq[MessageDto]) {.base.} =
|
method onSearchMessagesDone*(self: AccessInterface, messages: seq[MessageDto]) {.base.} =
|
||||||
raise newException(ValueError, "No implementation available")
|
raise newException(ValueError, "No implementation available")
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
method viewDidLoad*(self: AccessInterface) {.base.} =
|
method viewDidLoad*(self: AccessInterface) {.base.} =
|
||||||
raise newException(ValueError, "No implementation available")
|
raise newException(ValueError, "No implementation available")
|
||||||
|
|
||||||
method prepareLocationMenuModel*(self: AccessInterface) {.base.} =
|
method prepareLocationMenuModel*(self: AccessInterface) {.base.} =
|
||||||
raise newException(ValueError, "No implementation available")
|
raise newException(ValueError, "No implementation available")
|
||||||
|
@ -14,4 +14,4 @@ method searchMessages*(self: AccessInterface, searchTerm: string) {.base.} =
|
||||||
raise newException(ValueError, "No implementation available")
|
raise newException(ValueError, "No implementation available")
|
||||||
|
|
||||||
method resultItemClicked*(self: AccessInterface, itemId: string) {.base.} =
|
method resultItemClicked*(self: AccessInterface, itemId: string) {.base.} =
|
||||||
raise newException(ValueError, "No implementation available")
|
raise newException(ValueError, "No implementation available")
|
||||||
|
|
|
@ -5,7 +5,7 @@ type Item* = object
|
||||||
content: string
|
content: string
|
||||||
time: string
|
time: string
|
||||||
titleId: string
|
titleId: string
|
||||||
title: string
|
title: string
|
||||||
sectionName: string
|
sectionName: string
|
||||||
image: string
|
image: string
|
||||||
color: string
|
color: string
|
||||||
|
@ -15,8 +15,8 @@ type Item* = object
|
||||||
badgeIconColor: string
|
badgeIconColor: string
|
||||||
badgeIsLetterIdenticon: bool
|
badgeIsLetterIdenticon: bool
|
||||||
|
|
||||||
proc initItem*(itemId, content, time, titleId, title, sectionName: string, image, color, badgePrimaryText,
|
proc initItem*(itemId, content, time, titleId, title, sectionName: string, image, color, badgePrimaryText,
|
||||||
badgeSecondaryText, badgeImage, badgeIconColor: string, badgeIsLetterIdenticon: bool):
|
badgeSecondaryText, badgeImage, badgeIconColor: string, badgeIsLetterIdenticon: bool):
|
||||||
Item =
|
Item =
|
||||||
|
|
||||||
result.itemId = itemId
|
result.itemId = itemId
|
||||||
|
@ -40,7 +40,7 @@ proc `$`*(self: Item): string =
|
||||||
result &= fmt"time:{self.time}, "
|
result &= fmt"time:{self.time}, "
|
||||||
result &= fmt"titleId:{self.titleId}, "
|
result &= fmt"titleId:{self.titleId}, "
|
||||||
result &= fmt"title:{self.title}"
|
result &= fmt"title:{self.title}"
|
||||||
result &= fmt"sectionName:{self.sectionName}"
|
result &= fmt"sectionName:{self.sectionName}"
|
||||||
result &= fmt"image:{self.image}"
|
result &= fmt"image:{self.image}"
|
||||||
result &= fmt"color:{self.color}"
|
result &= fmt"color:{self.color}"
|
||||||
result &= fmt"badgePrimaryText:{self.badgePrimaryText}"
|
result &= fmt"badgePrimaryText:{self.badgePrimaryText}"
|
||||||
|
@ -87,4 +87,4 @@ proc badgeIconColor*(self: Item): string =
|
||||||
return self.badgeIconColor
|
return self.badgeIconColor
|
||||||
|
|
||||||
proc badgeIsLetterIdenticon*(self: Item): bool =
|
proc badgeIsLetterIdenticon*(self: Item): bool =
|
||||||
return self.badgeIsLetterIdenticon
|
return self.badgeIsLetterIdenticon
|
||||||
|
|
|
@ -38,7 +38,7 @@ QtObject:
|
||||||
result &= fmt"""SearchResultMessageModel:
|
result &= fmt"""SearchResultMessageModel:
|
||||||
[{i}]:({$self.resultList[i]})
|
[{i}]:({$self.resultList[i]})
|
||||||
"""
|
"""
|
||||||
|
|
||||||
proc countChanged*(self: Model) {.signal.}
|
proc countChanged*(self: Model) {.signal.}
|
||||||
proc count*(self: Model): int {.slot.} =
|
proc count*(self: Model): int {.slot.} =
|
||||||
self.resultList.len
|
self.resultList.len
|
||||||
|
@ -77,31 +77,31 @@ QtObject:
|
||||||
let enumRole = role.ModelRole
|
let enumRole = role.ModelRole
|
||||||
|
|
||||||
case enumRole:
|
case enumRole:
|
||||||
of ModelRole.ItemId:
|
of ModelRole.ItemId:
|
||||||
result = newQVariant(item.itemId)
|
result = newQVariant(item.itemId)
|
||||||
of ModelRole.Content:
|
of ModelRole.Content:
|
||||||
result = newQVariant(item.content)
|
result = newQVariant(item.content)
|
||||||
of ModelRole.Time:
|
of ModelRole.Time:
|
||||||
result = newQVariant(item.time)
|
result = newQVariant(item.time)
|
||||||
of ModelRole.TitleId:
|
of ModelRole.TitleId:
|
||||||
result = newQVariant(item.titleId)
|
result = newQVariant(item.titleId)
|
||||||
of ModelRole.Title:
|
of ModelRole.Title:
|
||||||
result = newQVariant(item.title)
|
result = newQVariant(item.title)
|
||||||
of ModelRole.SectionName:
|
of ModelRole.SectionName:
|
||||||
result = newQVariant(item.sectionName)
|
result = newQVariant(item.sectionName)
|
||||||
of ModelRole.Image:
|
of ModelRole.Image:
|
||||||
result = newQVariant(item.image)
|
result = newQVariant(item.image)
|
||||||
of ModelRole.Color:
|
of ModelRole.Color:
|
||||||
result = newQVariant(item.color)
|
result = newQVariant(item.color)
|
||||||
of ModelRole.BadgePrimaryText:
|
of ModelRole.BadgePrimaryText:
|
||||||
result = newQVariant(item.badgePrimaryText)
|
result = newQVariant(item.badgePrimaryText)
|
||||||
of ModelRole.BadgeSecondaryText:
|
of ModelRole.BadgeSecondaryText:
|
||||||
result = newQVariant(item.badgeSecondaryText)
|
result = newQVariant(item.badgeSecondaryText)
|
||||||
of ModelRole.BadgeImage:
|
of ModelRole.BadgeImage:
|
||||||
result = newQVariant(item.badgeImage)
|
result = newQVariant(item.badgeImage)
|
||||||
of ModelRole.BadgeIconColor:
|
of ModelRole.BadgeIconColor:
|
||||||
result = newQVariant(item.badgeIconColor)
|
result = newQVariant(item.badgeIconColor)
|
||||||
of ModelRole.BadgeIsLetterIdenticon:
|
of ModelRole.BadgeIsLetterIdenticon:
|
||||||
result = newQVariant(item.badgeIsLetterIdentIcon)
|
result = newQVariant(item.badgeIsLetterIdentIcon)
|
||||||
|
|
||||||
proc add*(self: Model, item: Item) =
|
proc add*(self: Model, item: Item) =
|
||||||
|
@ -117,4 +117,4 @@ QtObject:
|
||||||
proc clear*(self: Model) =
|
proc clear*(self: Model) =
|
||||||
self.beginResetModel()
|
self.beginResetModel()
|
||||||
self.resultList = @[]
|
self.resultList = @[]
|
||||||
self.endResetModel()
|
self.endResetModel()
|
||||||
|
|
|
@ -10,7 +10,7 @@ QtObject:
|
||||||
searchResultModelVariant: QVariant
|
searchResultModelVariant: QVariant
|
||||||
locationMenuModel: location_menu_model.Model
|
locationMenuModel: location_menu_model.Model
|
||||||
locationMenuModelVariant: QVariant
|
locationMenuModelVariant: QVariant
|
||||||
|
|
||||||
proc delete*(self: View) =
|
proc delete*(self: View) =
|
||||||
self.searchResultModel.delete
|
self.searchResultModel.delete
|
||||||
self.searchResultModelVariant.delete
|
self.searchResultModelVariant.delete
|
||||||
|
@ -36,33 +36,33 @@ QtObject:
|
||||||
proc locationMenuModel*(self: View): location_menu_model.Model =
|
proc locationMenuModel*(self: View): location_menu_model.Model =
|
||||||
return self.locationMenuModel
|
return self.locationMenuModel
|
||||||
|
|
||||||
proc getSearchResultModel*(self: View): QVariant {.slot.} =
|
proc getSearchResultModel*(self: View): QVariant {.slot.} =
|
||||||
return newQVariant(self.searchResultModel)
|
return newQVariant(self.searchResultModel)
|
||||||
|
|
||||||
QtProperty[QVariant] resultModel:
|
QtProperty[QVariant] resultModel:
|
||||||
read = getSearchResultModel
|
read = getSearchResultModel
|
||||||
|
|
||||||
proc getLocationMenuModel*(self: View): QVariant {.slot.} =
|
proc getLocationMenuModel*(self: View): QVariant {.slot.} =
|
||||||
newQVariant(self.locationMenuModel)
|
newQVariant(self.locationMenuModel)
|
||||||
|
|
||||||
QtProperty[QVariant] locationMenuModel:
|
QtProperty[QVariant] locationMenuModel:
|
||||||
read = getLocationMenuModel
|
read = getLocationMenuModel
|
||||||
|
|
||||||
proc prepareLocationMenuModel*(self: View) {.slot.} =
|
proc prepareLocationMenuModel*(self: View) {.slot.} =
|
||||||
self.delegate.prepareLocationMenuModel()
|
self.delegate.prepareLocationMenuModel()
|
||||||
|
|
||||||
proc setSearchLocation*(self: View, location: string = "", subLocation: string = "") {.slot.} =
|
proc setSearchLocation*(self: View, location: string = "", subLocation: string = "") {.slot.} =
|
||||||
self.delegate.setSearchLocation(location, subLocation)
|
self.delegate.setSearchLocation(location, subLocation)
|
||||||
|
|
||||||
proc getSearchLocationObject*(self: View): string {.slot.} =
|
proc getSearchLocationObject*(self: View): string {.slot.} =
|
||||||
self.delegate.getSearchLocationObject()
|
self.delegate.getSearchLocationObject()
|
||||||
|
|
||||||
proc searchMessages*(self: View, searchTerm: string) {.slot.} =
|
proc searchMessages*(self: View, searchTerm: string) {.slot.} =
|
||||||
self.delegate.searchMessages(searchTerm)
|
self.delegate.searchMessages(searchTerm)
|
||||||
|
|
||||||
proc resultItemClicked*(self: View, itemId: string) {.slot.} =
|
proc resultItemClicked*(self: View, itemId: string) {.slot.} =
|
||||||
self.delegate.resultItemClicked(itemId)
|
self.delegate.resultItemClicked(itemId)
|
||||||
|
|
||||||
proc appSearchCompleted(self: View) {.signal.}
|
proc appSearchCompleted(self: View) {.signal.}
|
||||||
proc emitAppSearchCompletedSignal*(self: View) =
|
proc emitAppSearchCompletedSignal*(self: View) =
|
||||||
self.appSearchCompleted()
|
self.appSearchCompleted()
|
||||||
|
|
|
@ -7,22 +7,22 @@ import ../../../../../app_service/service/bookmarks/service as bookmark_service
|
||||||
|
|
||||||
export controller_interface
|
export controller_interface
|
||||||
|
|
||||||
type
|
type
|
||||||
Controller* = ref object of controller_interface.AccessInterface
|
Controller* = ref object of controller_interface.AccessInterface
|
||||||
delegate: io_interface.AccessInterface
|
delegate: io_interface.AccessInterface
|
||||||
bookmarkService: bookmark_service.ServiceInterface
|
bookmarkService: bookmark_service.ServiceInterface
|
||||||
|
|
||||||
proc newController*(delegate: io_interface.AccessInterface,
|
proc newController*(delegate: io_interface.AccessInterface,
|
||||||
bookmarkService: bookmark_service.ServiceInterface):
|
bookmarkService: bookmark_service.ServiceInterface):
|
||||||
Controller =
|
Controller =
|
||||||
result = Controller()
|
result = Controller()
|
||||||
result.delegate = delegate
|
result.delegate = delegate
|
||||||
result.bookmarkService = bookmarkService
|
result.bookmarkService = bookmarkService
|
||||||
|
|
||||||
method delete*(self: Controller) =
|
method delete*(self: Controller) =
|
||||||
discard
|
discard
|
||||||
|
|
||||||
method init*(self: Controller) =
|
method init*(self: Controller) =
|
||||||
discard
|
discard
|
||||||
|
|
||||||
method getBookmarks*(self: Controller): seq[bookmark_service.BookmarkDto] =
|
method getBookmarks*(self: Controller): seq[bookmark_service.BookmarkDto] =
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import ../../../../../app_service/service/bookmarks/service_interface as bookmark_service
|
import ../../../../../app_service/service/bookmarks/service_interface as bookmark_service
|
||||||
|
|
||||||
type
|
type
|
||||||
AccessInterface* {.pure inheritable.} = ref object of RootObj
|
AccessInterface* {.pure inheritable.} = ref object of RootObj
|
||||||
## Abstract class for any input/interaction with this module.
|
## Abstract class for any input/interaction with this module.
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import json, strformat
|
import json, strformat
|
||||||
|
|
||||||
type
|
type
|
||||||
Item* = object
|
Item* = object
|
||||||
name: string
|
name: string
|
||||||
url: string
|
url: string
|
||||||
|
@ -13,16 +13,16 @@ proc initItem*(name, url, imageUrl: string): Item =
|
||||||
|
|
||||||
proc `$`*(self: Item): string =
|
proc `$`*(self: Item): string =
|
||||||
result = fmt"""BrowserItem(
|
result = fmt"""BrowserItem(
|
||||||
name: {self.name},
|
name: {self.name},
|
||||||
url: {self.url},
|
url: {self.url},
|
||||||
imageUrl: {self.imageUrl}
|
imageUrl: {self.imageUrl}
|
||||||
]"""
|
]"""
|
||||||
|
|
||||||
proc getName*(self: Item): string =
|
proc getName*(self: Item): string =
|
||||||
return self.name
|
return self.name
|
||||||
|
|
||||||
proc getUrl*(self: Item): string =
|
proc getUrl*(self: Item): string =
|
||||||
return self.url
|
return self.url
|
||||||
|
|
||||||
proc getImageUrl*(self: Item): string =
|
proc getImageUrl*(self: Item): string =
|
||||||
return self.imageUrl
|
return self.imageUrl
|
||||||
|
|
|
@ -60,11 +60,11 @@ QtObject:
|
||||||
let enumRole = role.ModelRole
|
let enumRole = role.ModelRole
|
||||||
|
|
||||||
case enumRole:
|
case enumRole:
|
||||||
of ModelRole.Name:
|
of ModelRole.Name:
|
||||||
result = newQVariant(item.getName())
|
result = newQVariant(item.getName())
|
||||||
of ModelRole.Url:
|
of ModelRole.Url:
|
||||||
result = newQVariant(item.getUrl())
|
result = newQVariant(item.getUrl())
|
||||||
of ModelRole.ImageUrl:
|
of ModelRole.ImageUrl:
|
||||||
result = newQVariant(item.getImageUrl())
|
result = newQVariant(item.getImageUrl())
|
||||||
|
|
||||||
proc rowData(self: Model, index: int, column: string): string {.slot.} =
|
proc rowData(self: Model, index: int, column: string): string {.slot.} =
|
||||||
|
|
|
@ -9,7 +9,7 @@ import ../../../../../app_service/service/bookmarks/service as bookmark_service
|
||||||
|
|
||||||
export io_interface
|
export io_interface
|
||||||
|
|
||||||
type
|
type
|
||||||
Module* = ref object of io_interface.AccessInterface
|
Module* = ref object of io_interface.AccessInterface
|
||||||
delegate: delegate_interface.AccessInterface
|
delegate: delegate_interface.AccessInterface
|
||||||
view: View
|
view: View
|
||||||
|
@ -41,7 +41,7 @@ method viewDidLoad*(self: Module) =
|
||||||
let bookmarks = self.controller.getBookmarks()
|
let bookmarks = self.controller.getBookmarks()
|
||||||
for b in bookmarks:
|
for b in bookmarks:
|
||||||
self.view.addItem(initItem(b.name, b.url, b.imageUrl))
|
self.view.addItem(initItem(b.name, b.url, b.imageUrl))
|
||||||
|
|
||||||
self.moduleLoaded = true
|
self.moduleLoaded = true
|
||||||
self.delegate.bookmarkDidLoad()
|
self.delegate.bookmarkDidLoad()
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
type
|
type
|
||||||
AccessInterface* {.pure inheritable.} = ref object of RootObj
|
AccessInterface* {.pure inheritable.} = ref object of RootObj
|
||||||
|
|
||||||
# Since nim doesn't support using concepts in second level nested types we
|
# Since nim doesn't support using concepts in second level nested types we
|
||||||
# define delegate interfaces within access interface.
|
# define delegate interfaces within access interface.
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
method viewDidLoad*(self: AccessInterface) {.base.} =
|
method viewDidLoad*(self: AccessInterface) {.base.} =
|
||||||
raise newException(ValueError, "No implementation available")
|
raise newException(ValueError, "No implementation available")
|
||||||
|
|
|
@ -9,8 +9,8 @@ QtObject:
|
||||||
delegate: io_interface.AccessInterface
|
delegate: io_interface.AccessInterface
|
||||||
model: Model
|
model: Model
|
||||||
modelVariant: QVariant
|
modelVariant: QVariant
|
||||||
|
|
||||||
proc setup(self: View) =
|
proc setup(self: View) =
|
||||||
self.QObject.setup
|
self.QObject.setup
|
||||||
|
|
||||||
proc delete*(self: View) =
|
proc delete*(self: View) =
|
||||||
|
@ -53,4 +53,4 @@ QtObject:
|
||||||
self.delegate.updateBookmark(oldUrl, newUrl, newName)
|
self.delegate.updateBookmark(oldUrl, newUrl, newName)
|
||||||
|
|
||||||
proc updateBookmarkByUrl*(self: View, oldUrl: string, item: Item) =
|
proc updateBookmarkByUrl*(self: View, oldUrl: string, item: Item) =
|
||||||
self.model.updateItemByUrl(oldUrl, item)
|
self.model.updateItemByUrl(oldUrl, item)
|
||||||
|
|
|
@ -7,22 +7,22 @@ import ../../../../../app_service/service/dapp_permissions/service as dapp_permi
|
||||||
|
|
||||||
export controller_interface
|
export controller_interface
|
||||||
|
|
||||||
type
|
type
|
||||||
Controller* = ref object of controller_interface.AccessInterface
|
Controller* = ref object of controller_interface.AccessInterface
|
||||||
delegate: io_interface.AccessInterface
|
delegate: io_interface.AccessInterface
|
||||||
dappPermissionsService: dapp_permissions_service.ServiceInterface
|
dappPermissionsService: dapp_permissions_service.ServiceInterface
|
||||||
|
|
||||||
proc newController*(delegate: io_interface.AccessInterface,
|
proc newController*(delegate: io_interface.AccessInterface,
|
||||||
dappPermissionsService: dapp_permissions_service.ServiceInterface):
|
dappPermissionsService: dapp_permissions_service.ServiceInterface):
|
||||||
Controller =
|
Controller =
|
||||||
result = Controller()
|
result = Controller()
|
||||||
result.delegate = delegate
|
result.delegate = delegate
|
||||||
result.dappPermissionsService = dappPermissionsService
|
result.dappPermissionsService = dappPermissionsService
|
||||||
|
|
||||||
method delete*(self: Controller) =
|
method delete*(self: Controller) =
|
||||||
discard
|
discard
|
||||||
|
|
||||||
method init*(self: Controller) =
|
method init*(self: Controller) =
|
||||||
discard
|
discard
|
||||||
|
|
||||||
method getDapps*(self: Controller): seq[dapp_permissions_service.Dapp] =
|
method getDapps*(self: Controller): seq[dapp_permissions_service.Dapp] =
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import ../../../../../app_service/service/dapp_permissions/service_interface as dapp_permissions_service
|
import ../../../../../app_service/service/dapp_permissions/service_interface as dapp_permissions_service
|
||||||
import options
|
import options
|
||||||
|
|
||||||
type
|
type
|
||||||
AccessInterface* {.pure inheritable.} = ref object of RootObj
|
AccessInterface* {.pure inheritable.} = ref object of RootObj
|
||||||
## Abstract class for any input/interaction with this module.
|
## Abstract class for any input/interaction with this module.
|
||||||
|
|
||||||
|
|
|
@ -59,7 +59,7 @@ QtObject:
|
||||||
for i in self.items:
|
for i in self.items:
|
||||||
if i == item:
|
if i == item:
|
||||||
return
|
return
|
||||||
|
|
||||||
self.beginInsertRows(parentModelIndex, self.items.len, self.items.len)
|
self.beginInsertRows(parentModelIndex, self.items.len, self.items.len)
|
||||||
self.items.add(item)
|
self.items.add(item)
|
||||||
self.endInsertRows()
|
self.endInsertRows()
|
||||||
|
|
|
@ -9,7 +9,7 @@ import ../../../../../app_service/service/dapp_permissions/service as dapp_permi
|
||||||
import options
|
import options
|
||||||
export io_interface
|
export io_interface
|
||||||
|
|
||||||
type
|
type
|
||||||
Module* = ref object of io_interface.AccessInterface
|
Module* = ref object of io_interface.AccessInterface
|
||||||
delegate: delegate_interface.AccessInterface
|
delegate: delegate_interface.AccessInterface
|
||||||
view: View
|
view: View
|
||||||
|
|
|
@ -66,4 +66,4 @@ QtObject:
|
||||||
proc clear*(self: PermissionsModel) {.slot.} =
|
proc clear*(self: PermissionsModel) {.slot.} =
|
||||||
self.beginResetModel()
|
self.beginResetModel()
|
||||||
self.items = @[]
|
self.items = @[]
|
||||||
self.endResetModel()
|
self.endResetModel()
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
type
|
type
|
||||||
AccessInterface* {.pure inheritable.} = ref object of RootObj
|
AccessInterface* {.pure inheritable.} = ref object of RootObj
|
||||||
|
|
||||||
# Since nim doesn't support using concepts in second level nested types we
|
# Since nim doesn't support using concepts in second level nested types we
|
||||||
# define delegate interfaces within access interface.
|
# define delegate interfaces within access interface.
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
method viewDidLoad*(self: AccessInterface) {.base.} =
|
method viewDidLoad*(self: AccessInterface) {.base.} =
|
||||||
raise newException(ValueError, "No implementation available")
|
raise newException(ValueError, "No implementation available")
|
||||||
|
|
|
@ -12,7 +12,7 @@ QtObject:
|
||||||
dappsModelVariant: QVariant
|
dappsModelVariant: QVariant
|
||||||
permissionsModelVariant: QVariant
|
permissionsModelVariant: QVariant
|
||||||
|
|
||||||
proc setup(self: View) =
|
proc setup(self: View) =
|
||||||
self.QObject.setup
|
self.QObject.setup
|
||||||
|
|
||||||
proc delete*(self: View) =
|
proc delete*(self: View) =
|
||||||
|
@ -58,7 +58,7 @@ QtObject:
|
||||||
|
|
||||||
proc hasPermission(self: View, hostname: string, permission: string): bool {.slot.} =
|
proc hasPermission(self: View, hostname: string, permission: string): bool {.slot.} =
|
||||||
return self.delegate.hasPermission(hostname, permission)
|
return self.delegate.hasPermission(hostname, permission)
|
||||||
|
|
||||||
proc addPermission(self: View, hostname: string, permission: string) {.slot.} =
|
proc addPermission(self: View, hostname: string, permission: string) {.slot.} =
|
||||||
self.delegate.addPermission(hostname, permission)
|
self.delegate.addPermission(hostname, permission)
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@ import ../../../../app_service/service/dapp_permissions/service as dapp_permissi
|
||||||
import ../../../../app_service/service/provider/service as provider_service
|
import ../../../../app_service/service/provider/service as provider_service
|
||||||
export io_interface
|
export io_interface
|
||||||
|
|
||||||
type
|
type
|
||||||
Module* = ref object of io_interface.AccessInterface
|
Module* = ref object of io_interface.AccessInterface
|
||||||
delegate: delegate_interface.AccessInterface
|
delegate: delegate_interface.AccessInterface
|
||||||
view: View
|
view: View
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
type
|
type
|
||||||
AccessInterface* {.pure inheritable.} = ref object of RootObj
|
AccessInterface* {.pure inheritable.} = ref object of RootObj
|
||||||
|
|
||||||
# Since nim doesn't support using concepts in second level nested types we
|
# Since nim doesn't support using concepts in second level nested types we
|
||||||
# define delegate interfaces within access interface.
|
# define delegate interfaces within access interface.
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
method viewDidLoad*(self: AccessInterface) {.base.} =
|
method viewDidLoad*(self: AccessInterface) {.base.} =
|
||||||
raise newException(ValueError, "No implementation available")
|
raise newException(ValueError, "No implementation available")
|
||||||
|
|
|
@ -7,7 +7,7 @@ import ../../../../../app_service/service/dapp_permissions/service as dapp_permi
|
||||||
import ../../../../../app_service/service/provider/service as provider_service
|
import ../../../../../app_service/service/provider/service as provider_service
|
||||||
export controller_interface
|
export controller_interface
|
||||||
|
|
||||||
type
|
type
|
||||||
Controller* = ref object of controller_interface.AccessInterface
|
Controller* = ref object of controller_interface.AccessInterface
|
||||||
delegate: io_interface.AccessInterface
|
delegate: io_interface.AccessInterface
|
||||||
settingsService: settings_service.ServiceInterface
|
settingsService: settings_service.ServiceInterface
|
||||||
|
@ -17,18 +17,18 @@ type
|
||||||
proc newController*(delegate: io_interface.AccessInterface,
|
proc newController*(delegate: io_interface.AccessInterface,
|
||||||
settingsService: settings_service.ServiceInterface,
|
settingsService: settings_service.ServiceInterface,
|
||||||
dappPermissionsService: dapp_permissions_service.ServiceInterface,
|
dappPermissionsService: dapp_permissions_service.ServiceInterface,
|
||||||
providerService: provider_service.ServiceInterface):
|
providerService: provider_service.ServiceInterface):
|
||||||
Controller =
|
Controller =
|
||||||
result = Controller()
|
result = Controller()
|
||||||
result.delegate = delegate
|
result.delegate = delegate
|
||||||
result.settingsService = settingsService
|
result.settingsService = settingsService
|
||||||
result.dappPermissionsService = dappPermissionsService
|
result.dappPermissionsService = dappPermissionsService
|
||||||
result.providerService = providerService
|
result.providerService = providerService
|
||||||
|
|
||||||
method delete*(self: Controller) =
|
method delete*(self: Controller) =
|
||||||
discard
|
discard
|
||||||
|
|
||||||
method init*(self: Controller) =
|
method init*(self: Controller) =
|
||||||
discard
|
discard
|
||||||
|
|
||||||
method getDappsAddress*(self: Controller): string =
|
method getDappsAddress*(self: Controller): string =
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
type
|
type
|
||||||
AccessInterface* {.pure inheritable.} = ref object of RootObj
|
AccessInterface* {.pure inheritable.} = ref object of RootObj
|
||||||
## Abstract class for any input/interaction with this module.
|
## Abstract class for any input/interaction with this module.
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@ import ../../../../../app_service/service/provider/service as provider_service
|
||||||
import ../../../../global/global_singleton
|
import ../../../../global/global_singleton
|
||||||
export io_interface
|
export io_interface
|
||||||
|
|
||||||
type
|
type
|
||||||
Module* = ref object of io_interface.AccessInterface
|
Module* = ref object of io_interface.AccessInterface
|
||||||
delegate: delegate_interface.AccessInterface
|
delegate: delegate_interface.AccessInterface
|
||||||
view: View
|
view: View
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
type
|
type
|
||||||
AccessInterface* {.pure inheritable.} = ref object of RootObj
|
AccessInterface* {.pure inheritable.} = ref object of RootObj
|
||||||
|
|
||||||
# Since nim doesn't support using concepts in second level nested types we
|
# Since nim doesn't support using concepts in second level nested types we
|
||||||
# define delegate interfaces within access interface.
|
# define delegate interfaces within access interface.
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
method viewDidLoad*(self: AccessInterface) {.base.} =
|
method viewDidLoad*(self: AccessInterface) {.base.} =
|
||||||
raise newException(ValueError, "No implementation available")
|
raise newException(ValueError, "No implementation available")
|
||||||
|
|
|
@ -16,7 +16,7 @@ QtObject:
|
||||||
new(result, delete)
|
new(result, delete)
|
||||||
result.QObject.setup
|
result.QObject.setup
|
||||||
result.delegate = delegate
|
result.delegate = delegate
|
||||||
|
|
||||||
proc load*(self: View) =
|
proc load*(self: View) =
|
||||||
self.delegate.viewDidLoad()
|
self.delegate.viewDidLoad()
|
||||||
|
|
||||||
|
@ -67,4 +67,4 @@ QtObject:
|
||||||
|
|
||||||
proc ensResourceURL*(self: View, ens: string, url: string): string {.slot.} =
|
proc ensResourceURL*(self: View, ens: string, url: string): string {.slot.} =
|
||||||
let (url, base, http_scheme, path_prefix, hasContentHash) = self.delegate.ensResourceURL(ens, url)
|
let (url, base, http_scheme, path_prefix, hasContentHash) = self.delegate.ensResourceURL(ens, url)
|
||||||
result = url_replaceHostAndAddPath(url, (if hasContentHash: base else: url_host(base)), http_scheme, path_prefix)
|
result = url_replaceHostAndAddPath(url, (if hasContentHash: base else: url_host(base)), http_scheme, path_prefix)
|
||||||
|
|
|
@ -5,8 +5,8 @@ QtObject:
|
||||||
type
|
type
|
||||||
View* = ref object of QObject
|
View* = ref object of QObject
|
||||||
delegate: io_interface.AccessInterface
|
delegate: io_interface.AccessInterface
|
||||||
|
|
||||||
proc setup(self: View) =
|
proc setup(self: View) =
|
||||||
self.QObject.setup
|
self.QObject.setup
|
||||||
|
|
||||||
proc delete*(self: View) =
|
proc delete*(self: View) =
|
||||||
|
|
|
@ -23,7 +23,7 @@ QtObject:
|
||||||
|
|
||||||
#################################################
|
#################################################
|
||||||
# Forward declaration section
|
# Forward declaration section
|
||||||
proc activeSubItemChanged(self: ActiveItem) {.signal.}
|
proc activeSubItemChanged(self: ActiveItem) {.signal.}
|
||||||
|
|
||||||
#################################################
|
#################################################
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ QtObject:
|
||||||
self.activeSubItem.setActiveSubItemData(subItem)
|
self.activeSubItem.setActiveSubItemData(subItem)
|
||||||
self.activeSubItemChanged()
|
self.activeSubItemChanged()
|
||||||
|
|
||||||
proc getId(self: ActiveItem): string {.slot.} =
|
proc getId(self: ActiveItem): string {.slot.} =
|
||||||
if(self.item.isNil):
|
if(self.item.isNil):
|
||||||
return ""
|
return ""
|
||||||
return self.item.id
|
return self.item.id
|
||||||
|
@ -40,7 +40,7 @@ QtObject:
|
||||||
QtProperty[string] id:
|
QtProperty[string] id:
|
||||||
read = getId
|
read = getId
|
||||||
|
|
||||||
proc getIsSubItemActive(self: ActiveItem): bool {.slot.} =
|
proc getIsSubItemActive(self: ActiveItem): bool {.slot.} =
|
||||||
if(self.activeSubItem.getId().len > 0):
|
if(self.activeSubItem.getId().len > 0):
|
||||||
return true
|
return true
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@ QtObject:
|
||||||
QtProperty[bool] isSubItemActive:
|
QtProperty[bool] isSubItemActive:
|
||||||
read = getIsSubItemActive
|
read = getIsSubItemActive
|
||||||
|
|
||||||
proc getName(self: ActiveItem): string {.slot.} =
|
proc getName(self: ActiveItem): string {.slot.} =
|
||||||
if(self.item.isNil):
|
if(self.item.isNil):
|
||||||
return ""
|
return ""
|
||||||
return self.item.name
|
return self.item.name
|
||||||
|
@ -57,7 +57,7 @@ QtObject:
|
||||||
QtProperty[string] name:
|
QtProperty[string] name:
|
||||||
read = getName
|
read = getName
|
||||||
|
|
||||||
proc getAmIChatAdmin(self: ActiveItem): bool {.slot.} =
|
proc getAmIChatAdmin(self: ActiveItem): bool {.slot.} =
|
||||||
if(self.item.isNil):
|
if(self.item.isNil):
|
||||||
return false
|
return false
|
||||||
return self.item.amIChatAdmin
|
return self.item.amIChatAdmin
|
||||||
|
@ -89,7 +89,7 @@ QtObject:
|
||||||
QtProperty[string] color:
|
QtProperty[string] color:
|
||||||
read = getColor
|
read = getColor
|
||||||
|
|
||||||
proc getDescription(self: ActiveItem): string {.slot.} =
|
proc getDescription(self: ActiveItem): string {.slot.} =
|
||||||
if(self.item.isNil):
|
if(self.item.isNil):
|
||||||
return ""
|
return ""
|
||||||
return self.item.description
|
return self.item.description
|
||||||
|
@ -97,7 +97,7 @@ QtObject:
|
||||||
QtProperty[string] description:
|
QtProperty[string] description:
|
||||||
read = getDescription
|
read = getDescription
|
||||||
|
|
||||||
proc getType(self: ActiveItem): int {.slot.} =
|
proc getType(self: ActiveItem): int {.slot.} =
|
||||||
if(self.item.isNil):
|
if(self.item.isNil):
|
||||||
return 0
|
return 0
|
||||||
return self.item.`type`
|
return self.item.`type`
|
||||||
|
@ -105,7 +105,7 @@ QtObject:
|
||||||
QtProperty[int] type:
|
QtProperty[int] type:
|
||||||
read = getType
|
read = getType
|
||||||
|
|
||||||
proc getHasUnreadMessages(self: ActiveItem): bool {.slot.} =
|
proc getHasUnreadMessages(self: ActiveItem): bool {.slot.} =
|
||||||
if(self.item.isNil):
|
if(self.item.isNil):
|
||||||
return false
|
return false
|
||||||
return self.item.hasUnreadMessages
|
return self.item.hasUnreadMessages
|
||||||
|
@ -113,7 +113,7 @@ QtObject:
|
||||||
QtProperty[bool] hasUnreadMessages:
|
QtProperty[bool] hasUnreadMessages:
|
||||||
read = getHasUnreadMessages
|
read = getHasUnreadMessages
|
||||||
|
|
||||||
proc getNotificationCount(self: ActiveItem): int {.slot.} =
|
proc getNotificationCount(self: ActiveItem): int {.slot.} =
|
||||||
if(self.item.isNil):
|
if(self.item.isNil):
|
||||||
return 0
|
return 0
|
||||||
return self.item.notificationsCount
|
return self.item.notificationsCount
|
||||||
|
@ -121,21 +121,21 @@ QtObject:
|
||||||
QtProperty[int] notificationCount:
|
QtProperty[int] notificationCount:
|
||||||
read = getNotificationCount
|
read = getNotificationCount
|
||||||
|
|
||||||
proc getMuted(self: ActiveItem): bool {.slot.} =
|
proc getMuted(self: ActiveItem): bool {.slot.} =
|
||||||
if(self.item.isNil):
|
if(self.item.isNil):
|
||||||
return false
|
return false
|
||||||
return self.item.muted
|
return self.item.muted
|
||||||
QtProperty[bool] muted:
|
QtProperty[bool] muted:
|
||||||
read = getMuted
|
read = getMuted
|
||||||
|
|
||||||
proc getBlocked(self: ActiveItem): bool {.slot.} =
|
proc getBlocked(self: ActiveItem): bool {.slot.} =
|
||||||
if(self.item.isNil):
|
if(self.item.isNil):
|
||||||
return false
|
return false
|
||||||
return self.item.blocked
|
return self.item.blocked
|
||||||
QtProperty[bool] blocked:
|
QtProperty[bool] blocked:
|
||||||
read = getBlocked
|
read = getBlocked
|
||||||
|
|
||||||
proc getPosition(self: ActiveItem): int {.slot.} =
|
proc getPosition(self: ActiveItem): int {.slot.} =
|
||||||
if(self.item.isNil):
|
if(self.item.isNil):
|
||||||
return 0
|
return 0
|
||||||
return self.item.position
|
return self.item.position
|
||||||
|
@ -143,11 +143,10 @@ QtObject:
|
||||||
QtProperty[int] position:
|
QtProperty[int] position:
|
||||||
read = getPosition
|
read = getPosition
|
||||||
|
|
||||||
proc getActiveSubItem(self: ActiveItem): QVariant {.slot.} =
|
proc getActiveSubItem(self: ActiveItem): QVariant {.slot.} =
|
||||||
return self.activeSubItemVariant
|
return self.activeSubItemVariant
|
||||||
|
|
||||||
QtProperty[QVariant] activeSubItem:
|
QtProperty[QVariant] activeSubItem:
|
||||||
read = getActiveSubItem
|
read = getActiveSubItem
|
||||||
notify = activeSubItemChanged
|
notify = activeSubItemChanged
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@ QtObject:
|
||||||
proc setActiveSubItemData*(self: ActiveSubItem, item: SubItem) =
|
proc setActiveSubItemData*(self: ActiveSubItem, item: SubItem) =
|
||||||
self.item = item
|
self.item = item
|
||||||
|
|
||||||
proc getId*(self: ActiveSubItem): string {.slot.} =
|
proc getId*(self: ActiveSubItem): string {.slot.} =
|
||||||
if(self.item.isNil):
|
if(self.item.isNil):
|
||||||
return ""
|
return ""
|
||||||
return self.item.id
|
return self.item.id
|
||||||
|
@ -26,7 +26,7 @@ QtObject:
|
||||||
QtProperty[string] id:
|
QtProperty[string] id:
|
||||||
read = getId
|
read = getId
|
||||||
|
|
||||||
proc getName(self: ActiveSubItem): string {.slot.} =
|
proc getName(self: ActiveSubItem): string {.slot.} =
|
||||||
if(self.item.isNil):
|
if(self.item.isNil):
|
||||||
return ""
|
return ""
|
||||||
return self.item.name
|
return self.item.name
|
||||||
|
@ -34,7 +34,7 @@ QtObject:
|
||||||
QtProperty[string] name:
|
QtProperty[string] name:
|
||||||
read = getName
|
read = getName
|
||||||
|
|
||||||
proc getAmIChatAdmin(self: ActiveSubItem): bool {.slot.} =
|
proc getAmIChatAdmin(self: ActiveSubItem): bool {.slot.} =
|
||||||
if(self.item.isNil):
|
if(self.item.isNil):
|
||||||
return false
|
return false
|
||||||
return self.item.amIChatAdmin
|
return self.item.amIChatAdmin
|
||||||
|
@ -66,7 +66,7 @@ QtObject:
|
||||||
QtProperty[string] color:
|
QtProperty[string] color:
|
||||||
read = getColor
|
read = getColor
|
||||||
|
|
||||||
proc getDescription(self: ActiveSubItem): string {.slot.} =
|
proc getDescription(self: ActiveSubItem): string {.slot.} =
|
||||||
if(self.item.isNil):
|
if(self.item.isNil):
|
||||||
return ""
|
return ""
|
||||||
return self.item.description
|
return self.item.description
|
||||||
|
@ -74,7 +74,7 @@ QtObject:
|
||||||
QtProperty[string] description:
|
QtProperty[string] description:
|
||||||
read = getDescription
|
read = getDescription
|
||||||
|
|
||||||
proc getHasUnreadMessages(self: ActiveSubItem): bool {.slot.} =
|
proc getHasUnreadMessages(self: ActiveSubItem): bool {.slot.} =
|
||||||
if(self.item.isNil):
|
if(self.item.isNil):
|
||||||
return false
|
return false
|
||||||
return self.item.hasUnreadMessages
|
return self.item.hasUnreadMessages
|
||||||
|
@ -82,7 +82,7 @@ QtObject:
|
||||||
QtProperty[bool] hasUnreadMessages:
|
QtProperty[bool] hasUnreadMessages:
|
||||||
read = getHasUnreadMessages
|
read = getHasUnreadMessages
|
||||||
|
|
||||||
proc getNotificationCount(self: ActiveSubItem): int {.slot.} =
|
proc getNotificationCount(self: ActiveSubItem): int {.slot.} =
|
||||||
if(self.item.isNil):
|
if(self.item.isNil):
|
||||||
return 0
|
return 0
|
||||||
return self.item.notificationsCount
|
return self.item.notificationsCount
|
||||||
|
@ -90,21 +90,21 @@ QtObject:
|
||||||
QtProperty[int] notificationCount:
|
QtProperty[int] notificationCount:
|
||||||
read = getNotificationCount
|
read = getNotificationCount
|
||||||
|
|
||||||
proc getMuted(self: ActiveSubItem): bool {.slot.} =
|
proc getMuted(self: ActiveSubItem): bool {.slot.} =
|
||||||
if(self.item.isNil):
|
if(self.item.isNil):
|
||||||
return false
|
return false
|
||||||
return self.item.muted
|
return self.item.muted
|
||||||
QtProperty[bool] muted:
|
QtProperty[bool] muted:
|
||||||
read = getMuted
|
read = getMuted
|
||||||
|
|
||||||
proc getBlocked(self: ActiveSubItem): bool {.slot.} =
|
proc getBlocked(self: ActiveSubItem): bool {.slot.} =
|
||||||
if(self.item.isNil):
|
if(self.item.isNil):
|
||||||
return false
|
return false
|
||||||
return self.item.blocked
|
return self.item.blocked
|
||||||
QtProperty[bool] blocked:
|
QtProperty[bool] blocked:
|
||||||
read = getBlocked
|
read = getBlocked
|
||||||
|
|
||||||
proc getPosition(self: ActiveSubItem): int {.slot.} =
|
proc getPosition(self: ActiveSubItem): int {.slot.} =
|
||||||
if(self.item.isNil):
|
if(self.item.isNil):
|
||||||
return 0
|
return 0
|
||||||
return self.item.position
|
return self.item.position
|
||||||
|
@ -112,4 +112,3 @@ QtObject:
|
||||||
QtProperty[int] position:
|
QtProperty[int] position:
|
||||||
read = getPosition
|
read = getPosition
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
type
|
type
|
||||||
BaseItem* {.pure inheritable.} = ref object of RootObj
|
BaseItem* {.pure inheritable.} = ref object of RootObj
|
||||||
id: string
|
id: string
|
||||||
name: string
|
name: string
|
||||||
|
@ -35,90 +35,90 @@ proc setup*(self: BaseItem, id, name, icon: string, isIdenticon: bool, color, de
|
||||||
self.position = position
|
self.position = position
|
||||||
self.categoryId = categoryId
|
self.categoryId = categoryId
|
||||||
|
|
||||||
proc initBaseItem*(id, name, icon: string, isIdenticon: bool, color, description: string, `type`: int,
|
proc initBaseItem*(id, name, icon: string, isIdenticon: bool, color, description: string, `type`: int,
|
||||||
amIChatAdmin: bool, hasUnreadMessages: bool, notificationsCount: int, muted, blocked, active: bool,
|
amIChatAdmin: bool, hasUnreadMessages: bool, notificationsCount: int, muted, blocked, active: bool,
|
||||||
position: int, categoryId: string = ""): BaseItem =
|
position: int, categoryId: string = ""): BaseItem =
|
||||||
result = BaseItem()
|
result = BaseItem()
|
||||||
result.setup(id, name, icon, isIdenticon, color, description, `type`, amIChatAdmin, hasUnreadMessages,
|
result.setup(id, name, icon, isIdenticon, color, description, `type`, amIChatAdmin, hasUnreadMessages,
|
||||||
notificationsCount, muted, blocked, active, position, categoryId)
|
notificationsCount, muted, blocked, active, position, categoryId)
|
||||||
|
|
||||||
proc delete*(self: BaseItem) =
|
proc delete*(self: BaseItem) =
|
||||||
discard
|
discard
|
||||||
|
|
||||||
method id*(self: BaseItem): string {.inline base.} =
|
method id*(self: BaseItem): string {.inline base.} =
|
||||||
self.id
|
self.id
|
||||||
|
|
||||||
method name*(self: BaseItem): string {.inline base.} =
|
method name*(self: BaseItem): string {.inline base.} =
|
||||||
self.name
|
self.name
|
||||||
|
|
||||||
method `name=`*(self: var BaseItem, value: string) {.inline base.} =
|
method `name=`*(self: var BaseItem, value: string) {.inline base.} =
|
||||||
self.name = value
|
self.name = value
|
||||||
|
|
||||||
method amIChatAdmin*(self: BaseItem): bool {.inline base.} =
|
method amIChatAdmin*(self: BaseItem): bool {.inline base.} =
|
||||||
self.amIChatAdmin
|
self.amIChatAdmin
|
||||||
|
|
||||||
method icon*(self: BaseItem): string {.inline base.} =
|
method icon*(self: BaseItem): string {.inline base.} =
|
||||||
self.icon
|
self.icon
|
||||||
|
|
||||||
method `icon=`*(self: var BaseItem, value: string) {.inline base.} =
|
method `icon=`*(self: var BaseItem, value: string) {.inline base.} =
|
||||||
self.icon = value
|
self.icon = value
|
||||||
|
|
||||||
method isIdenticon*(self: BaseItem): bool {.inline base.} =
|
method isIdenticon*(self: BaseItem): bool {.inline base.} =
|
||||||
self.isIdenticon
|
self.isIdenticon
|
||||||
|
|
||||||
method `isIdenticon=`*(self: var BaseItem, value: bool) {.inline base.} =
|
method `isIdenticon=`*(self: var BaseItem, value: bool) {.inline base.} =
|
||||||
self.isIdenticon = value
|
self.isIdenticon = value
|
||||||
|
|
||||||
method color*(self: BaseItem): string {.inline base.} =
|
method color*(self: BaseItem): string {.inline base.} =
|
||||||
self.color
|
self.color
|
||||||
|
|
||||||
method description*(self: BaseItem): string {.inline base.} =
|
method description*(self: BaseItem): string {.inline base.} =
|
||||||
self.description
|
self.description
|
||||||
|
|
||||||
method `description=`*(self: var BaseItem, value: string) {.inline base.} =
|
method `description=`*(self: var BaseItem, value: string) {.inline base.} =
|
||||||
self.description = value
|
self.description = value
|
||||||
|
|
||||||
method type*(self: BaseItem): int {.inline base.} =
|
method type*(self: BaseItem): int {.inline base.} =
|
||||||
self.`type`
|
self.`type`
|
||||||
|
|
||||||
method hasUnreadMessages*(self: BaseItem): bool {.inline base.} =
|
method hasUnreadMessages*(self: BaseItem): bool {.inline base.} =
|
||||||
self.hasUnreadMessages
|
self.hasUnreadMessages
|
||||||
|
|
||||||
method `hasUnreadMessages=`*(self: var BaseItem, value: bool) {.inline base.} =
|
method `hasUnreadMessages=`*(self: var BaseItem, value: bool) {.inline base.} =
|
||||||
self.hasUnreadMessages = value
|
self.hasUnreadMessages = value
|
||||||
|
|
||||||
method notificationsCount*(self: BaseItem): int {.inline base.} =
|
method notificationsCount*(self: BaseItem): int {.inline base.} =
|
||||||
self.notificationsCount
|
self.notificationsCount
|
||||||
|
|
||||||
method `notificationsCount=`*(self: var BaseItem, value: int) {.inline base.} =
|
method `notificationsCount=`*(self: var BaseItem, value: int) {.inline base.} =
|
||||||
self.notificationsCount = value
|
self.notificationsCount = value
|
||||||
|
|
||||||
method muted*(self: BaseItem): bool {.inline base.} =
|
method muted*(self: BaseItem): bool {.inline base.} =
|
||||||
self.muted
|
self.muted
|
||||||
|
|
||||||
method `muted=`*(self: var BaseItem, value: bool) {.inline base.} =
|
method `muted=`*(self: var BaseItem, value: bool) {.inline base.} =
|
||||||
self.muted = value
|
self.muted = value
|
||||||
|
|
||||||
method blocked*(self: BaseItem): bool {.inline base.} =
|
method blocked*(self: BaseItem): bool {.inline base.} =
|
||||||
self.blocked
|
self.blocked
|
||||||
|
|
||||||
method `blocked=`*(self: var BaseItem, value: bool) {.inline base.} =
|
method `blocked=`*(self: var BaseItem, value: bool) {.inline base.} =
|
||||||
self.blocked = value
|
self.blocked = value
|
||||||
|
|
||||||
method active*(self: BaseItem): bool {.inline base.} =
|
method active*(self: BaseItem): bool {.inline base.} =
|
||||||
self.active
|
self.active
|
||||||
|
|
||||||
method `active=`*(self: var BaseItem, value: bool) {.inline base.} =
|
method `active=`*(self: var BaseItem, value: bool) {.inline base.} =
|
||||||
self.active = value
|
self.active = value
|
||||||
|
|
||||||
method position*(self: BaseItem): int {.inline base.} =
|
method position*(self: BaseItem): int {.inline base.} =
|
||||||
self.position
|
self.position
|
||||||
|
|
||||||
method `position=`*(self: var BaseItem, value: int) {.inline base.} =
|
method `position=`*(self: var BaseItem, value: int) {.inline base.} =
|
||||||
self.position = value
|
self.position = value
|
||||||
|
|
||||||
method categoryId*(self: BaseItem): string {.inline base.} =
|
method categoryId*(self: BaseItem): string {.inline base.} =
|
||||||
self.categoryId
|
self.categoryId
|
||||||
|
|
||||||
method `categoryId=`*(self: var BaseItem, value: string) {.inline base.} =
|
method `categoryId=`*(self: var BaseItem, value: string) {.inline base.} =
|
||||||
self.categoryId = value
|
self.categoryId = value
|
||||||
|
|
|
@ -36,18 +36,18 @@ QtObject:
|
||||||
self.icon = icon
|
self.icon = icon
|
||||||
self.isIdenticon = isIdenticon
|
self.isIdenticon = isIdenticon
|
||||||
self.color = color
|
self.color = color
|
||||||
self.description = description
|
self.description = description
|
||||||
self.hasUnreadMessages = hasUnreadMessages
|
self.hasUnreadMessages = hasUnreadMessages
|
||||||
self.notificationsCount = notificationsCount
|
self.notificationsCount = notificationsCount
|
||||||
self.muted = muted
|
self.muted = muted
|
||||||
self.position = position
|
self.position = position
|
||||||
|
|
||||||
proc getId(self: ChatDetails): string {.slot.} =
|
proc getId(self: ChatDetails): string {.slot.} =
|
||||||
return self.id
|
return self.id
|
||||||
QtProperty[string] id:
|
QtProperty[string] id:
|
||||||
read = getId
|
read = getId
|
||||||
|
|
||||||
proc getType(self: ChatDetails): int {.slot.} =
|
proc getType(self: ChatDetails): int {.slot.} =
|
||||||
return self.`type`
|
return self.`type`
|
||||||
QtProperty[int] type:
|
QtProperty[int] type:
|
||||||
read = getType
|
read = getType
|
||||||
|
@ -61,19 +61,19 @@ QtObject:
|
||||||
return self.isUsersListAvailable
|
return self.isUsersListAvailable
|
||||||
QtProperty[bool] isUsersListAvailable:
|
QtProperty[bool] isUsersListAvailable:
|
||||||
read = getIsUsersListAvailable
|
read = getIsUsersListAvailable
|
||||||
|
|
||||||
proc nameChanged(self: ChatDetails) {.signal.}
|
proc nameChanged(self: ChatDetails) {.signal.}
|
||||||
proc getName(self: ChatDetails): string {.slot.} =
|
proc getName(self: ChatDetails): string {.slot.} =
|
||||||
return self.name
|
return self.name
|
||||||
QtProperty[string] name:
|
QtProperty[string] name:
|
||||||
read = getName
|
read = getName
|
||||||
notify = nameChanged
|
notify = nameChanged
|
||||||
|
|
||||||
proc setName*(self: ChatDetails, value: string) = # this is not a slot
|
proc setName*(self: ChatDetails, value: string) = # this is not a slot
|
||||||
self.name = value
|
self.name = value
|
||||||
self.nameChanged()
|
self.nameChanged()
|
||||||
|
|
||||||
proc iconChanged(self: ChatDetails) {.signal.}
|
proc iconChanged(self: ChatDetails) {.signal.}
|
||||||
proc getIcon(self: ChatDetails): string {.slot.} =
|
proc getIcon(self: ChatDetails): string {.slot.} =
|
||||||
return self.icon
|
return self.icon
|
||||||
QtProperty[string] icon:
|
QtProperty[string] icon:
|
||||||
|
@ -91,7 +91,7 @@ QtObject:
|
||||||
self.isIdenticon = isIdenticon
|
self.isIdenticon = isIdenticon
|
||||||
self.iconChanged()
|
self.iconChanged()
|
||||||
|
|
||||||
proc colorChanged(self: ChatDetails) {.signal.}
|
proc colorChanged(self: ChatDetails) {.signal.}
|
||||||
proc getColor(self: ChatDetails): string {.slot.} =
|
proc getColor(self: ChatDetails): string {.slot.} =
|
||||||
return self.color
|
return self.color
|
||||||
QtProperty[string] color:
|
QtProperty[string] color:
|
||||||
|
@ -102,8 +102,8 @@ QtObject:
|
||||||
self.color = value
|
self.color = value
|
||||||
self.colorChanged()
|
self.colorChanged()
|
||||||
|
|
||||||
proc descriptionChanged(self: ChatDetails) {.signal.}
|
proc descriptionChanged(self: ChatDetails) {.signal.}
|
||||||
proc getDescription(self: ChatDetails): string {.slot.} =
|
proc getDescription(self: ChatDetails): string {.slot.} =
|
||||||
return self.description
|
return self.description
|
||||||
QtProperty[string] description:
|
QtProperty[string] description:
|
||||||
read = getDescription
|
read = getDescription
|
||||||
|
@ -113,8 +113,8 @@ QtObject:
|
||||||
self.description = value
|
self.description = value
|
||||||
self.descriptionChanged()
|
self.descriptionChanged()
|
||||||
|
|
||||||
proc hasUnreadMessagesChanged(self: ChatDetails) {.signal.}
|
proc hasUnreadMessagesChanged(self: ChatDetails) {.signal.}
|
||||||
proc getHasUnreadMessages(self: ChatDetails): bool {.slot.} =
|
proc getHasUnreadMessages(self: ChatDetails): bool {.slot.} =
|
||||||
return self.hasUnreadMessages
|
return self.hasUnreadMessages
|
||||||
QtProperty[bool] hasUnreadMessages:
|
QtProperty[bool] hasUnreadMessages:
|
||||||
read = getHasUnreadMessages
|
read = getHasUnreadMessages
|
||||||
|
@ -124,8 +124,8 @@ QtObject:
|
||||||
self.hasUnreadMessages = value
|
self.hasUnreadMessages = value
|
||||||
self.hasUnreadMessagesChanged()
|
self.hasUnreadMessagesChanged()
|
||||||
|
|
||||||
proc notificationCountChanged(self: ChatDetails) {.signal.}
|
proc notificationCountChanged(self: ChatDetails) {.signal.}
|
||||||
proc getNotificationCount(self: ChatDetails): int {.slot.} =
|
proc getNotificationCount(self: ChatDetails): int {.slot.} =
|
||||||
return self.notificationsCount
|
return self.notificationsCount
|
||||||
QtProperty[int] notificationCount:
|
QtProperty[int] notificationCount:
|
||||||
read = getNotificationCount
|
read = getNotificationCount
|
||||||
|
@ -135,8 +135,8 @@ QtObject:
|
||||||
self.notificationsCount = value
|
self.notificationsCount = value
|
||||||
self.notificationCountChanged()
|
self.notificationCountChanged()
|
||||||
|
|
||||||
proc mutedChanged(self: ChatDetails) {.signal.}
|
proc mutedChanged(self: ChatDetails) {.signal.}
|
||||||
proc getMuted(self: ChatDetails): bool {.slot.} =
|
proc getMuted(self: ChatDetails): bool {.slot.} =
|
||||||
return self.muted
|
return self.muted
|
||||||
QtProperty[bool] muted:
|
QtProperty[bool] muted:
|
||||||
read = getMuted
|
read = getMuted
|
||||||
|
@ -146,8 +146,8 @@ QtObject:
|
||||||
self.muted = value
|
self.muted = value
|
||||||
self.mutedChanged()
|
self.mutedChanged()
|
||||||
|
|
||||||
proc positionChanged(self: ChatDetails) {.signal.}
|
proc positionChanged(self: ChatDetails) {.signal.}
|
||||||
proc getPosition(self: ChatDetails): int {.slot.} =
|
proc getPosition(self: ChatDetails): int {.slot.} =
|
||||||
return self.position
|
return self.position
|
||||||
QtProperty[int] position:
|
QtProperty[int] position:
|
||||||
read = getPosition
|
read = getPosition
|
||||||
|
@ -155,4 +155,4 @@ QtObject:
|
||||||
|
|
||||||
proc setPotion*(self: ChatDetails, value: int) = # this is not a slot
|
proc setPotion*(self: ChatDetails, value: int) = # this is not a slot
|
||||||
self.position = value
|
self.position = value
|
||||||
self.positionChanged()
|
self.positionChanged()
|
||||||
|
|
|
@ -15,7 +15,7 @@ import ../../../../core/eventemitter
|
||||||
|
|
||||||
export controller_interface
|
export controller_interface
|
||||||
|
|
||||||
type
|
type
|
||||||
Controller* = ref object of controller_interface.AccessInterface
|
Controller* = ref object of controller_interface.AccessInterface
|
||||||
delegate: io_interface.AccessInterface
|
delegate: io_interface.AccessInterface
|
||||||
events: EventEmitter
|
events: EventEmitter
|
||||||
|
@ -29,9 +29,9 @@ type
|
||||||
communityService: community_service.Service
|
communityService: community_service.Service
|
||||||
messageService: message_service.Service
|
messageService: message_service.Service
|
||||||
|
|
||||||
proc newController*(delegate: io_interface.AccessInterface, events: EventEmitter, sectionId: string, chatId: string,
|
proc newController*(delegate: io_interface.AccessInterface, events: EventEmitter, sectionId: string, chatId: string,
|
||||||
belongsToCommunity: bool, isUsersListAvailable: bool, settingsService: settings_service.ServiceInterface,
|
belongsToCommunity: bool, isUsersListAvailable: bool, settingsService: settings_service.ServiceInterface,
|
||||||
contactService: contact_service.Service, chatService: chat_service.Service,
|
contactService: contact_service.Service, chatService: chat_service.Service,
|
||||||
communityService: community_service.Service, messageService: message_service.Service): Controller =
|
communityService: community_service.Service, messageService: message_service.Service): Controller =
|
||||||
result = Controller()
|
result = Controller()
|
||||||
result.delegate = delegate
|
result.delegate = delegate
|
||||||
|
@ -45,11 +45,11 @@ proc newController*(delegate: io_interface.AccessInterface, events: EventEmitter
|
||||||
result.chatService = chatService
|
result.chatService = chatService
|
||||||
result.communityService = communityService
|
result.communityService = communityService
|
||||||
result.messageService = messageService
|
result.messageService = messageService
|
||||||
|
|
||||||
method delete*(self: Controller) =
|
method delete*(self: Controller) =
|
||||||
discard
|
discard
|
||||||
|
|
||||||
method init*(self: Controller) =
|
method init*(self: Controller) =
|
||||||
self.events.on(SIGNAL_MESSAGES_LOADED) do(e:Args):
|
self.events.on(SIGNAL_MESSAGES_LOADED) do(e:Args):
|
||||||
let args = MessagesLoadedArgs(e)
|
let args = MessagesLoadedArgs(e)
|
||||||
if(self.chatId != args.chatId or args.pinnedMessages.len == 0):
|
if(self.chatId != args.chatId or args.pinnedMessages.len == 0):
|
||||||
|
@ -143,7 +143,7 @@ method belongsToCommunity*(self: Controller): bool =
|
||||||
method unpinMessage*(self: Controller, messageId: string) =
|
method unpinMessage*(self: Controller, messageId: string) =
|
||||||
self.messageService.pinUnpinMessage(self.chatId, messageId, false)
|
self.messageService.pinUnpinMessage(self.chatId, messageId, false)
|
||||||
|
|
||||||
method getMessageDetails*(self: Controller, messageId: string):
|
method getMessageDetails*(self: Controller, messageId: string):
|
||||||
tuple[message: MessageDto, reactions: seq[ReactionDto], error: string] =
|
tuple[message: MessageDto, reactions: seq[ReactionDto], error: string] =
|
||||||
return self.messageService.getDetailsForMessage(self.chatId, messageId)
|
return self.messageService.getDetailsForMessage(self.chatId, messageId)
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ import ../../../../../app_service/service/community/dto/[community]
|
||||||
import ../../../../../app_service/service/chat/dto/[chat]
|
import ../../../../../app_service/service/chat/dto/[chat]
|
||||||
import ../../../../../app_service/service/contacts/service
|
import ../../../../../app_service/service/contacts/service
|
||||||
|
|
||||||
type
|
type
|
||||||
AccessInterface* {.pure inheritable.} = ref object of RootObj
|
AccessInterface* {.pure inheritable.} = ref object of RootObj
|
||||||
## Abstract class for any input/interaction with this module.
|
## Abstract class for any input/interaction with this module.
|
||||||
|
|
||||||
|
@ -19,11 +19,11 @@ method getMyChatId*(self: AccessInterface): string {.base.} =
|
||||||
|
|
||||||
method getChatDetails*(self: AccessInterface): ChatDto {.base.} =
|
method getChatDetails*(self: AccessInterface): ChatDto {.base.} =
|
||||||
raise newException(ValueError, "No implementation available")
|
raise newException(ValueError, "No implementation available")
|
||||||
|
|
||||||
method getCommunityDetails*(self: AccessInterface): CommunityDto {.base.} =
|
method getCommunityDetails*(self: AccessInterface): CommunityDto {.base.} =
|
||||||
raise newException(ValueError, "No implementation available")
|
raise newException(ValueError, "No implementation available")
|
||||||
|
|
||||||
method getOneToOneChatNameAndImage*(self: AccessInterface): tuple[name: string, image: string, isIdenticon: bool]
|
method getOneToOneChatNameAndImage*(self: AccessInterface): tuple[name: string, image: string, isIdenticon: bool]
|
||||||
{.base.} =
|
{.base.} =
|
||||||
raise newException(ValueError, "No implementation available")
|
raise newException(ValueError, "No implementation available")
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ method belongsToCommunity*(self: AccessInterface): bool {.base.} =
|
||||||
method unpinMessage*(self: AccessInterface, messageId: string) {.base.} =
|
method unpinMessage*(self: AccessInterface, messageId: string) {.base.} =
|
||||||
raise newException(ValueError, "No implementation available")
|
raise newException(ValueError, "No implementation available")
|
||||||
|
|
||||||
method getMessageDetails*(self: AccessInterface, messageId: string):
|
method getMessageDetails*(self: AccessInterface, messageId: string):
|
||||||
tuple[message: MessageDto, reactions: seq[ReactionDto], error: string] {.base.} =
|
tuple[message: MessageDto, reactions: seq[ReactionDto], error: string] {.base.} =
|
||||||
raise newException(ValueError, "No implementation available")
|
raise newException(ValueError, "No implementation available")
|
||||||
|
|
||||||
|
@ -71,4 +71,4 @@ method getRenderedText*(self: AccessInterface, parsedTextArray: seq[ParsedText])
|
||||||
raise newException(ValueError, "No implementation available")
|
raise newException(ValueError, "No implementation available")
|
||||||
|
|
||||||
method decodeContentHash*(self: AccessInterface, hash: string): string {.base.} =
|
method decodeContentHash*(self: AccessInterface, hash: string): string {.base.} =
|
||||||
raise newException(ValueError, "No implementation available")
|
raise newException(ValueError, "No implementation available")
|
||||||
|
|
|
@ -8,7 +8,7 @@ import ../../../../../../app_service/service/gif/dto
|
||||||
|
|
||||||
export controller_interface
|
export controller_interface
|
||||||
|
|
||||||
type
|
type
|
||||||
Controller* = ref object of controller_interface.AccessInterface
|
Controller* = ref object of controller_interface.AccessInterface
|
||||||
delegate: io_interface.AccessInterface
|
delegate: io_interface.AccessInterface
|
||||||
sectionId: string
|
sectionId: string
|
||||||
|
@ -23,7 +23,7 @@ proc newController*(
|
||||||
sectionId: string,
|
sectionId: string,
|
||||||
chatId: string,
|
chatId: string,
|
||||||
belongsToCommunity: bool,
|
belongsToCommunity: bool,
|
||||||
chatService: chat_service.Service,
|
chatService: chat_service.Service,
|
||||||
communityService: community_service.Service,
|
communityService: community_service.Service,
|
||||||
gifService: gif_service.Service
|
gifService: gif_service.Service
|
||||||
): Controller =
|
): Controller =
|
||||||
|
@ -35,11 +35,11 @@ proc newController*(
|
||||||
result.chatService = chatService
|
result.chatService = chatService
|
||||||
result.communityService = communityService
|
result.communityService = communityService
|
||||||
result.gifService = gifService
|
result.gifService = gifService
|
||||||
|
|
||||||
method delete*(self: Controller) =
|
method delete*(self: Controller) =
|
||||||
discard
|
discard
|
||||||
|
|
||||||
method init*(self: Controller) =
|
method init*(self: Controller) =
|
||||||
discard
|
discard
|
||||||
|
|
||||||
method getChatId*(self: Controller): string =
|
method getChatId*(self: Controller): string =
|
||||||
|
@ -97,4 +97,4 @@ method addToRecentsGif*(self: Controller, item: GifDto) =
|
||||||
self.gifService.addToRecents(item)
|
self.gifService.addToRecents(item)
|
||||||
|
|
||||||
method isFavorite*(self: Controller, item: GifDto): bool =
|
method isFavorite*(self: Controller, item: GifDto): bool =
|
||||||
return self.gifService.isFavorite(item)
|
return self.gifService.isFavorite(item)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import ../../../../../../app_service/service/gif/dto
|
import ../../../../../../app_service/service/gif/dto
|
||||||
|
|
||||||
type
|
type
|
||||||
AccessInterface* {.pure inheritable.} = ref object of RootObj
|
AccessInterface* {.pure inheritable.} = ref object of RootObj
|
||||||
## Abstract class for any input/interaction with this module.
|
## Abstract class for any input/interaction with this module.
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@ method acceptRequestAddressForTransaction*(self: AccessInterface, messageId: str
|
||||||
|
|
||||||
method acceptRequestTransaction*(self: AccessInterface, transactionHash: string, messageId: string, signature: string) {.base.} =
|
method acceptRequestTransaction*(self: AccessInterface, transactionHash: string, messageId: string, signature: string) {.base.} =
|
||||||
raise newException(ValueError, "No implementation available")
|
raise newException(ValueError, "No implementation available")
|
||||||
|
|
||||||
method searchGifs*(self: AccessInterface, query: string): seq[GifDto] {.base.} =
|
method searchGifs*(self: AccessInterface, query: string): seq[GifDto] {.base.} =
|
||||||
raise newException(ValueError, "No implementation available")
|
raise newException(ValueError, "No implementation available")
|
||||||
|
|
||||||
|
@ -59,4 +59,4 @@ method addToRecentsGif*(self: AccessInterface, item: GifDto) {.base.} =
|
||||||
raise newException(ValueError, "No implementation available")
|
raise newException(ValueError, "No implementation available")
|
||||||
|
|
||||||
method isFavorite*(self: AccessInterface, item: GifDto): bool {.base.} =
|
method isFavorite*(self: AccessInterface, item: GifDto): bool {.base.} =
|
||||||
raise newException(ValueError, "No implementation available")
|
raise newException(ValueError, "No implementation available")
|
||||||
|
|
|
@ -28,7 +28,7 @@ QtObject:
|
||||||
self.gifs = gifs
|
self.gifs = gifs
|
||||||
self.endResetModel()
|
self.endResetModel()
|
||||||
|
|
||||||
method rowCount(self: GifColumnModel, index: QModelIndex = nil): int =
|
method rowCount(self: GifColumnModel, index: QModelIndex = nil): int =
|
||||||
self.gifs.len
|
self.gifs.len
|
||||||
|
|
||||||
method data(self: GifColumnModel, index: QModelIndex, role: int): QVariant =
|
method data(self: GifColumnModel, index: QModelIndex, role: int): QVariant =
|
||||||
|
@ -51,4 +51,4 @@ QtObject:
|
||||||
GifRoles.Id.int:"id",
|
GifRoles.Id.int:"id",
|
||||||
GifRoles.Title.int:"title",
|
GifRoles.Title.int:"title",
|
||||||
GifRoles.TinyUrl.int:"tinyUrl",
|
GifRoles.TinyUrl.int:"tinyUrl",
|
||||||
}.toTable
|
}.toTable
|
||||||
|
|
|
@ -9,4 +9,4 @@ include ./private_interfaces/module_view_delegate_interface
|
||||||
include ./private_interfaces/module_controller_delegate_interface
|
include ./private_interfaces/module_controller_delegate_interface
|
||||||
|
|
||||||
# Defines how submodules of this module communicate with this module
|
# Defines how submodules of this module communicate with this module
|
||||||
# will be added if needed
|
# will be added if needed
|
||||||
|
|
|
@ -3,8 +3,8 @@ import NimQml
|
||||||
QtObject:
|
QtObject:
|
||||||
type
|
type
|
||||||
Item* = ref object of QObject
|
Item* = ref object of QObject
|
||||||
|
|
||||||
proc setup(self: Item) =
|
proc setup(self: Item) =
|
||||||
self.QObject.setup
|
self.QObject.setup
|
||||||
|
|
||||||
proc delete*(self: Item) =
|
proc delete*(self: Item) =
|
||||||
|
@ -14,8 +14,8 @@ QtObject:
|
||||||
new(result, delete)
|
new(result, delete)
|
||||||
result.setup()
|
result.setup()
|
||||||
|
|
||||||
proc id*(self: Item): string {.slot.} =
|
proc id*(self: Item): string {.slot.} =
|
||||||
self.id
|
self.id
|
||||||
|
|
||||||
QtProperty[string] id:
|
QtProperty[string] id:
|
||||||
read = id
|
read = id
|
||||||
|
|
|
@ -2,11 +2,11 @@ import NimQml
|
||||||
import item
|
import item
|
||||||
|
|
||||||
QtObject:
|
QtObject:
|
||||||
type
|
type
|
||||||
Model* = ref object of QAbstractListModel
|
Model* = ref object of QAbstractListModel
|
||||||
sections: seq[Item]
|
sections: seq[Item]
|
||||||
|
|
||||||
proc setup(self: Model) =
|
proc setup(self: Model) =
|
||||||
self.QAbstractListModel.setup
|
self.QAbstractListModel.setup
|
||||||
|
|
||||||
proc delete*(self: Model) =
|
proc delete*(self: Model) =
|
||||||
|
@ -14,4 +14,4 @@ QtObject:
|
||||||
|
|
||||||
proc newModel*(): Model =
|
proc newModel*(): Model =
|
||||||
new(result, delete)
|
new(result, delete)
|
||||||
result.setup
|
result.setup
|
||||||
|
|
|
@ -11,7 +11,7 @@ import ../../../../../../app_service/service/gif/dto
|
||||||
|
|
||||||
export io_interface
|
export io_interface
|
||||||
|
|
||||||
type
|
type
|
||||||
Module* = ref object of io_interface.AccessInterface
|
Module* = ref object of io_interface.AccessInterface
|
||||||
delegate: delegate_interface.AccessInterface
|
delegate: delegate_interface.AccessInterface
|
||||||
view: View
|
view: View
|
||||||
|
@ -23,7 +23,7 @@ proc newModule*(
|
||||||
delegate: delegate_interface.AccessInterface,
|
delegate: delegate_interface.AccessInterface,
|
||||||
sectionId: string,
|
sectionId: string,
|
||||||
chatId: string,
|
chatId: string,
|
||||||
belongsToCommunity: bool,
|
belongsToCommunity: bool,
|
||||||
chatService: chat_service.Service,
|
chatService: chat_service.Service,
|
||||||
communityService: community_service.Service,
|
communityService: community_service.Service,
|
||||||
gifService: gif_service.Service,
|
gifService: gif_service.Service,
|
||||||
|
@ -108,4 +108,4 @@ method addToRecentsGif*(self: Module, item: GifDto) =
|
||||||
self.controller.addToRecentsGif(item)
|
self.controller.addToRecentsGif(item)
|
||||||
|
|
||||||
method isFavorite*(self: Module, item: GifDto): bool =
|
method isFavorite*(self: Module, item: GifDto): bool =
|
||||||
return self.controller.isFavorite(item)
|
return self.controller.isFavorite(item)
|
||||||
|
|
|
@ -58,4 +58,4 @@ method addToRecentsGif*(self: AccessInterface, item: GifDto) {.base.} =
|
||||||
raise newException(ValueError, "No implementation available")
|
raise newException(ValueError, "No implementation available")
|
||||||
|
|
||||||
method isFavorite*(self: AccessInterface, item: GifDto): bool {.base.} =
|
method isFavorite*(self: AccessInterface, item: GifDto): bool {.base.} =
|
||||||
raise newException(ValueError, "No implementation available")
|
raise newException(ValueError, "No implementation available")
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
type
|
type
|
||||||
AccessInterface* {.pure inheritable.} = ref object of RootObj
|
AccessInterface* {.pure inheritable.} = ref object of RootObj
|
||||||
|
|
||||||
# Since nim doesn't support using concepts in second level nested types we
|
# Since nim doesn't support using concepts in second level nested types we
|
||||||
# define delegate interfaces within access interface.
|
# define delegate interfaces within access interface.
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
method viewDidLoad*(self: AccessInterface) {.base.} =
|
method viewDidLoad*(self: AccessInterface) {.base.} =
|
||||||
raise newException(ValueError, "No implementation available")
|
raise newException(ValueError, "No implementation available")
|
||||||
|
|
|
@ -12,7 +12,7 @@ QtObject:
|
||||||
gifColumnAModel: GifColumnModel
|
gifColumnAModel: GifColumnModel
|
||||||
gifColumnBModel: GifColumnModel
|
gifColumnBModel: GifColumnModel
|
||||||
gifColumnCModel: GifColumnModel
|
gifColumnCModel: GifColumnModel
|
||||||
|
|
||||||
proc delete*(self: View) =
|
proc delete*(self: View) =
|
||||||
self.model.delete
|
self.model.delete
|
||||||
self.QObject.delete
|
self.QObject.delete
|
||||||
|
@ -28,7 +28,7 @@ QtObject:
|
||||||
|
|
||||||
proc load*(self: View) =
|
proc load*(self: View) =
|
||||||
self.delegate.viewDidLoad()
|
self.delegate.viewDidLoad()
|
||||||
|
|
||||||
proc sendMessage*(
|
proc sendMessage*(
|
||||||
self: View,
|
self: View,
|
||||||
msg: string,
|
msg: string,
|
||||||
|
@ -53,7 +53,7 @@ QtObject:
|
||||||
|
|
||||||
proc declineRequest*(self: View, messageId: string) {.slot.} =
|
proc declineRequest*(self: View, messageId: string) {.slot.} =
|
||||||
self.delegate.declineRequestTransaction(messageId)
|
self.delegate.declineRequestTransaction(messageId)
|
||||||
|
|
||||||
proc acceptRequestTransaction*(self: View, transactionHash: string, messageId: string, signature: string) {.slot.} =
|
proc acceptRequestTransaction*(self: View, transactionHash: string, messageId: string, signature: string) {.slot.} =
|
||||||
self.delegate.acceptRequestTransaction(transactionHash, messageId, signature)
|
self.delegate.acceptRequestTransaction(transactionHash, messageId, signature)
|
||||||
|
|
||||||
|
@ -108,11 +108,11 @@ QtObject:
|
||||||
proc searchGifs*(self: View, query: string) {.slot.} =
|
proc searchGifs*(self: View, query: string) {.slot.} =
|
||||||
let data = self.delegate.searchGifs(query)
|
let data = self.delegate.searchGifs(query)
|
||||||
self.updateGifColumns(data)
|
self.updateGifColumns(data)
|
||||||
|
|
||||||
proc getTrendingsGifs*(self: View) {.slot.} =
|
proc getTrendingsGifs*(self: View) {.slot.} =
|
||||||
let data = self.delegate.getTrendingsGifs()
|
let data = self.delegate.getTrendingsGifs()
|
||||||
self.updateGifColumns(data)
|
self.updateGifColumns(data)
|
||||||
|
|
||||||
proc getRecentsGifs*(self: View) {.slot.} =
|
proc getRecentsGifs*(self: View) {.slot.} =
|
||||||
let data = self.delegate.getRecentsGifs()
|
let data = self.delegate.getRecentsGifs()
|
||||||
self.updateGifColumns(data)
|
self.updateGifColumns(data)
|
||||||
|
@ -149,4 +149,4 @@ QtObject:
|
||||||
|
|
||||||
proc isFavorite*(self: View, id: string): bool {.slot.} =
|
proc isFavorite*(self: View, id: string): bool {.slot.} =
|
||||||
let gifItem = self.findGifDto(id)
|
let gifItem = self.findGifDto(id)
|
||||||
return self.delegate.isFavorite(gifItem)
|
return self.delegate.isFavorite(gifItem)
|
||||||
|
|
|
@ -11,4 +11,4 @@ include ./private_interfaces/module_controller_delegate_interface
|
||||||
# Defines how submodules of this module communicate with this module
|
# Defines how submodules of this module communicate with this module
|
||||||
include ./private_interfaces/module_input_area_delegate_interface
|
include ./private_interfaces/module_input_area_delegate_interface
|
||||||
include ./private_interfaces/module_messages_delegate_interface
|
include ./private_interfaces/module_messages_delegate_interface
|
||||||
include ./private_interfaces/module_users_delegate_interface
|
include ./private_interfaces/module_users_delegate_interface
|
||||||
|
|
|
@ -16,7 +16,7 @@ export controller_interface
|
||||||
logScope:
|
logScope:
|
||||||
topics = "messages-controller"
|
topics = "messages-controller"
|
||||||
|
|
||||||
type
|
type
|
||||||
Controller* = ref object of controller_interface.AccessInterface
|
Controller* = ref object of controller_interface.AccessInterface
|
||||||
delegate: io_interface.AccessInterface
|
delegate: io_interface.AccessInterface
|
||||||
events: EventEmitter
|
events: EventEmitter
|
||||||
|
@ -31,9 +31,9 @@ type
|
||||||
messageService: message_service.Service
|
messageService: message_service.Service
|
||||||
mailserversService: mailservers_service.Service
|
mailserversService: mailservers_service.Service
|
||||||
|
|
||||||
proc newController*(delegate: io_interface.AccessInterface, events: EventEmitter, sectionId: string, chatId: string,
|
proc newController*(delegate: io_interface.AccessInterface, events: EventEmitter, sectionId: string, chatId: string,
|
||||||
belongsToCommunity: bool, contactService: contact_service.Service, communityService: community_service.Service,
|
belongsToCommunity: bool, contactService: contact_service.Service, communityService: community_service.Service,
|
||||||
chatService: chat_service.Service, messageService: message_service.Service, mailserversService: mailservers_service.Service):
|
chatService: chat_service.Service, messageService: message_service.Service, mailserversService: mailservers_service.Service):
|
||||||
Controller =
|
Controller =
|
||||||
result = Controller()
|
result = Controller()
|
||||||
result.delegate = delegate
|
result.delegate = delegate
|
||||||
|
@ -47,11 +47,11 @@ proc newController*(delegate: io_interface.AccessInterface, events: EventEmitter
|
||||||
result.chatService = chatService
|
result.chatService = chatService
|
||||||
result.messageService = messageService
|
result.messageService = messageService
|
||||||
result.mailserversService = mailserversService
|
result.mailserversService = mailserversService
|
||||||
|
|
||||||
method delete*(self: Controller) =
|
method delete*(self: Controller) =
|
||||||
discard
|
discard
|
||||||
|
|
||||||
method init*(self: Controller) =
|
method init*(self: Controller) =
|
||||||
self.events.on(SIGNAL_MESSAGES_LOADED) do(e:Args):
|
self.events.on(SIGNAL_MESSAGES_LOADED) do(e:Args):
|
||||||
let args = MessagesLoadedArgs(e)
|
let args = MessagesLoadedArgs(e)
|
||||||
if(self.chatId != args.chatId):
|
if(self.chatId != args.chatId):
|
||||||
|
@ -195,7 +195,7 @@ method getNumOfPinnedMessages*(self: Controller): int =
|
||||||
method getRenderedText*(self: Controller, parsedTextArray: seq[ParsedText]): string =
|
method getRenderedText*(self: Controller, parsedTextArray: seq[ParsedText]): string =
|
||||||
return self.messageService.getRenderedText(parsedTextArray)
|
return self.messageService.getRenderedText(parsedTextArray)
|
||||||
|
|
||||||
method getMessageDetails*(self: Controller, messageId: string):
|
method getMessageDetails*(self: Controller, messageId: string):
|
||||||
tuple[message: MessageDto, reactions: seq[ReactionDto], error: string] =
|
tuple[message: MessageDto, reactions: seq[ReactionDto], error: string] =
|
||||||
return self.messageService.getDetailsForMessage(self.chatId, messageId)
|
return self.messageService.getDetailsForMessage(self.chatId, messageId)
|
||||||
|
|
||||||
|
@ -208,7 +208,7 @@ method decodeContentHash*(self: Controller, hash: string): string =
|
||||||
method editMessage*(self: Controller, messageId: string, updatedMsg: string) =
|
method editMessage*(self: Controller, messageId: string, updatedMsg: string) =
|
||||||
self.messageService.editMessage(messageId, updatedMsg)
|
self.messageService.editMessage(messageId, updatedMsg)
|
||||||
|
|
||||||
method getLinkPreviewData*(self: Controller, link: string, uuid: string): string =
|
method getLinkPreviewData*(self: Controller, link: string, uuid: string): string =
|
||||||
self.messageService.asyncGetLinkPreviewData(link, uuid)
|
self.messageService.asyncGetLinkPreviewData(link, uuid)
|
||||||
|
|
||||||
method getSearchedMessageId*(self: Controller): string =
|
method getSearchedMessageId*(self: Controller): string =
|
||||||
|
|
|
@ -3,7 +3,7 @@ import ../../../../../../app_service/service/community/dto/[community]
|
||||||
import ../../../../../../app_service/service/chat/dto/[chat]
|
import ../../../../../../app_service/service/chat/dto/[chat]
|
||||||
import ../../../../../../app_service/service/message/dto/[message, reaction]
|
import ../../../../../../app_service/service/message/dto/[message, reaction]
|
||||||
|
|
||||||
type
|
type
|
||||||
AccessInterface* {.pure inheritable.} = ref object of RootObj
|
AccessInterface* {.pure inheritable.} = ref object of RootObj
|
||||||
## Abstract class for any input/interaction with this module.
|
## Abstract class for any input/interaction with this module.
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ method getChatDetails*(self: AccessInterface): ChatDto {.base.} =
|
||||||
method getCommunityDetails*(self: AccessInterface): CommunityDto {.base.} =
|
method getCommunityDetails*(self: AccessInterface): CommunityDto {.base.} =
|
||||||
raise newException(ValueError, "No implementation available")
|
raise newException(ValueError, "No implementation available")
|
||||||
|
|
||||||
method getOneToOneChatNameAndImage*(self: AccessInterface): tuple[name: string, image: string, isIdenticon: bool]
|
method getOneToOneChatNameAndImage*(self: AccessInterface): tuple[name: string, image: string, isIdenticon: bool]
|
||||||
{.base.} =
|
{.base.} =
|
||||||
raise newException(ValueError, "No implementation available")
|
raise newException(ValueError, "No implementation available")
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@ method belongsToCommunity*(self: AccessInterface): bool {.base.} =
|
||||||
|
|
||||||
method loadMoreMessages*(self: AccessInterface) {.base.} =
|
method loadMoreMessages*(self: AccessInterface) {.base.} =
|
||||||
raise newException(ValueError, "No implementation available")
|
raise newException(ValueError, "No implementation available")
|
||||||
|
|
||||||
method addReaction*(self: AccessInterface, messageId: string, emojiId: int) {.base.} =
|
method addReaction*(self: AccessInterface, messageId: string, emojiId: int) {.base.} =
|
||||||
raise newException(ValueError, "No implementation available")
|
raise newException(ValueError, "No implementation available")
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@ method getNumOfPinnedMessages*(self: AccessInterface): int {.base.} =
|
||||||
method getRenderedText*(self: AccessInterface, parsedTextArray: seq[ParsedText]): string {.base.} =
|
method getRenderedText*(self: AccessInterface, parsedTextArray: seq[ParsedText]): string {.base.} =
|
||||||
raise newException(ValueError, "No implementation available")
|
raise newException(ValueError, "No implementation available")
|
||||||
|
|
||||||
method getMessageDetails*(self: AccessInterface, messageId: string):
|
method getMessageDetails*(self: AccessInterface, messageId: string):
|
||||||
tuple[message: MessageDto, reactions: seq[ReactionDto], error: string] {.base.} =
|
tuple[message: MessageDto, reactions: seq[ReactionDto], error: string] {.base.} =
|
||||||
raise newException(ValueError, "No implementation available")
|
raise newException(ValueError, "No implementation available")
|
||||||
|
|
||||||
|
|
|
@ -9,4 +9,4 @@ include ./private_interfaces/module_view_delegate_interface
|
||||||
include ./private_interfaces/module_controller_delegate_interface
|
include ./private_interfaces/module_controller_delegate_interface
|
||||||
|
|
||||||
# Defines how submodules of this module communicate with this module
|
# Defines how submodules of this module communicate with this module
|
||||||
# will be added if needed
|
# will be added if needed
|
||||||
|
|
|
@ -21,7 +21,7 @@ logScope:
|
||||||
const CHAT_IDENTIFIER_MESSAGE_ID = "chat-identifier-message-id"
|
const CHAT_IDENTIFIER_MESSAGE_ID = "chat-identifier-message-id"
|
||||||
const FETCH_MORE_MESSAGES_MESSAGE_ID = "fetch-more_messages-message-id"
|
const FETCH_MORE_MESSAGES_MESSAGE_ID = "fetch-more_messages-message-id"
|
||||||
|
|
||||||
type
|
type
|
||||||
Module* = ref object of io_interface.AccessInterface
|
Module* = ref object of io_interface.AccessInterface
|
||||||
delegate: delegate_interface.AccessInterface
|
delegate: delegate_interface.AccessInterface
|
||||||
view: View
|
view: View
|
||||||
|
@ -29,15 +29,15 @@ type
|
||||||
controller: controller.AccessInterface
|
controller: controller.AccessInterface
|
||||||
moduleLoaded: bool
|
moduleLoaded: bool
|
||||||
|
|
||||||
proc newModule*(delegate: delegate_interface.AccessInterface, events: EventEmitter, sectionId: string, chatId: string,
|
proc newModule*(delegate: delegate_interface.AccessInterface, events: EventEmitter, sectionId: string, chatId: string,
|
||||||
belongsToCommunity: bool, contactService: contact_service.Service, communityService: community_service.Service,
|
belongsToCommunity: bool, contactService: contact_service.Service, communityService: community_service.Service,
|
||||||
chatService: chat_service.Service, messageService: message_service.Service, mailserversService: mailservers_service.Service):
|
chatService: chat_service.Service, messageService: message_service.Service, mailserversService: mailservers_service.Service):
|
||||||
Module =
|
Module =
|
||||||
result = Module()
|
result = Module()
|
||||||
result.delegate = delegate
|
result.delegate = delegate
|
||||||
result.view = view.newView(result)
|
result.view = view.newView(result)
|
||||||
result.viewVariant = newQVariant(result.view)
|
result.viewVariant = newQVariant(result.view)
|
||||||
result.controller = controller.newController(result, events, sectionId, chatId, belongsToCommunity, contactService,
|
result.controller = controller.newController(result, events, sectionId, chatId, belongsToCommunity, contactService,
|
||||||
communityService, chatService, messageService, mailserversService)
|
communityService, chatService, messageService, mailserversService)
|
||||||
result.moduleLoaded = false
|
result.moduleLoaded = false
|
||||||
|
|
||||||
|
@ -81,7 +81,7 @@ proc createFetchMoreMessagesItem(self: Module): Item =
|
||||||
amISender = false,
|
amISender = false,
|
||||||
outgoingStatus = "",
|
outgoingStatus = "",
|
||||||
text = "",
|
text = "",
|
||||||
image = "",
|
image = "",
|
||||||
messageContainsMentions = false,
|
messageContainsMentions = false,
|
||||||
seen = true,
|
seen = true,
|
||||||
timestamp = 0,
|
timestamp = 0,
|
||||||
|
@ -111,7 +111,7 @@ proc createChatIdentifierItem(self: Module): Item =
|
||||||
amISender = false,
|
amISender = false,
|
||||||
outgoingStatus = "",
|
outgoingStatus = "",
|
||||||
text = "",
|
text = "",
|
||||||
image = "",
|
image = "",
|
||||||
messageContainsMentions = false,
|
messageContainsMentions = false,
|
||||||
seen = true,
|
seen = true,
|
||||||
timestamp = 0,
|
timestamp = 0,
|
||||||
|
@ -135,10 +135,10 @@ proc checkIfMessageLoadedAndScrollToItIfItIs(self: Module): bool =
|
||||||
return true
|
return true
|
||||||
return false
|
return false
|
||||||
|
|
||||||
method newMessagesLoaded*(self: Module, messages: seq[MessageDto], reactions: seq[ReactionDto],
|
method newMessagesLoaded*(self: Module, messages: seq[MessageDto], reactions: seq[ReactionDto],
|
||||||
pinnedMessages: seq[PinnedMessageDto]) =
|
pinnedMessages: seq[PinnedMessageDto]) =
|
||||||
var viewItems: seq[Item]
|
var viewItems: seq[Item]
|
||||||
|
|
||||||
if(messages.len > 0):
|
if(messages.len > 0):
|
||||||
for m in messages:
|
for m in messages:
|
||||||
let sender = self.controller.getContactDetails(m.`from`)
|
let sender = self.controller.getContactDetails(m.`from`)
|
||||||
|
@ -150,12 +150,12 @@ method newMessagesLoaded*(self: Module, messages: seq[MessageDto], reactions: se
|
||||||
m.`from`,
|
m.`from`,
|
||||||
sender.displayName,
|
sender.displayName,
|
||||||
sender.details.localNickname,
|
sender.details.localNickname,
|
||||||
sender.icon,
|
sender.icon,
|
||||||
sender.isIdenticon,
|
sender.isIdenticon,
|
||||||
sender.isCurrentUser,
|
sender.isCurrentUser,
|
||||||
m.outgoingStatus,
|
m.outgoingStatus,
|
||||||
renderedMessageText,
|
renderedMessageText,
|
||||||
m.image,
|
m.image,
|
||||||
m.containsContactMentions(),
|
m.containsContactMentions(),
|
||||||
m.seen,
|
m.seen,
|
||||||
m.timestamp,
|
m.timestamp,
|
||||||
|
@ -172,7 +172,7 @@ method newMessagesLoaded*(self: Module, messages: seq[MessageDto], reactions: se
|
||||||
if(message_reaction_item.toEmojiIdAsEnum(r.emojiId, emojiIdAsEnum)):
|
if(message_reaction_item.toEmojiIdAsEnum(r.emojiId, emojiIdAsEnum)):
|
||||||
let userWhoAddedThisReaction = self.controller.getContactById(r.`from`)
|
let userWhoAddedThisReaction = self.controller.getContactById(r.`from`)
|
||||||
let didIReactWithThisEmoji = userWhoAddedThisReaction.id == singletonInstance.userProfile.getPubKey()
|
let didIReactWithThisEmoji = userWhoAddedThisReaction.id == singletonInstance.userProfile.getPubKey()
|
||||||
item.addReaction(emojiIdAsEnum, didIReactWithThisEmoji, userWhoAddedThisReaction.id,
|
item.addReaction(emojiIdAsEnum, didIReactWithThisEmoji, userWhoAddedThisReaction.id,
|
||||||
userWhoAddedThisReaction.userNameOrAlias(), r.id)
|
userWhoAddedThisReaction.userNameOrAlias(), r.id)
|
||||||
else:
|
else:
|
||||||
error "wrong emoji id found when loading messages", methodName="newMessagesLoaded"
|
error "wrong emoji id found when loading messages", methodName="newMessagesLoaded"
|
||||||
|
@ -202,7 +202,7 @@ method newMessagesLoaded*(self: Module, messages: seq[MessageDto], reactions: se
|
||||||
|
|
||||||
# check if this loading was caused by the click on a messages from the app search result
|
# check if this loading was caused by the click on a messages from the app search result
|
||||||
discard self.checkIfMessageLoadedAndScrollToItIfItIs()
|
discard self.checkIfMessageLoadedAndScrollToItIfItIs()
|
||||||
|
|
||||||
method messageAdded*(self: Module, message: MessageDto) =
|
method messageAdded*(self: Module, message: MessageDto) =
|
||||||
let sender = self.controller.getContactDetails(message.`from`)
|
let sender = self.controller.getContactDetails(message.`from`)
|
||||||
|
|
||||||
|
@ -212,13 +212,13 @@ method messageAdded*(self: Module, message: MessageDto) =
|
||||||
message.responseTo,
|
message.responseTo,
|
||||||
message.`from`,
|
message.`from`,
|
||||||
sender.displayName,
|
sender.displayName,
|
||||||
sender.details.localNickname,
|
sender.details.localNickname,
|
||||||
sender.icon,
|
sender.icon,
|
||||||
sender.isIdenticon,
|
sender.isIdenticon,
|
||||||
sender.isCurrentUser,
|
sender.isCurrentUser,
|
||||||
message.outgoingStatus,
|
message.outgoingStatus,
|
||||||
renderedMessageText,
|
renderedMessageText,
|
||||||
message.image,
|
message.image,
|
||||||
message.containsContactMentions(),
|
message.containsContactMentions(),
|
||||||
message.seen,
|
message.seen,
|
||||||
message.timestamp,
|
message.timestamp,
|
||||||
|
@ -260,7 +260,7 @@ method onReactionAdded*(self: Module, messageId: string, emojiId: int, reactionI
|
||||||
if(message_reaction_item.toEmojiIdAsEnum(emojiId, emojiIdAsEnum)):
|
if(message_reaction_item.toEmojiIdAsEnum(emojiId, emojiIdAsEnum)):
|
||||||
let myPublicKey = singletonInstance.userProfile.getPubKey()
|
let myPublicKey = singletonInstance.userProfile.getPubKey()
|
||||||
let myName = singletonInstance.userProfile.getName()
|
let myName = singletonInstance.userProfile.getName()
|
||||||
self.view.model().addReaction(messageId, emojiIdAsEnum, didIReactWithThisEmoji = true, myPublicKey, myName,
|
self.view.model().addReaction(messageId, emojiIdAsEnum, didIReactWithThisEmoji = true, myPublicKey, myName,
|
||||||
reactionId)
|
reactionId)
|
||||||
else:
|
else:
|
||||||
error "wrong emoji id found on reaction added response", emojiId, methodName="onReactionAdded"
|
error "wrong emoji id found on reaction added response", emojiId, methodName="onReactionAdded"
|
||||||
|
@ -272,7 +272,7 @@ method onReactionRemoved*(self: Module, messageId: string, emojiId: int, reactio
|
||||||
else:
|
else:
|
||||||
error "wrong emoji id found on reaction remove response", emojiId, methodName="onReactionRemoved"
|
error "wrong emoji id found on reaction remove response", emojiId, methodName="onReactionRemoved"
|
||||||
|
|
||||||
method toggleReactionFromOthers*(self: Module, messageId: string, emojiId: int, reactionId: string,
|
method toggleReactionFromOthers*(self: Module, messageId: string, emojiId: int, reactionId: string,
|
||||||
reactionFrom: string) =
|
reactionFrom: string) =
|
||||||
var emojiIdAsEnum: EmojiId
|
var emojiIdAsEnum: EmojiId
|
||||||
if(message_reaction_item.toEmojiIdAsEnum(emojiId, emojiIdAsEnum)):
|
if(message_reaction_item.toEmojiIdAsEnum(emojiId, emojiIdAsEnum)):
|
||||||
|
@ -282,7 +282,7 @@ method toggleReactionFromOthers*(self: Module, messageId: string, emojiId: int,
|
||||||
return
|
return
|
||||||
if(item.shouldAddReaction(emojiIdAsEnum, reactionFrom)):
|
if(item.shouldAddReaction(emojiIdAsEnum, reactionFrom)):
|
||||||
let userWhoAddedThisReaction = self.controller.getContactById(reactionFrom)
|
let userWhoAddedThisReaction = self.controller.getContactById(reactionFrom)
|
||||||
self.view.model().addReaction(messageId, emojiIdAsEnum, didIReactWithThisEmoji = false,
|
self.view.model().addReaction(messageId, emojiIdAsEnum, didIReactWithThisEmoji = false,
|
||||||
userWhoAddedThisReaction.id, userWhoAddedThisReaction.userNameOrAlias(), reactionId)
|
userWhoAddedThisReaction.id, userWhoAddedThisReaction.userNameOrAlias(), reactionId)
|
||||||
else:
|
else:
|
||||||
self.view.model().removeReaction(messageId, emojiIdAsEnum, reactionId, didIRemoveThisReaction = false)
|
self.view.model().removeReaction(messageId, emojiIdAsEnum, reactionId, didIRemoveThisReaction = false)
|
||||||
|
|
|
@ -13,4 +13,4 @@ method getModuleAsVariant*(self: AccessInterface): QVariant {.base.} =
|
||||||
raise newException(ValueError, "No implementation available")
|
raise newException(ValueError, "No implementation available")
|
||||||
|
|
||||||
method updateChatIdentifier*(self: AccessInterface) {.base.} =
|
method updateChatIdentifier*(self: AccessInterface) {.base.} =
|
||||||
raise newException(ValueError, "No implementation available")
|
raise newException(ValueError, "No implementation available")
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
type
|
type
|
||||||
AccessInterface* {.pure inheritable.} = ref object of RootObj
|
AccessInterface* {.pure inheritable.} = ref object of RootObj
|
||||||
|
|
||||||
# Since nim doesn't support using concepts in second level nested types we
|
# Since nim doesn't support using concepts in second level nested types we
|
||||||
# define delegate interfaces within access interface.
|
# define delegate interfaces within access interface.
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import ../../../../../../../app_service/service/message/dto/[message, reaction, pinned_message]
|
import ../../../../../../../app_service/service/message/dto/[message, reaction, pinned_message]
|
||||||
|
|
||||||
method newMessagesLoaded*(self: AccessInterface, messages: seq[MessageDto], reactions: seq[ReactionDto],
|
method newMessagesLoaded*(self: AccessInterface, messages: seq[MessageDto], reactions: seq[ReactionDto],
|
||||||
pinnedMessages: seq[PinnedMessageDto]) {.base.} =
|
pinnedMessages: seq[PinnedMessageDto]) {.base.} =
|
||||||
raise newException(ValueError, "No implementation available")
|
raise newException(ValueError, "No implementation available")
|
||||||
|
|
||||||
method onReactionAdded*(self: AccessInterface, messageId: string, emojiId: int, reactionId: string) {.base.} =
|
method onReactionAdded*(self: AccessInterface, messageId: string, emojiId: int, reactionId: string) {.base.} =
|
||||||
raise newException(ValueError, "No implementation available")
|
raise newException(ValueError, "No implementation available")
|
||||||
|
@ -10,7 +10,7 @@ method onReactionAdded*(self: AccessInterface, messageId: string, emojiId: int,
|
||||||
method onReactionRemoved*(self: AccessInterface, messageId: string, emojiId: int, reactionId: string) {.base.} =
|
method onReactionRemoved*(self: AccessInterface, messageId: string, emojiId: int, reactionId: string) {.base.} =
|
||||||
raise newException(ValueError, "No implementation available")
|
raise newException(ValueError, "No implementation available")
|
||||||
|
|
||||||
method toggleReactionFromOthers*(self: AccessInterface, messageId: string, emojiId: int, reactionId: string,
|
method toggleReactionFromOthers*(self: AccessInterface, messageId: string, emojiId: int, reactionId: string,
|
||||||
reactionFrom: string) {.base.} =
|
reactionFrom: string) {.base.} =
|
||||||
raise newException(ValueError, "No implementation available")
|
raise newException(ValueError, "No implementation available")
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@ method viewDidLoad*(self: AccessInterface) {.base.} =
|
||||||
|
|
||||||
method loadMoreMessages*(self: AccessInterface) {.base.} =
|
method loadMoreMessages*(self: AccessInterface) {.base.} =
|
||||||
raise newException(ValueError, "No implementation available")
|
raise newException(ValueError, "No implementation available")
|
||||||
|
|
||||||
method toggleReaction*(self: AccessInterface, messageId: string, emojiId: int) {.base.} =
|
method toggleReaction*(self: AccessInterface, messageId: string, emojiId: int) {.base.} =
|
||||||
raise newException(ValueError, "No implementation available")
|
raise newException(ValueError, "No implementation available")
|
||||||
|
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue