mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2024-12-17 17:20:21 +01:00
getAgentSubsSummary api
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user