mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-05-11 19:45:00 +00:00
types
This commit is contained in:
@@ -2224,3 +2224,80 @@ public enum MsgType: String, Codable {
|
||||
case message
|
||||
case quota
|
||||
}
|
||||
|
||||
public struct AgentServersSummary: Decodable {
|
||||
var usersServersSummary: Dictionary<Int64, ServersSummary>
|
||||
// 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<String, WorkersDetails>
|
||||
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
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user