getAgentSubsSummary api

This commit is contained in:
spaced4ndy
2024-06-26 13:53:24 +04:00
parent 09b2819fe6
commit 46bc947128
3 changed files with 17 additions and 0 deletions
+7
View File
@@ -1350,6 +1350,13 @@ func resetAgentServersStats() async throws {
try await sendCommandOkResp(.resetAgentServersStats)
}
func getAgentSubsSummary() throws -> SMPServerSubs {
let userId = try currentUserId("getAgentSubsSummary")
let r = chatSendCmdSync(.getAgentSubsSummary(userId: userId))
if case let .agentSubsSummary(_, subsSummary) = r { return subsSummary }
throw r
}
private func currentUserId(_ funcName: String) throws -> Int64 {
if let userId = ChatModel.shared.currentUser?.userId {
return userId