add mailserver layer to status lib; remove references to libstatus mailservers
This commit is contained in:
parent
ceb7f85e4e
commit
be696ad20f
|
@ -6,7 +6,6 @@ import
|
||||||
|
|
||||||
import # status-desktop libs
|
import # status-desktop libs
|
||||||
../../status/chat/chat as status_chat, ./views/communities,
|
../../status/chat/chat as status_chat, ./views/communities,
|
||||||
../../status/libstatus/mailservers as status_mailservers,
|
|
||||||
../../status/tasks/marathon,
|
../../status/tasks/marathon,
|
||||||
../../status/tasks/marathon/mailserver/worker,
|
../../status/tasks/marathon/mailserver/worker,
|
||||||
../../status/libstatus/mailservers # TODO: needed for MailserverTopic type, remove?
|
../../status/libstatus/mailservers # TODO: needed for MailserverTopic type, remove?
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
import NimQml, Tables, json, sequtils, chronicles, times, re, sugar, strutils, os, strformat, algorithm
|
import NimQml, Tables, json, sequtils, chronicles, times, re, sugar, strutils, os, strformat, algorithm
|
||||||
import ../../status/status
|
import ../../status/[status, mailservers]
|
||||||
import ../../status/libstatus/chat as libstatus_chat
|
import ../../status/libstatus/chat as libstatus_chat
|
||||||
import ../../status/libstatus/accounts/constants
|
import ../../status/libstatus/accounts/constants
|
||||||
import ../../status/libstatus/mailservers as status_mailservers
|
|
||||||
import ../../status/libstatus/chat as core_chat
|
import ../../status/libstatus/chat as core_chat
|
||||||
import ../../status/libstatus/utils as status_utils
|
import ../../status/libstatus/utils as status_utils
|
||||||
import ../../status/accounts as status_accounts
|
import ../../status/accounts as status_accounts
|
||||||
|
@ -749,7 +748,7 @@ QtObject:
|
||||||
proc fillGaps*(self: ChatsView, messageId: string) {.slot.} =
|
proc fillGaps*(self: ChatsView, messageId: string) {.slot.} =
|
||||||
self.loadingMessages = true
|
self.loadingMessages = true
|
||||||
self.loadingMessagesChanged(true)
|
self.loadingMessagesChanged(true)
|
||||||
discard status_mailservers.fillGaps(self.activeChannel.id, @[messageId])
|
discard self.status.mailservers.fillGaps(self.activeChannel.id, @[messageId])
|
||||||
|
|
||||||
proc leaveActiveChat*(self: ChatsView) {.slot.} =
|
proc leaveActiveChat*(self: ChatsView) {.slot.} =
|
||||||
self.status.chat.leave(self.activeChannel.id)
|
self.status.chat.leave(self.activeChannel.id)
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import NimQml, json, strutils, sugar, sequtils, tables
|
import NimQml, json, strutils, sugar, sequtils, tables
|
||||||
import json_serialization
|
import json_serialization
|
||||||
import ../../status/libstatus/mailservers as status_mailservers
|
|
||||||
import ../../status/signals/types
|
import ../../status/signals/types
|
||||||
import ../../status/libstatus/accounts/constants
|
import ../../status/libstatus/accounts/constants
|
||||||
import ../../status/libstatus/types as status_types
|
import ../../status/libstatus/types as status_types
|
||||||
|
|
|
@ -0,0 +1,22 @@
|
||||||
|
import json, json_serialization
|
||||||
|
|
||||||
|
import
|
||||||
|
sugar, sequtils, strutils, atomics
|
||||||
|
|
||||||
|
import libstatus/mailservers as status_mailservers
|
||||||
|
import ../eventemitter
|
||||||
|
import signals/types
|
||||||
|
|
||||||
|
#TODO: temporary?
|
||||||
|
import libstatus/types as LibStatusTypes
|
||||||
|
|
||||||
|
type
|
||||||
|
MailserversModel* = ref object
|
||||||
|
events*: EventEmitter
|
||||||
|
|
||||||
|
proc newMailserversModel*(events: EventEmitter): MailserversModel =
|
||||||
|
result = MailserversModel()
|
||||||
|
result.events = events
|
||||||
|
|
||||||
|
proc fillGaps*(self: MailserversModel, chatId: string, messageIds: seq[string]): string =
|
||||||
|
result = status_mailservers.fillGaps(chatId, messageIds)
|
|
@ -2,7 +2,7 @@ import libstatus/accounts as libstatus_accounts
|
||||||
import libstatus/core as libstatus_core
|
import libstatus/core as libstatus_core
|
||||||
import libstatus/settings as libstatus_settings
|
import libstatus/settings as libstatus_settings
|
||||||
import libstatus/types as libstatus_types
|
import libstatus/types as libstatus_types
|
||||||
import chat, accounts, wallet, node, network, messages, contacts, profile, stickers, permissions, fleet, settings
|
import chat, accounts, wallet, node, network, messages, contacts, profile, stickers, permissions, fleet, settings, mailservers
|
||||||
import ../eventemitter
|
import ../eventemitter
|
||||||
import ./tasks/task_runner_impl
|
import ./tasks/task_runner_impl
|
||||||
|
|
||||||
|
@ -23,6 +23,7 @@ type Status* = ref object
|
||||||
permissions*: PermissionsModel
|
permissions*: PermissionsModel
|
||||||
tasks*: TaskRunner
|
tasks*: TaskRunner
|
||||||
settings*: SettingsModel
|
settings*: SettingsModel
|
||||||
|
mailservers*: MailserversModel
|
||||||
|
|
||||||
proc newStatusInstance*(fleetConfig: string): Status =
|
proc newStatusInstance*(fleetConfig: string): Status =
|
||||||
result = Status()
|
result = Status()
|
||||||
|
@ -41,6 +42,7 @@ proc newStatusInstance*(fleetConfig: string): Status =
|
||||||
result.stickers = stickers.newStickersModel(result.events)
|
result.stickers = stickers.newStickersModel(result.events)
|
||||||
result.permissions = permissions.newPermissionsModel(result.events)
|
result.permissions = permissions.newPermissionsModel(result.events)
|
||||||
result.settings = settings.newSettingsModel(result.events)
|
result.settings = settings.newSettingsModel(result.events)
|
||||||
|
result.mailservers = mailservers.newMailserversModel(result.events)
|
||||||
|
|
||||||
proc initNode*(self: Status) =
|
proc initNode*(self: Status) =
|
||||||
self.tasks.init()
|
self.tasks.init()
|
||||||
|
|
Loading…
Reference in New Issue