From e0fd7ecd3be157fc853f988a851b58b5e4e1a615 Mon Sep 17 00:00:00 2001 From: Inex Code Date: Thu, 29 Oct 2020 09:53:36 +0000 Subject: [PATCH] chore: FurryChat patches --- .../list_items/participant_list_item.dart | 4 --- lib/components/matrix.dart | 2 -- lib/components/user_bottom_sheet.dart | 10 +++--- lib/utils/famedlysdk_store.dart | 12 ++++--- lib/utils/fluffy_share.dart | 5 +-- lib/utils/matrix_file_extension.dart | 9 ++--- lib/views/chat.dart | 2 +- lib/views/chat_list.dart | 5 +-- lib/views/homeserver_picker.dart | 16 +++++---- lib/views/settings/settings_themes.dart | 2 +- pubspec.lock | 35 +++++++++++-------- 11 files changed, 53 insertions(+), 49 deletions(-) diff --git a/lib/components/list_items/participant_list_item.dart b/lib/components/list_items/participant_list_item.dart index 907ed5b..278fb84 100644 --- a/lib/components/list_items/participant_list_item.dart +++ b/lib/components/list_items/participant_list_item.dart @@ -2,11 +2,7 @@ import 'package:famedlysdk/famedlysdk.dart'; import 'package:flutter/material.dart'; import 'package:flutter_gen/gen_l10n/l10n.dart'; -import '../../utils/app_route.dart'; -import '../../views/chat.dart'; import '../avatar.dart'; -import '../dialogs/simple_dialogs.dart'; -import '../matrix.dart'; import '../user_bottom_sheet.dart'; class ParticipantListItem extends StatelessWidget { diff --git a/lib/components/matrix.dart b/lib/components/matrix.dart index c22fa16..bcac3de 100644 --- a/lib/components/matrix.dart +++ b/lib/components/matrix.dart @@ -19,8 +19,6 @@ import '../utils/famedlysdk_store.dart'; import '../utils/firebase_controller.dart'; import '../utils/matrix_locals.dart'; import '../utils/platform_infos.dart'; -import '../utils/presence_extension.dart'; -import '../utils/user_status.dart'; import '../views/key_verification.dart'; import 'avatar.dart'; import 'dialogs/simple_dialogs.dart'; diff --git a/lib/components/user_bottom_sheet.dart b/lib/components/user_bottom_sheet.dart index 22095ef..69b5904 100644 --- a/lib/components/user_bottom_sheet.dart +++ b/lib/components/user_bottom_sheet.dart @@ -1,15 +1,15 @@ import 'dart:math'; import 'package:famedlysdk/famedlysdk.dart'; -import 'package:fluffychat/components/adaptive_page_layout.dart'; -import 'package:fluffychat/utils/app_route.dart'; -import 'package:fluffychat/utils/fluffy_share.dart'; -import 'package:fluffychat/views/chat.dart'; import 'package:flutter/material.dart'; -import 'content_banner.dart'; import 'package:flutter_gen/gen_l10n/l10n.dart'; +import '../utils/app_route.dart'; +import '../utils/fluffy_share.dart'; import '../utils/presence_extension.dart'; +import '../views/chat.dart'; +import 'adaptive_page_layout.dart'; +import 'content_banner.dart'; import 'dialogs/simple_dialogs.dart'; import 'matrix.dart'; diff --git a/lib/utils/famedlysdk_store.dart b/lib/utils/famedlysdk_store.dart index 9e671be..5614dd6 100644 --- a/lib/utils/famedlysdk_store.dart +++ b/lib/utils/famedlysdk_store.dart @@ -1,13 +1,15 @@ -import '../famedlysdk.dart'; -import './platform_infos.dart'; +import 'dart:async'; +import 'dart:core'; + +import 'package:famedlysdk/famedlysdk.dart'; import 'package:flutter_secure_storage/flutter_secure_storage.dart'; import 'package:localstorage/localstorage.dart'; import 'package:path_provider/path_provider.dart'; -import 'dart:async'; -import 'dart:core'; -import './database/shared.dart'; import 'package:random_string/random_string.dart'; +import './database/shared.dart'; +import './platform_infos.dart'; + Future getDatabase(Client client) async { while (_generateDatabaseLock) { await Future.delayed(Duration(milliseconds: 50)); diff --git a/lib/utils/fluffy_share.dart b/lib/utils/fluffy_share.dart index 88409a3..6aefa28 100644 --- a/lib/utils/fluffy_share.dart +++ b/lib/utils/fluffy_share.dart @@ -1,9 +1,10 @@ import 'package:bot_toast/bot_toast.dart'; -import 'package:fluffychat/utils/platform_infos.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; -import 'package:share/share.dart'; import 'package:flutter_gen/gen_l10n/l10n.dart'; +import 'package:share/share.dart'; + +import 'platform_infos.dart'; abstract class FluffyShare { static Future share(String text, BuildContext context) async { diff --git a/lib/utils/matrix_file_extension.dart b/lib/utils/matrix_file_extension.dart index d7daef3..6000a4a 100644 --- a/lib/utils/matrix_file_extension.dart +++ b/lib/utils/matrix_file_extension.dart @@ -1,14 +1,15 @@ import 'dart:io'; +import 'package:downloads_path_provider_28/downloads_path_provider_28.dart'; import 'package:famedlysdk/famedlysdk.dart'; -import 'package:fluffychat/utils/platform_infos.dart'; import 'package:flutter/foundation.dart'; +import 'package:mime_type/mime_type.dart'; import 'package:open_file/open_file.dart'; import 'package:path_provider/path_provider.dart'; -import 'package:universal_html/prefer_universal/html.dart' as html; -import 'package:mime_type/mime_type.dart'; -import 'package:downloads_path_provider_28/downloads_path_provider_28.dart'; import 'package:permission_handler/permission_handler.dart'; +import 'package:universal_html/prefer_universal/html.dart' as html; + +import 'platform_infos.dart'; extension MatrixFileExtension on MatrixFile { void open() async { diff --git a/lib/views/chat.dart b/lib/views/chat.dart index 1028cd2..ee7a896 100644 --- a/lib/views/chat.dart +++ b/lib/views/chat.dart @@ -25,8 +25,8 @@ import '../components/encryption_button.dart'; import '../components/input_bar.dart'; import '../components/list_items/message.dart'; import '../components/matrix.dart'; -import '../components/user_bottom_sheet.dart'; import '../components/reply_content.dart'; +import '../components/user_bottom_sheet.dart'; import '../config/app_emojis.dart'; import '../utils/app_route.dart'; import '../utils/matrix_file_extension.dart'; diff --git a/lib/views/chat_list.dart b/lib/views/chat_list.dart index 24e5aa9..e4299e5 100644 --- a/lib/views/chat_list.dart +++ b/lib/views/chat_list.dart @@ -9,16 +9,14 @@ import 'package:flutter_gen/gen_l10n/l10n.dart'; import 'package:receive_sharing_intent/receive_sharing_intent.dart'; import '../components/adaptive_page_layout.dart'; -import '../components/avatar.dart'; import '../components/connection_status_header.dart'; import '../components/dialogs/simple_dialogs.dart'; import '../components/list_items/chat_list_item.dart'; import '../components/list_items/public_room_list_item.dart'; -import '../components/list_items/status_list_item.dart'; import '../components/matrix.dart'; import '../utils/app_route.dart'; -import '../utils/matrix_file_extension.dart'; import '../utils/fluffy_share.dart'; +import '../utils/matrix_file_extension.dart'; import '../utils/platform_infos.dart'; import '../utils/url_launcher.dart'; import 'archive.dart'; @@ -26,7 +24,6 @@ import 'homeserver_picker.dart'; import 'new_group.dart'; import 'new_private_chat.dart'; import 'settings.dart'; -import 'status_view.dart'; enum SelectMode { normal, share, select } diff --git a/lib/views/homeserver_picker.dart b/lib/views/homeserver_picker.dart index 2cbf941..06a3f08 100644 --- a/lib/views/homeserver_picker.dart +++ b/lib/views/homeserver_picker.dart @@ -1,6 +1,6 @@ import 'dart:math'; -import 'package:famedlysdk/matrix_api/model/well_known_informations.dart'; +import 'package:famedlysdk/famedlysdk.dart'; import 'package:flutter/material.dart'; import 'package:flutter_gen/gen_l10n/l10n.dart'; @@ -30,9 +30,10 @@ class _HomeserverPickerState extends State { .client .getWellKnownInformationsByUserId(homeserver)); final success = await SimpleDialogs(context).tryRequestWithLoadingDialog( - Matrix.of(context).client.checkServer(wellknown.mHomeserver != null - ? 'https://${Uri.parse(wellknown.mHomeserver.baseUrl).host}' - : homeserver)); + Matrix.of(context).client.checkHomeserver( + wellknown.mHomeserver != null + ? 'https://${Uri.parse(wellknown.mHomeserver.baseUrl).host}' + : homeserver)); if (success != false) { await Navigator.of(context).push(AppRoute(Login( username: homeserver, @@ -50,9 +51,10 @@ class _HomeserverPickerState extends State { .getWellKnownInformationsByDomain(homeserver)); final success = await SimpleDialogs(context).tryRequestWithLoadingDialog( - Matrix.of(context).client.checkServer(wellknown.mHomeserver != null - ? 'https://${Uri.parse(wellknown.mHomeserver.baseUrl).host}' - : homeserver)); + Matrix.of(context).client.checkHomeserver( + wellknown.mHomeserver != null + ? 'https://${Uri.parse(wellknown.mHomeserver.baseUrl).host}' + : homeserver)); if (success != false) { await Navigator.of(context).push(AppRoute(SignUp( wellknown: wellknown, diff --git a/lib/views/settings/settings_themes.dart b/lib/views/settings/settings_themes.dart index 932d540..d887473 100644 --- a/lib/views/settings/settings_themes.dart +++ b/lib/views/settings/settings_themes.dart @@ -41,7 +41,7 @@ class _ThemesSettingsState extends State { void deleteWallpaperAction(BuildContext context) async { Matrix.of(context).wallpaper = null; - await Matrix.of(context).store.setItem('chat.fluffy.wallpaper', null); + await Matrix.of(context).store.deleteItem('chat.fluffy.wallpaper'); setState(() => null); } diff --git a/pubspec.lock b/pubspec.lock index 639c459..b4f1c50 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -216,7 +216,7 @@ packages: description: path: "." ref: yiffed - resolved-ref: d9bc92d6543e51845ef384ee7650fcb3428d0718 + resolved-ref: "0f5943382e8d08da9a3c019e75982d8dcc08d4a8" url: "https://github.com/innereq/famedlysdk-fork.git" source: git version: "0.0.1" @@ -247,14 +247,21 @@ packages: name: file_picker url: "https://pub.dartlang.org" source: hosted - version: "2.0.7" + version: "1.13.3" file_picker_cross: dependency: "direct main" description: name: file_picker_cross url: "https://pub.dartlang.org" source: hosted - version: "4.2.4" + version: "4.2.2" + file_picker_platform_interface: + dependency: transitive + description: + name: file_picker_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "1.3.1" firebase: dependency: transitive description: @@ -512,7 +519,7 @@ packages: name: js url: "https://pub.dartlang.org" source: hosted - version: "0.6.3-nullsafety.1" + version: "0.6.3-nullsafety.2" localstorage: dependency: "direct main" description: @@ -588,7 +595,7 @@ packages: description: path: "." ref: master - resolved-ref: c8eb59c25c4e3a568bd64e4722108ec45259e157 + resolved-ref: "42a0fa3d4643d1e0402f6ac599dff7062aff754f" url: "https://gitlab.com/famedly/libraries/native_imaging.git" source: git version: "0.0.1" @@ -703,7 +710,7 @@ packages: name: pedantic url: "https://pub.dartlang.org" source: hosted - version: "1.10.0-nullsafety.1" + version: "1.10.0-nullsafety.2" permission_handler: dependency: "direct main" description: @@ -759,7 +766,7 @@ packages: name: pool url: "https://pub.dartlang.org" source: hosted - version: "1.5.0-nullsafety.1" + version: "1.5.0-nullsafety.2" process: dependency: transitive description: @@ -780,7 +787,7 @@ packages: name: quiver url: "https://pub.dartlang.org" source: hosted - version: "2.1.3" + version: "2.1.4+1" random_string: dependency: "direct main" description: @@ -855,14 +862,14 @@ packages: name: source_map_stack_trace url: "https://pub.dartlang.org" source: hosted - version: "2.1.0-nullsafety.2" + version: "2.1.0-nullsafety.3" source_maps: dependency: transitive description: name: source_maps url: "https://pub.dartlang.org" source: hosted - version: "0.10.10-nullsafety.1" + version: "0.10.10-nullsafety.2" source_span: dependency: transitive description: @@ -876,7 +883,7 @@ packages: name: sqflite url: "https://pub.dartlang.org" source: hosted - version: "1.3.2" + version: "1.3.2+1" sqflite_common: dependency: transitive description: @@ -1009,7 +1016,7 @@ packages: name: url_launcher_linux url: "https://pub.dartlang.org" source: hosted - version: "0.0.1+1" + version: "0.0.1+3" url_launcher_macos: dependency: transitive description: @@ -1058,7 +1065,7 @@ packages: name: vm_service url: "https://pub.dartlang.org" source: hosted - version: "5.2.0" + version: "5.3.1" watcher: dependency: transitive description: @@ -1123,5 +1130,5 @@ packages: source: hosted version: "0.1.2" sdks: - dart: ">=2.10.2 <2.11.0" + dart: ">=2.10.2 <=2.11.0-161.0.dev" flutter: ">=1.22.2 <2.0.0"