diff options
Diffstat (limited to 'Hotline/Models')
| -rw-r--r-- | Hotline/Models/Hotline.swift | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Hotline/Models/Hotline.swift b/Hotline/Models/Hotline.swift index 93f1762..70073c2 100644 --- a/Hotline/Models/Hotline.swift +++ b/Hotline/Models/Hotline.swift @@ -125,6 +125,7 @@ class Hotline: Equatable, HotlineClientDelegate, HotlineFileClientDelegate { var access: HotlineUserAccessOptions? var agreed: Bool = false var users: [User] = [] + var accounts: [HotlineAccount] = [] var chat: [ChatMessage] = [] var messageBoard: [String] = [] var messageBoardLoaded: Bool = false @@ -133,6 +134,7 @@ class Hotline: Equatable, HotlineClientDelegate, HotlineFileClientDelegate { var news: [NewsInfo] = [] private var newsLookup: [String:NewsInfo] = [:] var newsLoaded: Bool = false + var accountsLoaded: Bool = false var instantMessages: [UInt16:[InstantMessage]] = [:] var transfers: [TransferInfo] = [] var downloads: [HotlineFileClient] = [] @@ -308,6 +310,14 @@ class Hotline: Equatable, HotlineClientDelegate, HotlineFileClientDelegate { } + @MainActor func getAccounts() async -> [HotlineAccount] { + return await withCheckedContinuation { [weak self] continuation in + self?.client.sendGetAccounts() { articles in + continuation.resume(returning: articles) + } + } + } + @MainActor func getNewsList(at path: [String] = []) async { return await withCheckedContinuation { [weak self] continuation in let parentNewsGroup = self?.findNews(in: self?.news ?? [], at: path) |