From d07c85a76b352857dd580f736f622ff4fcc0abd1 Mon Sep 17 00:00:00 2001 From: Inex Code Date: Sat, 13 Jun 2020 22:38:48 +0300 Subject: [PATCH] Jitsi detection via well-known --- .../model/well_known_informations.dart | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/lib/matrix_api/model/well_known_informations.dart b/lib/matrix_api/model/well_known_informations.dart index feba960..76dbdb2 100644 --- a/lib/matrix_api/model/well_known_informations.dart +++ b/lib/matrix_api/model/well_known_informations.dart @@ -19,6 +19,7 @@ class WellKnownInformations { MHomeserver mHomeserver; MHomeserver mIdentityServer; + JitsiHomeserver jitsiHomeserver; Map content; WellKnownInformations.fromJson(Map json) { @@ -29,6 +30,9 @@ class WellKnownInformations { mIdentityServer = json['m.identity_server'] != null ? MHomeserver.fromJson(json['m.identity_server']) : null; + jitsiHomeserver = json['im.vector.riot.jitsi'] != null + ? JitsiHomeserver.fromJson(json['im.vector.riot.jitsi']) + : null; } Map toJson() { @@ -52,3 +56,17 @@ class MHomeserver { return data; } } + +class JitsiHomeserver { + String baseUrl; + + JitsiHomeserver.fromJson(Map json) { + baseUrl = json['preferredDomain']; + } + + Map toJson() { + final data = {}; + data['preferredDomain'] = baseUrl; + return data; + } +}