From 6d59faaa89ba7b77e12803d4e7830efbabd455d0 Mon Sep 17 00:00:00 2001 From: ggurdin Date: Mon, 9 Dec 2024 15:42:53 -0500 Subject: [PATCH] matrix dart sdk updates --- .../settings_homeserver_view.dart | 54 ++++++++----------- .../settings_notifications.dart | 2 - lib/pangea/controllers/pangea_controller.dart | 1 - 3 files changed, 22 insertions(+), 35 deletions(-) diff --git a/lib/pages/settings_homeserver/settings_homeserver_view.dart b/lib/pages/settings_homeserver/settings_homeserver_view.dart index 3e006ef6c..9ad83346c 100644 --- a/lib/pages/settings_homeserver/settings_homeserver_view.dart +++ b/lib/pages/settings_homeserver/settings_homeserver_view.dart @@ -12,7 +12,6 @@ import 'package:url_launcher/url_launcher_string.dart'; import '../../widgets/matrix.dart'; import 'settings_homeserver.dart'; -/// MERGE TODO class SettingsHomeserverView extends StatelessWidget { final SettingsHomeserverController controller; @@ -48,10 +47,7 @@ class SettingsHomeserverView extends StatelessWidget { ), ), FutureBuilder( - // #Pangea - // future: client.getWellknownSupport(), - future: Future.value(null), - // Pangea# + future: client.getWellknownSupport(), builder: (context, snapshot) { final error = snapshot.error; final data = snapshot.data; @@ -74,21 +70,17 @@ class SettingsHomeserverView extends StatelessWidget { ), ); } - // #Pangea - const supportPage = null; - const contacts = null; - // final supportPage = data.supportPage; - // final contacts = data.contacts; - // if (supportPage == null && contacts == null) { - // return ListTile( - // leading: const Icon(Icons.error_outlined), - // title: Text( - // L10n.of(context).noContactInformationProvided, - // style: const TextStyle(fontSize: 14), - // ), - // ); - // } - // Pangea# + final supportPage = data.supportPage; + final contacts = data.contacts; + if (supportPage == null && contacts == null) { + return ListTile( + leading: const Icon(Icons.error_outlined), + title: Text( + L10n.of(context).noContactInformationProvided, + style: const TextStyle(fontSize: 14), + ), + ); + } return Column( mainAxisSize: MainAxisSize.min, children: [ @@ -290,15 +282,13 @@ class SettingsHomeserverView extends StatelessWidget { } } -// #Pangea -// extension on Role { -// String localizedString(L10n l10n) { -// switch (this) { -// case Role.mRoleAdmin: -// return l10n.contactServerAdmin; -// case Role.mRoleSecurity: -// return l10n.contactServerSecurity; -// } -// } -// } -// Pangea# +extension on Role { + String localizedString(L10n l10n) { + switch (this) { + case Role.mRoleAdmin: + return l10n.contactServerAdmin; + case Role.mRoleSecurity: + return l10n.contactServerSecurity; + } + } +} diff --git a/lib/pages/settings_notifications/settings_notifications.dart b/lib/pages/settings_notifications/settings_notifications.dart index 8ac6d2831..85e4320d1 100644 --- a/lib/pages/settings_notifications/settings_notifications.dart +++ b/lib/pages/settings_notifications/settings_notifications.dart @@ -101,8 +101,6 @@ class SettingsNotificationsController extends State { }); try { await Matrix.of(context).client.setPushRuleEnabled( - // MERGE TODO: upgrade SDK and remove this first argument - 'global', item.type, item.key, enabled, diff --git a/lib/pangea/controllers/pangea_controller.dart b/lib/pangea/controllers/pangea_controller.dart index 42d4ad9fe..3bfc5fd56 100644 --- a/lib/pangea/controllers/pangea_controller.dart +++ b/lib/pangea/controllers/pangea_controller.dart @@ -403,7 +403,6 @@ class PangeaController { ) ?? false)) { await matrixState.client.setPushRule( - 'global', PushRuleKind.override, PangeaEventTypes.textToSpeechRule, [PushRuleAction.dontNotify],