fluffychat merge - resolve conflicts

pull/1384/head
ggurdin 1 year ago
commit c58226807a
No known key found for this signature in database
GPG Key ID: A01CB41737CBB478

@ -2789,5 +2789,9 @@
}
},
"changelog": "Änderungsprotokoll",
"@changelog": {}
"@changelog": {},
"sendCanceled": "Senden abgebrochen",
"@sendCanceled": {},
"noChatsFoundHere": "Hier wurden noch keine Chats gefunden. Starten Sie einen neuen Chat mit jemandem, indem Sie die Schaltfläche unten verwenden. ⤵️",
"@noChatsFoundHere": {}
}

@ -4194,5 +4194,6 @@
"loginWithMatrixId": "Login with Matrix-ID",
"discoverHomeservers": "Discover homeservers",
"whatIsAHomeserver": "What is a homeserver?",
"homeserverDescription": "All your data is stored on the homeserver, just like an email provider. You can choose which homeserver you want to use, while you can still communicate with everyone. Learn more at at https://matrix.org."
"homeserverDescription": "All your data is stored on the homeserver, just like an email provider. You can choose which homeserver you want to use, while you can still communicate with everyone. Learn more at at https://matrix.org.",
"doesNotSeemToBeAValidHomeserver": "Doesn't seem to be a compatible homeserver. Wrong URL?"
}

