Merge pull request #1695 from famedly/krille/use-records-check-homeserver
refactor: Use dart records for checkHomeserver method
This commit is contained in:
commit
db49f1e196
|
|
@ -460,7 +460,12 @@ class Client extends MatrixApi {
|
|||
/// login types. Throws an exception if the server is not compatible with the
|
||||
/// client and sets [homeserver] to [homeserverUrl] if it is. Supports the
|
||||
/// types `Uri` and `String`.
|
||||
Future<HomeserverSummary> checkHomeserver(
|
||||
Future<
|
||||
(
|
||||
DiscoveryInformation?,
|
||||
GetVersionsResponse versions,
|
||||
List<LoginFlow>,
|
||||
)> checkHomeserver(
|
||||
Uri homeserverUrl, {
|
||||
bool checkWellKnown = true,
|
||||
Set<String>? overrideSupportedVersions,
|
||||
|
|
@ -497,11 +502,7 @@ class Client extends MatrixApi {
|
|||
loginTypes.map((f) => f.type ?? '').toSet(), supportedLoginTypes);
|
||||
}
|
||||
|
||||
return HomeserverSummary(
|
||||
discoveryInformation: wellKnown,
|
||||
versions: versions,
|
||||
loginFlows: loginTypes,
|
||||
);
|
||||
return (wellKnown, versions, loginTypes);
|
||||
} catch (_) {
|
||||
homeserver = null;
|
||||
rethrow;
|
||||
|
|
@ -3458,18 +3459,6 @@ class FileTooBigMatrixException extends MatrixException {
|
|||
'File size ${_formatFileSize(actualFileSize)} exceeds allowed maximum of ${_formatFileSize(maxFileSize)}';
|
||||
}
|
||||
|
||||
class HomeserverSummary {
|
||||
final DiscoveryInformation? discoveryInformation;
|
||||
final GetVersionsResponse versions;
|
||||
final List<LoginFlow> loginFlows;
|
||||
|
||||
HomeserverSummary({
|
||||
required this.discoveryInformation,
|
||||
required this.versions,
|
||||
required this.loginFlows,
|
||||
});
|
||||
}
|
||||
|
||||
class ArchivedRoom {
|
||||
final Room room;
|
||||
final Timeline timeline;
|
||||
|
|
|
|||
Loading…
Reference in New Issue