feat: Get jitsi instance from wellknown

This commit is contained in:
Christian Pauly 2021-02-13 09:56:16 +01:00
commit 1e326aa604
5 changed files with 69 additions and 8 deletions

View file

@ -1,3 +1,5 @@
import 'dart:io';
import 'package:famedlysdk/famedlysdk.dart';
import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/l10n.dart';
@ -14,7 +16,35 @@ extension LocalizedExceptionExtension on Object {
return (this as MatrixException).errorMessage;
}
}
if (this is MatrixConnectionException) {
if (this is BadServerVersionsException) {
final serverVersions = (this as BadServerVersionsException)
.serverVersions
.toString()
.replaceAll('{', '"')
.replaceAll('}', '"');
final supportedVersions = (this as BadServerVersionsException)
.supportedVersions
.toString()
.replaceAll('{', '"')
.replaceAll('}', '"');
return L10n.of(context)
.badServerVersionsException(serverVersions, supportedVersions);
}
if (this is BadServerLoginTypesException) {
final serverVersions = (this as BadServerLoginTypesException)
.serverLoginTypes
.toString()
.replaceAll('{', '"')
.replaceAll('}', '"');
final supportedVersions = (this as BadServerLoginTypesException)
.supportedLoginTypes
.toString()
.replaceAll('{', '"')
.replaceAll('}', '"');
return L10n.of(context)
.badServerLoginTypesException(serverVersions, supportedVersions);
}
if (this is MatrixConnectionException || this is SocketException) {
L10n.of(context).noConnectionToTheServer;
}
Logs().w('Something went wrong: ', this);