@ -342,7 +342,7 @@ class ChatController extends State<ChatPageWithRoom>
void tryLoadTimeline() async {
final initialEventId = widget.eventId;
loadTimelineFuture = getTimeline();
loadTimelineFuture = _getTimeline();
try {
await loadTimelineFuture;
if (initialEventId != null) scrollToEventId(initialEventId);
@ -394,6 +394,7 @@ class ChatController extends State<ChatPageWithRoom>
void updateView() {
if (!mounted) return;
setReadMarker();
setState(() {});
}
@ -402,18 +403,10 @@ class ChatController extends State<ChatPageWithRoom>
int? animateInEventIndex;
void onInsert(int i) {
onChange(i);
// setState will be called by updateView() anyway
animateInEventIndex = i;
}
void onChange(int i) {
if (timeline?.events[i].status == EventStatus.synced) {
final index = timeline!.events.firstIndexWhereNotError;
if (i == index) setReadMarker(eventId: timeline?.events[i].eventId);
}
}
// #Pangea
List<Event> get visibleEvents =>
timeline?.events
@ -424,7 +417,7 @@ class ChatController extends State<ChatPageWithRoom>
<Event>[];
// Pangea#
Future<void> getTimeline({
Future<void> _getTimeline({
String? eventContextId,
}) async {
await Matrix.of(context).client.roomsLoading;
@ -439,7 +432,6 @@ class ChatController extends State<ChatPageWithRoom>
onUpdate: updateView,
eventContextId: eventContextId,
onInsert: onInsert,
onChange: onChange,
);
// #Pangea
if (visibleEvents.length < 10 && timeline != null) {
@ -461,7 +453,6 @@ class ChatController extends State<ChatPageWithRoom>
timeline = await room.getTimeline(
onUpdate: updateView,
onInsert: onInsert,
onChange: onChange,
);
if (!mounted) return;
if (e is TimeoutException || e is IOException) {
@ -580,7 +571,7 @@ class ChatController extends State<ChatPageWithRoom>
}
// then cancel the old timeline
// fixes bug with read reciepts and quick switching
loadTimelineFuture = getTimeline(eventContextId: room.fullyRead).onError(
loadTimelineFuture = _getTimeline(eventContextId: room.fullyRead).onError(
ErrorReporter(
context,
'Unable to load timeline after changing sending Client',
@ -1175,7 +1166,7 @@ class ChatController extends State<ChatPageWithRoom>
setState(() {
timeline = null;
_scrolledUp = false;
loadTimelineFuture = getTimeline(eventContextId: eventId).onError(
loadTimelineFuture = _getTimeline(eventContextId: eventId).onError(
ErrorReporter(context, 'Unable to load timeline after scroll to ID')
.onErrorCallback,
);
@ -1204,7 +1195,7 @@ class ChatController extends State<ChatPageWithRoom>
setState(() {
timeline = null;
_scrolledUp = false;
loadTimelineFuture = getTimeline().onError(
loadTimelineFuture = _getTimeline().onError(
ErrorReporter(context, 'Unable to load timeline after scroll down')
.onErrorCallback,
);
@ -1717,12 +1708,3 @@ class ChatController extends State<ChatPageWithRoom>
}
enum EmojiPickerType { reaction, keyboard }
extension on List<Event> {
int get firstIndexWhereNotError {
if (isEmpty) return 0;
final index = indexWhere((event) => !event.status.isError);
if (index == -1) return length;
return index;
}
}

@ -34,6 +34,7 @@ class ChatMembersView extends StatelessWidget {
(room.summary.mInvitedMemberCount ?? 0);
final error = controller.error;
final theme = Theme.of(context);
return Scaffold(
appBar: AppBar(
@ -90,6 +91,16 @@ class ChatMembersView extends StatelessWidget {
controller: controller.filterController,
onChanged: controller.setFilter,
decoration: InputDecoration(
filled: true,
fillColor: theme.colorScheme.secondaryContainer,
border: OutlineInputBorder(
borderSide: BorderSide.none,
borderRadius: BorderRadius.circular(99),
),
hintStyle: TextStyle(
color: theme.colorScheme.onPrimaryContainer,
fontWeight: FontWeight.normal,
),
prefixIcon: const Icon(Icons.search_outlined),
hintText: L10n.of(context)!.search,
),

@ -31,6 +31,8 @@ class ChatSearchView extends StatelessWidget {
);
}
final theme = Theme.of(context);
return Scaffold(
appBar: AppBar(
leading: const Center(child: BackButton()),
@ -59,6 +61,16 @@ class ChatSearchView extends StatelessWidget {
decoration: InputDecoration(
hintText: L10n.of(context)!.search,
suffixIcon: const Icon(Icons.search_outlined),
filled: true,
fillColor: theme.colorScheme.secondaryContainer,
border: OutlineInputBorder(
borderSide: BorderSide.none,
borderRadius: BorderRadius.circular(99),
),
hintStyle: TextStyle(
color: theme.colorScheme.onPrimaryContainer,
fontWeight: FontWeight.normal,
),
),
),
),

@ -86,7 +86,17 @@ class HomeserverPickerController extends State<HomeserverPicker> {
Future<void> checkHomeserverAction([_]) async {
homeserverController.text =
homeserverController.text.trim().toLowerCase().replaceAll(' ', '-');
if (homeserverController.text == _lastCheckedUrl) return;
if (homeserverController.text.isEmpty) {
setState(() {
error = loginFlows = null;
isLoading = false;
Matrix.of(context).getLoginClient().homeserver = null;
});
return;
}
if (_lastCheckedUrl == homeserverController.text) return;
_lastCheckedUrl = homeserverController.text;
setState(() {
error = loginFlows = null;
@ -102,7 +112,12 @@ class HomeserverPickerController extends State<HomeserverPicker> {
final (_, _, loginFlows) = await client.checkHomeserver(homeserver);
this.loginFlows = loginFlows;
} catch (e) {
setState(() => error = (e).toLocalizedString(context));
setState(
() => error = (e).toLocalizedString(
context,
ExceptionContext.checkHomeserver,
),
);
} finally {
if (mounted) {
setState(() => isLoading = false);

@ -32,7 +32,8 @@ class HomeserverPickerView extends StatelessWidget {
),
),
// Pangea#
body: ListView(
body: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
// display a prominent banner to import session for TOR browser
// users. This feature is just some UX sugar as TOR users are
@ -58,133 +59,126 @@ class HomeserverPickerView extends StatelessWidget {
// ),
// ),
// ),
// Image.asset(
// 'assets/banner_transparent.png',
// ),
// if (MediaQuery.of(context).size.height > 512)
// ConstrainedBox(
// constraints: BoxConstraints(
// maxHeight: MediaQuery.of(context).size.height / 4,
// ),
// child: Image.asset(
// 'assets/banner_transparent.png',
// alignment: Alignment.center,
// repeat: ImageRepeat.repeat,
// ),
// ),
// Pangea#
Padding(
padding: const EdgeInsets.only(
top: 16.0,
right: 8.0,
left: 8.0,
bottom: 16.0,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
mainAxisSize: MainAxisSize.min,
children: [
Padding(
padding: const EdgeInsets.all(16.0),
child: TextField(
onChanged: controller.tryCheckHomeserverActionWithCooldown,
onEditingComplete:
controller.tryCheckHomeserverActionWithoutCooldown,
onSubmitted:
controller.tryCheckHomeserverActionWithoutCooldown,
onTap: controller.tryCheckHomeserverActionWithCooldown,
controller: controller.homeserverController,
decoration: InputDecoration(
prefixIcon: controller.isLoading
? Container(
width: 16,
height: 16,
alignment: Alignment.center,
child: const SizedBox(
width: 16,
height: 16,
child: CircularProgressIndicator.adaptive(
strokeWidth: 2,
),
),
)
: const Icon(Icons.search_outlined),
filled: false,
border: OutlineInputBorder(
borderRadius:
BorderRadius.circular(AppConfig.borderRadius),
),
hintText: AppConfig.defaultHomeserver,
labelText: L10n.of(context)!.homeserver,
errorText: controller.error,
suffixIcon: IconButton(
onPressed: () {
showDialog(
context: context,
builder: (context) => AlertDialog.adaptive(
title: Text(L10n.of(context)!.whatIsAHomeserver),
content: Linkify(
text: L10n.of(context)!.homeserverDescription,
),
actions: [
TextButton(
onPressed: () => launchUrl(
Uri.https('servers.joinmatrix.org'),
),
child: Text(
L10n.of(context)!.discoverHomeservers,
),
),
TextButton(
onPressed: Navigator.of(context).pop,
child: Text(L10n.of(context)!.close),
),
],
padding: const EdgeInsets.all(32.0),
child: TextField(
onChanged: controller.tryCheckHomeserverActionWithCooldown,
onEditingComplete:
controller.tryCheckHomeserverActionWithoutCooldown,
onSubmitted: controller.tryCheckHomeserverActionWithoutCooldown,
onTap: controller.tryCheckHomeserverActionWithCooldown,
controller: controller.homeserverController,
autocorrect: false,
keyboardType: TextInputType.url,
decoration: InputDecoration(
prefixIcon: controller.isLoading
? Container(
width: 16,
height: 16,
alignment: Alignment.center,
child: const SizedBox(
width: 16,
height: 16,
child: CircularProgressIndicator.adaptive(
strokeWidth: 2,
),
),
)
: const Icon(Icons.search_outlined),
filled: false,
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(AppConfig.borderRadius),
),
hintText: AppConfig.defaultHomeserver,
labelText: L10n.of(context)!.homeserver,
errorText: controller.error,
suffixIcon: IconButton(
onPressed: () {
showDialog(
context: context,
builder: (context) => AlertDialog.adaptive(
title: Text(L10n.of(context)!.whatIsAHomeserver),
content: Linkify(
text: L10n.of(context)!.homeserverDescription,
),
actions: [
TextButton(
onPressed: () => launchUrl(
Uri.https('servers.joinmatrix.org'),
),
);
},
icon: const Icon(Icons.info_outlined),
child: Text(
L10n.of(context)!.discoverHomeservers,
),
),
TextButton(
onPressed: Navigator.of(context).pop,
child: Text(L10n.of(context)!.close),
),
],
),
),
);
},
icon: const Icon(Icons.info_outlined),
),
),
),
),
if (MediaQuery.of(context).size.height > 512) const Spacer(),
ListView(
shrinkWrap: true,
padding: const EdgeInsets.symmetric(
horizontal: 32.0,
vertical: 32.0,
),
children: [
TextButton(
style: TextButton.styleFrom(
textStyle: theme.textTheme.labelMedium,
foregroundColor: theme.colorScheme.secondary,
),
onPressed: controller.isLoggingIn || controller.isLoading
? null
: controller.restoreBackup,
child: Text(L10n.of(context)!.hydrate),
),
if (controller.supportsPasswordLogin && controller.supportsSso)
TextButton(
style: TextButton.styleFrom(
foregroundColor: theme.colorScheme.secondary,
textStyle: theme.textTheme.labelMedium,
),
onPressed: controller.isLoggingIn || controller.isLoading
? null
: controller.login,
child: Text(L10n.of(context)!.loginWithMatrixId),
),
if (controller.supportsPasswordLogin || controller.supportsSso)
Padding(
padding: const EdgeInsets.symmetric(
horizontal: 16.0,
vertical: 8.0,
),
child: ElevatedButton(
style: ElevatedButton.styleFrom(
backgroundColor: theme.colorScheme.primary,
foregroundColor: theme.colorScheme.onPrimary,
),
onPressed: controller.isLoggingIn || controller.isLoading
? null
: controller.supportsSso
? controller.ssoLoginAction
: controller.login,
child: Text(L10n.of(context)!.connect),
),
const SizedBox(height: 8.0),
if (controller.supportsPasswordLogin || controller.supportsSso)
ElevatedButton(
style: ElevatedButton.styleFrom(
backgroundColor: theme.colorScheme.primary,
foregroundColor: theme.colorScheme.onPrimary,
),
if (controller.supportsPasswordLogin && controller.supportsSso)
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16.0),
child: TextButton(
style: TextButton.styleFrom(
foregroundColor: theme.colorScheme.secondary,
textStyle: theme.textTheme.labelMedium,
),
onPressed: controller.isLoggingIn || controller.isLoading
? null
onPressed: controller.isLoggingIn || controller.isLoading
? null
: controller.supportsSso
? controller.ssoLoginAction
: controller.login,
child: Text(L10n.of(context)!.loginWithMatrixId),
),
),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16.0),
child: TextButton(
style: TextButton.styleFrom(
textStyle: theme.textTheme.labelMedium,
foregroundColor: theme.colorScheme.secondary,
),
onPressed: controller.isLoggingIn || controller.isLoading
? null
: controller.restoreBackup,
child: Text(L10n.of(context)!.hydrate),
),
child: Text(L10n.of(context)!.next),
),
],
),
],
),
],
),

@ -30,6 +30,7 @@ class InvitationSelectionView extends StatelessWidget {
// #Pangea
// final groupName = room.name.isEmpty ? L10n.of(context)!.group : room.name;
// Pangea#
final theme = Theme.of(context);
return Scaffold(
appBar: AppBar(
// #Pangea
@ -52,6 +53,16 @@ class InvitationSelectionView extends StatelessWidget {
child: TextField(
textInputAction: TextInputAction.search,
decoration: InputDecoration(
filled: true,
fillColor: theme.colorScheme.secondaryContainer,
border: OutlineInputBorder(
borderSide: BorderSide.none,
borderRadius: BorderRadius.circular(99),
),
hintStyle: TextStyle(
color: theme.colorScheme.onPrimaryContainer,
fontWeight: FontWeight.normal,
),
// #Pangea
hintText: controller.mode == InvitationSelectionMode.admin
? L10n.of(context)!.inviteUsersFromPangea

@ -74,7 +74,7 @@ class NewGroupView extends StatelessWidget {
readOnly: controller.loading,
decoration: InputDecoration(
prefixIcon: const Icon(Icons.people_outlined),
hintText: L10n.of(context)!.groupName,
labelText: L10n.of(context)!.groupName,
),
),
),

@ -52,6 +52,16 @@ class NewPrivateChatView extends StatelessWidget {
onChanged: controller.searchUsers,
decoration: InputDecoration(
hintText: L10n.of(context)!.searchForUsers,
filled: true,
fillColor: theme.colorScheme.secondaryContainer,
border: OutlineInputBorder(
borderSide: BorderSide.none,
borderRadius: BorderRadius.circular(99),
),
hintStyle: TextStyle(
color: theme.colorScheme.onPrimaryContainer,
fontWeight: FontWeight.normal,
),
prefixIcon: searchResponse == null
? const Icon(Icons.search_outlined)
: FutureBuilder(

@ -61,7 +61,7 @@ class NewSpaceView extends StatelessWidget {
readOnly: controller.loading,
decoration: InputDecoration(
prefixIcon: const Icon(Icons.people_outlined),
hintText: L10n.of(context)!.spaceName,
labelText: L10n.of(context)!.spaceName,
// #Pangea
// errorText: controller.nameError,
// Pangea#

@ -45,7 +45,7 @@ class SettingsIgnoreListView extends StatelessWidget {
labelText: L10n.of(context)!.blockUsername,
suffixIcon: IconButton(
tooltip: L10n.of(context)!.block,
icon: const Icon(Icons.send_outlined),
icon: const Icon(Icons.add),
onPressed: () => controller.ignoreUser(context),
),
),

@ -17,12 +17,6 @@ class SettingsPasswordView extends StatelessWidget {
return Scaffold(
appBar: AppBar(
title: Text(L10n.of(context)!.changePassword),
actions: [
TextButton(
child: Text(L10n.of(context)!.passwordRecoverySettings),
onPressed: () => context.go('/rooms/settings/security/3pid'),
),
],
),
body: ListTileTheme(
iconColor: theme.colorScheme.onSurface,
@ -31,13 +25,6 @@ class SettingsPasswordView extends StatelessWidget {
padding: const EdgeInsets.all(16.0),
child: Column(
children: [
Center(
child: Icon(
Icons.key_outlined,
color: theme.dividerColor,
size: 80,
),
),
const SizedBox(height: 16),
TextField(
controller: controller.oldPasswordController,
@ -46,18 +33,22 @@ class SettingsPasswordView extends StatelessWidget {
autofocus: true,
readOnly: controller.loading,
decoration: InputDecoration(
hintText: L10n.of(context)!.pleaseEnterYourCurrentPassword,
prefixIcon: const Icon(Icons.lock_outlined),
hintText: '********',
labelText: L10n.of(context)!.pleaseEnterYourCurrentPassword,
errorText: controller.oldPasswordError,
),
),
const Divider(height: 32),
const Divider(height: 64),
TextField(
controller: controller.newPassword1Controller,
obscureText: true,
autocorrect: false,
readOnly: controller.loading,
decoration: InputDecoration(
hintText: L10n.of(context)!.newPassword,
prefixIcon: const Icon(Icons.lock_reset_outlined),
hintText: '********',
labelText: L10n.of(context)!.newPassword,
errorText: controller.newPassword1Error,
),
),
@ -68,22 +59,28 @@ class SettingsPasswordView extends StatelessWidget {
autocorrect: false,
readOnly: controller.loading,
decoration: InputDecoration(
hintText: L10n.of(context)!.repeatPassword,
prefixIcon: const Icon(Icons.repeat_outlined),
hintText: '********',
labelText: L10n.of(context)!.repeatPassword,
errorText: controller.newPassword2Error,
),
),
const SizedBox(height: 16),
const SizedBox(height: 32),
SizedBox(
width: double.infinity,
child: ElevatedButton.icon(
child: ElevatedButton(
onPressed:
controller.loading ? null : controller.changePassword,
icon: const Icon(Icons.send_outlined),
label: controller.loading
child: controller.loading
? const LinearProgressIndicator()
: Text(L10n.of(context)!.changePassword),
),
),
const SizedBox(height: 16),
TextButton(
child: Text(L10n.of(context)!.passwordRecoverySettings),
onPressed: () => context.go('/rooms/settings/security/3pid'),
),
],
),
),

@ -86,9 +86,7 @@ class SettingsSecurityView extends StatelessWidget {
onTap: controller.setAppLockAction,
),
},
Divider(
color: theme.dividerColor,
),
Divider(color: theme.dividerColor),
ListTile(
title: Text(
L10n.of(context)!.account,
@ -117,13 +115,14 @@ class SettingsSecurityView extends StatelessWidget {
),
ListTile(
iconColor: Colors.orange,
leading: const Icon(Icons.tap_and_play),
leading: const Icon(Icons.delete_sweep_outlined),
title: Text(
L10n.of(context)!.dehydrate,
style: const TextStyle(color: Colors.orange),
),
onTap: controller.dehydrateAction,
),
Divider(color: theme.dividerColor),
ListTile(
iconColor: Colors.red,
leading: const Icon(Icons.delete_outlined),

@ -2,6 +2,7 @@ import 'dart:io';
import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/l10n.dart';
import 'package:http/http.dart';
import 'package:matrix/encryption.dart';
import 'package:matrix/matrix.dart';
@ -68,9 +69,14 @@ extension LocalizedExceptionExtension on Object {
}
if (this is IOException ||
this is SocketException ||
this is SyncConnectionException) {
this is SyncConnectionException ||
this is ClientException) {
return L10n.of(context)!.noConnectionToTheServer;
}
if (this is FormatException &&
exceptionContext == ExceptionContext.checkHomeserver) {
return L10n.of(context)!.doesNotSeemToBeAValidHomeserver;
}
if (this is String) return toString();
if (this is UiaException) return toString();
Logs().w('Something went wrong: ', this);
@ -80,4 +86,5 @@ extension LocalizedExceptionExtension on Object {
enum ExceptionContext {
changePassword,
checkHomeserver,
}

Loading…
Cancel
Save