diff --git a/apps/ios/SimpleXChat/APITypes.swift b/apps/ios/SimpleXChat/APITypes.swift index 7b0a0a6646..f5458dda02 100644 --- a/apps/ios/SimpleXChat/APITypes.swift +++ b/apps/ios/SimpleXChat/APITypes.swift @@ -2224,3 +2224,80 @@ public enum MsgType: String, Codable { case message case quota } + +public struct AgentServersSummary: Decodable { + var usersServersSummary: Dictionary + // var totalServersSummary: ServersSummary +} + +public struct ServersSummary: Decodable { + var smpServersSummary: SMPServerSummary + var xftpServersSummary: XFTPServerSummary +} + +public struct SMPServerSummary: Decodable { + var smpServer: String + var usedForNewConnections: Bool + var subscriptionsSummary: SMPServerSubsSummary? + var workersSummary: SMPServerWorkersSummary + var commandsStats: [CommandStat] + var rcvMsgCounts: [SMPServerRcvMsgCounts] + var deliveryInfo: SMPServerDeliveryInfo? +} + +public struct XFTPServerSummary: Decodable { + var xftpServer: String + var usedForNewFiles: Bool + var workersSummary: SMPServerWorkersSummary + var commandsStats: [CommandStat] +} + +public struct SMPServerSubsSummary: Decodable { + var activeSubscriptions: [SMPServerSubInfo] + var pendingSubscriptions: [SMPServerSubInfo] + var removedSubscriptions: [SMPServerSubInfo] +} + +public struct SMPServerSubInfo: Decodable { + var rcvId: String + var subError: String? +} + +public struct SMPServerWorkersSummary: Decodable { + var smpDeliveryWorkers_: Dictionary + var asyncCmdWorker_: WorkersDetails + var smpSubWorkers_: [String] +} + +public struct SMPServerRcvMsgCounts: Decodable { + var connId: String + var total: Int + var duplicate: Int +} + +public struct SMPServerDeliveryInfo: Decodable { + var host: String + var viaOnionHost: Bool + var viaSocksProxy: Bool + var smpProxy: String? +} + +public struct XFTPServerWorkersSummary: Decodable { + var rcvWorker: WorkersDetails? + var sndWorker: WorkersDetails? + var delWorker: WorkersDetails? +} + +public struct WorkersDetails: Decodable { + var restarts: Int + var hasWork: Bool + var hasAction: Bool +} + +public struct CommandStat: Decodable { + var host: String + var clientTs: Date + var cmd: String + var res: String + var count: Int +} diff --git a/apps/ios/SimpleXChat/ChatTypes.swift b/apps/ios/SimpleXChat/ChatTypes.swift index 4c62fe4c8b..7c7233ab26 100644 --- a/apps/ios/SimpleXChat/ChatTypes.swift +++ b/apps/ios/SimpleXChat/ChatTypes.swift @@ -11,6 +11,7 @@ import SwiftUI public struct User: Identifiable, Decodable, UserLike, NamedChat { public var userId: Int64 + public var agentUserId: String var userContactId: Int64 var localDisplayName: ContactName public var profile: LocalProfile @@ -41,6 +42,7 @@ public struct User: Identifiable, Decodable, UserLike, NamedChat { public static let sampleData = User( userId: 1, + agentUserId: "abc", userContactId: 1, localDisplayName: "alice", profile: LocalProfile.sampleData,