core: agent users (#1727)

This commit is contained in:
JRoberts
2023-01-13 13:54:07 +04:00
committed by GitHub
parent 7323bb4333
commit 424328b9d1
17 changed files with 132 additions and 61 deletions

View File

@@ -323,7 +323,8 @@ func setUserSMPServers(smpServers: [ServerCfg]) async throws {
}
func testSMPServer(smpServer: String) async throws -> Result<(), SMPTestFailure> {
let r = await chatSendCmd(.testSMPServer(smpServer: smpServer))
guard let userId = ChatModel.shared.currentUser?.userId else { throw RuntimeError("testSMPServer: no current user") }
let r = await chatSendCmd(.testSMPServer(userId: userId, smpServer: smpServer))
if case let .smpTestResult(testFailure) = r {
if let t = testFailure {
return .failure(t)