diff --git a/lib/pages/chat/chat.dart b/lib/pages/chat/chat.dart index fb84bae63..971383fc5 100644 --- a/lib/pages/chat/chat.dart +++ b/lib/pages/chat/chat.dart @@ -795,7 +795,7 @@ class ChatController extends State } // #Pangea - // if (await Record().hasPermission() == false) return; + // if (await AudioRecorder().hasPermission() == false) return; // Pangea# final result = await showDialog( context: context, diff --git a/lib/pages/chat/chat_view.dart b/lib/pages/chat/chat_view.dart index ff6da5099..e09997fda 100644 --- a/lib/pages/chat/chat_view.dart +++ b/lib/pages/chat/chat_view.dart @@ -175,7 +175,8 @@ class ChatView extends StatelessWidget { } }, child: StreamBuilder( - stream: controller.room.onUpdate.stream + stream: controller.room.client.onRoomState.stream + .where((update) => update.roomId == controller.room.id) .rateLimit(const Duration(seconds: 1)), builder: (context, snapshot) => FutureBuilder( future: controller.loadTimelineFuture, diff --git a/lib/pages/chat/events/message.dart b/lib/pages/chat/events/message.dart index 9626ba12e..dc129a192 100644 --- a/lib/pages/chat/events/message.dart +++ b/lib/pages/chat/events/message.dart @@ -61,13 +61,13 @@ class Message extends StatelessWidget { this.highlightMarker = false, this.animateIn = false, this.resetAnimateIn, + this.avatarPresenceBackgroundColor, // #Pangea required this.selectedDisplayLang, required this.immersionMode, required this.definitions, required this.controller, // Pangea# - this.avatarPresenceBackgroundColor, super.key, }); @@ -315,6 +315,12 @@ class Message extends StatelessWidget { alignment: alignment, padding: const EdgeInsets.only(left: 8), child: GestureDetector( + // #Pangea + onTap: () => + toolbarController?.showToolbar(context), + onDoubleTap: () => + toolbarController?.showToolbar(context), + // Pangea# onLongPress: longPressSelect ? null : () { @@ -432,8 +438,7 @@ class Message extends StatelessWidget { // #Pangea selected: selected, pangeaMessageEvent: - toolbarController - ?.pangeaMessageEvent, + pangeaMessageEvent, immersionMode: immersionMode, toolbarController: toolbarController, @@ -445,9 +450,8 @@ class Message extends StatelessWidget { ) // #Pangea || - (toolbarController - ?.pangeaMessageEvent - .showUseType ?? + (pangeaMessageEvent + ?.showUseType ?? false) // Pangea# ) @@ -461,12 +465,10 @@ class Message extends StatelessWidget { MainAxisSize.min, children: [ // #Pangea - if (toolbarController - ?.pangeaMessageEvent - .showUseType ?? + if (pangeaMessageEvent + ?.showUseType ?? false) ...[ - toolbarController! - .pangeaMessageEvent + pangeaMessageEvent! .useType .iconView( context, @@ -474,7 +476,8 @@ class Message extends StatelessWidget { .withAlpha(164), ), const SizedBox( - width: 4), + width: 4, + ), ], if (event .hasAggregatedEvents( diff --git a/lib/pages/chat/recording_dialog.dart b/lib/pages/chat/recording_dialog.dart index 805f090df..5e358f291 100644 --- a/lib/pages/chat/recording_dialog.dart +++ b/lib/pages/chat/recording_dialog.dart @@ -28,19 +28,16 @@ class RecordingDialogState extends State { bool error = false; String? _recordedPath; - // #Pangea - // final _audioRecorder = Record(); final _audioRecorder = AudioRecorder(); - // Pangea# final List amplitudeTimeline = []; static const int bitRate = 64000; - static const int samplingRate = 22050; + static const int samplingRate = 44100; Future startRecording() async { try { final tempDir = await getTemporaryDirectory(); - _recordedPath = + final path = _recordedPath = '${tempDir.path}/recording${DateTime.now().microsecondsSinceEpoch}.${RecordingDialog.recordingFileType}'; final result = await _audioRecorder.hasPermission(); @@ -58,8 +55,13 @@ class RecordingDialogState extends State { const RecordConfig( bitRate: bitRate, sampleRate: samplingRate, - encoder: AudioEncoder.wav, numChannels: 1, + autoGain: true, + echoCancel: true, + noiseSuppress: true, + // #Pangea + encoder: AudioEncoder.wav, + // Pangea# ), ), // #Pangea diff --git a/lib/pages/chat_access_settings/chat_access_settings_page.dart b/lib/pages/chat_access_settings/chat_access_settings_page.dart index a0e2f8701..48d2d950c 100644 --- a/lib/pages/chat_access_settings/chat_access_settings_page.dart +++ b/lib/pages/chat_access_settings/chat_access_settings_page.dart @@ -22,7 +22,8 @@ class ChatAccessSettingsPageView extends StatelessWidget { ), body: MaxWidthBody( child: StreamBuilder( - stream: room.onUpdate.stream, + stream: room.client.onRoomState.stream + .where((update) => update.roomId == controller.room.id), builder: (context, snapshot) { final canonicalAlias = room.canonicalAlias; final altAliases = room diff --git a/lib/pages/chat_encryption_settings/chat_encryption_settings_view.dart b/lib/pages/chat_encryption_settings/chat_encryption_settings_view.dart index 20764021e..d53239a07 100644 --- a/lib/pages/chat_encryption_settings/chat_encryption_settings_view.dart +++ b/lib/pages/chat_encryption_settings/chat_encryption_settings_view.dart @@ -83,7 +83,8 @@ class ChatEncryptionSettingsView extends StatelessWidget { ), ), StreamBuilder( - stream: room.onUpdate.stream, + stream: room.client.onRoomState.stream + .where((update) => update.roomId == controller.room.id), builder: (context, snapshot) => FutureBuilder>( future: room.getUserDeviceKeys(), diff --git a/lib/pages/invitation_selection/invitation_selection_view.dart b/lib/pages/invitation_selection/invitation_selection_view.dart index a83c27d64..a776cccb0 100644 --- a/lib/pages/invitation_selection/invitation_selection_view.dart +++ b/lib/pages/invitation_selection/invitation_selection_view.dart @@ -77,7 +77,8 @@ class InvitationSelectionView extends StatelessWidget { ), ), StreamBuilder( - stream: room.onUpdate.stream, + stream: room.client.onRoomState.stream + .where((update) => update.roomId == room.id), builder: (context, snapshot) { final participants = room.getParticipants().map((user) => user.id).toSet(); diff --git a/lib/pages/settings_multiple_emotes/settings_multiple_emotes_view.dart b/lib/pages/settings_multiple_emotes/settings_multiple_emotes_view.dart index 939263fd3..5b910a8ba 100644 --- a/lib/pages/settings_multiple_emotes/settings_multiple_emotes_view.dart +++ b/lib/pages/settings_multiple_emotes/settings_multiple_emotes_view.dart @@ -21,7 +21,8 @@ class MultipleEmotesSettingsView extends StatelessWidget { title: Text(L10n.of(context)!.emotePacks), ), body: StreamBuilder( - stream: room.onUpdate.stream, + stream: room.client.onRoomState.stream + .where((update) => update.roomId == room.id), builder: (context, snapshot) { final packStateEvents = room.states['im.ponies.room_emotes']; // we need to manually convert the map using Map.of, otherwise assigning null will throw a type error. diff --git a/lib/utils/client_manager.dart b/lib/utils/client_manager.dart index 47805638e..6eba16eb1 100644 --- a/lib/utils/client_manager.dart +++ b/lib/utils/client_manager.dart @@ -130,6 +130,7 @@ abstract class ClientManager { }, nativeImplementations: nativeImplementations, customImageResizer: PlatformInfos.isMobile ? customImageResizer : null, + defaultNetworkRequestTimeout: const Duration(minutes: 5), enableDehydratedDevices: true, ); } diff --git a/pubspec.lock b/pubspec.lock index 24b87b776..6070b6b1b 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1408,10 +1408,11 @@ packages: matrix: dependency: "direct main" description: - name: matrix - sha256: "8610e6d207d6b667e4fe9e769d5b479db27aa1f80570880d3f171a5d3ff49d1a" - url: "https://pub.dev" - source: hosted + path: "." + ref: "krille/create-missing-object-box" + resolved-ref: f3e631b2eb477097c8fbfa188f81e6b80ee1dc58 + url: "https://github.com/famedly/matrix-dart-sdk.git" + source: git version: "0.29.2" meta: dependency: transitive diff --git a/pubspec.yaml b/pubspec.yaml index 9f4c63423..c5b439c81 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -70,8 +70,11 @@ dependencies: keyboard_shortcuts: ^0.1.4 latlong2: ^0.9.1 linkify: ^5.0.0 - matrix: ^0.29.2 - native_imaging: ^0.1.0 + matrix: + git: + url: https://github.com/famedly/matrix-dart-sdk.git + ref: krille/create-missing-object-box + native_imaging: ^0.1.1 package_info_plus: ^6.0.0 pasteboard: ^0.2.0 path: ^1.9.0 @@ -82,10 +85,7 @@ dependencies: punycode: ^1.0.0 qr_code_scanner: ^1.0.1 receive_sharing_intent: 1.4.5 # Update needs more work - # #Pangea - # record: 4.4.4 # Upgrade to 5 currently breaks playing on iOS record: ^5.0.5 - # Pangea# scroll_to_index: ^3.0.1 share_plus: ^9.0.0 shared_preferences: ^2.2.0 # Pinned because https://github.com/flutter/flutter/issues/118401