Jitsi detection via well-known

This commit is contained in:
Inex Code 2020-06-13 22:38:48 +03:00
parent 8db8972c2f
commit d07c85a76b

View file

@ -19,6 +19,7 @@
class WellKnownInformations { class WellKnownInformations {
MHomeserver mHomeserver; MHomeserver mHomeserver;
MHomeserver mIdentityServer; MHomeserver mIdentityServer;
JitsiHomeserver jitsiHomeserver;
Map<String, dynamic> content; Map<String, dynamic> content;
WellKnownInformations.fromJson(Map<String, dynamic> json) { WellKnownInformations.fromJson(Map<String, dynamic> json) {
@ -29,6 +30,9 @@ class WellKnownInformations {
mIdentityServer = json['m.identity_server'] != null mIdentityServer = json['m.identity_server'] != null
? MHomeserver.fromJson(json['m.identity_server']) ? MHomeserver.fromJson(json['m.identity_server'])
: null; : null;
jitsiHomeserver = json['im.vector.riot.jitsi'] != null
? JitsiHomeserver.fromJson(json['im.vector.riot.jitsi'])
: null;
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -52,3 +56,17 @@ class MHomeserver {
return data; return data;
} }
} }
class JitsiHomeserver {
String baseUrl;
JitsiHomeserver.fromJson(Map<String, dynamic> json) {
baseUrl = json['preferredDomain'];
}
Map<String, dynamic> toJson() {
final data = <String, dynamic>{};
data['preferredDomain'] = baseUrl;
return data;
}
}