mirror of
https://github.com/status-im/status-desktop.git
synced 2025-02-21 19:18:53 +00:00
refactor(general): core things moved to core
section of the app
This commit is contained in:
parent
786c0b4041
commit
a99422a00a
@ -34,7 +34,7 @@ import ../global/global_singleton
|
||||
# This will be removed later once we move to c++ and handle there async things
|
||||
# and improved some services, like EventsService which should implement
|
||||
# provider/subscriber principe, similar we should have SettingsService.
|
||||
import ../../app_service/[main]
|
||||
import ../core/[main]
|
||||
import eventemitter
|
||||
import status/[fleet]
|
||||
import ../profile/core as profile
|
||||
|
@ -3,7 +3,7 @@ import status/chat as chat_model
|
||||
import status/messages as messages_model
|
||||
import status/[chat, contacts, status, wallet, stickers, settings]
|
||||
import status/types/[message, transaction, os_notification, setting]
|
||||
import ../../app_service/[main]
|
||||
import ../core/[main]
|
||||
import view, views/channels_list, views/message_list, views/reactions, views/stickers as stickers_view
|
||||
import eventemitter
|
||||
|
||||
|
@ -5,12 +5,8 @@ import # status-desktop libs
|
||||
status/chat/chat as status_chat,
|
||||
./views/communities,
|
||||
./views/messages
|
||||
from ../../app_service/service/contacts/service import ContactArgs
|
||||
from ../../app_service/service/contacts/service import ContactNicknameUpdatedArgs
|
||||
import status/types/profile
|
||||
import status/contacts
|
||||
import ../../app_service/tasks/[qt, threadpool]
|
||||
import ../../app_service/tasks/marathon/mailserver/worker
|
||||
import ../core/tasks/[qt, threadpool]
|
||||
import ../core/tasks/marathon/mailserver/worker
|
||||
|
||||
proc handleChatEvents(self: ChatController) =
|
||||
# Display already saved messages
|
||||
@ -31,19 +27,6 @@ proc handleChatEvents(self: ChatController) =
|
||||
let notifications = ActivityCenterNotificationsArgs(e).activityCenterNotifications
|
||||
self.view.pushActivityCenterNotifications(notifications)
|
||||
|
||||
# This is a new event emitted and introduced by app_service when
|
||||
# the local nickname of a contact was changed. `contactUpdate` is
|
||||
# no longer emitted in such cases, so we need to make sure to also update
|
||||
# the view when this new event is emitted.
|
||||
self.status.events.on("new-contactNicknameChanged") do(e: Args):
|
||||
var evArgs = ContactNicknameUpdatedArgs(e)
|
||||
let contact = Profile(
|
||||
id: evArgs.contactId,
|
||||
localNickname: evArgs.nickname
|
||||
)
|
||||
self.view.updateUsernames(@[contact])
|
||||
self.view.updateChannelForContacts(@[contact])
|
||||
|
||||
self.status.events.on("contactUpdate") do(e: Args):
|
||||
var evArgs = ContactUpdateArgs(e)
|
||||
self.view.updateUsernames(evArgs.contacts)
|
||||
@ -56,6 +39,7 @@ proc handleChatEvents(self: ChatController) =
|
||||
# app to be slower
|
||||
self.status.events.on("chatUpdate") do(e: Args):
|
||||
var evArgs = ChatUpdateArgs(e)
|
||||
self.view.hideLoadingIndicator()
|
||||
self.view.updateChats(evArgs.chats)
|
||||
self.view.pushMessages(evArgs.messages)
|
||||
self.view.pushMembers(evArgs.chats)
|
||||
@ -118,8 +102,10 @@ proc handleChatEvents(self: ChatController) =
|
||||
|
||||
self.status.events.on("channelLoaded") do(e: Args):
|
||||
var channel = ChannelArgs(e)
|
||||
if channel.chat.chatType == ChatType.Timeline:
|
||||
self.view.setTimelineChat(channel.chat)
|
||||
# Do not add community chats to the normal chat list
|
||||
if channel.chat.chatType != status_chat.ChatType.CommunityChat:
|
||||
elif channel.chat.chatType != ChatType.Profile and channel.chat.chatType != status_chat.ChatType.CommunityChat:
|
||||
discard self.view.channelView.chats.addChatItemToList(channel.chat)
|
||||
self.view.messageView.upsertChannel(channel.chat.id)
|
||||
self.view.messageView.messageList[channel.chat.id].addChatMembers(channel.chat.members)
|
||||
@ -144,8 +130,11 @@ proc handleChatEvents(self: ChatController) =
|
||||
|
||||
self.status.events.on("channelJoined") do(e: Args):
|
||||
var channel = ChannelArgs(e)
|
||||
discard self.view.channelView.chats.addChatItemToList(channel.chat)
|
||||
self.view.setActiveChannel(channel.chat.id)
|
||||
if channel.chat.chatType == ChatType.Timeline:
|
||||
self.view.setTimelineChat(channel.chat)
|
||||
elif channel.chat.chatType != ChatType.Profile:
|
||||
discard self.view.channelView.chats.addChatItemToList(channel.chat)
|
||||
self.view.setActiveChannel(channel.chat.id)
|
||||
|
||||
self.status.chat.statusUpdates()
|
||||
|
||||
@ -153,6 +142,7 @@ proc handleChatEvents(self: ChatController) =
|
||||
let chatId = ChatIdArg(e).chatId
|
||||
self.view.removeChat(chatId)
|
||||
self.view.calculateUnreadMessages()
|
||||
self.view.removeMessagesFromTimeline(chatId)
|
||||
|
||||
self.status.events.on("activeChannelChanged") do(e: Args):
|
||||
self.view.setActiveChannel(ChatIdArg(e).chatId)
|
||||
@ -193,8 +183,18 @@ proc handleChatEvents(self: ChatController) =
|
||||
#Notifying communities about this change.
|
||||
self.view.communities.markNotificationsAsRead(markAsReadProps)
|
||||
|
||||
proc handleMailserverEvents(self: ChatController) =
|
||||
let mailserverWorker = self.appService.marathon[MailserverWorker().name]
|
||||
self.status.events.on("mailserverAvailable") do(e:Args):
|
||||
self.view.messageView.setLoadingMessages(true)
|
||||
let task = RequestMessagesTaskArg(
|
||||
`method`: "requestMessages",
|
||||
vptr: cast[ByteAddress](self.view.vptr),
|
||||
slot: "requestAllHistoricMessagesResult"
|
||||
)
|
||||
mailserverWorker.start(task)
|
||||
|
||||
proc handleSystemEvents(self: ChatController) =
|
||||
self.status.events.on("osNotificationClicked") do(e:Args):
|
||||
let arg = OsNotificationsArgs(e)
|
||||
self.view.onOsNotificationClicked(arg.details)
|
||||
self.view.onOsNotificationClicked(arg.details)
|
@ -1,5 +1,5 @@
|
||||
import
|
||||
../../app_service/tasks/marathon/mailserver/worker,
|
||||
../core/tasks/marathon/mailserver/worker,
|
||||
status/signals
|
||||
|
||||
proc handleSignals(self: ChatController) =
|
||||
|
@ -7,9 +7,9 @@ import status/contacts as status_contacts
|
||||
import status/ens as status_ens
|
||||
import status/chat/[chat]
|
||||
import status/types/[activity_center_notification, os_notification, rpc_response, profile]
|
||||
import ../../app_service/[main]
|
||||
import ../../app_service/tasks/[qt, threadpool]
|
||||
import ../../app_service/tasks/marathon/mailserver/worker
|
||||
import ../core/[main]
|
||||
import ../core/tasks/[qt, threadpool]
|
||||
import ../core/tasks/marathon/mailserver/worker
|
||||
import status/notifications/[os_notifications]
|
||||
import ../utils/image_utils
|
||||
import web3/[conversions, ethtypes]
|
||||
|
@ -6,8 +6,8 @@ import status/chat as status_chat
|
||||
import status/chat/[chat]
|
||||
|
||||
import status/statusgo_backend/chat as status_backend_chat
|
||||
import ../../../app_service/[main]
|
||||
import ../../../app_service/tasks/[qt, threadpool]
|
||||
import ../../core/[main]
|
||||
import ../../core/tasks/[qt, threadpool]
|
||||
|
||||
import communities, chat_item, channels_list, communities, community_list, activity_notification_list
|
||||
|
||||
|
@ -2,9 +2,9 @@ import NimQml, json, sequtils, chronicles, strutils
|
||||
|
||||
import status/[status, contacts]
|
||||
import status/ens as status_ens
|
||||
import ../../../app_service/[main]
|
||||
import ../../../app_service/tasks/[qt, threadpool]
|
||||
import ../../../app_service/tasks/marathon/mailserver/worker
|
||||
import ../../core/[main]
|
||||
import ../../core/tasks/[qt, threadpool]
|
||||
import ../../core/tasks/marathon/mailserver/worker
|
||||
|
||||
logScope:
|
||||
topics = "ens-view"
|
||||
|
@ -6,9 +6,9 @@ import status/utils as status_utils
|
||||
import status/chat/[chat]
|
||||
import status/types/[message, profile]
|
||||
|
||||
import ../../../app_service/[main]
|
||||
import ../../../app_service/tasks/[qt, threadpool]
|
||||
import ../../../app_service/tasks/marathon/mailserver/worker
|
||||
import ../../core/[main]
|
||||
import ../../core/tasks/[qt, threadpool]
|
||||
import ../../core/tasks/marathon/mailserver/worker
|
||||
|
||||
import communities, chat_item, channels_list, communities, user_list, community_members_list, message_list, channel, message_item, message_format
|
||||
|
||||
|
@ -8,9 +8,9 @@ import # status-desktop libs
|
||||
status/[status, stickers, wallet, utils],
|
||||
sticker_pack_list, sticker_list, chat_item
|
||||
import status/types/[sticker, pending_transaction_type]
|
||||
import ../../../app_service/[main]
|
||||
import ../../../app_service/tasks/[qt, threadpool]
|
||||
import ../../../app_service/tasks/marathon/mailserver/worker
|
||||
import ../../core/[main]
|
||||
import ../../core/tasks/[qt, threadpool]
|
||||
import ../../core/tasks/marathon/mailserver/worker
|
||||
|
||||
logScope:
|
||||
topics = "stickers-view"
|
||||
|
@ -6,7 +6,7 @@ import
|
||||
./tasks/threadpool,
|
||||
./signals/signal_controller
|
||||
|
||||
import service/os_notification/service as os_notification_service
|
||||
import ../../app_service/service/os_notification/service as os_notification_service
|
||||
|
||||
export status_lib_status
|
||||
export marathon, task_runner, signal_controller
|
21
src/app/core/tasks/marathon/mailserver/events.nim
Normal file
21
src/app/core/tasks/marathon/mailserver/events.nim
Normal file
@ -0,0 +1,21 @@
|
||||
import # vendor libs
|
||||
NimQml, json_serialization
|
||||
|
||||
import # status-desktop libs
|
||||
eventemitter
|
||||
|
||||
type
|
||||
MailserverEvents* = ref object
|
||||
vptr: ByteAddress
|
||||
MailserverArgs* = ref object of Args
|
||||
peer*: string
|
||||
|
||||
const EVENTS_SLOT = "receiveEvent"
|
||||
|
||||
proc newMailserverEvents*(vptr: ByteAddress): MailserverEvents =
|
||||
new(result)
|
||||
result.vptr = vptr
|
||||
|
||||
proc emit*(self: MailserverEvents, event: string, arg: MailserverArgs) =
|
||||
let payload: tuple[event: string, arg: MailserverArgs] = (event, arg)
|
||||
signal_handler(cast[pointer](self.vptr), Json.encode(payload), EVENTS_SLOT)
|
@ -9,8 +9,8 @@ import ./io_interface
|
||||
|
||||
# import status/types/[identity_image, profile]
|
||||
|
||||
import ../../../../../app_service/[main]
|
||||
import ../../../../../app_service/tasks/[qt, threadpool]
|
||||
import ../../../../core/[main]
|
||||
import ../../../../core/tasks/[qt, threadpool]
|
||||
|
||||
QtObject:
|
||||
type
|
||||
|
@ -12,8 +12,8 @@ export controller_interface
|
||||
|
||||
import status/types/transaction
|
||||
|
||||
import ../../../../../app_service/[main]
|
||||
import ../../../../../app_service/tasks/[qt, threadpool]
|
||||
import ../../../../core/[main]
|
||||
import ../../../../core/tasks/[qt, threadpool]
|
||||
|
||||
type
|
||||
Controller*[T: controller_interface.DelegateInterface] = ref object of controller_interface.AccessInterface
|
||||
|
@ -1,6 +1,6 @@
|
||||
import NimQml, chronicles
|
||||
import status/[signals, status, node, network, settings]
|
||||
import ../../app_service/[main]
|
||||
import ../core/[main]
|
||||
import eventemitter
|
||||
import view
|
||||
|
||||
|
@ -1,9 +1,9 @@
|
||||
import NimQml, chronicles, strutils, json
|
||||
import status/[node, settings, accounts]
|
||||
import status/types/[setting]
|
||||
import ../../app_service/[main]
|
||||
import ../core/[main]
|
||||
import status/signals/[stats]
|
||||
import ../../app_service/tasks/[qt, threadpool]
|
||||
import ../core/tasks/[qt, threadpool]
|
||||
|
||||
logScope:
|
||||
topics = "node-view"
|
||||
|
@ -7,7 +7,8 @@ import status/devices as status_devices
|
||||
import status/chat/chat
|
||||
import status/wallet
|
||||
import status/types/[account, transaction, setting, profile, mailserver]
|
||||
import ../../app_service/[main]
|
||||
import ../core/[main]
|
||||
import ../core/tasks/marathon/mailserver/events
|
||||
import eventemitter
|
||||
import view
|
||||
import views/[ens_manager, devices, network, mailservers, muted_chats]
|
||||
@ -94,10 +95,9 @@ proc init*(self: ProfileController, account: Account) =
|
||||
var evArgs = ChatUpdateArgs(e)
|
||||
self.view.mutedChats.updateChats(evArgs.chats)
|
||||
|
||||
self.status.events.on(SignalType.MailserverChanged.event) do(e: Args):
|
||||
let m = MailserverChangedSignal(e)
|
||||
info "active mailserver changed", node=m.address, topics="mailserver-interaction"
|
||||
self.view.mailservers.setActiveMailserver(m.address)
|
||||
self.status.events.on("mailserver:changed") do(e: Args):
|
||||
let mailserverArg = MailserverArgs(e)
|
||||
self.view.mailservers.activeMailserverChanged(mailserverArg.peer)
|
||||
|
||||
self.status.events.on(SignalType.HistoryRequestStarted.event) do(e: Args):
|
||||
let h = HistoryRequestStartedSignal(e)
|
||||
|
@ -15,7 +15,7 @@ import status/notifications/[os_notifications]
|
||||
|
||||
import ../chat/views/channels_list
|
||||
import ../../constants
|
||||
import ../../app_service/[main]
|
||||
import ../core/[main]
|
||||
import ../utils/image_utils
|
||||
import ../../constants
|
||||
|
||||
|
241
src/app/profile/views/contacts.nim
Normal file
241
src/app/profile/views/contacts.nim
Normal file
@ -0,0 +1,241 @@
|
||||
import NimQml, chronicles, sequtils, sugar, strutils, json
|
||||
|
||||
import status/utils as status_utils
|
||||
import status/status
|
||||
import status/chat/chat
|
||||
import status/types/profile
|
||||
import status/ens as status_ens
|
||||
|
||||
import contact_list
|
||||
|
||||
import ../../core/[main]
|
||||
import ../../core/tasks/[qt, threadpool]
|
||||
|
||||
logScope:
|
||||
topics = "contacts-view"
|
||||
|
||||
type
|
||||
LookupContactTaskArg = ref object of QObjectTaskArg
|
||||
value: string
|
||||
|
||||
const lookupContactTask: Task = proc(argEncoded: string) {.gcsafe, nimcall.} =
|
||||
let arg = decode[LookupContactTaskArg](argEncoded)
|
||||
var id = arg.value
|
||||
if not id.startsWith("0x"):
|
||||
id = status_ens.pubkey(id)
|
||||
arg.finish(id)
|
||||
|
||||
proc lookupContact[T](self: T, slot: string, value: string) =
|
||||
let arg = LookupContactTaskArg(
|
||||
tptr: cast[ByteAddress](lookupContactTask),
|
||||
vptr: cast[ByteAddress](self.vptr),
|
||||
slot: slot,
|
||||
value: value
|
||||
)
|
||||
self.appService.threadpool.start(arg)
|
||||
|
||||
QtObject:
|
||||
type ContactsView* = ref object of QObject
|
||||
status: Status
|
||||
appService: AppService
|
||||
contactList*: ContactList
|
||||
contactRequests*: ContactList
|
||||
addedContacts*: ContactList
|
||||
blockedContacts*: ContactList
|
||||
contactToAdd*: Profile
|
||||
accountKeyUID*: string
|
||||
|
||||
proc setup(self: ContactsView) =
|
||||
self.QObject.setup
|
||||
|
||||
proc delete*(self: ContactsView) =
|
||||
self.contactList.delete
|
||||
self.addedContacts.delete
|
||||
self.contactRequests.delete
|
||||
self.blockedContacts.delete
|
||||
self.QObject.delete
|
||||
|
||||
proc newContactsView*(status: Status, appService: AppService): ContactsView =
|
||||
new(result, delete)
|
||||
result.status = status
|
||||
result.appService = appService
|
||||
result.contactList = newContactList()
|
||||
result.contactRequests = newContactList()
|
||||
result.addedContacts = newContactList()
|
||||
result.blockedContacts = newContactList()
|
||||
result.contactToAdd = Profile(
|
||||
username: "",
|
||||
alias: "",
|
||||
ensName: ""
|
||||
)
|
||||
result.setup
|
||||
|
||||
proc contactListChanged*(self: ContactsView) {.signal.}
|
||||
proc contactRequestAdded*(self: ContactsView, name: string, address: string) {.signal.}
|
||||
|
||||
proc updateContactList*(self: ContactsView, contacts: seq[Profile]) =
|
||||
for contact in contacts:
|
||||
var requestAlreadyAdded = false
|
||||
for existingContact in self.contactList.contacts:
|
||||
if existingContact.address == contact.address and existingContact.requestReceived():
|
||||
requestAlreadyAdded = true
|
||||
break
|
||||
|
||||
self.contactList.updateContact(contact)
|
||||
if contact.added:
|
||||
self.addedContacts.updateContact(contact)
|
||||
|
||||
if contact.isBlocked():
|
||||
self.blockedContacts.updateContact(contact)
|
||||
|
||||
if contact.requestReceived() and not contact.added and not contact.blocked:
|
||||
self.contactRequests.updateContact(contact)
|
||||
|
||||
if not requestAlreadyAdded and contact.requestReceived():
|
||||
self.contactRequestAdded(status_ens.userNameOrAlias(contact), contact.address)
|
||||
|
||||
self.contactListChanged()
|
||||
|
||||
proc getContactList(self: ContactsView): QVariant {.slot.} =
|
||||
return newQVariant(self.contactList)
|
||||
|
||||
proc setContactList*(self: ContactsView, contactList: seq[Profile]) =
|
||||
self.contactList.setNewData(contactList)
|
||||
self.addedContacts.setNewData(contactList.filter(c => c.added))
|
||||
self.blockedContacts.setNewData(contactList.filter(c => c.blocked))
|
||||
self.contactRequests.setNewData(contactList.filter(c => c.hasAddedUs and not c.added and not c.blocked))
|
||||
|
||||
self.contactListChanged()
|
||||
|
||||
QtProperty[QVariant] list:
|
||||
read = getContactList
|
||||
write = setContactList
|
||||
notify = contactListChanged
|
||||
|
||||
proc getAddedContacts(self: ContactsView): QVariant {.slot.} =
|
||||
return newQVariant(self.addedContacts)
|
||||
|
||||
QtProperty[QVariant] addedContacts:
|
||||
read = getAddedContacts
|
||||
notify = contactListChanged
|
||||
|
||||
proc getBlockedContacts(self: ContactsView): QVariant {.slot.} =
|
||||
return newQVariant(self.blockedContacts)
|
||||
|
||||
QtProperty[QVariant] blockedContacts:
|
||||
read = getBlockedContacts
|
||||
notify = contactListChanged
|
||||
|
||||
proc isContactBlocked*(self: ContactsView, pubkey: string): bool {.slot.} =
|
||||
for contact in self.blockedContacts.contacts:
|
||||
if contact.id == pubkey:
|
||||
return true
|
||||
return false
|
||||
|
||||
proc getContactRequests(self: ContactsView): QVariant {.slot.} =
|
||||
return newQVariant(self.contactRequests)
|
||||
|
||||
QtProperty[QVariant] contactRequests:
|
||||
read = getContactRequests
|
||||
notify = contactListChanged
|
||||
|
||||
proc contactToAddChanged*(self: ContactsView) {.signal.}
|
||||
|
||||
proc getContactToAddUsername(self: ContactsView): QVariant {.slot.} =
|
||||
var username = self.contactToAdd.alias;
|
||||
|
||||
if self.contactToAdd.ensVerified and self.contactToAdd.ensName != "":
|
||||
username = self.contactToAdd.ensName
|
||||
|
||||
return newQVariant(username)
|
||||
|
||||
QtProperty[QVariant] contactToAddUsername:
|
||||
read = getContactToAddUsername
|
||||
notify = contactToAddChanged
|
||||
|
||||
proc getContactToAddPubKey(self: ContactsView): QVariant {.slot.} =
|
||||
return newQVariant(self.contactToAdd.address)
|
||||
|
||||
QtProperty[QVariant] contactToAddPubKey:
|
||||
read = getContactToAddPubKey
|
||||
notify = contactToAddChanged
|
||||
|
||||
proc isAdded*(self: ContactsView, pubkey: string): bool {.slot.} =
|
||||
for contact in self.addedContacts.contacts:
|
||||
if contact.id == pubkey:
|
||||
return true
|
||||
return false
|
||||
|
||||
proc contactRequestReceived*(self: ContactsView, pubkey: string): bool {.slot.} =
|
||||
for contact in self.contactRequests.contacts:
|
||||
if contact.id == pubkey:
|
||||
return true
|
||||
return false
|
||||
|
||||
proc lookupContact*(self: ContactsView, value: string) {.slot.} =
|
||||
if value == "":
|
||||
return
|
||||
|
||||
self.lookupContact("ensResolved", value)
|
||||
|
||||
proc ensWasResolved*(self: ContactsView, resolvedPubKey: string) {.signal.}
|
||||
|
||||
proc ensResolved(self: ContactsView, id: string) {.slot.} =
|
||||
self.ensWasResolved(id)
|
||||
if id == "":
|
||||
self.contactToAddChanged()
|
||||
return
|
||||
|
||||
let contact = self.status.contacts.getContactByID(id)
|
||||
|
||||
if contact != nil:
|
||||
self.contactToAdd = contact
|
||||
else:
|
||||
self.contactToAdd = Profile(
|
||||
address: id,
|
||||
username: "",
|
||||
alias: generateAlias(id),
|
||||
ensName: "",
|
||||
ensVerified: false
|
||||
)
|
||||
self.contactToAddChanged()
|
||||
|
||||
proc addContact*(self: ContactsView, publicKey: string) {.slot.} =
|
||||
self.status.contacts.addContact(publicKey, self.accountKeyUID)
|
||||
self.status.chat.join(status_utils.getTimelineChatId(publicKey), ChatType.Profile, "", publicKey)
|
||||
|
||||
proc rejectContactRequest*(self: ContactsView, publicKey: string) {.slot.} =
|
||||
self.status.contacts.rejectContactRequest(publicKey)
|
||||
|
||||
proc rejectContactRequests*(self: ContactsView, publicKeysJSON: string) {.slot.} =
|
||||
let publicKeys = publicKeysJSON.parseJson
|
||||
for pubkey in publicKeys:
|
||||
self.rejectContactRequest(pubkey.getStr)
|
||||
|
||||
proc acceptContactRequests*(self: ContactsView, publicKeysJSON: string) {.slot.} =
|
||||
let publicKeys = publicKeysJSON.parseJson
|
||||
for pubkey in publicKeys:
|
||||
self.addContact(pubkey.getStr)
|
||||
|
||||
proc changeContactNickname*(self: ContactsView, publicKey: string, nickname: string) {.slot.} =
|
||||
var nicknameToSet = nickname
|
||||
if (nicknameToSet == ""):
|
||||
nicknameToSet = DELETE_CONTACT
|
||||
self.status.contacts.setNickName(publicKey, nicknameToSet, self.accountKeyUID)
|
||||
|
||||
proc unblockContact*(self: ContactsView, publicKey: string) {.slot.} =
|
||||
self.contactListChanged()
|
||||
self.status.contacts.unblockContact(publicKey)
|
||||
|
||||
proc contactBlocked*(self: ContactsView, publicKey: string) {.signal.}
|
||||
|
||||
proc blockContact*(self: ContactsView, publicKey: string) {.slot.} =
|
||||
self.contactListChanged()
|
||||
self.contactBlocked(publicKey)
|
||||
self.status.contacts.blockContact(publicKey)
|
||||
|
||||
proc removeContact*(self: ContactsView, publicKey: string) {.slot.} =
|
||||
self.status.contacts.removeContact(publicKey)
|
||||
let channelId = status_utils.getTimelineChatId(publicKey)
|
||||
if self.status.chat.hasChannel(channelId):
|
||||
self.status.chat.leave(channelId)
|
@ -8,8 +8,8 @@ import status/utils as status_utils
|
||||
import status/[status, settings, wallet]
|
||||
import status/wallet
|
||||
import status/types/[setting, transaction, rpc_response]
|
||||
import ../../../app_service/[main]
|
||||
import ../../../app_service/tasks/[qt, threadpool]
|
||||
import ../../core/[main]
|
||||
import ../../core/tasks/[qt, threadpool]
|
||||
import sets
|
||||
import web3/ethtypes
|
||||
import chronicles
|
||||
|
@ -3,9 +3,9 @@ import status/[status, settings]
|
||||
import status/types/mailserver
|
||||
|
||||
import ./mailservers_list
|
||||
import ../../../app_service/[main]
|
||||
import ../../../app_service/tasks/[qt, threadpool]
|
||||
import ../../../app_service/tasks/marathon/mailserver/worker
|
||||
import ../../core/[main]
|
||||
import ../../core/tasks/[qt, threadpool]
|
||||
import ../../core/tasks/marathon/mailserver/worker
|
||||
|
||||
logScope:
|
||||
topics = "mailservers-view"
|
||||
|
@ -1,6 +1,6 @@
|
||||
import NimQml, chronicles
|
||||
import status/[status, node, network]
|
||||
import ../../app_service/[main]
|
||||
import ../core/[main]
|
||||
import view
|
||||
import eventemitter
|
||||
|
||||
|
@ -6,8 +6,8 @@ import status/tokens as status_tokens
|
||||
import status/utils as status_utils
|
||||
import status/ens as status_ens
|
||||
import status/types/[network_type]
|
||||
import ../../app_service/[main]
|
||||
import ../../app_service/tasks/[qt, threadpool]
|
||||
import ../core/[main]
|
||||
import ../core/tasks/[qt, threadpool]
|
||||
import ../utils/image_utils
|
||||
import web3/[ethtypes, conversions]
|
||||
import stew/byteutils
|
||||
|
@ -7,7 +7,7 @@ import status/[status, wallet, settings]
|
||||
import status/wallet/account as WalletTypes
|
||||
import status/types/[transaction, setting]
|
||||
import status/signals
|
||||
import ../../../app_service/[main]
|
||||
import ../../core/[main]
|
||||
import eventemitter
|
||||
|
||||
logScope:
|
||||
|
@ -4,7 +4,7 @@ import NimQml, chronicles, stint
|
||||
import
|
||||
status/[status, wallet],
|
||||
views/[accounts, collectibles, transactions, tokens, gas, dapp_browser, history, balance, utils, asset_list, account_list]
|
||||
import ../../../app_service/[main]
|
||||
import ../../core/[main]
|
||||
|
||||
QtObject:
|
||||
type
|
||||
|
@ -4,8 +4,8 @@ import NimQml, json, sequtils, chronicles, strutils, strformat, json
|
||||
import
|
||||
status/[status, wallet, tokens],
|
||||
status/tokens as status_tokens
|
||||
import ../../../../app_service/[main]
|
||||
import ../../../../app_service/tasks/[qt, threadpool]
|
||||
import ../../../core/[main]
|
||||
import ../../../core/tasks/[qt, threadpool]
|
||||
|
||||
import account_item, accounts, transactions, history
|
||||
|
||||
|
@ -4,8 +4,8 @@ import NimQml, json, sequtils, chronicles, strutils, json
|
||||
import
|
||||
status/[status, wallet],
|
||||
status/wallet/collectibles as status_collectibles
|
||||
import ../../../../app_service/[main]
|
||||
import ../../../../app_service/tasks/[qt, threadpool]
|
||||
import ../../../core/[main]
|
||||
import ../../../core/tasks/[qt, threadpool]
|
||||
|
||||
import collectibles_list, accounts, account_list, account_item
|
||||
|
||||
|
@ -6,8 +6,8 @@ import
|
||||
status/types/[gas_prediction],
|
||||
# TODO: Remove direct access to backend
|
||||
status/statusgo_backend/eth as eth
|
||||
import ../../../../app_service/[main]
|
||||
import ../../../../app_service/tasks/[qt, threadpool]
|
||||
import ../../../core/[main]
|
||||
import ../../../core/tasks/[qt, threadpool]
|
||||
|
||||
import account_item
|
||||
|
||||
|
@ -6,8 +6,8 @@ import
|
||||
status/[status, wallet, utils],
|
||||
status/wallet as status_wallet,
|
||||
status/types/[transaction]
|
||||
import ../../../../app_service/[main]
|
||||
import ../../../../app_service/tasks/[qt, threadpool]
|
||||
import ../../../core/[main]
|
||||
import ../../../core/tasks/[qt, threadpool]
|
||||
import account_list, account_item, transaction_list, accounts, transactions
|
||||
|
||||
logScope:
|
||||
|
@ -8,9 +8,9 @@ import # status-desktop libs
|
||||
status/[utils, tokens, settings],
|
||||
status/types/network_type,
|
||||
status/status
|
||||
import ../../../../app_service/[main]
|
||||
import ../../../../app_service/tasks/[qt, threadpool]
|
||||
import ../../../../app_service/tasks/marathon/mailserver/worker
|
||||
import ../../../core/[main]
|
||||
import ../../../core/tasks/[qt, threadpool]
|
||||
import ../../../core/tasks/marathon/mailserver/worker
|
||||
from web3/conversions import `$`
|
||||
|
||||
type
|
||||
|
@ -2,7 +2,7 @@ import strutils, sequtils, json, chronicles, web3/[ethtypes, conversions], stint
|
||||
import NimQml, json, sequtils, chronicles, strutils, json
|
||||
|
||||
import status/[status, wallet, tokens, utils]
|
||||
import ../../../../app_service/[main]
|
||||
import ../../../core/[main]
|
||||
import account_item, accounts, asset_list, token_list
|
||||
|
||||
logScope:
|
||||
|
@ -5,9 +5,9 @@ import
|
||||
status/[status, settings, wallet, tokens, utils],
|
||||
status/wallet as status_wallet
|
||||
|
||||
import ../../../../app_service/[main]
|
||||
import ../../../../app_service/tasks/[qt, threadpool]
|
||||
import ../../../../app_service/tasks/marathon/mailserver/worker
|
||||
import ../../../core/[main]
|
||||
import ../../../core/tasks/[qt, threadpool]
|
||||
import ../../../core/tasks/marathon/mailserver/worker
|
||||
|
||||
import account_list, account_item, transaction_list, accounts
|
||||
|
||||
|
@ -6,7 +6,7 @@ import views/[account_list, account_item, networks]
|
||||
import status/[status, wallet2, settings]
|
||||
import status/wallet2/account as WalletTypes
|
||||
import status/types/[transaction, setting]
|
||||
import ../../../app_service/[main]
|
||||
import ../../core/[main]
|
||||
import status/signals
|
||||
import eventemitter
|
||||
|
||||
|
@ -5,7 +5,7 @@ import
|
||||
chronicles, nimqml, status/[status, wallet2], stint
|
||||
|
||||
import
|
||||
../../../app_service/[main],
|
||||
../../core/[main],
|
||||
./views/[accounts, account_list, collectibles, networks, saved_addresses, settings],
|
||||
./views/buy_sell_crypto/[service_controller]
|
||||
|
||||
|
@ -2,8 +2,8 @@ import NimQml, json, strutils, chronicles
|
||||
|
||||
import service_model, service_item
|
||||
|
||||
import ../../../../../app_service/[main]
|
||||
import ../../../../../app_service/tasks/[qt, threadpool]
|
||||
import ../../../../core/[main]
|
||||
import ../../../../core/tasks/[qt, threadpool]
|
||||
import status/[status, wallet2]
|
||||
import status/statusgo_backend/wallet as status_wallet
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
import NimQml, Tables, json, chronicles
|
||||
|
||||
import status/[status, wallet2]
|
||||
import ../../../../app_service/[main]
|
||||
import ../../../../app_service/tasks/[qt, threadpool]
|
||||
import ../../../core/[main]
|
||||
import ../../../core/tasks/[qt, threadpool]
|
||||
|
||||
import collection_list, asset_list
|
||||
|
||||
|
@ -7,7 +7,7 @@ import # vendor libs
|
||||
stew/results
|
||||
|
||||
import # status-desktop modules
|
||||
../../../../app_service/main, ../../../../app_service/tasks/[qt, threadpool],
|
||||
../../../core/main, ../../../core/tasks/[qt, threadpool],
|
||||
./saved_addresses_list
|
||||
|
||||
logScope:
|
||||
|
@ -1,7 +1,7 @@
|
||||
import status/ens as status_ens
|
||||
|
||||
include ../../common/json_utils
|
||||
include ../../tasks/common
|
||||
include ../../../app/core/tasks/common
|
||||
|
||||
#################################################
|
||||
# Async lookup ENS contact
|
||||
|
@ -1,7 +1,7 @@
|
||||
import NimQml, Tables, json, sequtils, strformat, chronicles, strutils
|
||||
|
||||
import eventemitter
|
||||
import ../../tasks/[qt, threadpool]
|
||||
import ../../../app/core/tasks/[qt, threadpool]
|
||||
|
||||
import ./dto/contacts as contacts_dto
|
||||
import status/statusgo_backend_new/contacts as status_contacts
|
||||
|
@ -1,5 +1,5 @@
|
||||
include ../../common/json_utils
|
||||
include ../../tasks/common
|
||||
include ../../../app/core/tasks/common
|
||||
|
||||
#################################################
|
||||
# Async load messages
|
||||
|
@ -1,7 +1,7 @@
|
||||
import NimQml, tables, json, sequtils, chronicles
|
||||
|
||||
import eventemitter
|
||||
import ../../tasks/[qt, threadpool]
|
||||
import ../../../app/core/tasks/[qt, threadpool]
|
||||
|
||||
import status/statusgo_backend_new/messages as status_go
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
include ../../common/json_utils
|
||||
include ../../tasks/common
|
||||
include ../../../app/core/tasks/common
|
||||
|
||||
#################################################
|
||||
# Async load transactions
|
||||
|
@ -2,8 +2,9 @@ import NimQml, chronicles, sequtils, sugar, stint, json
|
||||
import status/statusgo_backend_new/transactions as transactions
|
||||
|
||||
import eventemitter
|
||||
import ../../tasks/[qt, threadpool]
|
||||
|
||||
import ../../../app/core/[main]
|
||||
import ../../../app/core/tasks/[qt, threadpool]
|
||||
import ../wallet_account/service as wallet_account_service
|
||||
import ./service_interface, ./dto
|
||||
|
||||
@ -12,9 +13,6 @@ export service_interface
|
||||
logScope:
|
||||
topics = "transaction-service"
|
||||
|
||||
import ../../../app_service/[main]
|
||||
import ../../../app_service/tasks/[qt, threadpool]
|
||||
|
||||
include async_tasks
|
||||
|
||||
# Signals which may be emitted by this service:
|
||||
|
@ -10,9 +10,9 @@ import status/types/[account]
|
||||
import status_go
|
||||
import status/status as statuslib
|
||||
import eventemitter
|
||||
import app_service/tasks/marathon/mailserver/controller as mailserver_controller
|
||||
import app_service/tasks/marathon/mailserver/worker as mailserver_worker
|
||||
import app_service/main
|
||||
import app/core/tasks/marathon/mailserver/controller as mailserver_controller
|
||||
import app/core/tasks/marathon/mailserver/worker as mailserver_worker
|
||||
import app/core/main
|
||||
import constants
|
||||
|
||||
import app/global/global_singleton
|
||||
|
Loading…
x
Reference in New Issue
Block a user