Add HealthChat API and extended profile services (#9)

Expose OpenID tokens and homeserver credentials from the client proxy, and
add fork-only services for the HealthChat member directory backend
(api.healthchat.ch) plus a service that reads MSC4133 extended profile
fields directly from the homeserver. Groundwork for the members tab and
the profile screens.

Claude-Session: https://claude.ai/code/session_013qdTbAWsZj2quQzEkagXaS
This commit is contained in:
2026-09-22 16:56:20 +02:00
parent 07918562dd
commit 00f08ab2dc
19 changed files with 1807 additions and 0 deletions
@@ -838,6 +838,28 @@ class ClientProxy: ClientProxyProtocol {
}
}
func requestOpenIDToken() async -> Result<OpenIDToken, ClientProxyError> {
do {
return try await .success(.init(rustValue: client.requestOpenidToken()))
} catch {
MXLog.error("Failed requesting OpenID token with error: \(error)")
return .failure(.sdkError(error))
}
}
func homeserverCredentials() -> Result<HomeserverCredentials, ClientProxyError> {
do {
let session = try client.session()
guard let homeserverURL = URL(string: session.homeserverUrl) else {
return .failure(.invalidServerName)
}
return .success(.init(homeserverURL: homeserverURL, accessToken: session.accessToken))
} catch {
MXLog.error("Failed retrieving the session's credentials with error: \(error)")
return .failure(.sdkError(error))
}
}
func roomDirectorySearchProxy() -> RoomDirectorySearchProxyProtocol {
RoomDirectorySearchProxy(roomDirectorySearch: client.roomDirectorySearch())
}