ios: asychronous subscription updates (#4707)

* ios: asychronous subscription updates

* cleanup
This commit is contained in:
Arturs Krumins
2024-08-17 15:26:56 +03:00
committed by GitHub
parent 3740805125
commit 3a0921c093
2 changed files with 23 additions and 20 deletions
+2 -2
View File
@@ -1420,9 +1420,9 @@ func apiGetVersion() throws -> CoreVersionInfo {
throw r
}
func getAgentSubsTotal() throws -> (SMPServerSubs, Bool) {
func getAgentSubsTotal() async throws -> (SMPServerSubs, Bool) {
let userId = try currentUserId("getAgentSubsTotal")
let r = chatSendCmdSync(.getAgentSubsTotal(userId: userId), log: false)
let r = await chatSendCmd(.getAgentSubsTotal(userId: userId))
if case let .agentSubsTotal(_, subsTotal, hasSession) = r { return (subsTotal, hasSession) }
logger.error("getAgentSubsTotal error: \(String(describing: r))")
throw r