mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
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:
@@ -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())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user